11g RAC 更改归档模式 ,归档文件存放在ASM 磁盘组

11g RAC  更改归档模式   ASM

本实验有两个节点tip01,tip02
oracle_sid 分别是 tips1,tips2

1.在节点1 tip01上执行
[root@tip01 ~]# su - grid
[grid@tip01 ~]$ sqlplus  / as  sysasm

SQL> select name from v$asm_diskgroup;

NAME
------------------------------
DATA
OCR


SQL> alter diskgroup data add directory '+DATA/ARC1';

Diskgroup altered.


2.在节点1 tip02上执行
[root@tip01 ~]# su - grid
[grid@tip01 ~]$ sqlplus  / as  sysasm

SQL> select name from v$asm_diskgroup;

NAME
------------------------------
DATA
OCR


SQL> alter diskgroup data add directory '+DATA/ARC2';

Diskgroup altered.


执行完成后,退出ASM实例


3.在tip01上执行
[grid@tip01 ~]$ su - oracle
[oracle@tip01 ~]$ sqlplus  / as sysdba

SQL> SELECT INSTANCE_NAME FROM V$INSTANCE;

INSTANCE_NAME
----------------
tips1

SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_1='LOCATION=+DATA/ARC1' SCOPE=SPFILE SID='tips1';

System altered.

SQL>  ALTER SYSTEM SET LOG_ARCHIVE_DEST_1='LOCATION=+DATA/ARC2' SCOPE=SPFILE SID='tips2';

System altered.


4.关掉所有节点实例tips1,tips2服务

节点tip01上执行

SQL> SHUTDOWN IMMEDIATE

节点tip02上执行

SQL> SHUTDOWN IMMEDIATE


5.更改归档模式

节点tip01上执行

SQL> STARTUP MOUNT
SQL>ALTER DATABASE ARCHIVELOG;
Database altered.

SQL> archive log list
archive log list
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            +DATA/arc1
Oldest online log sequence     255
Next log sequence to archive   256
Current log sequence           256

节点tip01已经更改成功

节点tip02上执行

SQL> STARTUP MOUNT
SQL>ALTER DATABASE ARCHIVELOG;
Database altered.

SQL> archive log list
archive log list
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            +DATA/arc2
Oldest online log sequence     255
Next log sequence to archive   256
Current log sequence           256


6.打开数据库

节点tip01,tip02上分别执行 
SQL> alter database open


7.验证归档文件

节点tip01上执行

SQL> alter system switch logfile;

System altered.


[oracle@tip01 ~]$ su - grid
[grid@tip01 ~]$ asmcmd
ASMCMD> ls
DATA/
OCR/
ASMCMD> cd DATA
ASMCMD> cd arc1
ASMCMD> ls
1_256_784611206.dbf



节点tip01 已经有归档文件产生了

你可能感兴趣的:(Oracle,RAC)