| 订阅 | 在线投稿
分享
 
 
当前位置: 王朝网络 >> mysql >> Oracle yu MySQL shan chu zi duan shi dui suo yin he yue shu de chu li

Oracle yu MySQL shan chu zi duan shi dui suo yin he yue shu de chu li

2008-08-05 07:04:56 编辑來源:互联网 评论
 
 
 
本文为【Oracle与MySQL删除字段时对索引和约束的处理】的拼音翻译版
  bu zhi dao you duo shao ren qing chu de zhi dao , zai Oracle zhong , ru guo yi ge fu he suo yin , jia ding suo yin (a,b,c) san ge zi duan , shan chu le ( bao kuo unused) qi zhong yi ge zi duan ,Oracle hui zen me chu li zhe ge suo yin 。 tong yang , ru guo shi yue shu ,Oracle you zen me chu li ?
  yong Oracle wei li zi , wo you na mysql zuo le yi ge dui bi , kan kan mysql shi zen me chu li zhe ge wen ti de 。 wo zhe li bu tao lun shui hao shui cha , zhi shi xi wang da jia zhi dao qi zhong de cha bie yu xi jie er yi 。
  wo men xian kan Oracle de li zi , wo men chuang jian yi ge biao , ran hou zai shang mian chuang jian yi ge yue shu , chuang jian yi ge suo yin :
  SQL10G>createtabletest(aint,bint,cint);
  Tablecreated.
  SQL10G>altertabletestaddconstraintpk_testprimarykey(a,b);
  Tablealtered.
  SQL10G>createindexind_testontest(b,c);
  Indexcreated.
  ran hou , wo men jian cha gang cai chuang jian de yue shu yu suo yin
  SQL10G>selectt.constraint_name,c.constraint_type,t.column_name,t.position,c.status,c.validated
  2fromuser_cons_columnst,user_constraintsc
  3wherec.constraint_name=t.constraint_name
  4andc.constraint_type!='C'
  5andt.table_name='TEST'
  6orderbyconstraint_name,position;
  CONSTRAINT_NAMECCOLUMN_NAMEPOSITIONSTATUSVALIDATED
  ------------------------------------------------------------
  PK_TESTPA1ENABLEDVALIDATED
  PK_TESTPB2ENABLEDVALIDATED
  SQL10G>selectt.index_name,t.column_name,t.column_position,i.status
  2fromuser_ind_columnst,user_indexesi
  3wheret.index_name=i.index_name
  4andt.table_name='TEST'
  5*orderbyindex_name,column_position
  INDEX_NAMECOLUMN_NAMECOLUMN_POSITIONSTATUS
  -------------------------------------------------
  IND_TESTB1VALID
  IND_TESTC2VALID
  xian zai , wo men xian shan chu suo yin shang de zi duan , qi shi bing mei you wu li shan chu , zhi shi she zhi wei unused:
  SQL10G>ALTERTABLEtestSETUNUSED(c);
  Tablealtered.
  SQL10G>selectt.index_name,t.column_name,t.column_position,i.status
  2fromuser_ind_columnst,user_indexesi
  3wheret.index_name=i.index_name
  4andt.table_name='TEST'
  5orderbyindex_name,column_position;
  norowsselected
  fa xian le shen me , suo yin ye shan chu le 。 na wo men zai shan chu yue shu shang de zi duan ne ?
  SQL10G>ALTERTABLEtestSETUNUSED(b);
  ALTERTABLEtestSETUNUSED(b)
  *
  ERRORatline1:
  ORA-12991:columnisreferencedinamulti-columnconstraint
  SQL10G>ALTERTABLEtestSETUNUSED(b)CASCADECONSTRAINTS;
  Tablealtered.
  SQL10G>selectt.constraint_name,c.constraint_type,t.column_name,t.position,c.status,c.validated
  2fromuser_cons_columnst,user_constraintsc
  3wherec.constraint_name=t.constraint_name
  4andc.constraint_type!='C'
  5andt.table_name='TEST'
  6orderbyconstraint_name,position;
  norowsselected
  wo men ke yi kan dao , zheng chang de shan chu hui bao yi ge cuo wu , ru guo wo men zhi ding le cascade, jiang hui ba dui ying de yue shu ye shan chu 。
  wo men kan wan le Oracle de chu li guo cheng , zai kan kan mysql shi zhe me chu li shan chu suo yin shang zi duan zhe ge shi qing de
  mysql>createtabletest(aint,bint,cint);
  QueryOK,0rowsaffected(0.72sec)
  mysql>altertabletestaddprimarykey(a,b);
  QueryOK,0rowsaffected(0.27sec)
  Records:0Duplicates:0Warnings:0
  mysql>createindexind_testontest(b,c);
  QueryOK,0rowsaffected(0.32sec)
  Records:0Duplicates:0Warnings:0
  wo men zhi xing tong yang de cao zuo , xian shan chu fu he suo yin zhong de yi ge zi duan , ran hou shan chu yue shu zhong de yi ge zi duan 。
  mysql>altertabletestdropc;
  QueryOK,0rowsaffected(0.58sec)
  Records:0Duplicates:0Warnings:0
  mysql>showindexfromtest;
  +-------+------------+----------+-----------+
  |Table|Non_unique|Key_name|Seq_in_index|Column_name|Collation|
  +-------+------------+----------+-----------+
  |test|0|PRIMARY|1|a|A|
  |test|0|PRIMARY|2|b|A|
  |test|1|ind_test|1|b|A|
  +-------+------------+----------+-----------+
  3rowsinset(0.06sec)
  mysql>altertabletestdropb;
  QueryOK,0rowsaffected(0.28sec)
  Records:0Duplicates:0Warnings:0
  mysql>showindexfromtest;
  +-------+------------+----------+-----------+
  |Table|Non_unique|Key_name|Seq_in_index|Column_name|Collation|
  +-------+------------+----------+-----------+
  |test|0|PRIMARY|1|a|A|
  +-------+------------+----------+-----------+
  1rowinset(0.03sec)
  ke yi kan dao ,mysql de chu li fang shi shi you cha bie de ,mysql jin jin shi ba zi duan cong suo yin zhong na diao , er bu shi shan chu gai suo yin 。
  ben wen de yi si , jiu shi xiang ti xing da jia , ping chang zai zuo columns shan chu de shi hou , bao kuo unused, yi ding yao xiao xin , shi fou you fu he suo yin bao han le gai zi duan , fou ze , yi bu xiao xin ba suo yin shan chu le , ke neng jiang yin fa da de cuo wu 。【原文】【汉音对照
 
 
 
 
 
 
 
 
 
