oracle 10g有了一个recyclebin的保留策略,我们现在看看这个策略是怎么工作的。
创建一个15M的测试表空间
SQL> create tablespace tsp_test datafile '/u01/app/oracle/oradata/orcl/tsp_test01.dbf' size 15M;
Tablespace created.
在这个表空间中创建一个用户,默认表空间为本表空间
SQL> create user test identified by "test" default tablespace tsp_test;
User created.
给用户赋予DBA权限
SQL> grant dba to test;
Grant succeeded.
以新建的用户登录,创建一个表
[oracle@RedHat ~]$ sqlplus test/test
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Aug 23 15:25:09 2013
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> create table test1 as select * from dba_objects;
Table created.
这时候查看表空间的情况
SQL> select owner,segment_name,round(bytes/1024/1024,2)||' MB' m from dba_segments where tablespace_name='TSP_TEST';
OWNER
------------------------------
SEGMENT_NAME
--------------------------------------------------------------------------------
M
-------------------------------------------
TEST
TEST1
6 MB
再创建一个表
SQL> create table test2