利用recyclebin的保留策略恢复被删除的表

本文介绍了如何在Oracle数据库中利用Recyclebin的保留策略恢复被删除的表。首先创建了一个15M的测试表空间,接着删除了test1和test2表。删除后,尽管Recyclebin被清空,但被删除的表及其相关对象如索引、约束等并未立即释放空间,而是在Recyclebin中占用空间。当需要恢复时,可以通过特定操作从Recyclebin中恢复已被删除的表,或者在表空间满时由数据库自动清理。
摘要由CSDN通过智能技术生成
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 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值