共计 5199 个字符,预计需要花费 13 分钟才能阅读完成。
根据客户要求,需要将归档日志存放在 ASM 上。因此需要在 ASM 建归档路径
ASMCMD> mkdir arch
ASMCMD> cd arch
ASMCMD> pwd
+data1/kdcs/arch
修改归档路径参数
SQL> alter system set log_archive_dest_1=’location=+data1/kdcs/arch’ scope=spfile sid=’*’;
System altered.
关闭数据库,全部节点都要关闭
[grid@linuxidc-db1 ~]$ srvctl stop database -d kdcs
检查数据库关闭后状态
[grid@linuxidc-db1 ~]$ crsctl stat res -t
——————————————————————————–
NAME TARGET STATE SERVER STATE_DETAILS
——————————————————————————–
Local Resources
——————————————————————————–
ora.DATA1.dg
ONLINE ONLINE linuxidc-db1
ONLINE ONLINE linuxidc-db2
ora.LISTENER.lsnr
ONLINE ONLINE linuxidc-db1
ONLINE ONLINE linuxidc-db2
ora.OCR_DISK.dg
ONLINE ONLINE linuxidc-db1
ONLINE ONLINE linuxidc-db2
ora.asm
ONLINE ONLINE linuxidc-db1 Started
ONLINE ONLINE linuxidc-db2 Started
ora.gsd
OFFLINE OFFLINE linuxidc-db1
OFFLINE OFFLINE linuxidc-db2
ora.net1.network
ONLINE ONLINE linuxidc-db1
ONLINE ONLINE linuxidc-db2
ora.ons
ONLINE ONLINE linuxidc-db1
ONLINE ONLINE linuxidc-db2
ora.registry.acfs
ONLINE ONLINE linuxidc-db1
ONLINE ONLINE linuxidc-db2
——————————————————————————–
Cluster Resources
——————————————————————————–
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE linuxidc-db1
ora.cvu
1 OFFLINE OFFLINE
ora.kdcs.db
1 OFFLINE OFFLINE Instance Shutdown
2 OFFLINE OFFLINE Instance Shutdown
ora.kdcs.ser_scanip.svc
1 OFFLINE OFFLINE
2 OFFLINE OFFLINE
ora.oc4j
1 ONLINE ONLINE linuxidc-db2
ora.scan1.vip
1 ONLINE ONLINE linuxidc-db1
ora.linuxidc-db1.vip
1 ONLINE ONLINE linuxidc-db1
ora.linuxidc-db2.vip
1 ONLINE ONLINE linuxidc-db2
将一个节点数据库启动到 mount 状态
[grid@linuxidc-db1 ~]$ srvctl start instance -d kdcs -i kdcs1 -o mount
修改数据库的归档模式并启动数据库
SQL> alter database archivelog;
Database altered.
SQL> alter database open;
Database altered.
检查状态
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination +DATA1/kdcs/arch
Oldest online log sequence 86
Next log sequence to archive 87
Current log sequence 87
SQL>
启动 2 节点数据库
[grid@linuxidc-db1 ~]$ srvctl start instance -d kdcs -i kdcs2
检查集群状态
[grid@linuxidc-db1 ~]$ crsctl stat res -t
——————————————————————————–
NAME TARGET STATE SERVER STATE_DETAILS
——————————————————————————–
Local Resources
——————————————————————————–
ora.DATA1.dg
ONLINE ONLINE linuxidc-db1
ONLINE ONLINE linuxidc-db2
ora.LISTENER.lsnr
ONLINE ONLINE linuxidc-db1
ONLINE ONLINE linuxidc-db2
ora.OCR_DISK.dg
ONLINE ONLINE linuxidc-db1
ONLINE ONLINE linuxidc-db2
ora.asm
ONLINE ONLINE linuxidc-db1 Started
ONLINE ONLINE linuxidc-db2 Started
ora.gsd
OFFLINE OFFLINE linuxidc-db1
OFFLINE OFFLINE linuxidc-db2
ora.net1.network
ONLINE ONLINE linuxidc-db1
ONLINE ONLINE linuxidc-db2
ora.ons
ONLINE ONLINE linuxidc-db1
ONLINE ONLINE linuxidc-db2
ora.registry.acfs
ONLINE ONLINE linuxidc-db1
ONLINE ONLINE linuxidc-db2
——————————————————————————–
Cluster Resources
——————————————————————————–
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE linuxidc-db1
ora.cvu
1 OFFLINE OFFLINE
ora.kdcs.db
1 ONLINE ONLINE linuxidc-db1 Open
2 ONLINE ONLINE linuxidc-db2 Open
ora.kdcs.ser_scanip.svc
1 ONLINE ONLINE linuxidc-db1
2 ONLINE ONLINE linuxidc-db2
ora.oc4j
1 ONLINE ONLINE linuxidc-db2
ora.scan1.vip
1 ONLINE ONLINE linuxidc-db1
ora.linuxidc-db1.vip
1 ONLINE ONLINE linuxidc-db1
ora.linuxidc-db2.vip
1 ONLINE ONLINE linuxidc-db2
[grid@linuxidc-db1 ~]$
更多 Oracle 相关信息见 Oracle 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=12
本文永久更新链接地址 :http://www.linuxidc.com/Linux/2016-10/135748.htm