闪回数据库操作流程

SQL> show parameter db_recovery_file_dest_size;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest_size           big integer 2600M
SQL> show parameter db_recovery_file_dest

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest                string      /u01/app/oracle/flash_recovery
                                                 _area
db_recovery_file_dest_size           big integer 2600M
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.

Total System Global Area  313860096 bytes
Fixed Size                  1336232 bytes
Variable Size             239078488 bytes
Database Buffers           67108864 bytes
Redo Buffers                6336512 bytes
Database mounted.
SQL> alter database archivelog;

Database altered.

SQL> alter database flashback on;

Database altered.

SQL> select name , log_mode,flashback_on from v$database;

NAME      LOG_MODE     FLASHBACK_ON
--------- ------------ ------------------
ORCL      ARCHIVELOG   YES

SQL> alter database open;

Database altered.

SQL> alter session set nls_date_formate='yyyy-mm-dd hh24:mi:ss';
alter session set nls_date_formate='yyyy-mm-dd hh24:mi:ss'
*
ERROR at line 1:
ORA-00922: missing or invalid option


SQL> alter session set nls_date_format='yyyy-mm-dd hh24:mi:ss';

Session altered.

SQL> select sysdate ,current_scn from v$database;

SYSDATE             CURRENT_SCN
------------------- -----------
2013-03-31 15:25:48     1054061

SQL> drop user scott cascade;

User dropped.

SQL> select sysdate , current_scn from $vdatabase;
select sysdate , current_scn from $vdatabase
                                  *
ERROR at line 1:
ORA-00911: invalid character


SQL> select sysdate , current_scn from v$database;

SYSDATE             CURRENT_SCN
------------------- -----------
2013-03-31 15:26:45     1054249

SQL> select * from v$flashback_database_log;

OLDEST_FLASHBACK_SCN OLDEST_FLASHBACK_TI RETENTION_TARGET FLASHBACK_SIZE ESTIMATED_FLASHBACK_SIZE
-------------------- ------------------- ---------------- -------------- ------------------------
             1053838 2013-03-31 15:22:25             1440        8192000       0

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.

Total System Global Area  313860096 bytes
Fixed Size                  1336232 bytes
Variable Size             239078488 bytes
Database Buffers           67108864 bytes
Redo Buffers                6336512 bytes
Database mounted.
SQL> flashback database to timestape to_date('2013-03-31 15:26:45','yyyy-mm-dd hh24:mi:ss');
flashback database to timestape to_date('2013-03-31 15:26:45','yyyy-mm-dd hh24:mi:ss')
                      *
ERROR at line 1:
ORA-38724: Invalid option to the FLASHBACK DATABASE command.


SQL> flashback database to timestamp to_date('2013-03-31 15:26:45','yyyy-mm-dd hh24:mi:ss');

Flashback complete.

SQL> alter database open read only;

Database altered.

SQL> select * from scott.test_query;
select * from scott.test_query
                    *
ERROR at line 1:
ORA-00942: table or view does not exist


SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.

Total System Global Area  313860096 bytes
Fixed Size                  1336232 bytes
Variable Size             239078488 bytes
Database Buffers           67108864 bytes
Redo Buffers                6336512 bytes
Database mounted.
SQL>  flashback database to timestamp to_date('2013-03-31 15:23:45','yyyy-mm-dd hh24:mi:ss');

Flashback complete.

SQL> alter database open read only;

Database altered.

SQL> select * from scott.test_query;

        ID NAME           SALARY
---------- ---------- ----------
         4 Chris            4400
         3 Lisa             7700
         2 William          6600
         1 John             5500

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.

Total System Global Area  313860096 bytes
Fixed Size                  1336232 bytes
Variable Size             239078488 bytes
Database Buffers           67108864 bytes
Redo Buffers                6336512 bytes
Database mounted.
SQL> alter database open resetlogs;

Database altered.

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/15874751/viewspace-757505/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/15874751/viewspace-757505/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值