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

ORACLE 10g Öлָ´ÒÑɾ³ýµÄ±í_flashback


-- ±Ê¼ÇÖв¿·ÖÄÚÈÝ
SQL> create table tt2 as select * from employee;
Table created.
SQL> drop table tt2;
Table dropped.
SQL> select * from tt2;
select * from tt2
*
ERROR at line 1:
ORA-00942: table or view does not exist
SQL> flashback table tt2 to before drop;
Flashback complete.
SQL> select count(1) from tt2;
COUNT(1)
----------
32
Èç¹ûÔÚ±íɾ³ýºó,ÓÖн¨ÁËÕâ¸ö±í,»Ö¸´Ê±¿ÉÒÔÖØÃüÃû,ÈçÏÂ:
SQL> drop table tt2;
Table dropped.
SQL> flashback table tt2 to before drop
2 rename to tt2_old;
Flashback complete.
SQL> select count(1) from tt2_old;
COUNT(1)
----------
32
Èç¹ûÕâ¸ö±íɾ³ýÁ˲»Ö¹Ò»´Î,ÎÒÏë»Ö¸´Ä³Ò»´ÎµÄɾ³ý,Ôõô°ì?
²éѯrecyclebinÊÓͼ,»òÕßshow recyclebin,È»ºó´øÃû×Ö»Ö¸´.
SQL> drop table tt2_old;
Table dropped.
SQL> show recyclebin
ORIGINAL NAME RECYCLEBIN NAME OBJECT TYPE DROP TIME
---------------- ------------------------------ ------------ -------------------
TT2_OLD BIN$SOz1cXPCADLgQwoKCiEAMg==$0 TABLE 2008-03-21:13:51:49
SQL>
SQL> create table tt2_old as select * from job;
Table created.
SQL> drop table tt2_old;
Table dropped.
SQL> show recyclebin
ORIGINAL NAME RECYCLEBIN NAME OBJECT TYPE DROP TIME
---------------- ------------------------------ ------------ -------------------
TT2_OLD BIN$SOz1cXPDADLgQwoKCiEAMg==$0 TABLE 2008-03-21:13:52:40
TT2_OLD BIN$SOz1cXPCADLgQwoKCiEAMg==$0 TABLE 2008-03-21:13:51:49
SQL> flashback table "BIN$SOz1cXPCADLgQwoKCiEAMg==$0" to before drop;
Flashback complete.
SQL> desc tt2_old
Name Null? Type
----------------------------------------- -------- ----------------------------
EMPLOYEE_ID NUMBER(4)
LAST_NAME VARCHAR2(15)
FIRST_NAME VARCHAR2(15)
MIDDLE_INITIAL VARCHAR2(1)
JOB_ID NUMBER(3)
MANAGER_ID NUMBER(4)
HIRE_DATE DATE
SALARY NUMBER(7,2)
COMMISSION NUMBER(7,2)
DEPARTMENT_ID NUMBER(2)
¿ÉÒÔ¿´µ½ÉÏÊö½á¹û²»ÊÇjob±íµÄ½á¹¹,¶øÊǵÚÒ»´ÎʱµÄ½á¹¹
ʹÓÃÏÞÖÆ:
1 Ö»ÓзÇϵͳ±í¿Õ¼ä,¶øÇÒÊDZ¾µØ¹ÜÀíµÄ±í¿Õ¼ä
2 ±íÉÏÏà¹Ø¶ÔÏó±»±£Áô,³ýÁËÒÔÏÂÄÚÈÝ:
bitmap


Ïà¹ØÎĵµ£º

ORACLEµÈ´ýʼþÀàÐÍ(Ò»)

author:skate
tiime:2009-11-18
ORACLEµÈ´ýʼþÀàÐÍ¡¾Classes of Wait Events¡¿
ÿһ¸öµÈ´ýʼþ¶¼ÊôÓÚijһÀ࣬ÏÂÃæ¸ø³öÁËÿһÀàµÈ´ýʼþµÄÃèÊö¡£¡¾Every wait event belongs to a class of wait event.
The following list describes each of the wait classes.¡¿
1. ¹ÜÀíÀࣺAdministrative
´ËÀàµÈ´ýʼþÊÇÓÉÓÚDBAµÄ ......

Oracle»ù±¾²Ù×÷

1.´´½¨±í¿Õ¼ä
  create tablespace test datafile'c:\test.dbf' size 10m;  //Ãû×Ö²»ÒªÎªÊý×Ö
2.´´½¨Óû§
create user userName identified by password;  //²»ÒªÎªÊý×Ö
3.¸øÓû§ÊÚȨ
grant dba to userName; --ÊÚÓèDBAȨÏÞ
grant unlimited tablespace to userName;--ÊÚÓè²»ÏÞÖƵıí¿Õ¼ä
grant sele ......

Introduction to Oracle9i: SQL

left join ºÍ left outer join µÄÇø±ð
ͨË׵Ľ²£º  
  A   left   join   B   µÄÁ¬½ÓµÄ¼Ç¼ÊýÓëA±íµÄ¼Ç¼Êýͬ  
  A   right   join   B   µÄÁ¬½Ó ......

OracleÖÐstart with...connect by prior×Ó¾äÓ÷¨

 
OracleÖÐstart with...connect by prior×Ó¾äÓ÷¨

connect by Êǽṹ»¯²éѯÖÐÓõ½µÄ£¬Æä»ù±¾Óï·¨ÊÇ£º
select ... from tablename start with Ìõ¼þ1
connect by Ìõ¼þ2
where Ìõ¼þ3;
Àý£º
select * from table
start with org_id = 'HBHqfWGWPy'
connect by prior org_id = parent_id;
¼òµ ......

Oracle¿ØÖÆÎļþ³£ÓòÙ×÷

ÏÞÖÆ¿ØÖÆÎļþµÄ´óС
a.)²éѯ¿É¸´Óò¿·ÖµÄ±£´æÌìÊý(²»ÄÜÖ±½Ó¿ØÖÆ´óС,±£´æÌìÊýÔ½´óÊý¾ÝÔ½¶à)
SELECT name,value from v$parameter WHERE name = 'control_file_record_keep_time';

b.)ÉèÖÿɸ´Óò¿·Ö±£´æʱ¼ä
ALTER SYSTEM SET CONTROL_FILE_RECORD_KEEP_TIME = 14;
......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