数据库建设到现在,一致在做逻辑备份,考虑到后期维护人员现场情况,建议最近就将归档日志打开
过程
因为之前没有在rac开启过归档,现在在虚拟rac下测试下如果归档路径放到某个节点,或者放到存储中
grid>asmcmd
>ls
cd DATADG/
cd arch
mkdir arch
pwd
[root@vmac1 ~]# su - oracle
[oracle@vmac1 ~]$ export ORACLE_SID=PROD1
[oracle@vmac1 ~]$ sqlplus "/as sysdba"
SQL> alter system set log_archive_dest_1='location=+DATADG/arch' scope=spfile sid='*';
System altered.
SQL> ALTER SYSTEM SET log_archive_format='arch_%t_%s_%r.arc' SCOPE=spfile;
System altered.
关闭数据库,全部节点都要关闭
[grid@zhcs-db1 ~]$ srvctl stop database -d PROD
srvctl stop database -d PROD
srvctl start database -d PROD -o mount
[root@vmac1 ~]# su - oracle
[oracle@vmac1 ~]$ export ORACLE_SID=PROD1
[oracle@vmac1 ~]$ sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.3.0 Production on 星期六 6月 11 22:30:39 2016
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SQL> alter database archivelog;
Database altered.
SQL> alter database open;
Database altered.
SQL>
[root@vmac2 ~]# su - oracle
[oracle@vmac2 ~]$ export ORACLE_SID=PROD2
[oracle@vmac2 ~]$ sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.3.0 Production on 星期六 6月 11 22:34:06 2016
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SQL> alter database open;
Database altered.
启动另外一个节点数据库实例
[root@vmac1 ~]# su - oracle
[oracle@vmac1 ~]$ export ORACLE_SID=PROD1
[oracle@vmac1 ~]$ ls
oradiag_oracle
[oracle@vmac1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on 星期二 6月 14 12:25:45 2016
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination +DATADG/arch
Oldest online log sequence 35
Next log sequence to archive 36
Current log sequence 36
2016-06-17
实战中
节点二的集群关闭,高可用关闭,后来重新启动都在报错,是在没招了,重启了节点二机器,重启后发现数据库还在重启中,但是集群已经启动了
参考文档