ʵÏÖORACLEÈçºÎÈ¥³ýijЩÓû§µÄDROPȨÏÞ!
ÓÐʱÔÚ½øÐÐÏîÄ¿¿ª·¢¹ý³ÌÖУ¬ÓÉÓÚһЩÎó²Ù×÷»áµ¼ÖÂÊý¾Ý¿âµÄ±í¸øÎóɾ³ýµô£¬ÎªÁ˱ÜÃâÕâÒ»Çé¿öµÄ·¢Éú£¬ÈçºÎÑϸñ¿ØÖÆijÓû§²»ÄܶÔ×Ô¼ºµÄ¿â½øÐÐDROPȨÏÞ£¬ÐèÒª½øÐÐÏà¹ØÉèÖã¬ÓÉÓÚĬÈÏconnectµÄȨÏÞÒ²ÊǾßÓÐdrop×Ô¼ºÓû§µÄ±í½á¹¹£¬Í¨¹ýproduct_user_profileÖ»ÄÜÏÞÖÆsql*plusµÄ²Ù×÷£¬¶ø²»ÄÜÏÞÖÆÆäËüµÚÈý·½oracleÁ¬½Ó¹¤¾ß£¬×îÓÐЧµÄ·½·¨¾ÍÊÇͨ¹ýÔÚsystemÓû§Ï½¨Á¢´¥·¢Æ÷À´ÏÞÖÆ¡£
¾ßÌåÈçÏ£º
Õâ¸ötrigger½¨µ½ÁËsystemÓû§Ï£¬TEMP¼¸¸öÓû§¶¼ÎÞ·¨Dop×Ô¼ºµÄ¶ÔÏó£¬Äã¿ÉÒÔ²ÎÕÕ½øÐÐÐ޸ġ£
CREATE OR REPLACE TRIGGER "TRG_DENY_DROP_UBISP" BEFORE
DROP ON DATABASE
BEGIN
IF (ORA_DICT_OBJ_OWNER='TEMP_ODS' OR
ORA_DICT_OBJ_OWNER='TEMP_MID' OR
ORA_DICT_OBJ_OWNER='TEMP_DW' OR
ORA_DICT_OBJ_OWNER='TEMP_REPORT' OR
ORA_DICT_OBJ_OWNER='TEMP_WEB' OR
ORA_DICT_OBJ_OWNER='TEMP_REPORT_NEW')
AND ORA_LOGIN_USER<>'TEMP_ADMIN'---ÅųýµÄÓû§
AND ORA_DICT_OBJ_TYPE='TABLE' AND ORA_DICT_OBJ_NAME NOT LIKE '%OLD' THEN--¿ÉÒÔÈñ»ÏÞÖƵÄÓû§É¾³ýµÄ±í
RAISE_APPLICATION_ERROR(-20010,'Äã²»ÄÜ´´½¨/ɾ³ýTEMP_%Óû§ÏµÄÈκαí.');
END IF;
END TRG_DENY_DROP_UBISP;
×¢£ºÈç¹ûÒª¶Ôµ±Ç°Óû§ÏÞÖÆËùÓжÔÏóµÄDROP²Ù×÷£¬¿É½«´¥·¢Æ÷ÖеÄORA_DICT_OBJ_TYPEºÍORA_DICT_OBJ_NAMEµÄÊôÐÔÈ¥µô¼´¿É¡£
Ïà¹ØÎĵµ£º
°²×°ÍêOracle 10g£¬sql*plusµÇ½
"Óû§Ãû³Æ£¨U£©:"ÖÐÊäÈë'system'
"¿ÚÁP£©:"ÖÐÊäÈë'manager'
"Ö÷»ú×Ö·û´®£¨H£©:" tnsname.oraÖÐÅäÖõķþÎñÃû(Èç¹ûÊÇϵͳĬÈÏÊý¾Ý¿â¿ÉÒÔ²»ÊäÈë)
(×¢1£ºÕâ¸öÓû§Ãû/ÃÜÂëÊÇÔÚ°²×°¹ý³ÌÖÐ×Ô¼ºÉ趨µÄ)
(×¢2: Èç¹ûÉÏÊö²Ù×÷Å׳öûÓмàÌýÆ÷£¬ÔòÐè¿ ......
select bid from t_branch c start with c.upbid ='11000000' connect by prior c.bid=c.upbid
˵Ã÷£º
1¡¢Í³¼Æij¸ö»ú¹¹ÏÂËùÓеÄ×ÓËï»ú¹¹¡£Èçͳ¼Æ±±¾©»ú¹¹ÏµÄ×ÓËï»ú¹¹£¬°üÀ¨£º³¯ÑôÇø»ú¹¹¡¢º£µíÓªÏú»ú¹¹¡¢¡¢¡¢ÇàÁúÇÅÏç»ú¹¹¡¢¡¢¡¢¡¢Ò»Ö±µ½×îµ×²ãµÄ»ú¹¹¡£
2¡¢upbidÊÇÖ¸Éϼ¶»ú¹¹µÄID¡£º£µíÇø»ú¹¹ID(bid)µÄÉϼ¶»ú ......
²éÕÒÊý¾Ý¿âÖÐËùÓÐ×ֶΠÒÔ¶ÔÓ¦µÄ±í
select C.column_name,C.TABLE_NAME from dba_tab_columns C where owner=''
²éÿ¸ö¿ÆÄ¿class ·ÖÊýscroÇ°ÈýÃû
select id, name, class, scro
from (select row_number() over(partition by class order by scro desc) cnt,
&n ......
1¡¢Ê¹ÓÃoracleÓû§µÇ¼£¬Á¬½ÓÊý¾Ý¿â
[oracle@wuzj ~]$ sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Thu Feb 26 12:06:29 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> conn /as sysdba
Connected.
//²é¿´Óû§
SQL> select username,password from dba_users;
......
Çø±ð£º
¡¡¡¡1£®CHARµÄ³¤¶ÈÊǹ̶¨µÄ£¬¶øVARCHAR2µÄ³¤¶ÈÊÇ¿ÉÒԱ仯µÄ£¬ ±ÈÈ磬´æ´¢×Ö·û´®“abc"£¬¶ÔÓÚCHAR
(20)£¬±íʾÄã´æ´¢µÄ×Ö·û½«Õ¼20¸ö×Ö½Ú(°üÀ¨17¸ö¿Õ×Ö·û)£¬¶øͬÑùµÄVARCHAR2
(20)ÔòÖ»Õ¼ÓÃ3¸ö×ֽڵij¤¶È£¬20Ö»ÊÇ×î´óÖµ£¬µ±Äã´æ´¢µÄ×Ö·ûСÓÚ20ʱ£¬°´Êµ¼Ê³¤¶È´æ´¢¡£
¡¡¡¡2£®CHARµÄЧÂʱÈVARCHAR2µÄЧÂÊ ......