日版宠物情人插曲《Winding Road》歌词

日版宠物情人2017的插曲,很带节奏感,日语的,女生唱的。 最后听见是在第8集的时候女主手割伤了,然后男主用嘴帮她吸了一下,插曲就出来了。 歌手:Def...

兄弟共妻,我成了他们夜里的美食

老钟家的两个儿子很特别,就是跟其他的人不太一样,魔一般的执着。兄弟俩都到了要结婚的年龄了,不管自家老爹怎么磨破嘴皮子,兄弟俩说不娶就不娶,老父母为兄弟两操碎了心...

如何磨出破洞牛仔裤?牛仔裤怎么剪破洞?

把牛仔裤磨出有线的破洞 1、具体工具就是磨脚石,下面垫一个硬物,然后用磨脚石一直磨一直磨,到把那块磨薄了,用手撕开就好了。出来的洞啊很自然的。需要猫须的话调几...

我就是扫描下图得到了敬业福和爱国福

先来看下敬业福和爱国福 今年春节,支付宝再次推出了“五福红包”活动,表示要“把欠大家的敬业福都还给大家”。 今天该活动正式启动,和去年一样,需要收集“五福”...

冰箱异味产生的原因和臭味去除的方法

有时候我们打开冰箱就会闻到一股异味,冰箱里的这种异味是因为一些物质发出的气味的混合体,闻起来让人恶心。 产生这些异味的主要原因有以下几点。 1、很多人有这种习...

 
 
