加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

使用 Flashback 恢复删除的 tablespace --实验

发布时间:2020-12-15 07:02:22 所属栏目:百科 来源:网络整理
导读:sys@LS1shutdown immediate Database closed. Database dismounted. ORACLE instance shut down. sys@LS1startup mount; ORACLE instance started. Total System Global Area? 855982080 bytes Fixed Size????????????????? 2218152 bytes Variable Size????
sys@LS1>shutdown immediate
Database closed.
Database dismounted.

ORACLE instance shut down.

sys@LS1>startup mount;
ORACLE instance started.

Total System Global Area? 855982080 bytes
Fixed Size????????????????? 2218152 bytes
Variable Size???????????? 633341784 bytes
Database Buffers????????? 213909504 bytes
Redo Buffers??????????????? 6512640 bytes

Database mounted.

sys@LS1>alter database archivelog;

Database altered.

sys@LS1>alter database flashback on;

Database altered.

sys@LS1>alter database open;

Database altered.

sys@LS1>create tablespace tb1 datafile '/u01/oradata/ls1/tb1.dbf' size 1m;

Tablespace created.

sys@LS1>create user tb1 identified by tb1;

User created.

sys@LS1>grant dba to tb1;

Grant succeeded.


sys@LS1>alter user tb1 default tablespace tb1;

User altered.


sys@LS1>create table tb (id? number);

Table created.


sys@LS1>select current_scn from v$database;

CURRENT_SCN
-----------
??? 5060095


sys@LS1>drop tablespace tb1 including contents and datafiles;

Tablespace dropped.



sys@LS1>shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
sys@LS1>startup mount
ORACLE instance started.

Total System Global Area? 855982080 bytes
Fixed Size????????????????? 2218152 bytes
Variable Size???????????? 633341784 bytes
Database Buffers????????? 213909504 bytes
Redo Buffers??????????????? 6512640 bytes
Database mounted.

sys@LS1>flashback database to scn 5060095;

Flashback complete


sys@LS1>select name from v$datafile;

NAME
----------------------------------------------------------------------------------------------------
/u01/oracle/dbs/UNNAMED00009

sys@LS1>alter database open resetlogs;

Database altered.

sys@LS1>select name from v$datafile;

NAME
----------------------------------------------------------------------------------------------------
/u01/oracle/dbs/UNNAMED00009


sys@LS1>flashback database to scn 5060095; Flashback complete. sys@LS1> alter database open resetlogs; Database altered. sys@LS1>select * from tb; no rows selected sys@LS1>select name from v$datafile; NAME ---------------------------------------------------------------------------------------------------- /u01/oradata/ls1/tb1.dbf sys@LS1>select name from v$tablespace; NAME ------------------------------ TB1

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读