oralce 10g rac 归档模式修改

这几天一直想修改rac归档模式,一直没有搞,今早起来参照以下文档,并增加自己的一些操作,更改成功,意在为以后出现此问题可以直接使用解决问题,其中红色字体为自己按本机操作的。

1. 在其中一个节点中检查是否处于归档模式
SQL> archive log list;

Database log mode              No Archive Mode
Automatic archival             Disabled
Archive destination            /oracle/product/database/dbs/arch
Oldest online log sequence     3
Current log sequence           4

2. 查看并修改 cluster_database参数

SQL> show parameter cluster_database;

NAME                                 TYPE        VALUE
———————————— ———– ——————————
cluster_database                     boolean     TRUE   <——-此处修改为false
cluster_database_instances           integer     2
2.1 执行如下命令使各节点的cluster_database参数为false

SQL> alter system set cluster_database=false scope=spfile sid=’*';

注明:*代表本机的sid
3. 在各节点中关闭实例
SQL> shutdown immediate;   <—- RAC1
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> shutdown immediate;   <— RAC2
Database closed.
Database dismounted.
ORACLE instance shut down.

 

4.将其中1个节点启动到 mount状态,以RAC1为例

SQL> startup nomount;
ORACLE instance started.

Total System Global Area  281018368 bytes
Fixed Size                  1267044 bytes
Variable Size             113248924 bytes
Database Buffers          163577856 bytes
Redo Buffers                2924544 bytes
SQL> 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     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

8. 查看数据库已经为指定位置的归档模式

SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /archive
Oldest online log sequence     3
Next log sequence to archive   4
Current log sequence           4
9. 到这里我们还需要将 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 Mode
Automatic archival             Enabled
Archive destination            /archive
Oldest online log sequence     1
Next log sequence to archive   2
Current log sequence           2
2
Current log sequence           2

注明:到这里归档模式己经改完了。下边为相应的操作如下:
SQL> create pfile=’/oracle/pfilerac.ora’ from spfile;

File created.

注明:备份spfile

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值