bu zhi dao you duo shao ren qing chu de zhi dao , zai Oracle zhong , ru guo yi ge fu he suo yin , jia ding suo yin (a,b,c) san ge zi duan , shan chu le ( bao kuo unused) qi zhong yi ge zi duan ,Oracle hui zen me chu li zhe ge suo yin 。 tong yang , ru guo shi yue shu ,Oracle you zen me chu li ? yong Oracle wei li zi , wo you na mysql zuo le yi ge dui bi , kan kan mysql shi zen me chu li zhe ge wen ti de 。 wo zhe li bu tao lun shui hao shui cha , zhi shi xi wang da jia zhi dao qi zhong de cha bie yu xi jie er yi 。 wo men xian kan Oracle de li zi , wo men chuang jian yi ge biao , ran hou zai shang mian chuang jian yi ge yue shu , chuang jian yi ge suo yin : SQL10G>createtabletest(aint,bint,cint); Tablecreated. SQL10G>altertabletestaddconstraintpk_testprimarykey(a,b); Tablealtered. SQL10G>createindexind_testontest(b,c); Indexcreated. ran hou , wo men jian cha gang cai chuang jian de yue shu yu suo yin   SQL10G>selectt.constraint_name,c.constraint_type,t.column_name,t.position,c.status,c.validated 2fromuser_cons_columnst,user_constraintsc 3wherec.constraint_name=t.constraint_name 4andc.constraint_type!='C' 5andt.table_name='TEST' 6orderbyconstraint_name,position; CONSTRAINT_NAMECCOLUMN_NAMEPOSITIONSTATUSVALIDATED ------------------------------------------------------------ PK_TESTPA1ENABLEDVALIDATED PK_TESTPB2ENABLEDVALIDATED SQL10G>selectt.index_name,t.column_name,t.column_position,i.status 2fromuser_ind_columnst,user_indexesi 3wheret.index_name=i.index_name 4andt.table_name='TEST' 5*orderbyindex_name,column_position INDEX_NAMECOLUMN_NAMECOLUMN_POSITIONSTATUS ------------------------------------------------- IND_TESTB1VALID IND_TESTC2VALID xian zai , wo men xian shan chu suo yin shang de zi duan , qi shi bing mei you wu li shan chu , zhi shi she zhi wei unused: SQL10G>ALTERTABLEtestSETUNUSED(c); Tablealtered. SQL10G>selectt.index_name,t.column_name,t.column_position,i.status 2fromuser_ind_columnst,user_indexesi 3wheret.index_name=i.index_name 4andt.table_name='TEST' 5orderbyindex_name,column_position; norowsselected fa xian le shen me , suo yin ye shan chu le 。 na wo men zai shan chu yue shu shang de zi duan ne ? SQL10G>ALTERTABLEtestSETUNUSED(b); ALTERTABLEtestSETUNUSED(b) * ERRORatline1: ORA-12991:columnisreferencedinamulti-columnconstraint SQL10G>ALTERTABLEtestSETUNUSED(b)CASCADECONSTRAINTS; Tablealtered.   SQL10G>selectt.constraint_name,c.constraint_type,t.column_name,t.position,c.status,c.validated 2fromuser_cons_columnst,user_constraintsc 3wherec.constraint_name=t.constraint_name 4andc.constraint_type!='C' 5andt.table_name='TEST' 6orderbyconstraint_name,position; norowsselected wo men ke yi kan dao , zheng chang de shan chu hui bao yi ge cuo wu , ru guo wo men zhi ding le cascade, jiang hui ba dui ying de yue shu ye shan chu 。 wo men kan wan le Oracle de chu li guo cheng , zai kan kan mysql shi zhe me chu li shan chu suo yin shang zi duan zhe ge shi qing de mysql>createtabletest(aint,bint,cint); QueryOK,0rowsaffected(0.72sec) mysql>altertabletestaddprimarykey(a,b); QueryOK,0rowsaffected(0.27sec) Records:0Duplicates:0Warnings:0 mysql>createindexind_testontest(b,c); QueryOK,0rowsaffected(0.32sec) Records:0Duplicates:0Warnings:0 wo men zhi xing tong yang de cao zuo , xian shan chu fu he suo yin zhong de yi ge zi duan , ran hou shan chu yue shu zhong de yi ge zi duan 。 mysql>altertabletestdropc; QueryOK,0rowsaffected(0.58sec) Records:0Duplicates:0Warnings:0 mysql>showindexfromtest; +-------+------------+----------+-----------+ |Table|Non_unique|Key_name|Seq_in_index|Column_name|Collation| +-------+------------+----------+-----------+ |test|0|PRIMARY|1|a|A| |test|0|PRIMARY|2|b|A| |test|1|ind_test|1|b|A| +-------+------------+----------+-----------+ 3rowsinset(0.06sec) mysql>altertabletestdropb; QueryOK,0rowsaffected(0.28sec) Records:0Duplicates:0Warnings:0 mysql>showindexfromtest; +-------+------------+----------+-----------+ |Table|Non_unique|Key_name|Seq_in_index|Column_name|Collation| +-------+------------+----------+-----------+ |test|0|PRIMARY|1|a|A| +-------+------------+----------+-----------+ 1rowinset(0.03sec) ke yi kan dao ,mysql de chu li fang shi shi you cha bie de ,mysql jin jin shi ba zi duan cong suo yin zhong na diao , er bu shi shan chu gai suo yin 。 ben wen de yi si , jiu shi xiang ti xing da jia , ping chang zai zuo columns shan chu de shi hou , bao kuo unused, yi ding yao xiao xin , shi fou you fu he suo yin bao han le gai zi duan , fou ze , yi bu xiao xin ba suo yin shan chu le , ke neng jiang yin fa da de cuo wu 。
󰈣󰈤
  免责声明:本文仅代表作者个人观点,与王朝网络无关。王朝网络登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述,其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
赏心悦目的模特儿(9)
赏心悦目的模特儿(8)
赏心悦目的模特儿(7)
赏心悦目的模特儿(6)
周六一日游--绿野翠蜂场(一)
骆驼峰
下一站上环
杂乱的几张Danang
 
>>返回首页<<
 
 
 为你推荐
 
 
 
 转载本文
 UBB代码 HTML代码
复制到剪贴板...
 
 热帖排行
 
 
 
 
 
©2005- 王朝网络 版权所有