Oracle 11g RAC更改归档到ASM


本实验有两个节点 rac01test,rac02test
oracle_sid 分别是 xedb01,xedb02

1.在节点1 rac01test 上执行


[root@rac01test bin]# su - grid
[grid@rac01test ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Tue Oct 27 10:09:43 2015

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options


SQL> select name from v$asm_diskgroup;

NAME
------------------------------
OCR_VOTE
DATADG01
ARCH_DG


SQL> alter diskgroup ARCH_DG add directory '+ARCH_DG/ARC1';

Diskgroup altered.


2.在节点2 rac02test 上执行


[root@rac02test ~]# su - grid
[grid@rac02test ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Tue Oct 27 10:21:39 2015

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options

SQL> select name from v$asm_diskgroup;

NAME
------------------------------
OCR_VOTE
DATADG01
ARCH_DG

SQL>  alter diskgroup ARCH_DG add directory '+ARCH_DG/ARC2';

Diskgroup altered.


执行完成后,退出ASM实例


3.在rac01test上执行


[root@rac01test bin]# su - oracle
-bash: [/bin/bash: No such file or directory
[oracle@rac01test ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Tue Oct 27 10:23:31 2015

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options

SQL> select instance_name from v$instance;

INSTANCE_NAME
----------------
xedb1


SQL> archive log list;
Database log mode        No Archive Mode
Automatic archival        Disabled
Archive destination        /u01/app/oracle/product/11.2.0/db_1/dbs/arch
Oldest online log sequence     66
Current log sequence        67


SQL>  alter system set log_archive_dest_1='LOCATION=+ARCH_DG/ARC1' scope=spfile sid='xedb1';
System altered.

SQL>  alter system set log_archive_dest_1='LOCATION=+ARCH_DG/ARC1' scope=spfile sid='xedb2';
System altered.


4.关掉所有节点实例 xedb01,xedb01 数据库


节点 xedb01 上执行

SQL> shutdown immediate

节点 xedb02 上执行

SQL> shutdown immediate


5.更改归档模式


节点 xedb01 上执行

SQL> startup mount
SQL> alter database archivelog;  
Database altered.


节点tip02上执行

SQL> startup mount
SQL> alter database archivelog;  
Database altered.



6.重启数据库


节点xedb01,xedb02上分别执行

SQL> shutdown immediate;
SQL> startup

节点1
SQL> archive log list
Database log mode        Archive Mode
Automatic archival        Enabled
Archive destination        +ARCH_DG/arc1
Oldest online log sequence     68
Next log sequence to archive   69
Current log sequence        69

节点2
SQL> archive log list;
Database log mode        Archive Mode
Automatic archival        Enabled
Archive destination        +ARCH_DG/arc2
Oldest online log sequence     1
Next log sequence to archive   2
Current log sequence        2


7.验证归档文件


在两个节点上执行

SQL> alter system switch logfile;

System altered.


[root@rac01test bin]# su - grid
[grid@rac01test ~]$ asmcmd

ASMCMD> ls
ARCH_DG/
DATADG01/
OCR_VOTE/
ASMCMD> cd arch_dg
ASMCMD> ls
ARC1/
ARC2/
XEDB/
ASMCMD> cd arc1
1_69_894187568.dbf
ASMCMD> cd arc2
ASMCMD> ls
2_2_894187568.dbf


可以看到两个节点的归档都产生了!

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值