Guenadi N Jilevski's Oracle BLOG

Oracle RAC, DG, EBS, DR and HA DBA BLOG

RAC Data Guard setup and management with Oracle 11gR2 (11.2.0.2)

RAC Data Guard setup and management with Oracle 11gR2 (11.2.0.2)

In the article we will look at Data Guard creation and management using both Oracle 11gR2 RAC as a primary and standby database. In the article OEL 5.4 and Oracle 11.2 Grid Infrastructure and RDBMS are used and ASM is used as storage. Oracle 11gR2 GI and RDBMS installation or update is a prerequisite for setup a DR primary and standby sites using RAC. The primary database is a RAC database created as described here.. The article will emphasize on creating and managing standby RAC database using sqlplus, RMAN and Data Guard Broker (dgmgrl) without OEM, whereas information related to OEM Grid Control 11g and Data Guard can be obtained here. The general approach for creating a DR standby database includes the following steps:

Continue reading

December 24, 2010 Posted by | oracle | 46 Comments

RAC enabling single instance database using RCONFIG with Oracle 11gR2

RAC enabling single instance database using RCONFIG with Oracle 11gR2

Conversion from a single instance database to RAC database can be done with the following tools.

  • DBCA – for more info click here.
  • Enterprise Manager – for more info click here.
  • Rconfig – scope of the present paper.

The paper will look at the steps to convert a single instance database to RAC database on ASM using rconfig utility from Oracle 11gR2 (11.2.0.2). In $ORACLE_HOME/assistants/rconfig/sampleXMLs directory there are two templates ConvertToRAC_AdminManaged.xml and ConvertToRAC_PolicyManaged.xml that are used to convert a single instance database to RAC admin or policy managed database respectively. In the paper a conversion to an admin managed RAC database will be covered although the same approach is applicable to a policy managed database. Rconfig utility takes as an input a customized template and produces a RAC enable database upon successful completion. Base templates provided in $ORACLE_HOME/assistants/rconfig/sampleXMLs are customized by providing the information in the list below.

  • Source $OH – OracleHome of non-rac database for SourceDBHome
  • Destination $OH – racleHome where the rac database should be configured.
  • SourceDBInfo SID
  • list of nodes that should have rac instances running for the Admin Managed Cluster Database. LocalNode should be the first node
  • Instance Prefix tag is optional starting with 11.2.
  • Specify the type of storage to be used by RAC database. ASM or Cluster File system
  • Specify Database Area Location to be configured for rac database.
  • Specify Fast Recovery Area to be configured for rac database.

The content of the In $ORACLE_HOME/assistants/rconfig/sampleXMLs templates are shown in the appendix. I created two customized templates /tmp/conv_ver.xml and /tmp/conv_imp.xml reflecting my set up. The important field in the template is . Allowable values are: YES|NO|ONLY. If ONLY is specified rconfig only checks that the prerequisites are met and do not perform the conversion. This is good to test. If YES is specified the prerequisites are checked and if they met rconfig performs the actual conversion. Both /tmp/conv_ver.xml and /tmp/conv_imp.xml are customized to reflect the environment and differ only in the value of ‘Convert Verify’. Look for the customized content of /tmp/conv_ver.xml and /tmp/conv_imp.xml in the appendix. Rconfig utility performs the conversion for us using RMAN behind the stage. The logs are in $ORACLE_BASE/cfgtoollogs/rconfig directory.

Continue reading

December 21, 2010 Posted by | oracle | 1 Comment

Moving a database from file system to ASM and vice versa in Oracle 11gR2

Moving a database from file system to ASM and vice versa in Oracle 11gR2

Moving a database from/to ASM is based on RMAN’s ability to backup files as a copies and perform a switch database in the copied location. Database file management is further simplified if OMF and FRA are used, that is if db_create_file_dest and db_recovery_* parameters are specified.

1.Moving a database from file system to ASM

Prepare a pfile for the duration of the move.

This is the original pfile.

[oracle@raclinux1 dbs]$ cat inittst.ora.org

tst.__db_cache_size=171966464

tst.__java_pool_size=4194304

tst.__large_pool_size=4194304

tst.__pga_aggregate_target=180355072

tst.__sga_target=343932928

tst.__shared_io_pool_size=0

tst.__shared_pool_size=150994944

tst.__streams_pool_size=4194304

*.audit_file_dest=’/u01/app/oracle/admin/tst/adump’

*.audit_trail=’db’

*.compatible=’11.2.0.0.0′

*.control_files=’/u01/app/oracle/TST/controlfile/o1_mf_6jy10hy0_.ctl’,’/u01/app/oracle/fast_recovery_area/TST/controlfile/o1_mf_6jy10jfk_.ctl’

*.db_block_size=8192

*.db_create_file_dest=’/u01/app/oracle’

*.db_domain=”

*.db_name=’tst’

*.db_recovery_file_dest=’/u01/app/oracle/fast_recovery_area’

*.db_recovery_file_dest_size=4227858432

*.diagnostic_dest=’/u01/app/oracle’

*.dispatchers='(PROTOCOL=TCP) (SERVICE=tstXDB)’

*.memory_target=524288000

*.open_cursors=300

*.processes=150

*.remote_login_passwordfile=’EXCLUSIVE’

*.undo_tablespace=’UNDOTBS1′

[oracle@raclinux1 dbs]$

 

This is a pfile for move to ASM. Note that control_files parameter is removed and db_create_file_dest and db_recovery_file_dest point to the disk goup.

[oracle@raclinux1 dbs]$ cat inittst.ora.new

tst.__db_cache_size=171966464

tst.__java_pool_size=4194304

tst.__large_pool_size=4194304

tst.__pga_aggregate_target=180355072

tst.__sga_target=343932928

tst.__shared_io_pool_size=0

tst.__shared_pool_size=150994944

tst.__streams_pool_size=4194304

*.audit_file_dest=’/u01/app/oracle/admin/tst/adump’

*.audit_trail=’db’

*.compatible=’11.2.0.0.0′

*.db_block_size=8192

*.db_create_file_dest=’+DGDUP’

*.db_domain=”

*.db_name=’tst’

*.db_recovery_file_dest=’+DGDUP’

*.db_recovery_file_dest_size=4227858432

*.diagnostic_dest=’/u01/app/oracle’

*.dispatchers='(PROTOCOL=TCP) (SERVICE=tstXDB)’

*.memory_target=524288000

*.open_cursors=300

*.processes=150

*.remote_login_passwordfile=’EXCLUSIVE’

*.undo_tablespace=’UNDOTBS1′

[oracle@raclinux1 dbs]$

 

This is a pfile for move from ASM to file system. Note that control_files parameter is removed and db_create_file_dest and db_recovery_file_dest point to the file system.

[oracle@raclinux1 dbs]$ cat inittst.ora.org1

tst.__db_cache_size=171966464

tst.__java_pool_size=4194304

tst.__large_pool_size=4194304

tst.__pga_aggregate_target=180355072

tst.__sga_target=343932928

tst.__shared_io_pool_size=0

tst.__shared_pool_size=150994944

tst.__streams_pool_size=4194304

*.audit_file_dest=’/u01/app/oracle/admin/tst/adump’

*.audit_trail=’db’

*.compatible=’11.2.0.0.0′

*.db_block_size=8192

*.db_create_file_dest=’/u01/app/oracle’

*.db_domain=”

*.db_name=’tst’

*.db_recovery_file_dest=’/u01/app/oracle/fast_recovery_area’

*.db_recovery_file_dest_size=4227858432

*.diagnostic_dest=’/u01/app/oracle’

*.dispatchers='(PROTOCOL=TCP) (SERVICE=tstXDB)’

*.memory_target=524288000

*.open_cursors=300

*.processes=150

*.remote_login_passwordfile=’EXCLUSIVE’

*.undo_tablespace=’UNDOTBS1′

[oracle@raclinux1 dbs]$

 

 

Take a note of the database file location prior to the move to ASM

[oracle@raclinux1 dbs]$ sqlplus / as sysdba

 

SQL*Plus: Release 11.2.0.2.0 Production on Mon Dec 20 03:23:48 2010

 

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

 

 

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 – 64bit Production

With the Partitioning, Real Application Clusters, OLAP, Data Mining

and Real Application Testing options

 

SQL> select name from v$controlfile;

 

NAME

——————————————————————————–

/u01/app/oracle/TST/controlfile/o1_mf_6jy10hy0_.ctl

/u01/app/oracle/fast_recovery_area/TST/controlfile/o1_mf_6jy10jfk_.ctl

 

SQL> select name from v$datafile;

 

NAME

——————————————————————————–

/u01/app/oracle/TST/datafile/o1_mf_system_6jy0osyn_.dbf

/u01/app/oracle/TST/datafile/o1_mf_sysaux_6jy0otdj_.dbf

/u01/app/oracle/TST/datafile/o1_mf_undotbs1_6jy0otxm_.dbf

/u01/app/oracle/TST/datafile/o1_mf_users_6jy0ovlz_.dbf

 

SQL> select member from v$logfile;

 

MEMBER

——————————————————————————–

/u01/app/oracle/TST/onlinelog/o1_mf_3_6jy12241_.log

/u01/app/oracle/fast_recovery_area/TST/onlinelog/o1_mf_3_6jy129og_.log

/u01/app/oracle/TST/onlinelog/o1_mf_2_6jy11bh5_.log

/u01/app/oracle/fast_recovery_area/TST/onlinelog/o1_mf_2_6jy11rbj_.log

/u01/app/oracle/TST/onlinelog/o1_mf_1_6jy10nhn_.log

/u01/app/oracle/fast_recovery_area/TST/onlinelog/o1_mf_1_6jy10qcz_.log

 

6 rows selected.

 

SQL> select name from v$tempfile;

 

NAME

——————————————————————————–

/u01/app/oracle/TST/datafile/o1_mf_temp_6jy13z9k_.tmp

 

SQL>

Backup the database as a copy to the disk group.

[oracle@raclinux1 dbs]$ rman target /

 

Recovery Manager: Release 11.2.0.2.0 – Production on Mon Dec 20 04:13:10 2010

 

Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.

 

connected to target database: TST (DBID=1879374527)

 

RMAN> backup as copy database format ‘+DGDUP’;

 

Starting backup at 20-DEC-10

using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile copy

input datafile file number=00001 name=/u01/app/oracle/TST/datafile/o1_mf_system_6jy0osyn_.dbf

output file name=+DGDUP/tst/datafile/system.271.738217627 tag=TAG20101220T042705 RECID=2 STAMP=738217808

channel ORA_DISK_1: datafile copy complete, elapsed time: 00:03:06

channel ORA_DISK_1: starting datafile copy

input datafile file number=00002 name=/u01/app/oracle/TST/datafile/o1_mf_sysaux_6jy0otdj_.dbf

output file name=+DGDUP/tst/datafile/sysaux.272.738217813 tag=TAG20101220T042705 RECID=3 STAMP=738217967

channel ORA_DISK_1: datafile copy complete, elapsed time: 00:02:46

channel ORA_DISK_1: starting datafile copy

input datafile file number=00003 name=/u01/app/oracle/TST/datafile/o1_mf_undotbs1_6jy0otxm_.dbf

output file name=+DGDUP/tst/datafile/undotbs1.273.738217977 tag=TAG20101220T042705 RECID=4 STAMP=738217999

channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25

channel ORA_DISK_1: starting datafile copy

copying current control file

output file name=+DGDUP/tst/controlfile/backup.274.738218003 tag=TAG20101220T042705 RECID=5 STAMP=738218003

channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03

channel ORA_DISK_1: starting datafile copy

input datafile file number=00004 name=/u01/app/oracle/TST/datafile/o1_mf_users_6jy0ovlz_.dbf

output file name=+DGDUP/tst/datafile/users.275.738218007 tag=TAG20101220T042705 RECID=6 STAMP=738218007

channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

including current SPFILE in backup set

channel ORA_DISK_1: starting piece 1 at 20-DEC-10

channel ORA_DISK_1: finished piece 1 at 20-DEC-10

piece handle=+DGDUP/tst/backupset/2010_12_20/nnsnf0_tag20101220t042705_0.276.738218007 tag=TAG20101220T042705 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01

Finished backup at 20-DEC-10

 

RMAN>

 

Start the instance with the temporarily created pfile and leave the database in nomount state. Recover the control file. Mount the database switch to copy and recover. Open the database.

[oracle@raclinux1 dbs]$ rman target /

 

Recovery Manager: Release 11.2.0.2.0 – Production on Mon Dec 20 04:57:34 2010

 

Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.

 

connected to target database (not started)

 

RMAN> startup nomount pfile=$ORACLE_HOME/dbs/inittst.ora.new

 

Oracle instance started

 

Total System Global Area 521936896 bytes

 

Fixed Size 2228072 bytes

Variable Size 343933080 bytes

Database Buffers 171966464 bytes

Redo Buffers 3809280 bytes

 

 

 

RMAN> restore controlfile from ‘/u01/app/oracle/TST/controlfile/o1_mf_6jy10hy0_.ctl’;

 

Starting restore at 20-DEC-10

using channel ORA_DISK_1

 

channel ORA_DISK_1: copied control file copy

output file name=+DGDUP/tst/controlfile/current.277.738219655

output file name=+DGDUP/tst/controlfile/current.278.738219657

Finished restore at 20-DEC-10

 

RMAN>

RMAN> alter database mount;

 

database mounted

released channel: ORA_DISK_1

 

RMAN> switch database to copy;

 

datafile 1 switched to datafile copy “+DGDUP/tst/datafile/system.271.738217627”

datafile 2 switched to datafile copy “+DGDUP/tst/datafile/sysaux.272.738217813”

datafile 3 switched to datafile copy “+DGDUP/tst/datafile/undotbs1.273.738217977”

datafile 4 switched to datafile copy “+DGDUP/tst/datafile/users.275.738218007”

 

RMAN> recover database;

 

Starting recover at 20-DEC-10

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=27 device type=DISK

 

starting media recovery

media recovery complete, elapsed time: 00:00:05

 

Finished recover at 20-DEC-10

 

RMAN> alter database open;

 

database opened

 

RMAN>

 

Add new log file and a new temporary tablespace and drop the old redo logs and temporary tablespace. Make sure that the spfile is created to take care of the control files.

[oracle@raclinux1 dbs]$ sqlplus / as sysdba

 

SQL*Plus: Release 11.2.0.2.0 Production on Mon Dec 20 05:09:42 2010

 

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

 

 

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 – 64bit Production

With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,

Data Mining and Real Application Testing options

 

SQL> select instance_name from v$instance;

 

INSTANCE_NAME

—————-

tst

 

SQL> select name from v$database;

 

NAME

———

TST

 

SQL> select name from v$datafile;

 

NAME

——————————————————————————–

+DGDUP/tst/datafile/system.271.738217627

+DGDUP/tst/datafile/sysaux.272.738217813

+DGDUP/tst/datafile/undotbs1.273.738217977

+DGDUP/tst/datafile/users.275.738218007

 

SQL> select name from v$controlfile;

 

NAME

——————————————————————————–

+DGDUP/tst/controlfile/current.277.738219655

+DGDUP/tst/controlfile/current.278.738219657

 

SQL>

 

 

SQL> alter database add logfile;

 

Database altered.

 

SQL> alter system switch logfile;

 

