Oracle10g RAC 归档模式修改过程
[backcolor=white]1. 在其中一个节点中检查是否处于归档模式
SQL> archive loglist;[backcolor=white]Database logmode No Archive Mode
Automaticarchival Disabled
Archivedestination /oracle/product/database/dbs/arch
Oldest online log sequence 3
Current logsequence 4[backcolor=white]–[backcolor=white]2. 查看并修改 cluster_database参数[backcolor=white]SQL> show parameter cluster_database;[backcolor=white]NAME TYPE VALUE
———————————— ———– ——————————
cluster_database boolean TRUE <——-此处修改为false
cluster_database_instances integer 2
2.1 执行如下命令使各节点的cluster_database参数为false[backcolor=white]SQL> alter system set cluster_database=falsescope=spfile sid=’*';
3. 在各节点中关闭实例
SQL> shutdownimmediate; <—- RAC1
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> shutdown immediate; <— RAC2
Database closed.
Database dismounted.
ORACLE instance shut down.[backcolor=white]4.将其中1个节点启动到 mount状态,以RAC1为例[backcolor=white]SQL> startup nomount;
ORACLE instance started.[backcolor=white]Total System Global Area 281018368 bytes
FixedSize 1267044 bytes
VariableSize 113248924 bytes
Database Buffers 163577856 bytes
RedoBuffers 2924544 bytes
SQL> alter database mount;[backcolor=white]Database altered.[backcolor=white]5. 修改归档模式并[backcolor=white]SQL> alter database archivelog;[backcolor=white]Database altered.
6. 将数据库置于open状态[backcolor=white]SQL> alter database open;[backcolor=white]Database altered.[backcolor=white]6.1 指定归档目标[backcolor=white]SQL> alter system setLOG_ARCHIVE_DEST_1=’LOCATION=/archive’;[backcolor=white]System altered.[backcolor=white]7. 查看cluster_database参数为false[backcolor=white]SQL> show parameter cluster_database;[backcolor=white]NAME TYPE VALUE
———————————— ———– ——————————
cluster_database boolean FALSE
cluster_database_instances integer 1
7.1 这时如果启动另一节点会报错
SQL> startup nomount; —> RAC2 节点置于nomount或startup会报错如:
ORA-29707:inconsistent value 2 for initialization parameter
cluster_database_instances with other instances[backcolor=white]8. 查看数据库已经为指定位置的归档模式[backcolor=white]SQL> archive log list;
Database logmode Archive Mode
Automaticarchival Enabled
Archivedestination /archive
Oldest online log sequence 3
Next log sequence to archive 4
Current logsequence 4
9. 到这里我们还需要将cluster_database参数为TRUE[backcolor=white]SQL> alter system set cluster_database=TRUEscope=spfile sid=’*';[backcolor=white]10. 创建pfile文件[backcolor=white]SQL> create pfile=’/oracle/pfilerac.ora’from spfile;[backcolor=white]File created.[backcolor=white]11. 启动各节点实例验证归档方式. [backcolor=white]注:如果想修改其它节点的归档位置还需要如下设置:[backcolor=white]SQL> archive log list;
Database logmode Archive Mode
Automatic archival Enabled
Archivedestination /oracle/product/database/dbs/arch
Oldest online log sequence 1
Next log sequence to archive 2
Current logsequence 2
SQL> alter system setLOG_ARCHIVE_DEST_1=’LOCATION=/archive’;[backcolor=white]System altered.[backcolor=white]SQL> archive log list;
Database logmode Archive Mode
Automaticarchival Enabled
Archivedestination /archive
Oldest online log sequence 1
Next log sequence to archive 2
Current log sequence 2
SQL> createpfile=’/oracle/pfilerac.ora’ from spfile;[backcolor=white]File created.
在10g R2 RAC中只需要下面的步骤就可以完成转换了:C:\>srvctlstatus database -d grid
实例 grid1 正在节点 winrac1 上运行
实例 grid2 正在节点 winrac2 上运行C:\>srvctl stopdatabase -d gridC:\>srvctlstatus database -d grid
实例 grid1 没有在 winrac1 节点上运行
实例 grid2 没有在 winrac2 节点上运行C:\>sqlplus"/ as sysdba"SQL*Plus: Release 10.2.0.3.0 - Production on 星期三 4月 4 10:29:53 2007Copyright (c) 1982,2006, Oracle. All Rights Reserved.已连接到空闲例程。SQL> startupmount
ORACLE 例程已经启动。Total System GlobalArea 255852544 bytes
FixedSize 1290012 bytes
VariableSize 125829348 bytes
Database Buffers 125829120 bytes
RedoBuffers 2904064 bytes
数据库装载完毕。
SQL> show parameter cluster_databaseNAME TYPE VALUE
----------------------- ----------- -----------cluster_database boolean TRUE
cluster_database_instances integer 2
SQL> archive log list;
数据库日志模式 非存档模式
自动存档 禁用
存档终点 C:\oracle\db10g\RDBMS
最早的联机日志序列 36
当前日志序列 38
SQL> alter system set log_archive_dest_1='location=O:\arch';系统已更改。SQL> alterdatabase archivelog;数据库已更改。SQL> alterdatabase open;数据库已更改。SQL> exit
从 Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options 断开C:\>srvctlstatus database -d grid
实例 grid1 正在节点 winrac1 上运行
实例 grid2 没有在 winrac2 节点上运行C:\>srvctl startdatabase -d gridC:\>srvctlstatus database -d grid
实例 grid1 正在节点 winrac1 上运行
实例 grid2 正在节点 winrac2 上运行C:\>sqlplus sys/sys@grid1 as sysdbaSQL*Plus: Release 10.2.0.3.0 - Production on 星期三 4月 4 10:32:17 2007Copyright (c) 1982,2006, Oracle. All Rights Reserved.
连接到:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining optionsSQL> archive loglist
数据库日志模式 存档模式
自动存档 启用
存档终点 O:\arch
最早的联机日志序列 36
下一个存档日志序列 38
当前日志序列 38
SQL> conn sys/sys@grid2 as sysdba
已连接。
SQL> archive log list
数据库日志模式 存档模式
自动存档 启用
存档终点 O:\arch
最早的联机日志序列 4
下一个存档日志序列 6
当前日志序列 6可以看到相比以前不用设置cluster_database=false,不用startup mount exclusive过程和单节点的noarchivelog到archivelog模式转换步骤一样。