RAC下修改归档方法
一、11GR2 RAC可用方法
1、所有的操作在trsen1上
–trsen1节点
[oracle@trsen1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Tue Mar 24 16:32:45 2015
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 – Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SQL> show parameter cluster_d
NAME TYPE VALUE
———————————— ———– ——————————
cluster_database boolean TRUE
cluster_database_instances integer 2
SQL> archive log list;
Database log mode Archive Mode======>当前为归档模式
Automatic archival Enabled
Archive destination +DATA_DG
Oldest online log sequence 12
Next log sequence to archive 13
Current log sequence 13
SQL> ho srvctl stop database -d trsen
SQL> ho srvctl status database -d trsen
Instance trsen1 is not running on node trsen1
Instance trsen2 is not running on node trsen2
SQL> startup mount exclusive;
ORA-03135: connection lost contact
SQL> exit
SQL> startup mount exclusive;
ORACLE instance started.
Total System Global Area 1255473152 bytes
Fixed Size 1344652 bytes
Variable Size 805309300 bytes
Database Buffers 436207616 bytes
Redo Buffers 12611584 bytes
Database mounted.
SQL> ho srvctl status database -d trsen
Instance trsen1 is running on node trsen1
Instance trsen2 is not running on node trsen2
SQL> alter database noarchivelog;==============>切换归档命令
Database altered.
SQL> shutdown immediate;
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> ho srvctl start database -d trsen
SQL> ho srvctl status database -d trsen
Instance trsen1 is running on node trsen1
Instance trsen2 is running on node trsen2
SQL> exit
SQL> archive log list;
Database log mode No Archive Mode========>切成非归档模式
Automatic archival Disabled
Archive destination +DATA_DG
Oldest online log sequence 15
Current log sequence 16
SQL> show parameter cluster_d
NAME TYPE VALUE
———————————— ———– ——————————
cluster_database boolean TRUE
cluster_database_instances integer 2
–查看trsen2节点的归档模式
SQL> archive log list;
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination +DATA_DG
Oldest online log sequence 7
Current log sequence 8
2、其日志记录
–trsen1节点
Post SMON to start 1st pass IR
Fix write in gcs resources
Reconfiguration complete
freeing rdom 0
Tue Mar 24 16:44:03 2015
Instance shutdown complete
Tue Mar 24 16:45:06 2015
Starting ORACLE instance (normal)
LICENSE_MAX_SESSION = 0
LICENSE_SESSIONS_WARNING = 0
Tue Mar 24 16:45:25 2015
Private Interface ‘eth1:1′ configured from GPnP for use as a private interconnect.
[name=’eth1:1’, type=1, ip=169.254.229.155, mac=08-00-27-6c-c3-df, net=169.254.0.0/16, mask=255.255.0.0, use=haip:cluster_interconnect/62]
Public Interface ‘eth0′ configured from GPnP for use as a public interface.
[name=’eth0’, type=1, ip=192.168.21.145, mac=08-00-27-13-20-5e, net=192.168.21.0/24, mask=255.255.255.0, use=public/1]
Public Interface ‘eth0:1′ configured from GPnP for use as a public interface.
[name=’eth0:1’, type=1, ip=192.168.21.149, mac=08-00-27-13-20-5e, net=192.168.21.0/24, mask=255.255.255.0, use=public/1]
Public Interface ‘eth0:3′ configured from GPnP for use as a public interface.
[name=’eth0:3’, type=1, ip=192.168.21.147, mac=08-00-27-13-20-5e, net=192.168.21.0/24, mask=255.255.255.0, use=public/1]
Picked latch-free SCN scheme 2
………..
………….
NOTE: dependency between database trsen and diskgroup resource ora.DATA_DG.dg is established
Tue Mar 24 16:46:52 2015
ALTER DATABASE MOUNT
This instance was first to mount
Tue Mar 24 16:47:06 2015
Successful mount of redo thread 1, with mount id 3708545148
Tue Mar 24 16:47:07 2015
Database mounted in Shared Mode (CLUSTER_DATABASE=TRUE)
Lost write protection disabled
Completed: ALTER DATABASE MOUNT
Tue Mar 24 16:50:42 2015
alter database noarchivelog
Completed: alter database noarchivelog
Tue Mar 24 16:51:49 2015
NOTE: Shutting down MARK background process
Tue Mar 24 16:51:56 2015
freeing rdom 0
Tue Mar 24 16:52:03 2015
Instance shutdown complete
Tue Mar 24 16:52:03 2015
Instance shutdown complete
Tue Mar 24 16:52:58 2015
Starting ORACLE instance (normal)
Tue Mar 24 16:53:17 2015
LICENSE_MAX_SESSION = 0
LICENSE_SESSIONS_WARNING = 0
Private Interface ‘eth1:1′ configured from GPnP for use as a private interconnect.
[name=’eth1:1’, type=1, ip=169.254.229.155, mac=08-00-27-6c-c3-df, net=169.254.0.0/16, mask=255.255.0.0, use=haip:cluster_interconnect/62]
Public Interface ‘eth0′ configured from GPnP for use as a public interface.
[name=’eth0’, type=1, ip=192.168.21.145, mac=08-00-27-13-20-5e, net=192.168.21.0/24, mask=255.255.255.0, use=public/1]
Public Interface ‘eth0:1′ configured from GPnP for use as a public interface.
[name=’eth0:1’, type=1, ip=192.168.21.149, mac=08-00-27-13-20-5e, net=192.168.21.0/24, mask=255.255.255.0, use=public/1]
Public Interface ‘eth0:3′ configured from GPnP for use as a public interface.
[name=’eth0:3’, type=1, ip=192.168.21.147, mac=08-00-27-13-20-5e, net=192.168.21.0/24, mask=255.255.255.0, use=public/1]
Picked latch-free SCN scheme 2
Autotune of undo retention is turned
……………………
Completed: ALTER DATABASE OPEN /* db agent *//* {1:22172:290} */
Tue Mar 24 16:55:41 2015
Starting background process CJQ0
Tue Mar 24 16:55:43 2015
CJQ0 started with pid=47, OS id=6913
–trsen2节点
Tue Mar 24 16:43:54 2015
NOTE: Shutting down MARK background process
Tue Mar 24 16:43:54 2015
NOTE: force a map free for map id 27
Tue Mar 24 16:43:57 2015
freeing rdom 0
Tue Mar 24 16:44:00 2015
Instance shutdown complete
Tue Mar 24 16:52:55 2015
Starting ORACLE instance (normal)
Tue Mar 24 16:53:08 2015
LICENSE_MAX_SESSION = 0
LICENSE_SESSIONS_WARNING = 0
Private Interface ‘eth1:1′ configured from GPnP for use as a private interconnect.
[name=’eth1:1’, type=1, ip=169.254.15.166, mac=08-00-27-3b-92-91, net=169.254.0.0/16, mask=255.255.0.0, use=haip:cluster_interconnect/62]
Public Interface ‘eth0′ configured from GPnP for use as a public interface.
[name=’eth0’, type=1, ip=192.168.21.146, mac=08-00-27-ff-86-eb, net=192.168.21.0/24, mask=255.255.255.0, use=public/1]
Public Interface ‘eth0:1′ configured from GPnP for use as a public interface.
[name=’eth0:1’, type=1, ip=192.168.21.148, mac=08-00-27-ff-86-eb, net=192.168.21.0/24, mask=255.255.255.0, use=public/1]
Picked latch-free SCN scheme 2
Tue Mar 24 16:53:21 2015
Autotune of undo retention is turned on.
LICENSE_MAX_USERS = 0
……………………
Starting background process QMNC
Tue Mar 24 16:54:21 2015
QMNC started with pid=39, OS id=5871
Tue Mar 24 16:54:31 2015
Completed: ALTER DATABASE OPEN /* db agent *//* {1:22172:290} */
Tue Mar 24 16:55:01 2015
Starting background process CJQ0
Tue Mar 24 16:55:01 2015
CJQ0 started with pid=48, OS id=5965
3、日志记录总结:
1)、两个节点大约在16:44左右完成关闭数据库的操作,至此trsen2节点一直持续到Tue Mar 24 16:52:55 2015此点起实例,二trsen1在期间做了较多操作
Tue Mar 24 16:44:03 2015
Instance shutdown complete
Tue Mar 24 16:44:00 2015
Instance shutdown complete
2)、trsen1节点alert日志记录期间启动关闭实例,归档切换,等操作
3)、大约在Tue Mar 24 16:55前,两个节点的instance都启动了
Completed: ALTER DATABASE OPEN /* db agent *//* {1:22172:290} */
Tue Mar 24 16:55:41 2015
Completed: ALTER DATABASE OPEN /* db agent *//* {1:22172:290} */
Tue Mar 24 16:55:01 2015
二、11GR2和10GR2 RAC即可方法,测试环境在11GR2下
SQL> archive log list;================>查看当前模式
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination +DATA_DG
Oldest online log sequence 15
Current log sequence 16
SQL> alter system set cluster_database=false scope=spfile;===========>修改参数cluster_database至spifle中
System altered.
SQL> ho srvctl stop database -d trsen=============>从停数据库开始,所有的操作都在trsen1,从alert日志来看trsen2节点没有相关日志记录,而且trsen2是处理关闭状态
SQL> exit
SQL> startup mount;
ORACLE instance started.
Total System Global Area 1255473152 bytes
Fixed Size 1344652 bytes
Variable Size 805309300 bytes
Database Buffers 436207616 bytes
Redo Buffers 12611584 bytes
Database mounted.
SQL> alter database archivelog;
Database altered.
SQL> show parameter cluster_database;
NAME TYPE VALUE
———————————— ———– ——————————
cluster_database boolean FALSE===============>状态已经更改
cluster_database_instances integer 1
SQL> alter system set cluster_database=true scope=spfile ;=============>将其状态再此修改成true
System altered.
SQL> shutdown immediate;
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> exit
SQL> ho srvctl start database -d trsen=============>启动数据库
SQL> exit
Disconnected
[oracle@trsen1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Tue Mar 24 17:31:19 2015
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 – Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SQL> show parameter cluster_d
NAME TYPE VALUE
———————————— ———– ——————————
cluster_database boolean TRUE
cluster_database_instances integer 2
SQL> select status from v$instance;
STATUS
————
OPEN
SQL> archive log list;========================>已经更改成归档模式
Database log mode Archive Mode
Automatic archival Enabled
Archive destination +DATA_DG
Oldest online log sequence 15
Next log sequence to archive 16
Current log sequence 16