System altered.

 

SQL> alter system switch logfile;

 

System altered.

 

SQL>

 

SQL> alter database add logfile ;

 

Database altered.

 

SQL>

 

SQL> column member format a90

SQL> select lf.member,l.group#,l.status from v$logfile lf, v$log l where lf.group#=l.group#;

 

MEMBER GROUP# STATUS

—————————————————————————————— ———- —————-

/u01/app/oracle/TST/onlinelog/o1_mf_3_6jy12241_.log 3 INACTIVE

/u01/app/oracle/fast_recovery_area/TST/onlinelog/o1_mf_3_6jy129og_.log 3 INACTIVE

/u01/app/oracle/TST/onlinelog/o1_mf_2_6jy11bh5_.log 2 INACTIVE

/u01/app/oracle/fast_recovery_area/TST/onlinelog/o1_mf_2_6jy11rbj_.log 2 INACTIVE

/u01/app/oracle/TST/onlinelog/o1_mf_1_6jy10nhn_.log 1 INACTIVE

/u01/app/oracle/fast_recovery_area/TST/onlinelog/o1_mf_1_6jy10qcz_.log 1 INACTIVE

+DGDUP/tst/onlinelog/group_4.279.738220289 4 INACTIVE

+DGDUP/tst/onlinelog/group_4.280.738220295 4 INACTIVE

+DGDUP/tst/onlinelog/group_5.281.738220315 5 CURRENT

+DGDUP/tst/onlinelog/group_5.282.738220321 5 CURRENT

+DGDUP/tst/onlinelog/group_6.285.738220875 6 UNUSED

 

MEMBER GROUP# STATUS

—————————————————————————————— ———- —————-

+DGDUP/tst/onlinelog/group_6.286.738220883 6 UNUSED

 

12 rows selected.

 

SQL>

SQL> alter database drop logfile group 1;

 

Database altered.

 

SQL> SQL> alter database drop logfile group 2;

 

Database altered.

 

SQL> alter database drop logfile 3;

alter database drop logfile 3

*

ERROR at line 1:

ORA-02236: invalid file name

 

 

SQL> alter database drop logfile group 3;

 

Database altered.

 

SQL>

 

SQL> select lf.member,l.group#,l.status from v$logfile lf, v$log l where lf.group#=l.group#;

 

MEMBER GROUP# STATUS

—————————————————————————————— ———- —————-

+DGDUP/tst/onlinelog/group_4.279.738220289 4 INACTIVE

+DGDUP/tst/onlinelog/group_4.280.738220295 4 INACTIVE

+DGDUP/tst/onlinelog/group_5.281.738220315 5 CURRENT

+DGDUP/tst/onlinelog/group_5.282.738220321 5 CURRENT

+DGDUP/tst/onlinelog/group_6.285.738220875 6 UNUSED

+DGDUP/tst/onlinelog/group_6.286.738220883 6 UNUSED

 

6 rows selected.

 

SQL>

 

SQL> create temporary tablespace temp1;

 

Tablespace created.

 

SQL> alter database default temporary tablespace temp1;

 

Database altered.

 

 

SQL> drop tablespace temp including contents and datafiles;

 

Tablespace dropped.

 

SQL>

 

SQL> alter tablespace temp1 rename to temp;

 

Tablespace altered.

 

SQL>

SQL> select name from v$tempfile;

 

NAME

——————————————————————————————————————————————————————————————————–

+DGDUP/tst/tempfile/temp1.287.738221951

 

SQL> select name from v$datafile;

 

NAME

——————————————————————————————————————————————————————————————————–

+DGDUP/tst/datafile/system.271.738217627

+DGDUP/tst/datafile/sysaux.272.738217813

+DGDUP/tst/datafile/undotbs1.273.738217977

+DGDUP/tst/datafile/users.275.738218007

 

SQL> select name from v$controlfile;

 

NAME

——————————————————————————————————————————————————————————————————–

+DGDUP/tst/controlfile/current.277.738219655

+DGDUP/tst/controlfile/current.278.738219657

 

SQL> select member from v$logfile;

 

MEMBER

——————————————————————————————

+DGDUP/tst/onlinelog/group_4.279.738220289

+DGDUP/tst/onlinelog/group_4.280.738220295

+DGDUP/tst/onlinelog/group_5.281.738220315

+DGDUP/tst/onlinelog/group_5.282.738220321

+DGDUP/tst/onlinelog/group_6.285.738220875

+DGDUP/tst/onlinelog/group_6.286.738220883

 

6 rows selected.

 

SQL>

 

2. Moving from ASM to file system

Create a backup as copy of the database to a directory in the file system. The datafiles’ location is shown at the end of the previous task.

RMAN> backup as copy database format ‘/u01/app/oracle/TST/datafile/%U’;

 

Starting backup at 20-DEC-10

using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile copy

input datafile file number=00001 name=+DGDUP/tst/datafile/system.271.738217627

output file name=/u01/app/oracle/TST/datafile/data_D-TST_I-1879374527_TS-SYSTEM_FNO-1_0om00prb tag=TAG20101220T061259 RECID=13 STAMP=738224186

channel ORA_DISK_1: datafile copy complete, elapsed time: 00:03:35

channel ORA_DISK_1: starting datafile copy

input datafile file number=00002 name=+DGDUP/tst/datafile/sysaux.272.738217813

output file name=/u01/app/oracle/TST/datafile/data_D-TST_I-1879374527_TS-SYSAUX_FNO-2_0pm00q22 tag=TAG20101220T061259 RECID=14 STAMP=738224354

channel ORA_DISK_1: datafile copy complete, elapsed time: 00:02:45

channel ORA_DISK_1: starting datafile copy

input datafile file number=00003 name=+DGDUP/tst/datafile/undotbs1.273.738217977

output file name=/u01/app/oracle/TST/datafile/data_D-TST_I-1879374527_TS-UNDOTBS1_FNO-3_0qm00q78 tag=TAG20101220T061259 RECID=15 STAMP=738224370

channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15

channel ORA_DISK_1: starting datafile copy

copying current control file

output file name=/u01/app/oracle/TST/datafile/cf_D-TST_id-1879374527_0rm00q7o tag=TAG20101220T061259 RECID=16 STAMP=738224382

channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07

channel ORA_DISK_1: starting datafile copy

input datafile file number=00004 name=+DGDUP/tst/datafile/users.275.738218007

output file name=/u01/app/oracle/TST/datafile/data_D-TST_I-1879374527_TS-USERS_FNO-4_0sm00q7v tag=TAG20101220T061259 RECID=17 STAMP=738224386

channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03

Finished backup at 20-DEC-10

 

RMAN>

 

Start the instance with the temporarily created pfile for the move from ASM to file system. Restore the control file. Switch the database and recover. Open the database.

[oracle@raclinux1 dbs]$ rman target /

 

Recovery Manager: Release 11.2.0.2.0 – Production on Mon Dec 20 06:30:27 2010

 

Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.

 

connected to target database (not started)

 

RMAN> shutdown immediate;

 

RMAN> startup nomount pfile=inittst.ora.org1;

 

Oracle instance started

 

Total System Global Area 521936896 bytes

 

Fixed Size 2228072 bytes

Variable Size 343933080 bytes

Database Buffers 171966464 bytes

Redo Buffers 3809280 bytes

 

RMAN> restore controlfile from ‘+DGDUP/tst/controlfile/current.277.738219655’;

 

Starting restore at 20-DEC-10

using target database control file instead of recovery catalog

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=25 device type=DISK

 

channel ORA_DISK_1: copied control file copy

output file name=/u01/app/oracle/TST/controlfile/o1_mf_6jyhotol_.ctl

output file name=/u01/app/oracle/fast_recovery_area/TST/controlfile/o1_mf_6jyhovxm_.ctl

Finished restore at 20-DEC-10

 

RMAN> alter database mount;

 

database mounted

released channel: ORA_DISK_1

 

RMAN> switch database to copy;

 

datafile 1 switched to datafile copy “/u01/app/oracle/TST/datafile/data_D-TST_I-1879374527_TS-SYSTEM_FNO-1_0om00prb”

datafile 2 switched to datafile copy “/u01/app/oracle/TST/datafile/data_D-TST_I-1879374527_TS-SYSAUX_FNO-2_0pm00q22”

datafile 3 switched to datafile copy “/u01/app/oracle/TST/datafile/data_D-TST_I-1879374527_TS-UNDOTBS1_FNO-3_0qm00q78”

datafile 4 switched to datafile copy “/u01/app/oracle/TST/datafile/data_D-TST_I-1879374527_TS-USERS_FNO-4_0sm00q7v”

 

RMAN>

RMAN> recover database;

 

Starting recover at 20-DEC-10

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=33 device type=DISK

 

starting media recovery

media recovery complete, elapsed time: 00:00:04

 

Finished recover at 20-DEC-10

 

RMAN> alter database open;

 

database opened

 

RMAN>

 

So far the data files and the control files are moved from ASM to file system. Create new log file and temporary tablespace and drop the old temporary tablespace and old redo logs. Make sure that the spfile is created to take care of the control files.

[oracle@raclinux1 dbs]$ sqlplus / as sysdba

 

SQL*Plus: Release 11.2.0.2.0 Production on Mon Dec 20 06:36:09 2010

 

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

 

 

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 – 64bit Production

With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,

Data Mining and Real Application Testing options

 

SQL> select name from v$controlfile;

 

NAME

——————————————————————————–

/u01/app/oracle/TST/controlfile/o1_mf_6jyhotol_.ctl

/u01/app/oracle/fast_recovery_area/TST/controlfile/o1_mf_6jyhovxm_.ctl

 

SQL> select name from v$datafile;

 

NAME

——————————————————————————–

/u01/app/oracle/TST/datafile/data_D-TST_I-1879374527_TS-SYSTEM_FNO-1_0om00prb

/u01/app/oracle/TST/datafile/data_D-TST_I-1879374527_TS-SYSAUX_FNO-2_0pm00q22

/u01/app/oracle/TST/datafile/data_D-TST_I-1879374527_TS-UNDOTBS1_FNO-3_0qm00q78

/u01/app/oracle/TST/datafile/data_D-TST_I-1879374527_TS-USERS_FNO-4_0sm00q7v

 

 

 

SQL> select member from v$logfile;

 

MEMBER

——————————————————————————–

+DGDUP/tst/onlinelog/group_4.279.738220289

+DGDUP/tst/onlinelog/group_4.280.738220295

+DGDUP/tst/onlinelog/group_5.281.738220315

+DGDUP/tst/onlinelog/group_5.282.738220321

+DGDUP/tst/onlinelog/group_6.285.738220875

+DGDUP/tst/onlinelog/group_6.286.738220883

 

6 rows selected.

 

SQL>

 

SQL> alter database add logfile;

 

Database altered.

 

SQL> alter database add logfile;

 

Database altered.

 

SQL> alter database add logfile;

 

Database altered.

 

SQL> alter system switch logfile;

 

System altered.

 

SQL> alter system switch logfile;

 

System altered.

 

SQL> alter system switch logfile;

 

System altered.

 

SQL>

 

 

SQL> alter database drop logfile group 6;

 

Database altered.

 

SQL> alter database drop logfile group 4;

 

Database altered.

 

SQL> alter database drop logfile group 5;

alter database drop logfile group 5

*

ERROR at line 1:

ORA-01624: log 5 needed for crash recovery of instance tst (thread 1)

ORA-00312: online log 5 thread 1: ‘+DGDUP/tst/onlinelog/group_5.281.738220315’

ORA-00312: online log 5 thread 1: ‘+DGDUP/tst/onlinelog/group_5.282.738220321’

 

 

SQL>

 

SQL> select lf.member,l.group#,l.status from v$logfile lf, v$log l where lf.group#=l.group#;

 

MEMBER GROUP# STATUS

—————————————————————————————— ———- —————-

/u01/app/oracle/TST/onlinelog/o1_mf_1_6jyj3hk7_.log 1 ACTIVE

/u01/app/oracle/fast_recovery_area/TST/onlinelog/o1_mf_1_6jyj3ht7_.log 1 ACTIVE

/u01/app/oracle/TST/onlinelog/o1_mf_2_6jyj54df_.log 2 ACTIVE

/u01/app/oracle/fast_recovery_area/TST/onlinelog/o1_mf_2_6jyj56yg_.log 2 ACTIVE

/u01/app/oracle/TST/onlinelog/o1_mf_3_6jyj6kph_.log 3 CURRENT

/u01/app/oracle/fast_recovery_area/TST/onlinelog/o1_mf_3_6jyj6kxn_.log 3 CURRENT

+DGDUP/tst/onlinelog/group_5.281.738220315 5 INACTIVE

+DGDUP/tst/onlinelog/group_5.282.738220321 5 INACTIVE

 

8 rows selected.

 

 

SQL> create temporary tablespace temp1;

 

Tablespace created.

 

SQL> alter database default temporary tablespace temp1;

 

Database altered.

 

 

 

SQL> drop tablespace temp including contents and datafiles;

 

Tablespace dropped.

 

SQL>

 

 

SQL> select name from v$controlfile;

 

NAME

————————————————————————————————————————————————————————————————————————————————————————————————————

/u01/app/oracle/TST/controlfile/o1_mf_6jyhotol_.ctl

/u01/app/oracle/fast_recovery_area/TST/controlfile/o1_mf_6jyhovxm_.ctl

 

SQL> select name from v$datafile;

 

NAME

————————————————————————————————————————————————————————————————————————————————————————————————————

/u01/app/oracle/TST/datafile/data_D-TST_I-1879374527_TS-SYSTEM_FNO-1_0om00prb

/u01/app/oracle/TST/datafile/data_D-TST_I-1879374527_TS-SYSAUX_FNO-2_0pm00q22

/u01/app/oracle/TST/datafile/data_D-TST_I-1879374527_TS-UNDOTBS1_FNO-3_0qm00q78

/u01/app/oracle/TST/datafile/data_D-TST_I-1879374527_TS-USERS_FNO-4_0sm00q7v

 

SQL> select name from v$tempfile;

 

NAME

————————————————————————————————————————————————————————————————————————————————————————————————————

/u01/app/oracle/TST/datafile/o1_mf_temp1_6jyjmflz_.tmp

 

SQL> select member from v$logfile;

 

MEMBER

——————————————————————————————

/u01/app/oracle/TST/onlinelog/o1_mf_1_6jyj3hk7_.log

/u01/app/oracle/fast_recovery_area/TST/onlinelog/o1_mf_1_6jyj3ht7_.log

/u01/app/oracle/TST/onlinelog/o1_mf_2_6jyj54df_.log

/u01/app/oracle/fast_recovery_area/TST/onlinelog/o1_mf_2_6jyj56yg_.log

/u01/app/oracle/TST/onlinelog/o1_mf_3_6jyj6kph_.log

/u01/app/oracle/fast_recovery_area/TST/onlinelog/o1_mf_3_6jyj6kxn_.log

 

6 rows selected.

 

SQL>

 

SQL> create spfile from pfile=’inittst.ora.org1′;

 

File created.

 

SQL>

December 21, 2010 Posted by | oracle | 4 Comments

Backup and Restore of ASM Metadata in Oracle 11gR2 (md_backup and md_restore)

Backup and Restore of ASM Metadata in Oracle 11gR2 (md_backup and md_restore)

