Oracle 10g ÒªµãÕûÀí Ö® ÉÁ»Ø£¨½öÏÞÓÚSQL*Plus£©
ÉÁ»Ø
1 ÌØÕ÷
ÉÁ»ØÊý¾Ý¿âÖ»ÊÇÂß¼Êý¾ÝÔâµ½ÆÆ»µÊ±µÄÊֶΡ£
ÉÁ»ØÊý¾Ý¿âÈÕÖ¾±ØÐëÔÚÊý¾Ý¿â»Ö¸´ÇøÖд´½¨¡£
ÉÁ»ØÈÕÖ¾²»ÐèÒª¹éµµ£¬²»ÄÜÓÃÓÚÎïÀí»Ö¸´¡£
Ö´ÐÐÉÁ»ØÊý¾Ý¿â²Ù×÷ʱ£¬±³¾°½ø³ÌRVWR¾ÍÆô¶¯ÁË¡£
2 ʹÓÃÉÁ»ØÊý¾Ý¿â
3ÖÖ¹¤¾ß£¬SQL*Plus£¬RMAN£¬OEM¡£
£¨1£©ÒªÇó
ΪÁËʹÓÃÉÁ»ØÊý¾Ý¿â£¬Êý¾Ý¿â±ØÐë´¦Óڹ鵵ÈÕ־ģʽ¡£
£¨2£©´ÓSQL*PlusÖÐÉÁ»ØÊý¾Ý¿â
¢Ù Óû§±ØÐëʹÓÃas sysdbaÁ¬½Óµ½Êý¾Ý¿â¡£
¢Ú ¹Ø±ÕÊý¾Ý¿â
shutdown immediate;
¢Û °²×°Êý¾Ý¿â
startup mount exclusive;
¢Ü ʹÓÃalter systemÃüÁÉèÖÃdb_flashback_retention_targetΪһ¸öÄ¿±êÖµ£¬¸ÃÖµÖ¸¶¨ÁË¿ÉÒÔÉÁ»ØµÄʱ¼äÉÏÏÞ£¨·ÖÖÓ£©
alter system set db_flashback_retention_target = Êý×Ö;
¢Ý ʹÓÃalter database ÉèÖÃÔÊÐíÉÁ»Ø
alter database flashback on£»
¢Þ ʹÓÃalter database openÃüÁî´ò¿ªÊý¾Ý¿â¡£
¢ß ¹Ø±ÕÊý¾Ý¿â£¬ÖØа²×°Êý¾Ý¿â¡£
¢à ʹÓÃflashback database to timestamp»òflashback database to scn Êý×Ö Ö´ÐÐÉÁ»Ø²Ù×÷¡£
¢á ʹÓÃalter database open read only¡£
¢â È·ÈÏÉÁ»Ø³É¹¦ºó£¬Ö´ÐÐalter database open resetlog
3 Ïà¹ØÊÓͼ
£¨1£©v$database£ºÀïÃæÓÐÒ»ÁГflashback_on”£¬²¼¶ûÀàÐÍ¡£¾ö¶¨ÊÇ·ñÔÊÐíÖ´ÐÐÉÁ»Ø²Ù×÷¡£
£¨2£©v$flashback_database_log£ºÓÃÓÚ¼àÊÓÉÁ»ØÊý¾Ý¿â¡£
£¨3£©v$ flashback_database_stat£ºÓÃÓÚ¼àÊÓÉÁ»ØÊý¾Ý¿âÈÕÖ¾µÄ¸ººÉ¡£
4»ØÊÕÕ¾
»ØÊÕÕ¾¾ÍÊÇÒ»¸öÊý¾Ý×Öµä±í£¬·ÅÖÃÓû§ÒÑɾ³ýµÄÊý¾Ý¿â¶ÔÏóÐÅÏ¢¡£
ÓÃÓÚÖ§³Öflashback drop¹¦ÄÜ¡£µ±Ä³¸ö¶ÔÏó±»dropÖ®ºó£¬Ëü¾ÍÒƶ¯µ½ÁË»ØÊÕÕ¾ÖС£
Èç¹ûÏ£Íû³¹µ×ɾ³ý¶ÔÏ󣬶ø²»ÒƵ½»ØÊÕÕ¾£¬¾ÍÔÚdropÃüÁîºó¼Ópurge²ÎÊý¡£
È磺drop table emp purge£»
±»É¾³ýºÍÒƵ½µ½»ØÊÕÕ¾ÖеĶÔÏó²¢Ã»ÓÐÊͷſռ䣬ֱµ½½«Æä´Ó»ØÊÕÕ¾Çå³ýΪֹ¡£
purge ¶ÔÏóÀàÐÍ ¶ÔÏóÃû£»
ÉÏÃæµÄÓï¾äÓÃÓÚÇå³ý»ØÊÕÕ¾ÖÐÖ¸¶¨µÄ¶ÔÏó¡£
flashback ¶ÔÏóÀàÐÍ ¶ÔÏóÃû to before drop (rename to жÔÏóÃû)£»
Èç¹û¶à´Î´´½¨ºÍɾ³ýͬһ¶ÔÏó£¬ÄÇôֻÊǻָ´×îб»É¾³ýµÄ¶ÔÏó¡£
ʹÓÃuser_recyclebinÊÓͼ²é¿´»ØÊÕÕ¾ÖеÄÐÅÏ¢¡£
Èƹý»ØÊÕÕ¾
¢Ùdrop table ±íÃû purge£»
¢Údrop tablespace ±í¿Õ¼äÃû including contents£»
¢Ûdrop user Óû§Ãû cascade£»
´ÓÉÁ»ØÊý¾Ý¿âÖÐÅųý±í¿Õ¼ä
alter tablespace ±í¿Õ¼äÃ
Ïà¹ØÎĵµ£º
ÎÊÌ⣺
1. oracleÖÐnumber£¬char/varchar£¬dateµÈÊý¾ÝÀàÐÍÊÇÔõô´æ´¢µÄ£¿×Ö½ÚÁ÷ÊÇʲôÑùµÄ£¿
2. ¸÷ÖÖÊý¾ÝÀàÐÍÕ¼ÓõÄ×Ö½Ú³¤¶ÈÊǶà´ó£¿
SELECT dump(1), DUMP(123456), DUMP(-123456), DUMP(1234567890123456) -- ÕûÊý
--SELECT DUMP(123456.789), DUMP(-123456.789), dump(1.234567890123456789E15), dump(1234567890123 ......
ת×Ô£ºhttp://book.csdn.net/bookfiles/235/10023510864.shtml
ÔÚʵ¼ÊSQLÓ¦ÓÃÖУ¬¾³£ÐèÒª½øÐзÖ×é¾ÛºÏ£¬¼´½«²éѯ¶ÔÏó°´Ò»¶¨Ìõ¼þ·Ö×飬Ȼºó¶Ôÿһ¸ö×é½øÐоۺϷÖÎö¡£
GROUP BY×Ӿ䴴½¨·Ö×é
´´½¨·Ö×éÊÇͨ¹ýGROUP BY×Ó¾äʵÏֵġ£ÓëWHERE×Ӿ䲻ͬ£¬GROUP BY×Ó¾äÓÃÓÚ¹éÄÉÐÅÏ¢ÀàÐÍ£¬ÒÔ»ã×ÜÏà¹ØÊý¾Ý¡£¶øΪʲôҪʹÓÃGROUP BY ......
Ò» µ¥´Ê½âÊÍ(2·Ö/¸ö) 34·Ö
¡¡¡¡Data Êý¾Ý Database Êý¾Ý¿â RDBMS ¹ØϵÊý¾Ý¿â¹ÜÀíϵͳ GRANT ÊÚȨ
¡¡¡¡REVOKE È¡ÏûȨÏÞ DENY ¾Ü¾øȨÏÞ DECLARE ¶¨Òå±äÁ¿ PROCEDURE´æ´¢¹ý³Ì
¡¡¡¡ÊÂÎñ Transaction ´¥·¢Æ÷ TRIGGER ¼ÌÐø continue Ψһ unqiue
¡¡¡¡Ö÷¼ü primary key ±êʶÁÐ identity Íâ¼ü foreign key ¼ì ......
Èç¹ûÏë²éÕÒ“_cs”½áβµÄµÄÕË»§
select * from [user] where loginname like '%_cs'ÊDz»Ðеģ¬_ ±»ÈÏΪÊÇÈÎÒâµÄ×Ö·û£¬
ËùÒÔÐèҪתÒå×Ö·û£¬ÓÐÁ½ÖÖд·¨£º
select * from [user] where loginname like '%[_]cs'
select * from [user] where loginname like '%/_cs' escape'/'
ͨÅä·ûº¬Òå
%
°üº¬Áã¸ö»ò¸ü¶à×Ö· ......