Archivelog-Modus in RAC aktivieren

Die Aktivierung des Archivelog-Modus einer in RAC-Umgebung ist etwas anders, als bei einer Single-Instanzdatenbank. In diesem Beispiel wird der Archivelog-Modus mit der Fastrecovery Area aktiviert, die auf einem NFS-Laufwerk liegt.

 [oracle@rac1 racdisk]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Thu Apr 12 12:34:57 2012

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

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options

SQL> show parameter db_recovery_file_dest

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest                string
db_recovery_file_dest_size           big integer 0

SQL> alter system set db_recovery_file_dest_size=5G;

System altered.

SQL> alter system set db_recovery_file_dest='/u01/racdisk/flash_recovery_area';

System altered.

SQL> archive log list
Database log mode              No Archive Mode
Automatic archival             Disabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     10
Current log sequence           11

Im nächsten Schritt wird der Parameter cluster_database für die Instanz, aus der der Archivelog-Modus aktiviert werden soll, auf FALSE gesetzt.

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

System altered.

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

 

Nach dem Setzen des Parameters werden alle Instanzen des Clusters heruntergefahren.

[oracle@rac1 racdisk]$ srvctl stop database -d orcl

Daraufhin wird die Instanz, aus der der Archivelog-Modus aktiviert wird, in die Mount-Fase gestartet und in den Archivelog-Modus gebracht.

[oracle@rac1 racdisk]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Thu Apr 12 12:35:45 2012

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

Connected to an idle instance.

SQL> startup mount
ORACLE instance started.

Total System Global Area  839282688 bytes
Fixed Size                  2217992 bytes
Variable Size             641730552 bytes
Database Buffers          192937984 bytes
Redo Buffers                2396160 bytes
Database mounted.
SQL> alter database archivelog;

Database altered.

Daraufhin wird der Parameter cluster_database wieder auf TRUE gesetzt und die Instanz heruntergefahren.

 

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

System altered.

SQL> shutdown immediate
ORA-01109: database not open

Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options

Zum Schluss können alle Instanzen wieder gestartet werden.

[oracle@rac1 racdisk]$ srvctl start database -d orcl
[oracle@rac1 racdisk]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Thu Apr 12 12:39:38 2012

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

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options

SQL> archive log list
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     10
Next log sequence to archive   11
Current log sequence           11

SQL> r
1* alter system switch logfile

System altered.

SQL> r
1* alter system switch logfile

System altered.

SQL> r
1* alter system switch logfile

System altered.

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

Nun sollte die Durchführung einer Online-Sicherung mit dem Recovery Manager möglich sein.

[oracle@rac1 racdisk]$ rman target /

Recovery Manager: Release 11.2.0.1.0 - Production on Thu Apr 12 12:43:16 2012

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

connected to target database: ORCL (DBID=1301895602)

RMAN> backup as compressed backupset database plus archivelog delete input;