ASMCMD utility was introduced in Oracle 10g and offered some basic features for navigation, search, monitoring and management, for full description see the docs here. In Oracle 11gR1 the asmcmd functionality was extended to include ability to backup existing disk groups metadata among other new 11g features, for full information refer to the docs here. In Oracle 11gR2 with the introduction of the ACFS the ASMCMD functionality was further extended see here. In Oracle 11gR2 ASMCMD can be used to perform almost all of the activities that used to be performed from sqlplus prompt previously and both sqlplus and asmcmd can be used interchangeably. In this article I will demo how to backup a disk group using md_backup command and use md_restore to obtain the SQL statements to recreate the disk groups and all the dependencies such as templates, aliases, directories and disk group attributes.

The syntax of md_backup in Oracle 11gR2 is as follow.

ASMCMD> md_backup

usage: md_backup backup_file [-G diskgroup [,diskgroup,…]]

help: help md_backup

ASMCMD>

The syntax of md_restore is as follow.

ASMCMD> md_restore

usage: md_restore backup_file [–silent][–full|–nodg|–newdg -o ‘old_diskgroup:new_diskgroup [,…]’][-S sql_script_file] [-G ‘diskgroup [,diskgroup…]’]

help: help md_restore

Lets first make a backup of all disk groups.

md_backup /tmp/backup_ASM.bcp -G data,dgdup,dgdup1,dgdup2,prim,sec

The backed diskgroup metadata can be directly restored upon failure of the disk or we can have asmcmd generate a script and later use the script to generate the disk groups and all of the dependencies from sqlplus.

md_restore /tmp/backup_ASM.bcp –full -S /tmp/ASM_diskgroup.sql

The file is generated as shown in the annex.

ANNEX


ASMCMD> ls

DATA/

DGDUP/

DGDUP1/

DGDUP2/

PRIM/

SEC/

ASMCMD>

ASMCMD>  md_backup /tmp/backup_ASM.bcp -G data,dgdup,dgdup1,dgdup2,prim,sec

Disk group metadata to be backed up: DATA

Disk group metadata to be backed up: DGDUP

Disk group metadata to be backed up: DGDUP1

Disk group metadata to be backed up: DGDUP2

Disk group metadata to be backed up: PRIM

Disk group metadata to be backed up: SEC

Current alias directory path: RO/ONLINELOG

Current alias directory path: RO/CONTROLFILE

Current alias directory path: RONE/ONLINELOG

Current alias directory path: R1N

Current alias directory path: RACDB/CONTROLFILE

Current alias directory path: ORA1

Current alias directory path: R1N/PARAMETERFILE

Current alias directory path: rac-scan/ASMPARAMETERFILE

Current alias directory path: ORA1/DATAFILE

Current alias directory path: RO

Current alias directory path: ORCL/TEMPFILE

Current alias directory path: RAC0/TEMPFILE

Current alias directory path: RACDB/ONLINELOG

Current alias directory path: RACDB

Current alias directory path: RACDB/DATAFILE

Current alias directory path: RAC0

Current alias directory path: RONE/CONTROLFILE

Current alias directory path: ORCL/CONTROLFILE

Current alias directory path: RONE/PARAMETERFILE

Current alias directory path: RUP/ONLINELOG

Current alias directory path: RO/DATAFILE

Current alias directory path: RACO

Current alias directory path: rac-scan/OCRFILE

Current alias directory path: RUP/CONTROLFILE

Current alias directory path: RAC0/CONTROLFILE

Current alias directory path: RONE/DATAFILE

Current alias directory path: RUP

Current alias directory path: rac-scan

Current alias directory path: ORCL/DATAFILE

Current alias directory path: RONE/TEMPFILE

Current alias directory path: RACDB/TEMPFILE

Current alias directory path: R1N/DATAFILE

Current alias directory path: RACO/TEMPFILE

Current alias directory path: RACO/DATAFILE

Current alias directory path: R1N/TEMPFILE

Current alias directory path: RUP/TEMPFILE

Current alias directory path: RAC0/DATAFILE

Current alias directory path: ORCL

Current alias directory path: RUP/DATAFILE

Current alias directory path: ORCL/ONLINELOG

Current alias directory path: RACO/ONLINELOG

Current alias directory path: RUP/PARAMETERFILE

Current alias directory path: R1N/ONLINELOG

Current alias directory path: RO/TEMPFILE

Current alias directory path: RAC0/PARAMETERFILE

Current alias directory path: RACO/CONTROLFILE

Current alias directory path: RAC0/ONLINELOG

Current alias directory path: RONE

Current alias directory path: R1N/CONTROLFILE

Current alias directory path: RACDB/CONTROLFILE

Current alias directory path: RACDB/DATAFILE

Current alias directory path: RACDB/PARAMETERFILE

Current alias directory path: RACDB/TEMPFILE

Current alias directory path: RACDB/ONLINELOG

Current alias directory path: RACDB

Current alias directory path: rac-scan/OCRFILE

Current alias directory path: rac-scan

Current alias directory path: rac-scan/OCRFILE

Current alias directory path: rac-scan

ASMCMD>

ASMCMD> md_restore  /tmp/backup_ASM.bcp --full -S /tmp/ASM_diskgroup.sql

Current Diskgroup metadata being restored: DATA

Current Diskgroup metadata being restored: DGDUP

Current Diskgroup metadata being restored: DGDUP1

Current Diskgroup metadata being restored: DGDUP2

Current Diskgroup metadata being restored: PRIM

Current Diskgroup metadata being restored: SEC

ASMCMD>

[root@raclinux1 tmp]# cat ASM_diskgroup.sql

create diskgroup DATA EXTERNAL redundancy  disk '/dev/oracleasm/disks/DISK4' name DATA_0003 size 10236M  disk '/dev/oracleasm/disks/DISK2' name DATA_0001 size 10236M  disk '/dev/oracleasm/disks/DISK1' name DATA_0000 size 10236M  disk '/dev/oracleasm/disks/DISK3' name DATA_0002 size 10236M  disk '/dev/oracleasm/disks/DISK5' name DATA_0004 size 10236M attribute 'compatible.asm' = '11.2.0.0.0', 'compatible.rdbms' = '10.1.0.0.0';

alter diskgroup /*ASMCMD AMBR*/DATA set attribute '_._DIRVERSION' = '11.2.0.0.0';

alter diskgroup /*ASMCMD AMBR*/DATA set attribute 'COMPATIBLE.ADVM' = '11.2';

alter diskgroup /*ASMCMD AMBR*/DATA alter template AUTOBACKUP attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/DATA alter template ONLINELOG attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/DATA alter template OCRBACKUP attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/DATA alter template DUMPSET attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/DATA alter template ASM_STALE attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/DATA alter template CONTROLFILE attributes (UNPROTECTED FINE);

alter diskgroup /*ASMCMD AMBR*/DATA alter template FLASHFILE attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/DATA alter template OCRFILE attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/DATA alter template CHANGETRACKING attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/DATA alter template ARCHIVELOG attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/DATA alter template ASMPARAMETERBAKFILE attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/DATA alter template TEMPFILE attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/DATA alter template XTRANSPORT attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/DATA alter template DATAGUARDCONFIG attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/DATA alter template FLASHBACK attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/DATA alter template DATAFILE attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/DATA alter template ASMPARAMETERFILE attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/DATA alter template BACKUPSET attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/DATA alter template PARAMETERFILE attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR */ DATA add directory '+DATA/rac-scan';

alter diskgroup /*ASMCMD AMBR */ DATA add directory '+DATA/R1N';

alter diskgroup /*ASMCMD AMBR */ DATA add directory '+DATA/ORCL';

alter diskgroup /*ASMCMD AMBR */ DATA add directory '+DATA/ORA1';

alter diskgroup /*ASMCMD AMBR */ DATA add directory '+DATA/RONE';

alter diskgroup /*ASMCMD AMBR */ DATA add directory '+DATA/RACDB';

alter diskgroup /*ASMCMD AMBR */ DATA add directory '+DATA/RO';

alter diskgroup /*ASMCMD AMBR */ DATA add directory '+DATA/RACO';

alter diskgroup /*ASMCMD AMBR */ DATA add directory '+DATA/RAC0';

alter diskgroup /*ASMCMD AMBR */ DATA add directory '+DATA/RUP';

alter diskgroup /*ASMCMD AMBR */ DATA add directory '+DATA/rac-scan/ASMPARAMETERFILE';

alter diskgroup /*ASMCMD AMBR */ DATA add directory '+DATA/R1N/PARAMETERFILE';

alter diskgroup /*ASMCMD AMBR */ DATA add directory '+DATA/R1N/TEMPFILE';

alter diskgroup /*ASMCMD AMBR */ DATA add directory '+DATA/R1N/ONLINELOG';

alter diskgroup /*ASMCMD AMBR */ DATA add directory '+DATA/R1N/CONTROLFILE';

alter diskgroup /*ASMCMD AMBR */ DATA add directory '+DATA/R1N/DATAFILE';

alter diskgroup /*ASMCMD AMBR */ DATA add directory '+DATA/RUP/PARAMETERFILE';

alter diskgroup /*ASMCMD AMBR */ DATA add directory '+DATA/RUP/TEMPFILE';

alter diskgroup /*ASMCMD AMBR */ DATA add directory '+DATA/RUP/ONLINELOG';

alter diskgroup /*ASMCMD AMBR */ DATA add directory '+DATA/rac-scan/OCRFILE';

alter diskgroup /*ASMCMD AMBR */ DATA add directory '+DATA/ORCL/DATAFILE';

alter diskgroup /*ASMCMD AMBR */ DATA add directory '+DATA/ORCL/CONTROLFILE';

alter diskgroup /*ASMCMD AMBR */ DATA add directory '+DATA/ORCL/ONLINELOG';

alter diskgroup /*ASMCMD AMBR */ DATA add directory '+DATA/ORCL/TEMPFILE';

alter diskgroup /*ASMCMD AMBR */ DATA add directory '+DATA/ORA1/DATAFILE';

alter diskgroup /*ASMCMD AMBR */ DATA add directory '+DATA/RONE/CONTROLFILE';

alter diskgroup /*ASMCMD AMBR */ DATA add directory '+DATA/RONE/ONLINELOG';

alter diskgroup /*ASMCMD AMBR */ DATA add directory '+DATA/RONE/DATAFILE';

alter diskgroup /*ASMCMD AMBR */ DATA add directory '+DATA/RONE/TEMPFILE';

alter diskgroup /*ASMCMD AMBR */ DATA add directory '+DATA/RONE/PARAMETERFILE';

alter diskgroup /*ASMCMD AMBR */ DATA add directory '+DATA/RACDB/CONTROLFILE';

alter diskgroup /*ASMCMD AMBR */ DATA add directory '+DATA/RACDB/ONLINELOG';

alter diskgroup /*ASMCMD AMBR */ DATA add directory '+DATA/RACDB/DATAFILE';

alter diskgroup /*ASMCMD AMBR */ DATA add directory '+DATA/RACDB/TEMPFILE';

alter diskgroup /*ASMCMD AMBR */ DATA add directory '+DATA/RO/DATAFILE';

alter diskgroup /*ASMCMD AMBR */ DATA add directory '+DATA/RO/CONTROLFILE';

alter diskgroup /*ASMCMD AMBR */ DATA add directory '+DATA/RO/ONLINELOG';

alter diskgroup /*ASMCMD AMBR */ DATA add directory '+DATA/RO/TEMPFILE';

alter diskgroup /*ASMCMD AMBR */ DATA add directory '+DATA/RACO/DATAFILE';

alter diskgroup /*ASMCMD AMBR */ DATA add directory '+DATA/RACO/CONTROLFILE';

alter diskgroup /*ASMCMD AMBR */ DATA add directory '+DATA/RACO/ONLINELOG';

alter diskgroup /*ASMCMD AMBR */ DATA add directory '+DATA/RACO/TEMPFILE';

alter diskgroup /*ASMCMD AMBR */ DATA add directory '+DATA/RAC0/DATAFILE';

alter diskgroup /*ASMCMD AMBR */ DATA add directory '+DATA/RAC0/CONTROLFILE';

alter diskgroup /*ASMCMD AMBR */ DATA add directory '+DATA/RAC0/ONLINELOG';

alter diskgroup /*ASMCMD AMBR */ DATA add directory '+DATA/RAC0/TEMPFILE';

alter diskgroup /*ASMCMD AMBR */ DATA add directory '+DATA/RAC0/PARAMETERFILE';

alter diskgroup /*ASMCMD AMBR */ DATA add directory '+DATA/RUP/DATAFILE';

alter diskgroup /*ASMCMD AMBR */ DATA add directory '+DATA/RUP/CONTROLFILE';

create diskgroup DGDUP EXTERNAL redundancy  disk '/dev/oracleasm/disks/DISK7' name DGDUP_0002 size 10236M  disk '/dev/oracleasm/disks/DISK8' name DGDUP_0003 size 10236M  disk '/dev/oracleasm/disks/DISK10' name DGDUP_0000 size 10236M  disk '/dev/oracleasm/disks/DISK6' name DGDUP_0001 size 10236M  disk '/dev/oracleasm/disks/DISK9' name DGDUP_0004 size 10236M attribute 'compatible.asm' = '11.2.0.0.0', 'compatible.rdbms' = '10.1.0.0.0';

alter diskgroup /*ASMCMD AMBR*/DGDUP set attribute '_._DIRVERSION' = '11.2.0.0.0';

alter diskgroup /*ASMCMD AMBR*/DGDUP alter template AUTOBACKUP attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/DGDUP alter template ONLINELOG attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/DGDUP alter template OCRBACKUP attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/DGDUP alter template ASMPARAMETERBAKFILE attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/DGDUP alter template ASMPARAMETERFILE attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/DGDUP alter template ASM_STALE attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/DGDUP alter template PARAMETERFILE attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/DGDUP alter template OCRFILE attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/DGDUP alter template CHANGETRACKING attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/DGDUP alter template ARCHIVELOG attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/DGDUP alter template DUMPSET attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/DGDUP alter template TEMPFILE attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/DGDUP alter template XTRANSPORT attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/DGDUP alter template DATAGUARDCONFIG attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/DGDUP alter template FLASHBACK attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/DGDUP alter template DATAFILE attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/DGDUP alter template CONTROLFILE attributes (UNPROTECTED FINE);

alter diskgroup /*ASMCMD AMBR*/DGDUP alter template BACKUPSET attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/DGDUP alter template FLASHFILE attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR */ DGDUP add directory '+DGDUP/RACDB';

alter diskgroup /*ASMCMD AMBR */ DGDUP add directory '+DGDUP/RACDB/PARAMETERFILE';

alter diskgroup /*ASMCMD AMBR */ DGDUP add directory '+DGDUP/RACDB/DATAFILE';

alter diskgroup /*ASMCMD AMBR */ DGDUP add directory '+DGDUP/RACDB/CONTROLFILE';

alter diskgroup /*ASMCMD AMBR */ DGDUP add directory '+DGDUP/RACDB/TEMPFILE';

alter diskgroup /*ASMCMD AMBR */ DGDUP add directory '+DGDUP/RACDB/ONLINELOG';

