这几天一直想修改rac归档模式,一直没有搞,今早起来参照以下文档,并增加自己的一些操作,更改成功,意在为以后出现此问题可以直接使用解决问题,其中红色字体为自己按本机操作的。
1. 在其中一个节点中检查是否处于归档模式SQL> archive log list;
Database log mode No Archive ModeAutomatic archival DisabledArchive destination /oracle/product/database/dbs/archOldest online log sequence 3Current log sequence 4
2. 查看并修改 cluster_database参数
SQL> show parameter cluster_database;
NAME TYPE VALUE———————————— ———– ——————————cluster_database boolean TRUE <——-此处修改为falsecluster_database_instances integer 22.1 执行如下命令使各节点的cluster_database参数为false
SQL> alter system set cluster_database=false scope=spfile sid=’*';
注明:*代表本机的sid3. 在各节点中关闭实例SQL> shutdown immediate; <—- RAC1Database closed.Database dismounted.ORACLE instance shut down.SQL> shutdown immediate; <— RAC2Database closed.Database dismounted.ORACLE instance shut down.
4.将其中1个节点启动到 mount状态,以RAC1为例
SQL> startup nomount;ORACLE instance started.
Total System Global Area 281018368 bytesFixed Size 1267044 bytesVariable Size 113248924 bytesDatabase Buffers 163577856 bytesRedo Buffers 2924544 bytesSQL> alter database mount;
Database altered.
5. 修改归档模式并
SQL> alter database archivelog;--->这个命令我经常忘
Database altered.6. 将数据库置于open状态
SQL> alter database open;
Database altered.
6.1 指定归档目标
SQL> alter system set LOG_ARCHIVE_DEST_1=’LOCATION=/archive’;
System altered.
注明:如果上面指定的目录一下需要用root用户创建,并用chown -R oracle:dba /archive ,我分别在两个结点上创建这个目录,
当指定后,然后切换日志就可以到看在该目录生成相应的文件。(alter system switch logfile;)
7. 查看cluster_database参数为false
SQL> show parameter cluster_database;
NAME TYPE VALUE———————————— ———– ——————————cluster_database boolean FALSEcluster_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
8. 查看数据库已经为指定位置的归档模式
SQL> archive log list;Database log mode Archive ModeAutomatic archival EnabledArchive destination /archiveOldest online log sequence 3Next log sequence to archive 4Current log sequence 49. 到这里我们还需要将 cluster_database参数为TRUE
SQL> alter system set cluster_database=TRUE scope=spfile sid=’*';
10. 创建pfile文件
SQL> create pfile=’/oracle/pfilerac.ora’ from spfile;
File created.
11.启动结点2并修改
alter system set cluster_database=TRUE scope=spfile sid=’*';
12.关闭结点2
shutdown immediate;
13.启动结点1并用pfile启动
startup pfile=’/oracle/pfilerac.ora’;
14.在结点1重新生成spfile
create spfile from pfile;
15.关闭结点1
shutdown immediate;
12. 启动各节点实例验证归档方式. (以spfile方式启动)
注:如果想修改其它节点的归档位置还需要如下设置:
SQL> archive log list;Database log mode Archive ModeAutomatic archival EnabledArchive destination /archiveOldest online log sequence 1Next log sequence to archive 2Current log sequence 22Current log sequence 2
注明:到这里归档模式己经改完了。下边为相应的操作如下:SQL> create pfile=’/oracle/pfilerac.ora’ from spfile;
File created.
注明:备份spfile