rac归档切换测试记录

归档测试记录


测试记录


[root@rac1 ~]# su - oracle


[oracle@rac1 ~]$ export ORACLE_SID=racjiqun1


[oracle@rac1 ~]$ sqlplus / as sysdba




SQL> show parameter cluster;


NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
cluster_database                     boolean     TRUE
cluster_database_instances           integer     2
cluster_interconnects                string
在各个节点上执行如下命令


SQL> alter system set cluster_database=false scope=spfile sid='racjiqun1';


System altered.


在一二节点执行  shutdown immediate;


SQL> shutdown immediate;


Database closed.


Database dismounted.


ORACLE instance shut down.




在一节点执行 startup mount;
SQL> startup mount;


ORACLE instance started.






Total System Global Area 1269366784 bytes


Fixed Size                  2252864 bytes


Variable Size             822087616 bytes


Database Buffers          436207616 bytes


Redo Buffers                8818688 bytes


Database mounted.




SQL> show parameter cluster;  查看操作是否生效






NAME                                 TYPE        VALUE


------------------------------------ ----------- ------------------------------


cluster_database                     boolean     FALSE


cluster_database_instances           integer     1


cluster_interconnects                string








SQL> archive log list;


Database log mode              No Archive Mode


Automatic archival             Disabled


Archive destination            /oracle/app/oracle/11.2.4/db_1/dbs/arch


Oldest online log sequence     22


Current log sequence           23






SQL> alter database archivelog;


Database altered.




SQL> alter system set log_archive_format='test_%t_%s_%r.log' scope=spfile;


System altered.


归档格式说明:


%t     重做线程号


%s     日志序列号


%r      resetlogs的id号


SQL> alter system set log_archive_start=true  scope=spfile;






System altered.




SQL> alter system set log_archive_dest_1='location=+DATA/arch' scope=spfile;


System altered.






SQL> alter system set cluster_database=true scope=spfile sid='racjiqun1';


System altered.






SQL> alter system set cluster_database=true scope=spfile sid='racjiqun2';






System altered.




SQL> shutdown immediate;


Database closed.


Database dismounted.


ORACLE instance shut down.






[oracle@rac1 ~]$ srvctl  start database -d racjiqun






切换归档,查看归档是否正常工作


alter system switch logfile;或者


alter system archive log current;






[oracle@rac1 ~]$ sqlplus / as sysdba


SQL*Plus: Release 11.2.0.4.0 Production on Sat May 28 14:36:49 2016


Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:


Oracle Database 11g Enterprise Edition Release 11.2.0.4.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            +DATA/arch


Oldest online log sequence     22


Next log sequence to archive   23


Current log sequence           23






[oracle@rac2 ~]$ sqlplus / as sysdba


SQL*Plus: Release 11.2.0.4.0 Production on Sat May 28 14:37:24 2016


Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:


Oracle Database 11g Enterprise Edition Release 11.2.0.4.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            +DATA/arch


Oldest online log sequence     7


Next log sequence to archive   8


Current log sequence           8

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值