create diskgroup DGDUP1 HIGH redundancy failgroup DGDUP1_0003 disk '/dev/oracleasm/disks/DISK14' name DGDUP1_0003 size 10236M failgroup DGDUP1_0000 disk '/dev/oracleasm/disks/DISK11' name DGDUP1_0000 size 10236M failgroup DGDUP1_0004 disk '/dev/oracleasm/disks/DISK15' name DGDUP1_0004 size 10236M failgroup DGDUP1_0001 disk '/dev/oracleasm/disks/DISK12' name DGDUP1_0001 size 10236M failgroup DGDUP1_0002 disk '/dev/oracleasm/disks/DISK13' name DGDUP1_0002 size 10236M attribute 'compatible.asm' = '11.2.0.0.0', 'compatible.rdbms' = '10.1.0.0.0';

alter diskgroup /*ASMCMD AMBR*/DGDUP1 set attribute '_._DIRVERSION' = '11.2.0.0.0';

alter diskgroup /*ASMCMD AMBR*/DGDUP1 alter template ONLINELOG attributes (HIGH COARSE);

alter diskgroup /*ASMCMD AMBR*/DGDUP1 alter template XTRANSPORT attributes (HIGH COARSE);

alter diskgroup /*ASMCMD AMBR*/DGDUP1 alter template DUMPSET attributes (HIGH COARSE);

alter diskgroup /*ASMCMD AMBR*/DGDUP1 alter template OCRFILE attributes (HIGH COARSE);

alter diskgroup /*ASMCMD AMBR*/DGDUP1 alter template FLASHBACK attributes (HIGH COARSE);

alter diskgroup /*ASMCMD AMBR*/DGDUP1 alter template CONTROLFILE attributes (HIGH FINE);

alter diskgroup /*ASMCMD AMBR*/DGDUP1 alter template AUTOBACKUP attributes (HIGH COARSE);

alter diskgroup /*ASMCMD AMBR*/DGDUP1 alter template DATAFILE attributes (HIGH COARSE);

alter diskgroup /*ASMCMD AMBR*/DGDUP1 alter template TEMPFILE attributes (HIGH COARSE);

alter diskgroup /*ASMCMD AMBR*/DGDUP1 alter template DATAGUARDCONFIG attributes (HIGH COARSE);

alter diskgroup /*ASMCMD AMBR*/DGDUP1 alter template FLASHFILE attributes (HIGH COARSE);

alter diskgroup /*ASMCMD AMBR*/DGDUP1 alter template ASMPARAMETERFILE attributes (HIGH COARSE);

alter diskgroup /*ASMCMD AMBR*/DGDUP1 alter template ARCHIVELOG attributes (HIGH COARSE);

alter diskgroup /*ASMCMD AMBR*/DGDUP1 alter template BACKUPSET attributes (HIGH COARSE);

alter diskgroup /*ASMCMD AMBR*/DGDUP1 alter template CHANGETRACKING attributes (HIGH COARSE);

alter diskgroup /*ASMCMD AMBR*/DGDUP1 alter template PARAMETERFILE attributes (HIGH COARSE);

alter diskgroup /*ASMCMD AMBR */ DGDUP1 add directory '+DGDUP1/rac-scan';

alter diskgroup /*ASMCMD AMBR */ DGDUP1 add directory '+DGDUP1/rac-scan/OCRFILE';

create diskgroup DGDUP2 EXTERNAL redundancy  disk '/dev/oracleasm/disks/DISK17' name DGDUP2_0000 size 10236M  disk '/dev/oracleasm/disks/DISK20' name DGDUP2_0003 size 10236M  disk '/dev/oracleasm/disks/DISK16' name DGDUP2_0004 size 10236M  disk '/dev/oracleasm/disks/DISK19' name DGDUP2_0002 size 10236M  disk '/dev/oracleasm/disks/DISK18' name DGDUP2_0001 size 10236M attribute 'compatible.asm' = '11.2.0.0.0', 'compatible.rdbms' = '10.1.0.0.0';

alter diskgroup /*ASMCMD AMBR*/DGDUP2 set attribute '_._DIRVERSION' = '11.2.0.0.0';

alter diskgroup /*ASMCMD AMBR*/DGDUP2 alter template DATAGUARDCONFIG attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/DGDUP2 alter template BACKUPSET attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/DGDUP2 alter template CONTROLFILE attributes (UNPROTECTED FINE);

alter diskgroup /*ASMCMD AMBR*/DGDUP2 alter template FLASHBACK attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/DGDUP2 alter template XTRANSPORT attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/DGDUP2 alter template DUMPSET attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/DGDUP2 alter template TEMPFILE attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/DGDUP2 alter template ASMPARAMETERFILE attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/DGDUP2 alter template ONLINELOG attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/DGDUP2 alter template CHANGETRACKING attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/DGDUP2 alter template OCRFILE attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/DGDUP2 alter template FLASHFILE attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/DGDUP2 alter template PARAMETERFILE attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/DGDUP2 alter template DATAFILE attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/DGDUP2 alter template AUTOBACKUP attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/DGDUP2 alter template ARCHIVELOG attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR */ DGDUP2 add directory '+DGDUP2/rac-scan';

alter diskgroup /*ASMCMD AMBR */ DGDUP2 add directory '+DGDUP2/rac-scan/OCRFILE';

create diskgroup PRIM EXTERNAL redundancy  disk '/dev/oracleasm/disks/DISK22' name PRIM_0001 size 10236M  disk '/dev/oracleasm/disks/DISK21' name PRIM_0000 size 10236M attribute 'compatible.asm' = '11.2.0.2.0', 'compatible.rdbms' = '10.1.0.0.0';

alter diskgroup /*ASMCMD AMBR*/PRIM set attribute '_._DIRVERSION' = '11.2.0.2.0';

alter diskgroup /*ASMCMD AMBR*/PRIM set attribute 'COMPATIBLE.ADVM' = '11.2.0.2.0';

alter diskgroup /*ASMCMD AMBR*/PRIM alter template XTRANSPORT attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/PRIM alter template ONLINELOG attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/PRIM alter template DATAGUARDCONFIG attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/PRIM alter template AUTOBACKUP attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/PRIM alter template TEMPFILE attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/PRIM alter template OCRFILE attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/PRIM alter template ARCHIVELOG attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/PRIM alter template DUMPSET attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/PRIM alter template CONTROLFILE attributes (UNPROTECTED FINE);

alter diskgroup /*ASMCMD AMBR*/PRIM alter template BACKUPSET attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/PRIM alter template ASMPARAMETERFILE attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/PRIM alter template FLASHBACK attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/PRIM alter template PARAMETERFILE attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/PRIM alter template FLASHFILE attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/PRIM alter template DATAFILE attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/PRIM alter template CHANGETRACKING attributes (UNPROTECTED COARSE);

create diskgroup SEC EXTERNAL redundancy  disk '/dev/oracleasm/disks/DISK23' name SEC_0000 size 10236M  disk '/dev/oracleasm/disks/DISK25' name SEC_0002 size 10236M  disk '/dev/oracleasm/disks/DISK24' name SEC_0001 size 10236M attribute 'compatible.asm' = '11.2.0.2.0', 'compatible.rdbms' = '10.1.0.0.0';

alter diskgroup /*ASMCMD AMBR*/SEC set attribute '_._DIRVERSION' = '11.2.0.2.0';

alter diskgroup /*ASMCMD AMBR*/SEC set attribute 'COMPATIBLE.ADVM' = '11.2.0.2.0';

alter diskgroup /*ASMCMD AMBR*/SEC alter template BACKUPSET attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/SEC alter template FLASHFILE attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/SEC alter template CHANGETRACKING attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/SEC alter template TEMPFILE attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/SEC alter template ONLINELOG attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/SEC alter template FLASHBACK attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/SEC alter template CONTROLFILE attributes (UNPROTECTED FINE);

alter diskgroup /*ASMCMD AMBR*/SEC alter template DATAGUARDCONFIG attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/SEC alter template ASMPARAMETERFILE attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/SEC alter template DATAFILE attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/SEC alter template OCRFILE attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/SEC alter template XTRANSPORT attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/SEC alter template PARAMETERFILE attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/SEC alter template DUMPSET attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/SEC alter template ARCHIVELOG attributes (UNPROTECTED COARSE);

alter diskgroup /*ASMCMD AMBR*/SEC alter template AUTOBACKUP attributes (UNPROTECTED COARSE);

[root@raclinux1 tmp]#

December 20, 2010 Posted by | oracle | 6 Comments

Backup and Restore of OCR in Grid Infrastructure 11G R2 11.2

Backup and Restore of OCR in Grid Infrastructure 11G R2 11.2

In this article are going to have a look at the components of the Oracle Clusterware existing in Oracle GI 11.2 that need attention to ensure high availability of the RAC system. The article will focus on backup and restore of the OCR and will point out some practices for high availability on the GI Clusterware components. Oracle Clusterware in Oracle 11gR2 Grid Infrastructure consists of the OCR, vote disk and OLR click here for more info. Here in the article Oracle ASM is installed and used for Oracle GI and RDBMS storage and we will look at how to implement a robust backup and restore strategy for the clusterware components. To ensure that RAC is deployed and operating successfully we need to ensure that the following policies listed in the bullets are in place.

  • High availability for OCR and vote disk.
  • Robust backup and recovery policy for the Oracle GI clusterware components.

 

How to configure multiple OCR and vote disk high availability using ASM disk groups is elaborated here. Note that vote disk can be on only one ASM disk group and the disk group itself provides redundancy.

Staring with Oracle 11gR2 vote disk is automatically backed up in the OCR and there is need to perform manual backups as in earlier pre 11.2 Oracle versions. Having configured multiple OCR and vote disk on a high redundancy ASM disk group we will continue with the ways to ensure that OCR backup and recovery strategy is in place.

Backing up and Recovering OCR

 

Oracle Clusterware automatically creates OCR backups every 4 hours. At any one time, Oracle Clusterware always retains the latest 3 backup copies of the OCR that are 4 hours old, 1 day old and 1 week old. There is no way to customize the backup frequencies or the number of files that Oracle Grid Infrastructure retains while automatically backing OCR. In addition a custom OCR backup can be made at any time. However any backup software can be used to copy the automatically or manually generated backup files at least once daily to a different destination. The default location for generating backups on OEL systems is GI_home/cdata/cluster_name where the cluster_name is the name of your cluster and GI_home is the home directory of your Oracle GI installation. RAC-SCAN is the scan cluster specified during the installation.

To perform a manual backup use the following command:     

ocrconfig -manualbackup


To view the all backups generated automatically or manually by Oracle Clusterware use the ocrconfig
utility. To find the most recent backup of the OCR, run the following command on any node in the cluster:

ocrconfig -showbackup


This command can be used to show both automatically or manually created backups.


In addition to using the automatically or manually created OCR backup files, you can also export the OCR contents to a file before and after making significant configuration changes such as adding or deleting nodes from your environment, modifying Oracle Clusterware resources, or creating a database.

Exporting the OCR contents to a file lets you restore the OCR if your configuration changes cause errors. For example, if you have un-resolvable configuration problems, or if you are unable to restart your cluster database after such changes, then you can restore your configuration by importing the saved OCR content from the valid configuration. To export the contents of the OCR to a file log as the root user, use the following command:

ocrconfig -export backup_file_name

The
backup_file_name
is the name of the OCR backup file you want to create.


Recovering the OCR using manually or auto generated backups

There are two methods when recovering the OCR. The first method uses automatic or user generated OCR file backup copies and the second method uses manually created OCR export files. In this section, we will look at recovering the OCR using the manual or auto generated backups. In the event of a failure, before you attempt to restore the OCR, ensure that the OCR is unavailable. To check the status of the OCR, run the following command:

ocrcheck


If this command does not display the message Device/File integrity check succeeded for at least one copy of the OCR, then both the primary OCR and the OCR mirrors have failed. You must restore the OCR from a backup. If there is at least one copy of the OCR available, you can use that copy to restore the other copies of the OCR.

When restoring the OCR from automatically generated backups, you first have to determine which backup file you will use for the recovery. Identify the available OCR backups using the ocrconfig command while logged in as root user:

ocrconfig -showbackup

[root@raclinux2 bin]# ./ocrconfig -showbackup

raclinux1 2010/12/04 04:07:18 /u01/app/11.2.0.2/grid/cdata/rac-scan/backup00.ocr

raclinux1 2010/12/04 00:07:08 /u01/app/11.2.0.2/grid/cdata/rac-scan/backup01.ocr

raclinux1 2010/12/03 20:07:02 /u01/app/11.2.0.2/grid/cdata/rac-scan/backup02.ocr

raclinux1 2010/12/03 16:06:53 /u01/app/11.2.0.2/grid/cdata/rac-scan/day.ocr

raclinux1 2010/12/03 16:06:53 /u01/app/11.2.0.2/grid/cdata/rac-scan/week.ocr

raclinux2 2010/12/19 20:37:14 /u01/app/11.2.0.2/grid/cdata/rac-scan/backup_20101219_203714.ocr

raclinux2 2010/12/19 20:35:51 /u01/app/11.2.0.2/grid/cdata/rac-scan/backup_20101219_203551.ocr

raclinux2 2010/12/19 20:35:36 /u01/app/11.2.0.2/grid/cdata/rac-scan/backup_20101219_203536.ocr

raclinux2 2010/12/19 20:35:24 /u01/app/11.2.0.2/grid/cdata/rac-scan/backup_20101219_203524.ocr

raclinux2 2010/12/19 20:33:56 /u01/app/11.2.0.2/grid/cdata/rac-scan/backup_20101219_203356.ocr

[root@raclinux2 bin]# ./ocrconfig -showbackup manual

raclinux2 2010/12/19 20:37:14 /u01/app/11.2.0.2/grid/cdata/rac-scan/backup_20101219_203714.ocr

raclinux2 2010/12/19 20:35:51 /u01/app/11.2.0.2/grid/cdata/rac-scan/backup_20101219_203551.ocr

raclinux2 2010/12/19 20:35:36 /u01/app/11.2.0.2/grid/cdata/rac-scan/backup_20101219_203536.ocr

raclinux2 2010/12/19 20:35:24 /u01/app/11.2.0.2/grid/cdata/rac-scan/backup_20101219_203524.ocr

raclinux2 2010/12/19 20:33:56 /u01/app/11.2.0.2/grid/cdata/rac-scan/backup_20101219_203356.ocr

[root@raclinux2 bin]#

Review the contents of the backup using the following ocrdump
command, where file_name is the name of the OCR backup file. The command generates an ASCII file OCRDUMPFILE:

ocrdump -backupfile OCR_backup_file_name


 

[root@raclinux2 bin]# ./ocrdump -backupfile /u01/app/11.2.0.2/grid/cdata/rac-scan/backup_20101219_203714.ocr

[root@raclinux2 bin]# ls OCRDUMPFILE

OCRDUMPFILE

[root@raclinux2 bin]#

As the root user, stop Oracle Clusterware on all the nodes in your Oracle RAC cluster by executing the following command:

crsctl stop crs

The outputs from the command on both nodes are in the Annex.

As the OCR is on ASM we need to start the ASM on the node where we will recover the OCR. The output of the command is in the Annex.

crsctl start crs -excl

After the startup verify that the diskgroups we need are mounted.

SQL> select name, state from v$asm_diskgroup;

NAME STATE

—————————— ———–

DATA MOUNTED

DGDUP1 MOUNTED

