Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1008536
  • 博文数量: 116
  • 博客积分: 3758
  • 博客等级: 中校
  • 技术积分: 1316
  • 用 户 组: 普通用户
  • 注册时间: 2008-07-17 11:49
个人简介

这家伙很懒。。。

文章分类

全部博文(116)

文章存档

2016年(3)

2015年(2)

2014年(1)

2013年(9)

2012年(25)

2011年(50)

2010年(12)

2009年(14)

分类: Oracle

2011-05-03 16:27:27

1.开启10g的数据库闪回特征

a.确定当前的模式:
  1. SQL> select flashback_on from v$database;
FLASHBACK_ON
------------------
NO

  1. SQL> show parameter db_recovery
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest                string      /oracle/product/10.2.0/db_1/fl
                                                 ash_recovery_area
db_recovery_file_dest_size           big integer 2G

  1. SQL> show parameter db_flashback_retention_target;
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_flashback_retention_target        integer     1440

b.启用flash database选项:
  1. SQL> shutdown immediate;
      
Database closed.
Database dismounted.
ORACLE instance shut down.
  1. SQL> startup mount
ORACLE instance started.
Total System Global Area  167772160 bytes
Fixed Size                  1279120 bytes
Variable Size             104860528 bytes
Database Buffers           58720256 bytes
Redo Buffers                2912256 bytes
Database mounted.
  1. SQL> alter database flashback on;
alter database flashback on
*
ERROR at line 1:
ORA-38706: Cannot turn on FLASHBACK DATABASE logging.
ORA-38707: Media recovery is not enabled.
 
--可以看到,flashback还必须要归档的保证

  1. SQL> archive log list;
Database log mode              No Archive Mode
Automatic archival             Disabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     17
Current log sequence           19
 
  1. SQL> alter database archivelog;
Database altered.  
  
  1. SQL> alter database flashback on;
Database altered.
  1. SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     17
Next log sequence to archive   19
Current log sequence           19
 
  1. SQL> alter database open;
Database altered.


阅读(810) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~