Starting backup at 12-APR-12
current log archived
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=43 instance=orcl1 device type=DISK
channel ORA_DISK_1: starting compressed archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=2 sequence=7 RECID=3 STAMP=780410454
input archived log thread=1 sequence=11 RECID=1 STAMP=780410451
input archived log thread=1 sequence=12 RECID=2 STAMP=780410454
input archived log thread=1 sequence=13 RECID=4 STAMP=780410457
input archived log thread=2 sequence=8 RECID=6 STAMP=780410505
input archived log thread=1 sequence=14 RECID=5 STAMP=780410460
input archived log thread=1 sequence=15 RECID=9 STAMP=780410511
input archived log thread=2 sequence=9 RECID=7 STAMP=780410508
input archived log thread=2 sequence=10 RECID=8 STAMP=780410511
input archived log thread=2 sequence=11 RECID=11 STAMP=780410619
input archived log thread=1 sequence=16 RECID=10 STAMP=780410617
channel ORA_DISK_1: starting piece 1 at 12-APR-12
channel ORA_DISK_1: finished piece 1 at 12-APR-12
piece handle=/u01/racdisk/flash_recovery_area/ORCL/backupset/2012_04_12/o1_mf_annnn_TAG20120412T124348__80613b0.bkp tag=TAG20120412T124348 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: deleting archived log(s)
archived log file name=/u01/racdisk/flash_recovery_area/ORCL/archivelog/2012_04_12/o1_mf_2_7__fd90330c.arc RECID=3 STAMP=780410454
archived log file name=/u01/racdisk/flash_recovery_area/ORCL/archivelog/2012_04_12/o1_mf_1_11__fd57642a.arc RECID=1 STAMP=780410451
archived log file name=/u01/racdisk/flash_recovery_area/ORCL/archivelog/2012_04_12/o1_mf_1_12__fd8ea7d8.arc RECID=2 STAMP=780410454
archived log file name=/u01/racdisk/flash_recovery_area/ORCL/archivelog/2012_04_12/o1_mf_1_13__fdbb6a9b.arc RECID=4 STAMP=780410457
archived log file name=/u01/racdisk/flash_recovery_area/ORCL/archivelog/2012_04_12/o1_mf_2_8__98d187.arc RECID=6 STAMP=780410505
archived log file name=/u01/racdisk/flash_recovery_area/ORCL/archivelog/2012_04_12/o1_mf_1_14__fde927b8.arc RECID=5 STAMP=780410460
archived log file name=/u01/racdisk/flash_recovery_area/ORCL/archivelog/2012_04_12/o1_mf_1_15__f51c74.arc RECID=9 STAMP=780410511
archived log file name=/u01/racdisk/flash_recovery_area/ORCL/archivelog/2012_04_12/o1_mf_2_9__c5bc9f.arc RECID=7 STAMP=780410508
archived log file name=/u01/racdisk/flash_recovery_area/ORCL/archivelog/2012_04_12/o1_mf_2_10__f2de8c.arc RECID=8 STAMP=780410511
archived log file name=/u01/racdisk/flash_recovery_area/ORCL/archivelog/2012_04_12/o1_mf_2_11__765b12e.arc RECID=11 STAMP=780410619
archived log file name=/u01/racdisk/flash_recovery_area/ORCL/archivelog/2012_04_12/o1_mf_1_16__73f898f.arc RECID=10 STAMP=780410617
Finished backup at 12-APR-12

Starting backup at 12-APR-12
using channel ORA_DISK_1
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/racdisk/oradata/orcl/system01.dbf
input datafile file number=00002 name=/u01/racdisk/oradata/orcl/sysaux01.dbf
input datafile file number=00005 name=/u01/racdisk/oradata/orcl/example01.dbf
input datafile file number=00003 name=/u01/racdisk/oradata/orcl/undotbs01.dbf
input datafile file number=00006 name=/u01/racdisk/oradata/orcl/undotbs02.dbf
input datafile file number=00004 name=/u01/racdisk/oradata/orcl/users01.dbf
channel ORA_DISK_1: starting piece 1 at 12-APR-12
channel ORA_DISK_1: finished piece 1 at 12-APR-12
piece handle=/u01/racdisk/flash_recovery_area/ORCL/backupset/2012_04_12/o1_mf_nnndf_TAG20120412T124352__8355c18.bkp tag=TAG20120412T124352 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:15
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 12-APR-12
channel ORA_DISK_1: finished piece 1 at 12-APR-12
piece handle=/u01/racdisk/flash_recovery_area/ORCL/backupset/2012_04_12/o1_mf_ncsnf_TAG20120412T124352__ce58ca1.bkp tag=TAG20120412T124352 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 12-APR-12

Starting backup at 12-APR-12
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting compressed archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=17 RECID=13 STAMP=780410715
input archived log thread=2 sequence=12 RECID=12 STAMP=780410715
channel ORA_DISK_1: starting piece 1 at 12-APR-12
channel ORA_DISK_1: finished piece 1 at 12-APR-12
piece handle=/u01/racdisk/flash_recovery_area/ORCL/backupset/2012_04_12/o1_mf_annnn_TAG20120412T124517__d3ad5b1.bkp tag=TAG20120412T124517 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: deleting archived log(s)
archived log file name=/u01/racdisk/flash_recovery_area/ORCL/archivelog/2012_04_12/o1_mf_1_17__d214044.arc RECID=13 STAMP=780410715
archived log file name=/u01/racdisk/flash_recovery_area/ORCL/archivelog/2012_04_12/o1_mf_2_12__d1fd310.arc RECID=12 STAMP=780410715
Finished backup at 12-APR-12

RMAN>