DGDUP2 MOUNTED

DGDUP MOUNTED

PRIM MOUNTED

SEC MOUNTED

6 rows selected.

SQL>

Stop crsd if running

crsctl stop resource ora.crsd -init

Failure to do so will result in error

[root@raclinux2 bin]# ./ocrconfig -restore /u01/app/11.2.0.2/grid/cdata/rac-scan/backup_20101219_203714.ocr

PROT-19: Cannot proceed while the Cluster Ready Service is running

[root@raclinux2 bin]# ./crsctl stop resource ora.crsd -init

CRS-2673: Attempting to stop ‘ora.crsd’ on ‘raclinux2’

CRS-2677: Stop of ‘ora.crsd’ on ‘raclinux2’ succeeded

[root@raclinux2 bin]#

As the root user, restore the OCR by applying an OCR backup file using the following command, where file_name is the name of the OCR that you want to restore:

ocrconfig -restore file_name


 

[root@raclinux2 bin]# ./ocrconfig -restore /u01/app/11.2.0.2/grid/cdata/rac-scan/backup_20101219_203714.ocr

[root@raclinux2 bin]#

As root verify the OCR

[root@raclinux2 bin]# ./ocrcheck

Status of Oracle Cluster Registry is as follows :

Version : 3

Total space (kbytes) : 262120

Used space (kbytes) : 4128

Available space (kbytes) : 257992

ID : 1332773503

Device/File Name : +DATA

Device/File integrity check succeeded

Device/File Name : +dgdup2

Device/File integrity check succeeded

Device/File Name : +dgdup1

Device/File integrity check succeeded

Device/File not configured

Device/File not configured

Cluster registry integrity check succeeded

Logical corruption check succeeded

[root@raclinux2 bin]#

As root stop the Oracle clusterware as it is running in exclusive mode.

[root@raclinux2 bin]# ./crsctl stop crs -f

CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on ‘raclinux2’

CRS-2673: Attempting to stop ‘ora.mdnsd’ on ‘raclinux2’

CRS-2673: Attempting to stop ‘ora.ctssd’ on ‘raclinux2’

CRS-2673: Attempting to stop ‘ora.asm’ on ‘raclinux2’

CRS-2673: Attempting to stop ‘ora.drivers.acfs’ on ‘raclinux2’

CRS-2677: Stop of ‘ora.asm’ on ‘raclinux2’ succeeded

CRS-2673: Attempting to stop ‘ora.cluster_interconnect.haip’ on ‘raclinux2’

CRS-2677: Stop of ‘ora.cluster_interconnect.haip’ on ‘raclinux2’ succeeded

CRS-2677: Stop of ‘ora.mdnsd’ on ‘raclinux2’ succeeded

CRS-2677: Stop of ‘ora.ctssd’ on ‘raclinux2’ succeeded

CRS-2673: Attempting to stop ‘ora.cssd’ on ‘raclinux2’

CRS-2677: Stop of ‘ora.cssd’ on ‘raclinux2’ succeeded

CRS-2673: Attempting to stop ‘ora.gipcd’ on ‘raclinux2’

CRS-2673: Attempting to stop ‘ora.diskmon’ on ‘raclinux2’

CRS-2677: Stop of ‘ora.drivers.acfs’ on ‘raclinux2’ succeeded

CRS-2677: Stop of ‘ora.gipcd’ on ‘raclinux2’ succeeded

CRS-2673: Attempting to stop ‘ora.gpnpd’ on ‘raclinux2’

CRS-2677: Stop of ‘ora.diskmon’ on ‘raclinux2’ succeeded

CRS-2677: Stop of ‘ora.gpnpd’ on ‘raclinux2’ succeeded

CRS-2793: Shutdown of Oracle High Availability Services-managed resources on ‘raclinux2’ has completed

CRS-4133: Oracle High Availability Services has been stopped.

[root@raclinux2 bin]#

As the root user, restart Oracle Clusterware on all the nodes in your cluster by executing the following command:

crsctl start crs

[root@raclinux1 bin]# ./crsctl start crs

CRS-4123: Oracle High Availability Services has been started.

[root@raclinux2 bin]# ./crsctl start crs

CRS-4123: Oracle High Availability Services has been started.

Use the Cluster Verification Utility (CVU) to verify the OCR integrity. Run the following command, where the -n all argument retrieves a list of all the cluster nodes that are configured as part of your cluster:

cluvfy comp ocr -n all [-verbose]

The output as show below confirms that OCR was successfully restored on raclinux2.


The output as show below confirms that OCR was successfully restored on raclinux1.


Recovering the OCR using manually generated exports

 

There are two methods when recovering the OCR. The first method uses automatic or user generated OCR file backup copies as we already covered in the section above and the second method uses manually created OCR export files. In this section we will look at recovering the OCR using the manually generated exports.

The ocrconfig -export command creates an export backup of the OCR, enabling you to restore the OCR using the ocrconfig -import option if your configuration changes cause errors. To restore the previous configuration stored in the OCR from an OCR export file as the root user, stop Oracle Clusterware on all the nodes in your Oracle RAC cluster by executing the following command:

crsctl stop crs

The output from the commands on both nodes are in the Annex.

As root start the Oracle clusterware on only one node in exclusive mode so that to be able to perform the import.

crsctl start crs -excl -nocrs

The output is in the Annex. Make sure that all ASM disk groups that are to be used for the OCR are mounted by ASM prior to the import as how below.

SQL> select name, state from v$asm_diskgroup;

NAME STATE

—————————— ———–

DATA MOUNTED

DGDUP1 MOUNTED

DGDUP2 MOUNTED

DGDUP MOUNTED

PRIM MOUNTED

SEC MOUNTED

6 rows selected.

SQL>

Restore the OCR data by importing the contents of the OCR export file using the following command, where file_name is the name of the OCR export file created with the ocrconfig –export backup_file_name:

ocrconfig -import file_name

[root@raclinux2 bin]# ls /tmp

CVU_11.2.0.2.0_oracle keyring-DogWA0 keyring-Rz8s0k keyring-YLYULe OCR_export12202001.exp orbit-root

gconfd-root keyring-DsfLiM keyring-XneWAG lost+found OCR_export12202010.exp ssh-qEcgof5487

hsperfdata_oracle keyring-QiN0FU keyring-Y3hxJA mapping-root OCR_export12212010.exp virtual-root.uFl45n

[root@raclinux2 bin]# ./ocrconfig -import /tmp/OCR_export12202010.exp

[root@raclinux2 bin]#

As root verify OCR.

[root@raclinux2 bin]# ./ocrcheck

Status of Oracle Cluster Registry is as follows :

Version : 3

Total space (kbytes) : 262120

Used space (kbytes) : 4128

Available space (kbytes) : 257992

ID : 437081935

Device/File Name : +DATA

Device/File integrity check succeeded

Device/File Name : +dgdup2

Device/File integrity check succeeded

Device/File Name : +dgdup1

Device/File integrity check succeeded

Device/File not configured

Device/File not configured

Cluster registry integrity check succeeded

Logical corruption check succeeded

[root@raclinux2 bin]#

As root stop the CRS on raclinux2 temporarily started for the import.

[root@raclinux2 bin]# ./crsctl stop crs -f

CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on ‘raclinux2’

CRS-2673: Attempting to stop ‘ora.drivers.acfs’ on ‘raclinux2’

CRS-2673: Attempting to stop ‘ora.mdnsd’ on ‘raclinux2’

CRS-2673: Attempting to stop ‘ora.ctssd’ on ‘raclinux2’

CRS-2673: Attempting to stop ‘ora.asm’ on ‘raclinux2’

CRS-2677: Stop of ‘ora.drivers.acfs’ on ‘raclinux2’ succeeded

CRS-2677: Stop of ‘ora.asm’ on ‘raclinux2’ succeeded

CRS-2673: Attempting to stop ‘ora.cluster_interconnect.haip’ on ‘raclinux2’

CRS-2677: Stop of ‘ora.mdnsd’ on ‘raclinux2’ succeeded

CRS-2677: Stop of ‘ora.cluster_interconnect.haip’ on ‘raclinux2’ succeeded

CRS-2677: Stop of ‘ora.ctssd’ on ‘raclinux2’ succeeded

CRS-2673: Attempting to stop ‘ora.cssd’ on ‘raclinux2’

CRS-2677: Stop of ‘ora.cssd’ on ‘raclinux2’ succeeded

CRS-2673: Attempting to stop ‘ora.gipcd’ on ‘raclinux2’

CRS-2673: Attempting to stop ‘ora.diskmon’ on ‘raclinux2’

CRS-2677: Stop of ‘ora.diskmon’ on ‘raclinux2’ succeeded

CRS-2677: Stop of ‘ora.gipcd’ on ‘raclinux2’ succeeded

CRS-2673: Attempting to stop ‘ora.gpnpd’ on ‘raclinux2’

CRS-2677: Stop of ‘ora.gpnpd’ on ‘raclinux2’ succeeded

CRS-2793: Shutdown of Oracle High Availability Services-managed resources on ‘raclinux2’ has completed

CRS-4133: Oracle High Availability Services has been stopped.

[root@raclinux2 bin]#

Logged in as the root user, restart Oracle Clusterware on all the nodes in your cluster by restarting each node, or by running the following command:

crsctl start crs

[root@raclinux1 bin]# ./crsctl start crs

CRS-4123: Oracle High Availability Services has been started.

[root@raclinux2 bin]# ./crsctl start crs

CRS-4123: Oracle High Availability Services has been started.

Use the
CVU
to verify the OCR integrity. Run the following command, where the
-n all argument retrieves a list of all the cluster nodes that are configured as part of your cluster:

cluvfy comp ocr -n all [-verbose]

On node raclinux1 the output shown below confirms the OCR integrity.


On node raclinux2 the output shown below confirms the OCR integrity.


Please note that you cannot use the ocrconfig command to import an OCR backup file, only an OCR export file.

Summary

 

In the article we looked at a step by step implementation of a backup and recovery procedure for the OCR. As Oracle GI provides both backup and export features related to OCR we detailed two alternative ways for OCR backup. First is using automatic or manual backups of OCR and the latter is using OCR exports. Pointers were provided to additional information related to OCR redundancy and vote disk high availability implementations. As the article is based on the assumption that ASM diskgroups are used for both OCR and vote disks in great details step by step the procedure for restore or import was covered to illustrate the importance of starting the CRS in exclusive mode to make the ASM disk groups available during either the restore or the import. In both cases the OCR integrity was verified successfully confirming that both procedures can be used with setups where OCR is based on ASM disk groups.

Annex

 

Output from raclinux2

[root@raclinux2 bin]# ./crsctl stop crs

CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on ‘raclinux2’

CRS-2673: Attempting to stop ‘ora.crsd’ on ‘raclinux2’

CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on ‘raclinux2’

CRS-2673: Attempting to stop ‘ora.repl.main.sec.sec.acfs’ on ‘raclinux2’

CRS-2673: Attempting to stop ‘ora.repl.main.prim.prim.acfs’ on ‘raclinux2’

CRS-2673: Attempting to stop ‘ora.LISTENER_SCAN1.lsnr’ on ‘raclinux2’

CRS-2673: Attempting to stop ‘ora.cvu’ on ‘raclinux2’

CRS-2673: Attempting to stop ‘ora.repl.init.prim.prim.acfs’ on ‘raclinux2’

CRS-2673: Attempting to stop ‘ora.LISTENER.lsnr’ on ‘raclinux2’

CRS-2673: Attempting to stop ‘ora.DGDUP1.dg’ on ‘raclinux2’

CRS-2673: Attempting to stop ‘ora.DGDUP2.dg’ on ‘raclinux2’

CRS-2673: Attempting to stop ‘ora.PRIM.dg’ on ‘raclinux2’

CRS-2673: Attempting to stop ‘ora.SEC.dg’ on ‘raclinux2’

CRS-2673: Attempting to stop ‘ora.registry.acfs’ on ‘raclinux2’

CRS-2673: Attempting to stop ‘ora.racdb.db’ on ‘raclinux2’

CRS-2673: Attempting to stop ‘ora.repl.apply.sec.sec.acfs’ on ‘raclinux2’

CRS-2673: Attempting to stop ‘ora.oc4j’ on ‘raclinux2’

CRS-2677: Stop of ‘ora.LISTENER_SCAN1.lsnr’ on ‘raclinux2’ succeeded

CRS-2673: Attempting to stop ‘ora.scan1.vip’ on ‘raclinux2’

CRS-2677: Stop of ‘ora.scan1.vip’ on ‘raclinux2’ succeeded

CRS-2672: Attempting to start ‘ora.scan1.vip’ on ‘raclinux1’

CRS-2677: Stop of ‘ora.LISTENER.lsnr’ on ‘raclinux2’ succeeded

CRS-2673: Attempting to stop ‘ora.raclinux2.vip’ on ‘raclinux2’

CRS-2677: Stop of ‘ora.raclinux2.vip’ on ‘raclinux2’ succeeded

CRS-2672: Attempting to start ‘ora.raclinux2.vip’ on ‘raclinux1’

CRS-2677: Stop of ‘ora.cvu’ on ‘raclinux2’ succeeded

CRS-2672: Attempting to start ‘ora.cvu’ on ‘raclinux1’

CRS-2676: Start of ‘ora.scan1.vip’ on ‘raclinux1’ succeeded

CRS-2676: Start of ‘ora.raclinux2.vip’ on ‘raclinux1’ succeeded

CRS-2675: Stop of ‘ora.repl.init.prim.prim.acfs’ on ‘raclinux2’ failed

CRS-2679: Attempting to clean ‘ora.repl.init.prim.prim.acfs’ on ‘raclinux2’

CRS-2676: Start of ‘ora.cvu’ on ‘raclinux1’ succeeded

CRS-2675: Stop of ‘ora.repl.apply.sec.sec.acfs’ on ‘raclinux2’ failed

CRS-2679: Attempting to clean ‘ora.repl.apply.sec.sec.acfs’ on ‘raclinux2’

CRS-2681: Clean of ‘ora.repl.init.prim.prim.acfs’ on ‘raclinux2’ succeeded

CRS-2672: Attempting to start ‘ora.repl.init.prim.prim.acfs’ on ‘raclinux1’

CRS-2681: Clean of ‘ora.repl.apply.sec.sec.acfs’ on ‘raclinux2’ succeeded

CRS-2672: Attempting to start ‘ora.repl.apply.sec.sec.acfs’ on ‘raclinux1’

CRS-2676: Start of ‘ora.repl.init.prim.prim.acfs’ on ‘raclinux1’ succeeded

CRS-2677: Stop of ‘ora.racdb.db’ on ‘raclinux2’ succeeded

CRS-2673: Attempting to stop ‘ora.DGDUP.dg’ on ‘raclinux2’

CRS-2673: Attempting to stop ‘ora.DATA.dg’ on ‘raclinux2’

CRS-2676: Start of ‘ora.repl.apply.sec.sec.acfs’ on ‘raclinux1’ succeeded

CRS-2675: Stop of ‘ora.repl.main.prim.prim.acfs’ on ‘raclinux2’ failed

CRS-2679: Attempting to clean ‘ora.repl.main.prim.prim.acfs’ on ‘raclinux2’

CRS-2675: Stop of ‘ora.repl.main.sec.sec.acfs’ on ‘raclinux2’ failed

