Oracle 11g回收站(recyclebin)的使用是本文我们主要要介绍的内容,我们知道,Flashback是以undo segment中的内容为基础的,因此受限于undo_retenton参数,要使用flashback的特征,必须启动自动撤销表空间。Version
Parameter Name
Data Type
Session Modifiable
System Modifiable
10.2.0
recyclebin
String
TRUE
IMMEDIATE
11.1.0
recyclebin
String
TRUE
DEFERRED
启动闪回数据库的步骤:查看哪些对象可以利用闪回恢复区来存放:
1. SQL> select file_type from v$flash_recovery_area_usage; FILE_TYPE
2. -------------------- CONTROL FILE
3. REDO LOG ARCHIVED LOG
4. BACKUP PIECE IMAGE COPY
5. FLASHBACK LOG FOREIGN ARCHIVED LOG
6. 7 rows selected.
查看闪回恢复区空间的使用情况:
1. SQL> select * from v$flash_recovery_area_usage; FILE_TYPE PERCENT_SPACE_USED PERCENT_SPACE_RECLAIMABLE
2. -------------------- ------------------ ------------------------- NUMBER_OF_FILES
3. --------------- CONTROL FILE 0 0
4. 0 REDO LOG 0 0
5. 0 ARCHIVED LOG 0 0
6. 0 FILE_TYPE .__USED PERCENT_SPACE_RECLAIMABLE
7. -------------------- ------------------ ------------------------- NUMBER_OF_FILES
8. --------------- BACKUP PIECE 0 0
9. 0 IMAGE COPY 0 0
10. 0 FLASHBACK LOG 0 0
11. 0 FILE_TYPE PERCENT_SPACE_USED PERCENT_SPACE_RECLAIMABLE
12. -------------------- ------------------ ------------------------- NUMBER_OF_FILES
13. --------------- FOREIGN ARCHIVED LOG 0 0
14. 0 7 rows selected.
计算flash recovery area已经占用的空间:
1. SQL> select sum(percent_space_used)*3/100 from v$flash_recovery_area_usage; SUM(PERCENT_SPACE_USED)*3/100
2. ----------------------------- 0 |