QUESTION NO: 374
Which of the following statements are true regarding the Recycle Bin? (Choose all that apply.) A. The Recycle Bin is a physical storage area for dropped objects.
B. The Recycle Bin is a logical container for dropped objects.
C. The Recycle Bin stores the results of a Flashback Drop operation.
D. The objects in the Recycle Bin are stored in the tablespace in which they were created.
【题目示意】
此题考查有关于Recycle Bin的相关知识。
【解析】
Recycle Bin是一个真实的数据字典表,里面包含被drop的数据信息。删除的表没有被移出,仍然占着空间,删除的表被换一个名字,放在Recycle Bin中,当一张表被错误的删除,之后还是可以被恢复的,这种特性就是Flashback Drop。
【实验】
1)新创建一个表空间大小是‘20M’
SYS@ENMOEDU > create tablespace test3 datafile '/u01/app/oracle/oradata/ENMOEDU/test03.dbf' size 20m;
Tablespace created.
2)创建一个test1测试表,并查看它占空间的大小
SYS@ENMOEDU > create table test1 tablespace test3 as select * from dba_objects;
Table created.
SYS@ENMOEDU > select owner,segment_name,round(bytes/1024/1024,2)||' MB' m from dba_segments where tablespace_name='TEST3';
OWNER SEGMENT_NAME M
-----------------------------------------------------------------------------------
SYS TEST1 9 MB
3)再创建一个test2测试表
SYS@ENMOEDU > create table test2 tablespace test3 as select * from dba_objects;
Table created.
SYS@ENMOEDU > select owner,segment_name,round(bytes/1024/1024,2)||' MB' m from dba_segments where tablespace_name='TEST3';
OWNER SEGMENT_NAME M
-----------------------------------------------------------------------------------
SYS TEST1 9 MB
SYS TEST2 9 MB
4)此时两个测试表占表空间的大小是18M。现在把两个测试表删除
SYS@ENMOEDU > drop table test1;
Table dropped.
SYS@ENMOEDU > drop table test2;
Table dropped.
SYS@ENMOEDU > select owner,object_name,original_name from dba_recyclebin where ts_name='TEST3';
OWNER OBJECT_NAME ORIGINAL_NAME
-----------------------------------------------------------------------------------
SYS BIN$8WVlRItrFN3gQwpQqMAwyQ==$0 TEST2
SYS BIN$8WVlRItqFN3gQwpQqMAwyQ==$0 TEST1
SYS@ENMOEDU > select owner,segment_name,round(bytes/1024/1024,2)||' MB' m from dba_segments where tablespace_name='TEST3';
OWNER SEGMENT_NAME M
--------------------------------------------------------------------------------
SYS BIN$8WVlRItqFN3gQwpQqMAwyQ==$0 9 MB
SYS BIN$8WVlRItrFN3gQwpQqMAwyQ==$0 9 MB
可以看到,2张表到了回收站中,空间也没有释放。
此时20m的表空间还剩余2m可用,如果我再创建一张同样的表呢
5)再创建一张test3测试表
SYS@ENMOEDU > create table test3 tablespace test3 as select * from dba_objects;
Table created.
SYS@ENMOEDU > select owner,object_name,original_name from dba_recyclebin where ts_name='TEST3';
OWNER OBJECT_NAME ORIGINAL_NAME
-----------------------------------------------------------------------------------
SYS BIN$8WVlRItrFN3gQwpQqMAwyQ==$0 TEST2
我们可以得出这样的结论:当删除表的时候,若不指定purge,会将表放入到回收站中。在创建新的段时,若表空间中没有足够的剩余空间,Oracle会按dropscn顺序从回收站中删除一些对象。
【小结】
因此可以看出回收站是逻辑的存储删除的表。当表被删除的时候,表仍然存在创建表时的表空间中,直到创建新的段时,没有足够的空间时,才是从回收占里删除一些对象。因此选择BD
【答案】 BD
相关参考
http://docs.oracle.com/cd/E11882_01/server.112/e25494/tables.htm#ADMIN11679
http://docs.oracle.com/cd/E11882_01/backup.112/e10642/rcmbckad.htm#BRADV89579
The end
DB_SUN
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29435844/viewspace-1076836/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/29435844/viewspace-1076836/