CRS-2679: Attempting to clean ‘ora.repl.main.sec.sec.acfs’ on ‘raclinux2’

CRS-2681: Clean of ‘ora.repl.main.prim.prim.acfs’ on ‘raclinux2’ succeeded

CRS-2672: Attempting to start ‘ora.repl.main.prim.prim.acfs’ on ‘raclinux1’

CRS-2681: Clean of ‘ora.repl.main.sec.sec.acfs’ on ‘raclinux2’ succeeded

CRS-2672: Attempting to start ‘ora.repl.main.sec.sec.acfs’ on ‘raclinux1’

CRS-2672: Attempting to start ‘ora.LISTENER_SCAN1.lsnr’ on ‘raclinux1’

CRS-2676: Start of ‘ora.repl.main.prim.prim.acfs’ on ‘raclinux1’ succeeded

CRS-2676: Start of ‘ora.repl.main.sec.sec.acfs’ on ‘raclinux1’ succeeded

CRS-2676: Start of ‘ora.LISTENER_SCAN1.lsnr’ on ‘raclinux1’ succeeded

CRS-2677: Stop of ‘ora.SEC.dg’ on ‘raclinux2’ succeeded

CRS-2677: Stop of ‘ora.registry.acfs’ on ‘raclinux2’ succeeded

CRS-2677: Stop of ‘ora.oc4j’ on ‘raclinux2’ succeeded

CRS-2677: Stop of ‘ora.DGDUP.dg’ on ‘raclinux2’ succeeded

CRS-2677: Stop of ‘ora.PRIM.dg’ on ‘raclinux2’ succeeded

CRS-2677: Stop of ‘ora.DGDUP2.dg’ on ‘raclinux2’ succeeded

CRS-2677: Stop of ‘ora.DGDUP1.dg’ on ‘raclinux2’ succeeded

CRS-2677: Stop of ‘ora.DATA.dg’ on ‘raclinux2’ succeeded

CRS-2673: Attempting to stop ‘ora.asm’ on ‘raclinux2’

CRS-2677: Stop of ‘ora.asm’ on ‘raclinux2’ succeeded

CRS-2673: Attempting to stop ‘ora.ons’ on ‘raclinux2’

CRS-2677: Stop of ‘ora.ons’ on ‘raclinux2’ succeeded

CRS-2673: Attempting to stop ‘ora.net1.network’ on ‘raclinux2’

CRS-2677: Stop of ‘ora.net1.network’ on ‘raclinux2’ succeeded

CRS-2792: Shutdown of Cluster Ready Services-managed resources on ‘raclinux2’ has completed

CRS-2677: Stop of ‘ora.crsd’ on ‘raclinux2’ succeeded

CRS-2673: Attempting to stop ‘ora.ctssd’ on ‘raclinux2’

CRS-2673: Attempting to stop ‘ora.evmd’ on ‘raclinux2’

CRS-2673: Attempting to stop ‘ora.asm’ on ‘raclinux2’

CRS-2673: Attempting to stop ‘ora.mdnsd’ on ‘raclinux2’

CRS-2673: Attempting to stop ‘ora.drivers.acfs’ on ‘raclinux2’

CRS-2677: Stop of ‘ora.drivers.acfs’ on ‘raclinux2’ succeeded

CRS-2677: Stop of ‘ora.asm’ on ‘raclinux2’ succeeded

CRS-2673: Attempting to stop ‘ora.cluster_interconnect.haip’ on ‘raclinux2’

CRS-2677: Stop of ‘ora.evmd’ on ‘raclinux2’ succeeded

CRS-2677: Stop of ‘ora.mdnsd’ on ‘raclinux2’ succeeded

CRS-2677: Stop of ‘ora.ctssd’ on ‘raclinux2’ succeeded

CRS-2677: Stop of ‘ora.cluster_interconnect.haip’ on ‘raclinux2’ succeeded

CRS-2673: Attempting to stop ‘ora.cssd’ on ‘raclinux2’

CRS-2677: Stop of ‘ora.cssd’ on ‘raclinux2’ succeeded

CRS-2673: Attempting to stop ‘ora.diskmon’ on ‘raclinux2’

CRS-2673: Attempting to stop ‘ora.crf’ on ‘raclinux2’

CRS-2677: Stop of ‘ora.diskmon’ on ‘raclinux2’ succeeded

CRS-2677: Stop of ‘ora.crf’ on ‘raclinux2’ succeeded

CRS-2673: Attempting to stop ‘ora.gipcd’ on ‘raclinux2’

CRS-2677: Stop of ‘ora.gipcd’ on ‘raclinux2’ succeeded

CRS-2673: Attempting to stop ‘ora.gpnpd’ on ‘raclinux2’

CRS-2677: Stop of ‘ora.gpnpd’ on ‘raclinux2’ succeeded

CRS-2793: Shutdown of Oracle High Availability Services-managed resources on ‘raclinux2’ has completed

CRS-4133: Oracle High Availability Services has been stopped.

[root@raclinux2 bin]#

Output from raclinux1

[root@raclinux1 bin]# ./crsctl stop crs

CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on ‘raclinux1’

CRS-2673: Attempting to stop ‘ora.crsd’ on ‘raclinux1’

CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on ‘raclinux1’

CRS-2673: Attempting to stop ‘ora.DGDUP1.dg’ on ‘raclinux1’

CRS-2673: Attempting to stop ‘ora.DGDUP2.dg’ on ‘raclinux1’

CRS-2673: Attempting to stop ‘ora.PRIM.dg’ on ‘raclinux1’

CRS-2673: Attempting to stop ‘ora.SEC.dg’ on ‘raclinux1’

CRS-2673: Attempting to stop ‘ora.registry.acfs’ on ‘raclinux1’

CRS-2673: Attempting to stop ‘ora.racdb.db’ on ‘raclinux1’

CRS-2673: Attempting to stop ‘ora.rone.racone.svc’ on ‘raclinux1’

CRS-2673: Attempting to stop ‘ora.repl.transport.sec.sec.acfs’ on ‘raclinux1’

CRS-2673: Attempting to stop ‘ora.repl.transport.prim.prim.acfs’ on ‘raclinux1’

CRS-2673: Attempting to stop ‘ora.LISTENER.lsnr’ on ‘raclinux1’

CRS-2677: Stop of ‘ora.LISTENER.lsnr’ on ‘raclinux1’ succeeded

CRS-2677: Stop of ‘ora.rone.racone.svc’ on ‘raclinux1’ succeeded

CRS-2673: Attempting to stop ‘ora.rone.db’ on ‘raclinux1’

CRS-2675: Stop of ‘ora.repl.transport.sec.sec.acfs’ on ‘raclinux1’ failed

CRS-2679: Attempting to clean ‘ora.repl.transport.sec.sec.acfs’ on ‘raclinux1’

CRS-2681: Clean of ‘ora.repl.transport.sec.sec.acfs’ on ‘raclinux1’ succeeded

CRS-2675: Stop of ‘ora.repl.transport.prim.prim.acfs’ on ‘raclinux1’ failed

CRS-2679: Attempting to clean ‘ora.repl.transport.prim.prim.acfs’ on ‘raclinux1’

CRS-2681: Clean of ‘ora.repl.transport.prim.prim.acfs’ on ‘raclinux1’ succeeded

CRS-2673: Attempting to stop ‘ora.raclinux2.vip’ on ‘raclinux1’

CRS-2677: Stop of ‘ora.raclinux2.vip’ on ‘raclinux1’ succeeded

CRS-2673: Attempting to stop ‘ora.cvu’ on ‘raclinux1’

CRS-2673: Attempting to stop ‘ora.raclinux1.vip’ on ‘raclinux1’

CRS-2677: Stop of ‘ora.raclinux1.vip’ on ‘raclinux1’ succeeded

CRS-2677: Stop of ‘ora.cvu’ on ‘raclinux1’ succeeded

CRS-2673: Attempting to stop ‘ora.repl.init.prim.prim.acfs’ on ‘raclinux1’

CRS-2675: Stop of ‘ora.repl.init.prim.prim.acfs’ on ‘raclinux1’ failed

CRS-2679: Attempting to clean ‘ora.repl.init.prim.prim.acfs’ on ‘raclinux1’

CRS-2681: Clean of ‘ora.repl.init.prim.prim.acfs’ on ‘raclinux1’ succeeded

CRS-2673: Attempting to stop ‘ora.repl.apply.sec.sec.acfs’ on ‘raclinux1’

CRS-2675: Stop of ‘ora.repl.apply.sec.sec.acfs’ on ‘raclinux1’ failed

CRS-2679: Attempting to clean ‘ora.repl.apply.sec.sec.acfs’ on ‘raclinux1’

CRS-2681: Clean of ‘ora.repl.apply.sec.sec.acfs’ on ‘raclinux1’ succeeded

CRS-2673: Attempting to stop ‘ora.repl.main.prim.prim.acfs’ on ‘raclinux1’

CRS-2677: Stop of ‘ora.rone.db’ on ‘raclinux1’ succeeded

CRS-2673: Attempting to stop ‘ora.repl.main.sec.sec.acfs’ on ‘raclinux1’

CRS-2677: Stop of ‘ora.racdb.db’ on ‘raclinux1’ succeeded

CRS-2673: Attempting to stop ‘ora.DGDUP.dg’ on ‘raclinux1’

CRS-2673: Attempting to stop ‘ora.DATA.dg’ on ‘raclinux1’

CRS-2675: Stop of ‘ora.repl.main.prim.prim.acfs’ on ‘raclinux1’ failed

CRS-2679: Attempting to clean ‘ora.repl.main.prim.prim.acfs’ on ‘raclinux1’

CRS-2681: Clean of ‘ora.repl.main.prim.prim.acfs’ on ‘raclinux1’ succeeded

CRS-2673: Attempting to stop ‘ora.LISTENER_SCAN1.lsnr’ on ‘raclinux1’

CRS-2677: Stop of ‘ora.LISTENER_SCAN1.lsnr’ on ‘raclinux1’ succeeded

CRS-2673: Attempting to stop ‘ora.scan1.vip’ on ‘raclinux1’

CRS-2677: Stop of ‘ora.scan1.vip’ on ‘raclinux1’ succeeded

CRS-2675: Stop of ‘ora.repl.main.sec.sec.acfs’ on ‘raclinux1’ failed

CRS-2679: Attempting to clean ‘ora.repl.main.sec.sec.acfs’ on ‘raclinux1’

CRS-2681: Clean of ‘ora.repl.main.sec.sec.acfs’ on ‘raclinux1’ succeeded

CRS-2677: Stop of ‘ora.registry.acfs’ on ‘raclinux1’ succeeded

CRS-2677: Stop of ‘ora.PRIM.dg’ on ‘raclinux1’ succeeded

CRS-2677: Stop of ‘ora.DGDUP.dg’ on ‘raclinux1’ succeeded

CRS-2677: Stop of ‘ora.SEC.dg’ on ‘raclinux1’ succeeded

CRS-2677: Stop of ‘ora.DGDUP1.dg’ on ‘raclinux1’ succeeded

CRS-2677: Stop of ‘ora.DGDUP2.dg’ on ‘raclinux1’ succeeded

CRS-2677: Stop of ‘ora.DATA.dg’ on ‘raclinux1’ succeeded

CRS-2673: Attempting to stop ‘ora.asm’ on ‘raclinux1’

CRS-2677: Stop of ‘ora.asm’ on ‘raclinux1’ succeeded

CRS-2673: Attempting to stop ‘ora.ons’ on ‘raclinux1’

CRS-2677: Stop of ‘ora.ons’ on ‘raclinux1’ succeeded

CRS-2673: Attempting to stop ‘ora.net1.network’ on ‘raclinux1’

CRS-2677: Stop of ‘ora.net1.network’ on ‘raclinux1’ succeeded

CRS-2792: Shutdown of Cluster Ready Services-managed resources on ‘raclinux1’ has completed

CRS-2677: Stop of ‘ora.crsd’ on ‘raclinux1’ succeeded

CRS-2673: Attempting to stop ‘ora.drivers.acfs’ on ‘raclinux1’

CRS-2673: Attempting to stop ‘ora.ctssd’ on ‘raclinux1’

CRS-2673: Attempting to stop ‘ora.evmd’ on ‘raclinux1’

CRS-2673: Attempting to stop ‘ora.asm’ on ‘raclinux1’

CRS-2673: Attempting to stop ‘ora.mdnsd’ on ‘raclinux1’

CRS-2677: Stop of ‘ora.drivers.acfs’ on ‘raclinux1’ succeeded

CRS-2677: Stop of ‘ora.asm’ on ‘raclinux1’ succeeded

CRS-2673: Attempting to stop ‘ora.cluster_interconnect.haip’ on ‘raclinux1’

CRS-2677: Stop of ‘ora.evmd’ on ‘raclinux1’ succeeded

CRS-2677: Stop of ‘ora.mdnsd’ on ‘raclinux1’ succeeded

CRS-2677: Stop of ‘ora.ctssd’ on ‘raclinux1’ succeeded

CRS-2677: Stop of ‘ora.cluster_interconnect.haip’ on ‘raclinux1’ succeeded

CRS-2673: Attempting to stop ‘ora.cssd’ on ‘raclinux1’

CRS-2677: Stop of ‘ora.cssd’ on ‘raclinux1’ succeeded

CRS-2673: Attempting to stop ‘ora.diskmon’ on ‘raclinux1’

CRS-2673: Attempting to stop ‘ora.crf’ on ‘raclinux1’

CRS-2677: Stop of ‘ora.crf’ on ‘raclinux1’ succeeded

CRS-2673: Attempting to stop ‘ora.gipcd’ on ‘raclinux1’

CRS-2677: Stop of ‘ora.diskmon’ on ‘raclinux1’ succeeded

CRS-2677: Stop of ‘ora.gipcd’ on ‘raclinux1’ succeeded

CRS-2673: Attempting to stop ‘ora.gpnpd’ on ‘raclinux1’

CRS-2677: Stop of ‘ora.gpnpd’ on ‘raclinux1’ succeeded

CRS-2793: Shutdown of Oracle High Availability Services-managed resources on ‘raclinux1’ has completed

CRS-4133: Oracle High Availability Services has been stopped.

[root@raclinux1 bin]#

Output from raclinux2

[root@raclinux2 bin]# ./crsctl start crs -excl

CRS-4123: Oracle High Availability Services has been started.

CRS-2672: Attempting to start ‘ora.mdnsd’ on ‘raclinux2’

CRS-2676: Start of ‘ora.mdnsd’ on ‘raclinux2’ succeeded

CRS-2672: Attempting to start ‘ora.gpnpd’ on ‘raclinux2’

CRS-2676: Start of ‘ora.gpnpd’ on ‘raclinux2’ succeeded

CRS-2672: Attempting to start ‘ora.cssdmonitor’ on ‘raclinux2’

CRS-2672: Attempting to start ‘ora.gipcd’ on ‘raclinux2’

CRS-2676: Start of ‘ora.cssdmonitor’ on ‘raclinux2’ succeeded

CRS-2676: Start of ‘ora.gipcd’ on ‘raclinux2’ succeeded

CRS-2672: Attempting to start ‘ora.cssd’ on ‘raclinux2’

CRS-2672: Attempting to start ‘ora.diskmon’ on ‘raclinux2’

