Change the Archiving Mode in a RAC Environment
For Oracle 10g R2, you can run the ALTER DATABASE SQL statement
to change the archiving mode in Oracle RAC as long as the database is
mounted by the local instance but not open in any instances. You do not
need to modify parameter settings to run this statement.
Oracle 的生產庫都是啟動在歸檔模式下,RAC下歸檔非歸檔的切換和單例項也是一樣的,都是在MOUNT模式下執行ALTER DATABASE ARCHIVELOG/NOARCHIVELOG;命令。不同的是:RAC環境下所有例項都必須處於非OPEN狀態,然後在任意一個處於MOUNT狀態的例項執行ALTER DATABASE命令,操作成功後,再正常啟動其它例項即可。
一、切換歸檔
SQL> show parameter cluster
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
cluster_database boolean TRUE
cluster_database_instances integer 4
cluster_interconnects string
SQL>
###check out archive default dest "log_archive_dest_1"
SQL> show parameter log_archive_dest_1
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_1 string LOCATION=+BACKUP_DG/
### issue the following command on all of nodes if the destination is null
SQL> alter system set log_archive_dest_1='location=+BACKUP_DG/' sid='STW8AIA1';
System altered.
SQL> Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
wirac01 | STW8AIA1 | /export/home/oracle > srvctl stop database -d STW8AIA
wirac01 | STW8AIA1 | /export/home/oracle >
###注意事項: 所有節點都必須處於mount狀態。在其中一個節點修改模式,然後在其他節點正常啟動即可。
wirac01 | STW8AIA1 | /export/home/oracle > srvctl start database -d STW8AIA -o mount
wirac01 | STW8AIA1 | /export/home/oracle > dba
SQL*Plus: Release 10.2.0.5.0 - Production on Wed Oct 5 07:03:40 2011
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL> alter database archivelog;
Database altered.
SQL> alter database open;
Database altered.
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination +BACKUP_DG
Oldest online log sequence 33
Next log sequence to archive 34
Current log sequence 34
####最後一步需要 alter database open其他節點DB; 或srvctl stop database 再start 亦可。
Note: You can also change the archive log mode by using the Recovery Settings page in the Maintenance tab of the Enterprise Manager Oracle RAC Database Home Page.
二、切換成非歸檔
在一個節點上執行:
SQL>ALTER SYSTEM SET CLUSTER_DATABASE=FALSE SCOPE=SPFILE;
wirac01 | STW8AIA1 | /export/home/oracle > srvctl stop database -d STW8AIA
SQL>startup mount;
SQL>alter database noarchivelog;
SQL>ALTER SYSTEM SET CLUSTER_DATABASE=TRUE SCOPE=SPFILE;
SQL>shutdown immediate;
wirac01 | STW8AIA1 | /export/home/oracle > srvctl start database -d STW8AIA
三、10g R2之前版本的模式切換
RAC資料庫從noarchivelog模式轉換到archivelog模式,步驟:
在一個節點上執行:
####first, set cluster_database=false and log_archive_start=true; set log_archive_* appropriately
SQL> alter system set cluster_database=false scope=spfile sid='STW8AIA1';
SQL> alter system set log_archive_start=true scope=spfile sid='STW8AIA1';
wirac01 | STW8AIA1 | /export/home/oracle > srvctl stop database -d STW8AIA
SQL> startup mount exclusive;
SQL> alter database archivelog;
SQL> alter system set cluster_database=true scope=spfile sid='STW8AIA1';
SQL>shutdown immediate;
wirac01 | STW8AIA1 | /export/home/oracle > srvctl start database -d STW8AIA
Oracle 的生產庫都是啟動在歸檔模式下,RAC下歸檔非歸檔的切換和單例項也是一樣的,都是在MOUNT模式下執行ALTER DATABASE ARCHIVELOG/NOARCHIVELOG;命令。不同的是:RAC環境下所有例項都必須處於非OPEN狀態,然後在任意一個處於MOUNT狀態的例項執行ALTER DATABASE命令,操作成功後,再正常啟動其它例項即可。
一、切換歸檔
SQL> show parameter cluster
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
cluster_database boolean TRUE
cluster_database_instances integer 4
cluster_interconnects string
SQL>
###check out archive default dest "log_archive_dest_1"
SQL> show parameter log_archive_dest_1
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_1 string LOCATION=+BACKUP_DG/
### issue the following command on all of nodes if the destination is null
SQL> alter system set log_archive_dest_1='location=+BACKUP_DG/' sid='STW8AIA1';
System altered.
SQL> Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
wirac01 | STW8AIA1 | /export/home/oracle > srvctl stop database -d STW8AIA
wirac01 | STW8AIA1 | /export/home/oracle >
###注意事項: 所有節點都必須處於mount狀態。在其中一個節點修改模式,然後在其他節點正常啟動即可。
wirac01 | STW8AIA1 | /export/home/oracle > srvctl start database -d STW8AIA -o mount
wirac01 | STW8AIA1 | /export/home/oracle > dba
SQL*Plus: Release 10.2.0.5.0 - Production on Wed Oct 5 07:03:40 2011
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL> alter database archivelog;
Database altered.
SQL> alter database open;
Database altered.
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination +BACKUP_DG
Oldest online log sequence 33
Next log sequence to archive 34
Current log sequence 34
####最後一步需要 alter database open其他節點DB; 或srvctl stop database 再start 亦可。
Note: You can also change the archive log mode by using the Recovery Settings page in the Maintenance tab of the Enterprise Manager Oracle RAC Database Home Page.
二、切換成非歸檔
在一個節點上執行:
SQL>ALTER SYSTEM SET CLUSTER_DATABASE=FALSE SCOPE=SPFILE;
wirac01 | STW8AIA1 | /export/home/oracle > srvctl stop database -d STW8AIA
SQL>startup mount;
SQL>alter database noarchivelog;
SQL>ALTER SYSTEM SET CLUSTER_DATABASE=TRUE SCOPE=SPFILE;
SQL>shutdown immediate;
wirac01 | STW8AIA1 | /export/home/oracle > srvctl start database -d STW8AIA
三、10g R2之前版本的模式切換
RAC資料庫從noarchivelog模式轉換到archivelog模式,步驟:
在一個節點上執行:
####first, set cluster_database=false and log_archive_start=true; set log_archive_* appropriately
SQL> alter system set cluster_database=false scope=spfile sid='STW8AIA1';
SQL> alter system set log_archive_start=true scope=spfile sid='STW8AIA1';
wirac01 | STW8AIA1 | /export/home/oracle > srvctl stop database -d STW8AIA
SQL> startup mount exclusive;
SQL> alter database archivelog;
SQL> alter system set cluster_database=true scope=spfile sid='STW8AIA1';
SQL>shutdown immediate;
wirac01 | STW8AIA1 | /export/home/oracle > srvctl start database -d STW8AIA
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/628922/viewspace-708688/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- chmod命令(change mode)
- Oracle RAC active-passive modeOracle
- Top 5 Database and/or Instance Performance Issues in RAC EnvironmentDatabaseORM
- Oracle 12c Rac Set Archive ModeOracleHive
- Database and/or Instance Performance Issues in RAC Environment_1373500.1DatabaseORM
- Oracle 12c 2 Nodes sandbox RAC environment on your laptop!OracleAPT
- 'enq: TX - index contention' Waits in a RAC Environment. [ID 873243.1]ENQIndexAI
- Top 11 Things to do NOW to Stabilize your RAC Cluster Environment_1344678.1
- Using Oracle Database 11g Release 2 Result Cache in an Oracle RAC EnvironmentOracleDatabase
- RAC生產庫出現嚴重row cache lock和log file switch(archiving need)
- How to change Public VIP Address in 11gR2 RAC
- 轉載一個step by step change public-ip and vip on RAC
- (EXPDP) Fails With Errors ORA-39079 ORA-25306 On One Node In RAC EnvironmentAIError
- Oracle environment variableOracle
- Get Oracle Environment InformaticaOracleORM
- Microsoft IT Environment Health ScannerROS
- The DB2 environmentDB2
- MyBatis-03-environmentMyBatis
- sqlserver Change Data Capture&Change TrackingSQLServerAPT
- RAC 11.2.0.3 ORA-01102: cannot mount database in EXCLUSIVE mode”Database
- Archiving not possible: No primary destinations errorsError
- How to Turn Archiving ON and OFF in Oracle RDBMS [ID 69739.1]Oracle
- Spring系列.Environment介面Spring
- Setup python virtual environmentPython
- Quickly setup a stream environment.UI
- set up the appropriate environmentAPP
- oracle 11.2.0.1 rac 修改asm磁碟組的冗餘模式(redundancy mode)為normalOracleASM模式ORM
- ORA-31626 ORA-31650 While Using DataPump Export in RAC Environment [ID 454639.1]WhileExport
- Window mode
- JavaScript change 事件JavaScript事件
- js change 事件JS事件
- jQuery change事件jQuery事件
- Change domain timeAI
- Who is the Last Change?AST
- Oracle 11g RAC ORA-01102: cannot mount database in EXCLUSIVE modeOracleDatabase
- Qt QML之 JavaScript Host EnvironmentQTJavaScript
- 配好 Europa C++ EnvironmentC++
- consistent mode和current mode的區別