步骤:(包括启动归档和关闭归档,操作都在一个节点进行):
SQL> archive log list Database log mode Archive Mode Automatic archival Enabled Archive destination USE_DB_RECOVERY_FILE_DEST Oldest online log sequence 338 Next log sequence to archive 339 Current log sequence 339 SQL> alter system set cluster_database=false scope=spfile; System altered. SQL> exit Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP, Data Mining and Real Application Testing options [oracle@rac121 ~]$ srvctl stop database -d racdb [oracle@rac121 ~]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.3.0 Production on 星期五 8月 31 15:37:30 2012 Copyright (c) 1982, 2011, Oracle. All rights reserved. Connected to an idle instance. SQL> startup mount ORACLE instance started. Total System Global Area 1.3462E+10 bytes Fixed Size 2241104 bytes Variable Size 7281315248 bytes Database Buffers 6174015488 bytes Redo Buffers 4485120 bytes Database mounted. SQL> alter database flashback on; Database altered. SQL> alter system set cluster_database=true scope=spfile; System altered. SQL> shutdown immediate ORA-01109: 数据库未打开 Database dismounted. ORACLE instance shut down. SQL> exit Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP, Data Mining and Real Application Testing options [oracle@rac121 ~]$ srvctl start database -d racdb [oracle@rac121 ~]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.3.0 Production on 星期五 8月 31 15:40:38 2012 Copyright (c) 1982, 2011, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP, Data Mining and Real Application Testing options SQL> select flashback_on from v$database; FLASHBACK_ON ------------------ YES --下面是关闭闪回恢复区操作: SQL> alter system set cluster_database=false scope=spfile; System altered. SQL> exit Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP, Data Mining and Real Application Testing options [oracle@rac121 ~]$ srvctl stop database -d racdb [oracle@rac121 ~]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.3.0 Production on 星期五 8月 31 15:42:24 2012 Copyright (c) 1982, 2011, Oracle. All rights reserved. Connected to an idle instance. SQL> startup mount ORACLE instance started. Total System Global Area 1.3462E+10 bytes Fixed Size 2241104 bytes Variable Size 7281315248 bytes Database Buffers 6174015488 bytes Redo Buffers 4485120 bytes Database mounted. SQL> alter database flashback off; Database altered. SQL> alter system set cluster_database=true scope=spfile; System altered. SQL> shutdown immediate ORA-01109: 数据库未打开 Database dismounted. ORACLE instance shut down. SQL> exit Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP, Data Mining and Real Application Testing options [oracle@rac121 ~]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.3.0 Production on 星期五 8月 31 15:43:58 2012 Copyright (c) 1982, 2011, Oracle. All rights reserved. Connected to an idle instance. SQL> exit Disconnected [oracle@rac121 ~]$ srvctl start database -d racdb [oracle@rac121 ~]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.3.0 Production on 星期五 8月 31 15:44:46 2012 Copyright (c) 1982, 2011, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP, Data Mining and Real Application Testing options SQL> select flashback_on from v$database; FLASHBACK_ON ------------------ NO SQL>
note:可以根据需要为具体表空间打开 或关闭闪回日志记录,如下所示:
SQL>alter tablespace data01 flashback on;
SQL>alter tablespace data01 flashback off;