Skip to content

RAC-Archive Log

March 10, 2012

####################################################################################
RAC Archive Mode
####################################################################################

DBName/Instances : d041 ( d0411 & d0412)

SQL> ALTER SYSTEM SET log_archive_dest_1=’LOCATION=/u02/oradata/arch_log/d041/’ SCOPE=spfile;
SQL> ALTER SYSTEM SET log_archive_format=’d041_arch_T%TR%RS%S.arc’ SCOPE=spfile;
SQL> alter system set cluster_database=false scope=spfile sid=’d0411′;

srvctl stop database -d d041
OR

pbrun hares -offline d041 -sys maldevsrv01
pbrun hares -offline d041 -sys maldevsrv02

SQL> startup mount
SQL> alter database archivelog;
SQL> alter system set cluster_database=true scope=spfile sid=’d0411′;
SQL> shutdown;

srvctl start database -d d041
OR
pbrun hares -state d041 -sys maldevsrv01
pbrun hares -state d041 -sys maldevsrv02
pbrun hares -online d041 -sys maldevsrv01
pbrun hares -online d041 -sys maldevsrv02

(Optional) Bring any services (i.e. TAF) back up using srvctl:

$ srvctl start service -d d041

####################################################################################
Practical Screen Shots
####################################################################################

maldevsrv01:/opt/oracle: sqlplus “/ as sysdba”

SQL*Plus: Release 11.2.0.1.0 Production on Fri Mar 9 08:38:00 2012

Copyright (c) 1982, 2009, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 – 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options

SQL> archive log list
Database log mode              No Archive Mode
Automatic archival             Disabled
Archive destination            /u01/app/oracle/product/11.2.0/dbs/arch
Oldest online log sequence     80
Current log sequence           81

SQL>
SQL> ALTER SYSTEM SET log_archive_dest_1=’LOCATION=/u02/oradata/arch_log/d041/’ SCOPE=spfile;

System altered.

SQL> ALTER SYSTEM SET log_archive_format=’d041_arch_T%TR%RS%S.arc’ SCOPE=spfile;

System altered.

SQL> alter system set cluster_database=false scope=spfile sid=’d0411′;

System altered.

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 – 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
maldevsrv01:/opt/oracle:

Bring Down Database Instance Configured with VCS (Veritas Cluster Services), Using HA Commands.
================================================================================================
maldevsrv01:/opt/oracle: pbrun hares -offline d041 -sys maldevsrv01

maldevsrv02:/opt/oracle: pbrun hares -offline d041 -sys maldevsrv02

OR

Use Srvctl to bring Entire Database down.
================================================================================================

srvctl stop database -d d041

maldevsrv01:/opt/oracle: ps -ef |grep pmon
oracle 10961 28244   0 08:47:08 pts/12      0:00 grep pmon

maldevsrv01:/opt/oracle: sqlplus “/ as sysdba”

SQL*Plus: Release 11.2.0.1.0 Production on Fri Mar 9 08:47:33 2012

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

Connected to an idle instance.

SQL> startup mount
ORACLE instance started.

Total System Global Area 5346328576 bytes
Fixed Size                  2157504 bytes
Variable Size            2868909120 bytes
Database Buffers         2466250752 bytes
Redo Buffers                9011200 bytes
Database mounted.
SQL> alter database archivelog;

Database altered.

SQL> alter system set cluster_database=true scope=spfile sid=’d0411′;

System altered.

SQL> shutdown
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL>

Use Srvctl to bring UP Entire Database .
================================================================================================

srvctl start database -d d041


OR

Bring UP Database Instances Configured with VCS (Veritas Cluster Services), Using HA Commands.
================================================================================================

maldevsrv01:/opt/oracle: pbrun hares -state d041 -sys maldevsrv01
OFFLINE
maldevsrv01:/opt/oracle: pbrun hares -state d041 -sys maldevsrv02
OFFLINE
maldevsrv01:/opt/oracle:

maldevsrv01:/opt/oracle: pbrun hares -online d041 -sys maldevsrv01
maldevsrv01:/opt/oracle: pbrun hares -online d041 -sys maldevsrv02
maldevsrv01:/opt/oracle:

maldevsrv01:/opt/oracle: ps -ef |grep pmon
oracle 14905     1   0 08:52:14 ?           0:00 ora_pmon_d0411
oracle 16107 28244   0 08:53:45 pts/12      0:00 grep pmon

maldevsrv02:/opt/oracle: ps -ef |grep pmon
oracle  8628 11858   0 08:54:13 pts/6       0:00 grep pmon
oracle  7749     1   0 08:53:04 ?           0:00 ora_pmon_d0412

Node 1:
==========
SQL> archive log list
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /u02/oradata/arch_log/d041/
Oldest online log sequence     80
Next log sequence to archive   81
Current log sequence           81
SQL>

SQL> !ls -ltr /u02/oradata/arch_log/d041/
total 77696
-rw-r—–   1 oracle   dba      39771648 Mar  9 08:52 d041_arch_T0002R0777189896S0000000003.arc

SQL> alter system switch logfile;

System altered.

SQL> archive log list
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /u02/oradata/arch_log/d041/
Oldest online log sequence     81
Next log sequence to archive   82
Current log sequence           82
SQL>

Node 2:
==========
SQL> archive log list
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /u02/oradata/arch_log/d041/
Oldest online log sequence     3
Next log sequence to archive   4
Current log sequence           4
SQL>
SQL> alter system switch logfile;

System altered.

SQL> archive log list
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /u02/oradata/arch_log/d041/
Oldest online log sequence     4
Next log sequence to archive   5
Current log sequence           5
SQL>

SQL> !ls -ltr /u02/oradata/arch_log/d041/
total 129136
-rw-r—–   1 oracle   dba      39771648 Mar  9 08:52 d041_arch_T0002R0777189896S0000000003.arc
-rw-r—–   1 oracle   dba      26276352 Mar  9 08:56 d041_arch_T0001R0777189896S0000000081.arc
-rw-r—–   1 oracle   dba        46592 Mar  9 08:56 d041_arch_T0002R0777189896S0000000004.arc

From → RAC

One Comment
  1. Kumar Gummula permalink

    Nice…….

    Like

Leave a comment