本文适用于非归档模式开启归档和归档模式修改归档路径操作情景。
目的:
把归档模式打开并且将日志放在共享存储(ASM)上。
环境信息:
主机名:eric1,eric2
实例名:guitar1,guitar2
操作步骤:
1.配置归档目录
在eric1上执行
[root@eric1 ~]#
su - grid
[grid@eric1 ~]$
sqlplus / as sysasm
SQL>
select name from v$asm_diskgroup;
NAME
------------------------------
DATA
OCR
FRA
SQL>
alter system set log_archive_dest_1='LOCATION=+FRA/GUITAR/ARC1' scope=spfile sid='guitar1';
Diskgroup altered.
SQL>
alter system set log_archive_dest_1='LOCATION=+FRA/GUITAR/ARC2' scope=spfile sid='guitar2';
Diskgroup altered.
2.关闭2个实例
节点eric1上执行
SQL>
SHUTDOWN IMMEDIATE
节点eric2上执行
SQL>
SHUTDOWN IMMEDIATE
3.开启归档模式
节点eric1上执行
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
+FRA/GUITAR/ARC1
Oldest online log sequence 7
Next log sequence to archive 8
Current log sequence 8
节点eric1已经更改成功 ~
节点eric2上执行
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
+FRA/GUITAR/ARC2
Oldest online log sequence 7
Next log sequence to archive 8
Current log sequence 8
4.打开数据库
节点eric1,eric2上分别执行
SQL>
alter database open
5.验证归档文件成功生成在目标位置
节点eric1上执行
SQL>
alter system switch logfile;
System altered.
[oracle@eric1 ~]$
su - grid
[grid@eric ~]$
asmcmd
ASMCMD>
ls
DATA/
OCR/
FRA/
ASMCMD>
cd
ASMCMD>
cd FRA
ASMCMD>
ls
1_1_784610026.dbf
节点eric1已经有归档文件在目标位置产生了,按照此方法在节点eric2上执行alter system switch logfile并且多切换几次确定每次切换都有相对应的归档日志生成,同样OK。
归档开启成功!~~~
阅读(2133) | 评论(0) | 转发(0) |