CRS-2676: Start of ‘ora.diskmon’ on ‘raclinux2’ succeeded

CRS-2676: Start of ‘ora.cssd’ on ‘raclinux2’ succeeded

CRS-2672: Attempting to start ‘ora.ctssd’ on ‘raclinux2’

CRS-2672: Attempting to start ‘ora.drivers.acfs’ on ‘raclinux2’

CRS-2672: Attempting to start ‘ora.cluster_interconnect.haip’ on ‘raclinux2’

CRS-2676: Start of ‘ora.drivers.acfs’ on ‘raclinux2’ succeeded

CRS-2676: Start of ‘ora.ctssd’ on ‘raclinux2’ succeeded

CRS-2676: Start of ‘ora.cluster_interconnect.haip’ on ‘raclinux2’ succeeded

CRS-2672: Attempting to start ‘ora.asm’ on ‘raclinux2’

CRS-2676: Start of ‘ora.asm’ on ‘raclinux2’ succeeded

CRS-2672: Attempting to start ‘ora.crsd’ on ‘raclinux2’

CRS-2676: Start of ‘ora.crsd’ on ‘raclinux2’ succeeded

[root@raclinux2 bin]#

Output from raclinux2

[root@raclinux2 bin]# ./crsctl start crs -excl -nocrs

CRS-4123: Oracle High Availability Services has been started.

CRS-2672: Attempting to start ‘ora.mdnsd’ on ‘raclinux2’

CRS-2676: Start of ‘ora.mdnsd’ on ‘raclinux2’ succeeded

CRS-2672: Attempting to start ‘ora.gpnpd’ on ‘raclinux2’

CRS-2676: Start of ‘ora.gpnpd’ on ‘raclinux2’ succeeded

CRS-2672: Attempting to start ‘ora.cssdmonitor’ on ‘raclinux2’

CRS-2672: Attempting to start ‘ora.gipcd’ on ‘raclinux2’

CRS-2676: Start of ‘ora.cssdmonitor’ on ‘raclinux2’ succeeded

CRS-2676: Start of ‘ora.gipcd’ on ‘raclinux2’ succeeded

CRS-2672: Attempting to start ‘ora.cssd’ on ‘raclinux2’

CRS-2672: Attempting to start ‘ora.diskmon’ on ‘raclinux2’

CRS-2676: Start of ‘ora.diskmon’ on ‘raclinux2’ succeeded

CRS-2676: Start of ‘ora.cssd’ on ‘raclinux2’ succeeded

CRS-2672: Attempting to start ‘ora.drivers.acfs’ on ‘raclinux2’

CRS-2672: Attempting to start ‘ora.cluster_interconnect.haip’ on ‘raclinux2’

CRS-2672: Attempting to start ‘ora.ctssd’ on ‘raclinux2’

CRS-2676: Start of ‘ora.drivers.acfs’ on ‘raclinux2’ succeeded

CRS-2676: Start of ‘ora.ctssd’ on ‘raclinux2’ succeeded

CRS-2676: Start of ‘ora.cluster_interconnect.haip’ on ‘raclinux2’ succeeded

CRS-2672: Attempting to start ‘ora.asm’ on ‘raclinux2’

CRS-2676: Start of ‘ora.asm’ on ‘raclinux2’ succeeded

[root@raclinux2 bin]#

December 20, 2010 Posted by | oracle | 7 Comments

New truncate table feature (DROP ALL STORAGE) in Oracle 11gR2 11.2.0.2

New truncate table feature (DROP ALL STORAGE) in Oracle 11gR2 11.2.0.2

Starting with Oracle 11gR2 11.2.0.2 there is a new clause added to the truncate table SQL statement allowing to release the space allocated even for extents corresponding to the minextents storage clause. Prior to 11.2.0.2 truncate table statement with its different flavor of clauses was used to delete all the rows from the table and possibly release the space but up to the space allocated with minextents. Now in 11.2.0.2 a new clause DROP ALL STORAGE for the truncate table SQL statement allows releasing even the space allocated to store the extents specified by minextents storage clause. However this clause is a subject to the same restrictions that apply to the deferred segment creation. More on the deferred segment creation can be found in a previous post here.

Let’s create a table and see the new truncate table SQL statement feature. Notice in the example below that due to the deferred segment creation an extent is allocated only after the insert as the parameter deferred_segment_creation is set to true. It is only until when DROP ALL STORAGE is used than all extents are de-allocated and the space is released.


SQL> show parameter defer

NAME                                 TYPE        VALUE

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

deferred_segment_creation            boolean     TRUE

SQL>

SQL> create table mytest01 (col number) storage(initial 60k next 60k minextents 4 maxextents unlimited pctincrease 0);

Table created.

SQL> select segment_name, segment_type, extent_id,  bytes, blocks  from user_extents where segment_name = 'MYTEST01';

no rows selected

SQL> insert into mytest01 values (1);

1 row created.

SQL> commit;

Commit complete.

SQL>

SQL> truncate table mytest01 drop storage;       

Table truncated.

SQL> select segment_name, segment_type, extent_id,  bytes, blocks  from user_extents where segment_name = 'MYTEST01';

SEGMENT_NAME                                                                      SEGMENT_TYPE        EXTENT_ID      BYTES     BLOCKS

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

MYTEST01                                                                          TABLE                       0      65536          8

MYTEST01                                                                          TABLE                       1      65536          8

MYTEST01                                                                          TABLE                       2      65536          8

MYTEST01                                                                          TABLE                       3      65536          8

SQL>

SQL> insert into mytest01 values (1);

1 row created.

SQL> commit;

Commit complete.

SQL>

SQL> insert into mytest01 values (1);

1 row created.

SQL> commit;

Commit complete.

SQL> truncate table mytest01 reuse storage;

Table truncated.

SQL> select segment_name, segment_type, extent_id,  bytes, blocks  from user_extents where segment_name = 'MYTEST01';

SEGMENT_NAME                                                                      SEGMENT_TYPE        EXTENT_ID      BYTES     BLOCKS

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

MYTEST01                                                                          TABLE                       0      65536          8

MYTEST01                                                                          TABLE                       1      65536          8

MYTEST01                                                                          TABLE                       2      65536          8

MYTEST01                                                                          TABLE                       3      65536          8

SQL>

SQL> truncate table mytest01;

Table truncated.

SQL> select segment_name, segment_type, extent_id,  bytes, blocks  from user_extents where segment_name = 'MYTEST01';

SEGMENT_NAME                                                                      SEGMENT_TYPE        EXTENT_ID      BYTES     BLOCKS

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

MYTEST01                                                                          TABLE                       0      65536          8

MYTEST01                                                                          TABLE                       1      65536          8

MYTEST01                                                                          TABLE                       2      65536          8

MYTEST01                                                                          TABLE                       3      65536          8

SQL>

SQL> truncate table mytest01 drop all storage;

Table truncated.

SQL> select segment_name, segment_type, extent_id,  bytes, blocks  from user_extents where segment_name = 'MYTEST01';

no rows selected

SQL>

 

December 4, 2010 Posted by | oracle | 2 Comments

Oracle Data Guard 11g Release 2 with Oracle Enterprise Manager 11g Grid Control

Oracle Data Guard 11g Release 2 with Oracle Enterprise Manager 11g Grid Control

Presentation Managing Oracle Data Guard 11g Release 2 with Oracle Enterprise Manager 11g Grid Control
can be downloaded from DataGuard25August .  Related post can be found here.


December 4, 2010 Posted by | oracle | Leave a comment

Oracle 11gR2 ACFS Replication – New feature in 11.2.0.2

Oracle 11gR2 ACFS Replication – New feature in 11.2.0.2

We will look at how to implement an ACFS replication in a two node cluster. We have a two node RAC cluster running OEL 5.4 and Oracle 11.2.0.2 GI and RDBMS. Oracle with 11.2.0.2 extends the concept of standby database to further support an asynchronous replication of ACFS from a designated primary ACFS file system to a secondary ACFS file system. This functionality provides disaster recovery by replicating an ACFS file systems across the network. The Concepts of an ACFS Replication, limitations and prerequisites are described in the Oracle documentation available here. In a nutshell we have a primary site ACFS file system and a secondary site ACFS file system that serves as a disaster recovery standby site that is used for protection. Both clustered and standalone single node ACFS can be used for replication. We simply designate one source ACFS as a primary and the target ACFS file system is the standby ACFS file system. For detailed information related to ACFS look at the post for ACFS here.

Some of the present limitations are as follows.

  • There is presently only one standby site supported for a given primary files system.
  • Only up to 8 nodes in a cluster can mount a file system.
  • There is no support for ACFS file systems with encryption or ACFS security.

 

The idea of ACFS replication as implemented as capture of the changes on the primary ACFS file system into log change files on the primary site, transferring the changes to similar log change files to the standby site and applying the changes from the logs to the standby ACFS file system. After the application of the changes the log files are purged. In order to successfully implement the ACFS Replication the ACFS file systems need to be properly sized to accommodate the changes and the network used for transferring the log should have a sufficient bandwidth. The acfsutl utility can be ran to gather for a period of time statistics for the volume of change(MB) and rate of change MB/S as specified here. This is necessary to start with properly sized ACFS file system sufficient for the replication. Also the network bandwidth is important for the replication.

For the ACFS to maintain replication version 11gR2 11.2.0.2 is required to be installed and the disk groups the ACFS file systems are based on should be created with both compatible.ASM=11.2.0.2 and compatible.ADVM=11.2.0.2 attributes. I have pre-created two groups PRIM and SEC in the two node cluster with both compatible attributes set. I have created /u05 ACFS based on PRIM data group and /u06 ACFS based on the SEC data group. The ACFS /u05 will be the primary and ACFS /u06 will be the standby.

ASMCA can be used to create the disk groups with the attributes required.


The same for the disk group the will serve as a foundation for the standby ACFS.


Here are the final ACFS file systems ( /u05 and /u06). Please note that they are mounted on both nodes of the cluster.


The following queries can be used to verify that those two attributes are set.

SELECT dg.name AS diskgroup, SUBSTR(a.name,1,18) AS name,
     SUBSTR(a.value,1,24) AS value, read_only FROM V$ASM_DISKGROUP dg,
     V$ASM_ATTRIBUTE a WHERE dg.name = 'PRIM'
     AND dg.group_number = a.group_number;

DISKGROUP                      NAME               VALUE
------------------------------ ------------------ ------------------------
READ_ON
-------
PRIM                           template.FLASHBACK 0
N
{snipped}
PRIM                           compatible.asm     11.2.0.2.0
N
DISKGROUP                      NAME               VALUE
------------------------------ ------------------ ------------------------
READ_ON
-------
PRIM                           compatible.rdbms   10.1.0.0.0
N

PRIM                           compatible.advm    11.2.0.2.0
N

PRIM                           cell.smart_scan_ca FALSE
N

{snipped}
DISKGROUP                      NAME               VALUE
------------------------------ ------------------ ------------------------
READ_ON
-------
PRIM                           template.CHANGETRA 0
N
76 rows selected.

SQL>

 

If the groups are already create make sure that those compatibility attributes are set using ‘ALTER DISKGROUP ..’ command.

Although up to eight cluster nodes are supported to mount the ACFS on the primary site, during the initial set up the primary ACFS site needs to be mounted by only one node. In our paper we will have /u05 and /u06 ACFS file system mounted on the two nodes of the cluster. ACFS based on /u05 will be primary ACFS and /u06 will be the standby ( secondary ) ACFS. The following commands will be used for mount and umount.

/bin/umount /dev/asm/prim-481 # Unmount on raclinux1,raclinux2

/bin/mount -t acfs /dev/asm/prim-481 /u05 # Mount on raclinux1,raclinux2

/bin/mount -t acfs /dev/asm/sec-351 /u06 # Mount on raclinux1,raclinux2

/bin/umount /dev/asm/sec-351 # Mount on on raclinux1,raclinux2

/sbin/mount.acfs -o all # Mount all on raclinux1, raclinux2

 

 

