Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

oracle ²é¿´Ö÷Íâ¼üÔ¼Êø

select a.constraint_name, a.table_name, b.constraint_name 
from user_constraints a, user_constraints b
where a.constraint_type = 'R' 
and b.constraint_type = 'P' 
and a.r_constraint_name = b.constraint_name
P ´ú±íÖ÷¼ü
R ´ú±íÍâ¼ü
ͨ¹ý¹ØÁª£¬Äܲéѯµ½ÄãËùÏëÒªµÄÒ»ÇС£
select constraint_name from dba_cons_columns where table_name='';
Alter table XX drop constraint sys…
/////////////////////////////
user_constraints,user_cons_columns²é¿´Íâ¼ü
Oracle ²é¿´Ò»¸ö±í¶ÔÓ¦µÄÖ÷¼üºÍÍâ¼üµÄÔ¼Êø¹Øϵ£¬²é¿´µÄÓï¾ä£º
select a.owner Ö÷¼üÓµÓÐÕß
         ,a.table_name Ö÷¼ü±í
        ,b.column_name Ö÷¼üÁÐ
        ,C.OWNER Íâ¼üÓµÓÐÕß
        ,c.table_name Íâ¼ü±í
       ,d.column_name Íâ¼üÁÐ
from user_constraints a
left join user_cons_columns b
            on a.constraint_name=b.constraint_name
left join user_constraints C
            ON C.R_CONSTRAINT_NAME=a.constraint_name
left join user_cons_columns d
            on c.constraint_name=d.constraint_name
where a.constraint_type='P'
    and a.table_name='XXX' --ÐèÒª²é¿´Ö÷Íâ¼ü¹ØϵµÄ±í
order by a.table_name
ÄþÍâµÄÒ»ÖÖд·¨
select
a.owner Íâ¼üÓµÓÐÕß,
a.table_name Íâ¼ü±í,
substr(c.column_name,1,127) Íâ¼üÁÐ,
b.owner Ö÷¼üÓµÓÐÕß,
b.table_name Ö÷¼ü±í,
substr(d.column_name,1,127) Ö÷¼üÁÐ
from
user_constraints a,
user_constraints b,
user_cons_columns c,
user_cons_columns d
where
    a.r_constraint_name=b.constraint_name
and a.constraint_type='R'
and b.constraint_type='P'
and a.r_owner=b.owner
and a.constraint_name=c.constraint_name
and b.constraint_name=d.constraint_name
and a.owner=c.owner


Ïà¹ØÎĵµ£º

Oracle°²È«È«½Ó´¥£¨ÉÏ£©

Ëæ׿ÆËã»úµÄÆÕ¼°ÒÔ¼°ÍøÂçµÄ·¢Õ¹£¬Êý¾Ý¿âÒѾ­²»ÔÙ½ö½öÊÇÄÇЩ³ÌÐòÔ±ËùרÓеĻ°Ìâ¡£¶øOracleÊý¾Ý¿â¸üÊÇƾ½èÆäÐÔÄÜ׿Խ£¬²Ù×÷·½±ãÁé»îµÄÌص㣬ÔÚÊý¾Ý¿âµÄÊг¡ÖÐÒѾ­Õ¼¾ÝÁËһϯ֮µØ¡£µ«ÊÇͬÑùËæ×ÅÍøÂç¼¼ÊõµÄ²»¶Ï½ø²½£¬Êý¾ÝÐÅÏ¢µÄ²»¶ÏÔö¼Ó£¬Êý¾Ý°²È«ÒѾ­²»ÔÙÊÇÒÔÇ°µÄ“ÀÏÉú³¤Ì¸”£¬Ò²¸ü²»ÊÇÒÔÇ°Êé±¾ÉÏÄÇЩ“¿ÉÍû² ......

Oracle Òƶ¯Êý¾ÝÎļþµÄ²Ù×÷·½·¨


½«±í¿Õ¼äºÍÊý¾ÝÎļþ´ÓÒ»¸öλÖÃÒƶ¯µ½ÁíÒ»¸öλÖõIJÙ×÷·½·¨
Ò»£® OFFLINE
OFFLINE ·ÖΪALTER DATABASE Óë ALTER TABLESPACE OFFLINE£¬
ËûÃǵÄÇø±ð²Î¿´blog£ºhttp://blog.csdn.net/tianlesoftware/archive/2009/11/29/4898800.aspx
°´Êý¾ÝÎļþÀ´£º
1.ÏȽ«ÏàÓ¦µÄÊý¾ÝÎļþ offl ......

oracle ´æ´¢¹ý³ÌµÄ»ù±¾Óï·¨

1.»ù±¾½á¹¹
CREATE OR REPLACE PROCEDURE ´æ´¢¹ý³ÌÃû×Ö
(
    ²ÎÊý1 IN NUMBER,
    ²ÎÊý2 IN NUMBER
) IS
±äÁ¿1 INTEGER :=0;
±äÁ¿2 DATE;
BEGIN
END ´æ´¢¹ý³ÌÃû×Ö
2.SELECT INTO STATEMENT
  ½«select²éѯµÄ½á¹û´æÈëµ½±äÁ¿ÖУ¬¿ÉÒÔͬʱ½«¶à¸öÁд洢¶à¸ö±äÁ¿ÖУ¬±ØÐëÓÐÒ»Ì ......

Oracleº¯Êý´óÈ«

SQLÖеĵ¥¼Ç¼º¯Êý
1.ASCII
·µ»ØÓëÖ¸¶¨µÄ×Ö·û¶ÔÓ¦µÄÊ®½øÖÆÊý;
SQL> select ascii('A') A,ascii('a') a,ascii('0') zero,ascii(' ') space from dual;
        A         A      ZERO     ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