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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章