Let’s start the preparation.

  1. Create a user on the ASM that is granted both sysasm and sysadm privileges. In this case an user named oracle is created and a password is specified as oracle.
  2. Create a service for the primary and the secondary site.

     

    SQL> show parameter service
    
    NAME                                 TYPE        VALUE
    ------------------------------------ ----------- ------------------------------
    service_names                        string      +ASM, sec, prim, sec, prim
    SQL>
    
    [oracle@raclinux1 admin]$ cat tnsnames.ora
    # tnsnames.ora Network Configuration File: /u01/app/11.2.0.2/grid/network/admin/tnsnames.ora
    # Generated by Oracle configuration tools.
    SEC =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = TCP)(HOST = rac-san)(PORT = 1521))
        )
        (CONNECT_DATA =
          (SERVICE_NAME = SEC)
        )
      )
    
    PRIM =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = TCP)(HOST = rac-scan)(PORT = 1521))
        )
        (CONNECT_DATA =
          (SERVICE_NAME = PRIM)
        )
      )
    
    [oracle@raclinux1 admin]$
    
    [oracle@raclinux1 admin]$ lsnrctl status
    
    LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 03-DEC-2010 14:50:50
    
    Copyright (c) 1991, 2010, Oracle.  All rights reserved.
    
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
    STATUS of the LISTENER
    ------------------------
    Alias                     LISTENER
    Version                   TNSLSNR for Linux: Version 11.2.0.2.0 - Production
    Start Date                03-DEC-2010 11:52:16
    Uptime                    0 days 2 hr. 58 min. 34 sec
    Trace Level               off
    Security                  ON: Local OS Authentication
    SNMP                      OFF
    Listener Parameter File   /u01/app/11.2.0.2/grid/network/admin/listener.ora
    Listener Log File         /u01/app/oracle/diag/tnslsnr/raclinux1/listener/alert/log.xml
    Listening Endpoints Summary...
      (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
      (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.20.21)(PORT=1521)))
      (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.20.51)(PORT=1521)))
    Services Summary...
    Service "+ASM" has 1 instance(s).
      Instance "+ASM1", status READY, has 1 handler(s) for this service...
    Service "RACDB" has 1 instance(s).
      Instance "RACDB1", status READY, has 1 handler(s) for this service...
    Service "RACDBXDB" has 1 instance(s).
      Instance "RACDB1", status READY, has 1 handler(s) for this service...
    Service "RACONE" has 1 instance(s).
      Instance "RONE_1", status READY, has 1 handler(s) for this service...
    Service "RONE" has 1 instance(s).
      Instance "RONE_1", status READY, has 1 handler(s) for this service...
    Service "RONEXDB" has 1 instance(s).
      Instance "RONE_1", status READY, has 1 handler(s) for this service...
    Service "prim" has 1 instance(s).
      Instance "+ASM1", status READY, has 1 handler(s) for this service...
    Service "sec" has 1 instance(s).
      Instance "+ASM1", status READY, has 1 handler(s) for this service...
    The command completed successfully
    [oracle@raclinux1 admin]$
    
  3. Initiate the standby ACFS while as root executing /sbin/acfsutil init standby command as follows.

     

    [root@raclinux1 bin]#

    [root@raclinux1 bin]# /sbin/acfsutil repl init standby -p oracle/oracle@prim -c sec /u06

    [root@raclinux1 bin]#

    [root@raclinux1 bin]#

    Where prim is the service created in bullet two and oracle is the user created in bullet one. Note that before starting the initiation the standby and primary site we need to have the ACFS mounted on only one node that is we need to dismount the both /u05 and /u06 on raclinux2 node.

  4. Initiate the primary ACFS while as root executing /sbin/acfsutil init primary command as follows.

     

    [root@raclinux1 bin]#

    [root@raclinux1 bin]# /sbin/acfsutil repl init primary -s oracle/oracle@sec -m /u06 -c prim /u05

    validating the remote connection

    validating the remote connection

    validating the remote connection

    acfsutil repl init: ACFS-05050: remote connection cannot be established

    acfsutil repl init: ACFS-05052: standby replication site requires reinitialization

    [root@raclinux1 bin]# /sbin/acfsutil repl init standby -p oracle/oracle@prim -c sec /u06

    [root@raclinux1 bin]#

    [root@raclinux1 bin]# /sbin/acfsutil repl init primary -s oracle/oracle@sec -m /u06 -c prim /u05

    remote connection has been established

    Registering with user specified service name-prim

    waiting for the standby replication site to initialize

    waiting for the standby replication site to initialize

    The standby replication site is initialized. ACFS replication will begin.

    [root@raclinux1 bin]#

    Note in red is the correct execution. If the service or the user is not properly created the process will have to start all over again from bullet 1.

  5. Step 4 starts the processes for ACFS replication and we can use already the ACFS replication. The replication can be validated and configuration checked with the following commands.

     

    [root@raclinux1 bin]# /sbin/acfsutil repl info -c -v /u06

    Site: Standby

    Standby status: Online

    Standby mount point: /u06

    Standby Oracle Net service name: sec

    Primary mount point: /u05

    Primary Oracle Net service name: PRIM

    Primary Oracle Net alias: oracle/****@prim

    Replicated tags:

    Log compression: Off

    Debug log level: 0

     

    [root@raclinux1 bin]#

     

    [root@raclinux1 bin]# /sbin/acfsutil repl bg info /u06

    Resource: ora.repl.transport.sec.sec.acfs

    Target State: ONLINE

    Current State: ONLINE on raclinux1

     

    Resource: ora.repl.main.sec.sec.acfs

    Target State: ONLINE

    Current State: ONLINE on raclinux1

     

    Resource: ora.repl.apply.sec.sec.acfs

    Target State: ONLINE

    Current State: ONLINE on raclinux1

     

  6. Mount primary and standby ACFS on all node of the cluster the cluster.

 

Let’s test the ACFS replication by creating a file on the primary site and re-synchronizing the standby site. On the node raclinux1 create a file on the primary /u05 ACFS.

[oracle@raclinux1 u05]$ dd if=/dev/zero of=/u05/test.dmp bs=1M count=1024

1024+0 records in

1024+0 records out

1073741824 bytes (1.1 GB) copied, 198.774 seconds, 5.4 MB/s

[oracle@raclinux1 u05]$ ls -l

total 1050688

drwx—— 2 root root 65536 Dec 3 12:28 lost+found

-rw-r–r– 1 oracle oinstall 1073741824 Dec 3 15:03 test.dmp

[oracle@raclinux1 u05]$

[root@raclinux1 bin]# /sbin/acfsutil repl sync apply /u05

[root@raclinux1 bin]#

The above created a file in the primary /u05 and resynchronized the standby /u06. As a result the file is present on the standby ACFS /u06 and the status of the synchronization are as follows.

[root@raclinux1 bin]# /sbin/acfsutil repl info -s -v /u05

 

——————————————————-

Fri Dec 3 14:49:52 2010 – Fri Dec 3 15:47:23 2010

——————————————————-

Data replicated: 1.01GB

From writes: 1.01GB

From memory mapped updates: 0.00GB

File operations replicated: 7

Avg. rate of data replication: 17.98MB/minute

Avg. rate of file op. replication: 0.12/minute

 

Avg. time from capture to apply: 00:01:36

Min. time from capture to apply: 00:00:04

Max. time from capture to apply: 00:04:23

 

Last rlog capture to apply: 00:00:04

Last rlog apply time: Fri Dec 3 15:47:12 2010

 

Avg. time before rlog transport: 00:00:29

Min. time before rlog transport: 00:00:00

Max. time before rlog transport: 00:03:12

 

Avg. time to transport rlog: 00:00:44

Min. time to transport rlog: 00:00:00

Max. time to transport rlog: 00:03:11

 

Avg. time before rlog preprocessing: 00:00:03

Min. time before rlog preprocessing: 00:00:01

Max. time before rlog preprocessing: 00:00:08

 

Avg. time for rlog preprocessing: 00:00:00

Min. time for rlog preprocessing: 00:00:00

Max. time for rlog preprocessing: 00:00:01

 

Avg. time before applying rlog changes: 00:00:05

Min. time before applying rlog changes: 00:00:01

Max. time before applying rlog changes: 00:00:22

 

Avg. time to apply rlog changes: 00:00:12

Min. time to apply rlog changes: 00:00:00

Max. time to apply rlog changes: 00:01:16

 

Avg. time from apply to receipt: 00:00:10

Max time from apply to receipt: 00:00:19

Min time from apply to receipt: 00:00:06

 

[root@raclinux1 bin]#

 

Let’s test now creating file on both nodes on the cluster.

On node raclinux1 create the following files.

[oracle@raclinux1 u06]$ dd if=/dev/zero of=/u05/test2.dmp bs=1M count=10

10+0 records in

10+0 records out

10485760 bytes (10 MB) copied, 0.104704 seconds, 100 MB/s

[oracle@raclinux1 u06]$ ls

lost+found test2.dmp test.dmp

[oracle@raclinux1 u06]$ dd if=/dev/zero of=/u05/test3.dmp bs=1M count=1024

1024+0 records in

1024+0 records out

1073741824 bytes (1.1 GB) copied, 245.041 seconds, 4.4 MB/s

[oracle@raclinux1 u06]$

 

On node raclinux2 create the following files.

[root@raclinux2 ~]# dd if=/dev/zero of=/u05/test5.dmp bs=1M count=1024

1024+0 records in

1024+0 records out

1073741824 bytes (1.1 GB) copied, 324.003 seconds, 3.3 MB/s

[root@raclinux2 ~]# dd if=/dev/zero of=/u05/test6.dmp bs=1M count=1024

1024+0 records in

1024+0 records out

1073741824 bytes (1.1 GB) copied, 198.966 seconds, 5.4 MB/s

[root@raclinux2 ~]#

 

On node raclinux1 performed synchronization of the standby ACFS and verified that the files are present on the standby ACFS file system.

[root@raclinux1 bin]# /sbin/acfsutil repl info -s -v /u05

 

——————————————————-

Fri Dec 3 14:49:52 2010 – Fri Dec 3 16:32:57 2010

——————————————————-

Data replicated: 5.01GB

From writes: 5.01GB

From memory mapped updates: 0.00GB

File operations replicated: 11

Avg. rate of data replication: 49.77MB/minute

Avg. rate of file op. replication: 0.11/minute

 

Avg. time from capture to apply: 00:02:52

Min. time from capture to apply: 00:00:02

Max. time from capture to apply: 00:11:16

 

Last rlog capture to apply: 00:00:14

Last rlog apply time: Fri Dec 3 16:32:46 2010

 

Avg. time before rlog transport: 00:00:32

Min. time before rlog transport: 00:00:00

Max. time before rlog transport: 00:03:12

 

Avg. time to transport rlog: 00:01:04

Min. time to transport rlog: 00:00:00

Max. time to transport rlog: 00:03:11

 

Avg. time before rlog preprocessing: 00:00:04

Min. time before rlog preprocessing: 00:00:01

Max. time before rlog preprocessing: 00:00:27

 

Avg. time for rlog preprocessing: 00:00:00

Min. time for rlog preprocessing: 00:00:00

Max. time for rlog preprocessing: 00:00:02

 

Avg. time before applying rlog changes: 00:00:18

Min. time before applying rlog changes: 00:00:01

Max. time before applying rlog changes: 00:02:31

 

Avg. time to apply rlog changes: 00:00:45

Min. time to apply rlog changes: 00:00:00

Max. time to apply rlog changes: 00:06:51

 

Avg. time from apply to receipt: 00:00:11

Max time from apply to receipt: 00:00:19

Min time from apply to receipt: 00:00:06

 

[root@raclinux1 bin]#

 

ACFS Replication management

After ACFS replication was configured and tested we can look at some useful commands to check configuration, start and stop replication and pause and resume replication.

  1. Check replication configuration

     

    [root@raclinux1 bin]# /sbin/acfsutil repl info -c -v /u06

    Site: Standby

    Standby status: Online

    Standby mount point: /u06

    Standby Oracle Net service name: sec

    Primary mount point: /u05

    Primary Oracle Net service name: PRIM

    Primary Oracle Net alias: oracle/****@prim

    Replicated tags:

    Log compression: Off

    Debug log level: 0

    [root@raclinux1 bin]# /sbin/acfsutil repl info -c -v /u05

    Site: Primary

    Primary status: Online

    Primary mount point: /u05

    Primary Oracle Net service name: prim

    Standby mount point: /u06

    Standby Oracle Net service name: SEC

    Standby Oracle Net alias: oracle/****@sec

    Replicated tags:

    Log compression: Off

    Debug log level: 2

    [root@raclinux1 bin]# /sbin/acfsutil repl bg info /u06

    Resource: ora.repl.transport.sec.sec.acfs

    Target State: ONLINE

    Current State: ONLINE on raclinux1

    Resource: ora.repl.main.sec.sec.acfs

    Target State: ONLINE

    Current State: ONLINE on raclinux1

    Resource: ora.repl.apply.sec.sec.acfs

    Target State: ONLINE

    Current State: ONLINE on raclinux1

  2. Start and Stop replication. Although ACFS replication is automatically started after initiation and registered with Grid Infrastructure as a resource for automatic restart the acfsutil repl bg command can be used to start and stop the background processes and daemons implementing the replication.

     

    [root@raclinux1 bin]# /sbin/acfsutil repl bg stop /u06

    [root@raclinux1 bin]# /sbin/acfsutil repl bg start /u06

  3. Suspending and resuming ACFS replication. ACFS replication can be manually suspended and resumed. Prior to pausing the replication the sync must be executed. Pausing and resuming ACFS replication are done using the acfsuti repl [ pause | resume] /standby_fs command. Here we are going to suspend replication, resume replication create a file in the primary ACFS to synchronize with the standby ACFS file system.

     

    [root@raclinux1 bin]# sync

    [root@raclinux1 bin]# /sbin/acfsutil repl pause /u06

    [root@raclinux1 bin]# /sbin/acfsutil repl info -s -v /u05

    ——————————————————-

    Fri Dec 3 14:49:52 2010 – Fri Dec 3 16:44:18 2010

    ——————————————————-

    Data replicated: 5.01GB

    From writes: 5.01GB

    From memory mapped updates: 0.00GB

    File operations replicated: 11

    Avg. rate of data replication: 44.83MB/minute

    Avg. rate of file op. replication: 0.10/minute

    Avg. time from capture to apply: 00:02:52

    Min. time from capture to apply: 00:00:02

    Max. time from capture to apply: 00:11:16

    Last rlog capture to apply: 00:00:14

    Last rlog apply time: Fri Dec 3 16:32:46 2010

    Avg. time before rlog transport: 00:00:32

    Min. time before rlog transport: 00:00:00

    Max. time before rlog transport: 00:03:12

    Avg. time to transport rlog: 00:01:04

    Min. time to transport rlog: 00:00:00

    Max. time to transport rlog: 00:03:11

    Avg. time before rlog preprocessing: 00:00:04

    Min. time before rlog preprocessing: 00:00:01

    Max. time before rlog preprocessing: 00:00:27

    Avg. time for rlog preprocessing: 00:00:00

    Min. time for rlog preprocessing: 00:00:00

    Max. time for rlog preprocessing: 00:00:02

    Avg. time before applying rlog changes: 00:00:18

    Min. time before applying rlog changes: 00:00:01

    Max. time before applying rlog changes: 00:02:31

    Avg. time to apply rlog changes: 00:00:45

    Min. time to apply rlog changes: 00:00:00

    Max. time to apply rlog changes: 00:06:51

    Avg. time from apply to receipt: 00:00:11

    Max time from apply to receipt: 00:00:19

    Min time from apply to receipt: 00:00:06

    [root@raclinux1 bin]#

    [root@raclinux1 bin]# /sbin/acfsutil repl pause /u06

    acfsutil repl pause: ACFS-05066: ACFS replication is already paused

    [root@raclinux1 bin]# /sbin/acfsutil repl resume /u06

    [root@raclinux1 bin]#

    ## Create another 1GB file on /u05

    [root@raclinux1 bin]# /sbin/acfsutil repl sync /u05

    [root@raclinux1 bin]# /sbin/acfsutil repl sync apply /u05

    [root@raclinux1 bin]# /sbin/acfsutil repl info -s -v /u05

    ——————————————————-

    Fri Dec 3 14:49:52 2010 – Fri Dec 3 16:56:55 2010

    ——————————————————-

    Data replicated: 6.01GB

    From writes: 6.01GB

    From memory mapped updates: 0.00GB

    File operations replicated: 19

    Avg. rate of data replication: 48.44MB/minute

    Avg. rate of file op. replication: 0.15/minute

    Avg. time from capture to apply: 00:03:06

    Min. time from capture to apply: 00:00:02

    Max. time from capture to apply: 00:11:16

    Last rlog capture to apply: 00:00:49

    Last rlog apply time: Fri Dec 3 16:57:29 2010

    Avg. time before rlog transport: 00:00:31

    Min. time before rlog transport: 00:00:00

    Max. time before rlog transport: 00:03:12

    Avg. time to transport rlog: 00:00:50

    Min. time to transport rlog: 00:00:00

    Max. time to transport rlog: 00:03:11

    Avg. time before rlog preprocessing: 00:00:19

    Min. time before rlog preprocessing: 00:00:01

    Max. time before rlog preprocessing: 00:00:50

    Avg. time for rlog preprocessing: 00:00:00

    Min. time for rlog preprocessing: 00:00:00

    Max. time for rlog preprocessing: 00:00:05

    Avg. time before applying rlog changes: 00:00:47

    Min. time before applying rlog changes: 00:00:00

    Max. time before applying rlog changes: 00:03:52

    Avg. time to apply rlog changes: 00:00:35

    Min. time to apply rlog changes: 00:00:00

    Max. time to apply rlog changes: 00:06:51

    Avg. time from apply to receipt: 00:00:07

    Max time from apply to receipt: 00:00:19

    Min time from apply to receipt: 00:00:00

    [root@raclinux1 bin]#

    The file is create d in /u05 and propagated to /u06 after the replication is restarted and standby ACFS is resynchronized.

  4. Miscellaneous commands for ACFS replication. Look at acfsutil repl command.

     

Summary:

In the paper we looked at the new feature for ACFS replication introduced in Oracle 11gR2 11.2.0.2. We covered the concept of the ACFS replication based on replication logs on both primary and standby file system sites and network based change transfer from primary to standby ACFS. After Highlighting the prerequisites for ACFS replication we step by step implemented ACFS replication and demoed some basic commands for management and monitoring.

 

 

 

 

 

December 4, 2010 Posted by | oracle | Leave a comment