ITPub博客

首页 > 数据库 > Oracle > Oracle闪回技术

Oracle闪回技术

原创 Oracle 作者:StevenBeijing 时间:2015-11-17 14:48:14 0 删除 编辑
1.查看闪回区位置
SQL> show parameter db_recoverNAME     TYPE VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest     string /u01/app/oracle/flash_recovery
_area
db_recovery_file_dest_size     big integer 2G

2.修改闪回区大小
SQL> alter system set db_recovery_file_dest_size=3G;
System altered.

SQL> show parameter db_recover
NAME     TYPE VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest     string /u01/app/oracle/flash_recovery
_area
db_recovery_file_dest_size     big integer 3G

3.查看并修改db_flashback_retention_target参数
SQL> show parameter db_flash
NAME     TYPE VALUE
------------------------------------ ----------- ------------------------------
db_flashback_retention_target     integer 1440

SQL> alter system set db_flashback_retention_target=2880 scope=both;
System altered.

4.开启闪回区(必须在mount状态)
SQL> alter database flashback on;
Database altered.

SQL> alter database open;
Database altered.

5.关闭或打开对某个表空间的闪回
SQL> alter tablespace users flashback off;
Tablespace altered.

SQL> alter tablespace users flashback on;
alter tablespace users flashback on
*
ERROR at line 1:
ORA-01126: database must be mounted in this instance and not open in any
instance

将数据库启动到mount状态后,重亲对users表空间开启闪回
SQL> alter tablespace users flashback on;
Tablespace altered.

SQL> alter database open;
Database altered.

6.闪回数据库到某个时间点(必须在mount状态)
11:48:22 SQL> flashback database to timestamp to_date('2015-11-17 11:31:40','yyyy-mm-dd hh24:mi:ss');
Flashback complete.

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

请登录后发表评论 登录
全部评论

注册时间:2015-02-10

  • 博文量
    197
  • 访问量
    189215