RE: RMAN level 0 hot backup and archive logs

From: Ruel, Chris <Chris.Ruel_at_lfg.com>
Date: Tue, 5 Jan 2016 16:06:10 +0000
Message-ID: <1AFD62082EEAF0448EF1815139687F133DB041AE_at_NC2PWEX504.us.ad.lfg.com>



Scott and I work together (previous response) and were typing at the same time…let me add a few more details for what we do…

We use this particular backup command to get a “complete” backup with all archivelogs packaged in.

It does a switch log, then backs up the archivelogs It then backs up the database
Finally, it backups up the archivelogs again

…all in one nice command (I am leaving out all the korn shell stuff):

rman << EOF
spool log to ${RMAN_LOG} append;
connect target /
run {
backup as compressed backupset incremental level 0 database tag=level0 include current controlfile plus archivelog tag=archive_bak; delete noprompt obsolete device type disk; sql 'alter database backup controlfile to trace';
}

spool log off
EOF
}

Then, we follow that up with something like this to get it all to tape, leaving one copy in our FRA:

rman << EOF
spool log to ${RMAN_LOG} append;
connect target /
run {
allocate channel sbt1 type sbt parms 'ENV=(TDPO_OPTFILE=${TDPO_HOME}/tdpo_${ORACLE_DB_NAME}.opt)'; allocate channel sbt2 type sbt parms 'ENV=(TDPO_OPTFILE=${TDPO_HOME}/tdpo_${ORACLE_DB_NAME}.opt)';

backup backupset all;
release channel sbt1;
release channel sbt2;

}

run {
delete noprompt obsolete redundancy 1 device type disk;
}

spool log off
EOF
}

It then, looks like this this:

RMAN> list backup summary;

List of Backups


Key         TY LV S Device Type Completion Time      #Pieces #Copies Compressed Tag
-------     -- -- - ----------- -------------------- ------- ------- ---------- ---
13164744979 B  A  A SBT_TAPE    29-DEC-2015 21:31:35 1       1       YES        ARCHIVE_BAK
13164744980 B  A  A SBT_TAPE    29-DEC-2015 21:31:54 1       1       YES        ARCHIVE_BAK
13164744981 B  0  A *           29-DEC-2015 21:49:12 3       2       YES        LEVEL0
13164744982 B  0  A SBT_TAPE    29-DEC-2015 21:49:15 1       1       YES        LEVEL0
13164744983 B  0  A *           29-DEC-2015 21:51:31 3       2       YES        LEVEL0
13164744984 B  A  A *           29-DEC-2015 21:51:50 1       2       YES        ARCHIVE_BAK
13164744985 B  F  A SBT_TAPE    29-DEC-2015 21:51:58 1       1       NO         TAG20151229T215158

Clarifications:

Device type “*” means it’s on tape and disk: We always keep a copy in the FRA for faster recover if needed). Hence: delete noprompt obsolete redundancy 1 device type disk; Can’t seem to override the tag (TAG20151229T215158) that Oracle automatically creates for the control/spfile backup. The LEVEL0 that is only on tape (not disk as well) is because the delete obsolete removed that one from disk in favor of (TAG20151229T215158).

Chris..



Chris Ruel * Oracle Database Administrator * Lincoln Financial Group cruel_at_lfg.com<mailto:cruel_at_lfg.com> * Desk:317.759.2172 * Cell 317.523.8482

From: oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Kenneth Fowler Sent: Tuesday, January 05, 2016 10:34 AM To: Oracle-L_at_FreeLists.org
Subject: RMAN level 0 hot backup and archive logs

Hi All,

We currently have a backup script that executes RMAN level 0 backups once per week and level 1 backups every other day. The code is generated dynamically via a shell script and is then executed. Here is a recent example of a level 0 backup that was executed...

    sql 'alter system checkpoint';
    backup as compressed backupset incremental level 0     format '/opt/oracle/backup/bioocld1/sets/2016-01-02_211929_lev0/2016-01-02_211929_lev0_%s_%p'     database;
    alter system switch logfile;
    alter database backup controlfile to '/opt/oracle/backup/bioocld1/sets/2016-01-02_211929_lev0/2016-01-02_211929_ctl_bk';

Archive log backups are not currently included and are backed up via a separate process however I want to change this slightly. I would like the level 0 backup sets to also include the minimal set of archive logs needed to recover the backup. The reason being is that sometimes we might need to take a copy of a recent level 0 backup and archive it and we will want to be able to restore and recover at some future time when the archive logs are no longer on disk. I guess I can query v$log to get the current archive log sequence before the backup starts and use "backup archivelog from sequence nnn" after the database backup but wondering if there is already some RMAN functionality/syntax that I can use to achieve the same?

Thanks,
Ken.
Notice of Confidentiality: **This E-mail and any of its attachments may contain Lincoln National Corporation proprietary information, which is privileged, confidential, or subject to copyright belonging to the Lincoln National Corporation family of companies. This E-mail is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient of this E-mail, you are hereby notified that any dissemination, distribution, copying, or action taken in relation to the contents of and attachments to this E-mail is strictly prohibited and may be unlawful. If you have received this E-mail in error, please notify the sender immediately and permanently delete the original and any copy of this E-mail and any printout. Thank You.**

--
http://www.freelists.org/webpage/oracle-l
Received on Tue Jan 05 2016 - 17:06:10 CET

Original text of this message