Thinking Out Loud

June 29, 2013

RMAN using Substitution Variable

Filed under: 11g,RMAN — mdinh @ 5:11 am

bkupinc.rman

&1 = incremental level

&2 = tag

spool log to bkupinc&1_&2..log
connect target;
# maxopenfiles: ASM/striped 1; else 8
# 1 channel per tape drive for tape backup
run {
set command id to "INC&1_&2";
set controlfile autobackup format for device type disk to '/oracle/backup/%d_%F';
allocate channel d1 device type disk format '/oracle/backup/%d_%I_%T_%U.inc&1_&2' maxopenfiles 1;
backup as compressed backupset
incremental level &1 check logical database
filesperset 1 tag="INC&1_&2"
include current controlfile
plus archivelog not backed up 1 times
filesperset 8 tag="INC&1_&2"
;
backup spfile tag="INC&1_&2";
}
exit

$ nohup rman @bkupinc.rman 0 `date '+%a'` > /dev/null 2>&1 &

[1] 2776
[oracle@lax:db01]/home/oracle
$ ls -l *.log
-rw-r--r-- 1 oracle oinstall 1268 Jun 28 22:01 bkupinc0_Fri.log
[oracle@lax:db01]/home/oracle
$
[1]+ Done nohup rman @bkupinc.rman 0 `date '+%a'` > /dev/null 2>&1
[oracle@lax:db01]/home/oracle
$

$ ls -l /oracle/backup/

total 169936
-rw-r----- 1 oracle oinstall 22029824 Jun 28 22:01 DB01_1439793859_20130628_tbodbp63_1_1.inc0_Fri
-rw-r----- 1 oracle oinstall 12934144 Jun 28 22:01 DB01_1439793859_20130628_tcodbp6a_1_1.inc0_Fri
-rw-r----- 1 oracle oinstall  1236992 Jun 28 22:01 DB01_1439793859_20130628_tdodbp6d_1_1.inc0_Fri
-rw-r----- 1 oracle oinstall  6857728 Jun 28 22:01 DB01_1439793859_20130628_teodbp6f_1_1.inc0_Fri
-rw-r----- 1 oracle oinstall 23293952 Jun 28 22:01 DB01_1439793859_20130628_tfodbp6i_1_1.inc0_Fri
-rw-r----- 1 oracle oinstall  1555456 Jun 28 22:01 DB01_1439793859_20130628_tgodbp6l_1_1.inc0_Fri
-rw-r----- 1 oracle oinstall  7286272 Jun 28 22:01 DB01_1439793859_20130628_thodbp6m_1_1.inc0_Fri
-rw-r----- 1 oracle oinstall  9636352 Jun 28 22:02 DB01_1439793859_20130628_tiodbp6p_1_1.inc0_Fri
-rw-r----- 1 oracle oinstall  1377280 Jun 28 22:02 DB01_1439793859_20130628_tjodbp6t_1_1.inc0_Fri
-rw-r----- 1 oracle oinstall  5707264 Jun 28 22:02 DB01_1439793859_20130628_tkodbp6u_1_1.inc0_Fri
-rw-r----- 1 oracle oinstall 37765120 Jun 28 22:02 DB01_1439793859_20130628_tlodbp6v_1_1.inc0_Fri
-rw-r----- 1 oracle oinstall  4841472 Jun 28 22:02 DB01_1439793859_20130628_tmodbp7e_1_1.inc0_Fri
-rw-r----- 1 oracle oinstall 20168704 Jun 28 22:02 DB01_1439793859_20130628_tnodbp7i_1_1.inc0_Fri
-rw-r----- 1 oracle oinstall  2678784 Jun 28 22:02 DB01_1439793859_20130628_toodbp8b_1_1.inc0_Fri
-rw-r----- 1 oracle oinstall  1073152 Jun 28 22:02 DB01_1439793859_20130628_tpodbp8i_1_1.inc0_Fri
-rw-r----- 1 oracle oinstall  1073152 Jun 28 22:02 DB01_1439793859_20130628_tqodbp8j_1_1.inc0_Fri
-rw-r----- 1 oracle oinstall  1073152 Jun 28 22:03 DB01_1439793859_20130628_trodbp8k_1_1.inc0_Fri
-rw-r----- 1 oracle oinstall  1073152 Jun 28 22:03 DB01_1439793859_20130628_tsodbp8l_1_1.inc0_Fri
-rw-r----- 1 oracle oinstall  1073152 Jun 28 22:03 DB01_1439793859_20130628_ttodbp8n_1_1.inc0_Fri
-rw-r----- 1 oracle oinstall  1277952 Jun 28 22:03 DB01_1439793859_20130628_tuodbp8o_1_1.inc0_Fri
-rw-r----- 1 oracle oinstall    42496 Jun 28 22:03 DB01_1439793859_20130628_tvodbp8t_1_1.inc0_Fri
-rw-r----- 1 oracle oinstall    98304 Jun 28 22:03 DB01_1439793859_20130628_u0odbp8u_1_1.inc0_Fri
-rw-r----- 1 oracle oinstall  9830400 Jun 28 22:03 DB01_c-1439793859-20130628-08
[oracle@lax:db01]/home/oracle
$ rman target /

Recovery Manager: Release 11.2.0.3.0 - Production on Fri Jun 28 22:05:12 2013

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

connected to target database: DB01 (DBID=1439793859)

RMAN> list backup summary;

using target database control file instead of recovery catalog

List of Backups
===============
Key     TY LV S Device Type Completion Time      #Pieces #Copies Compressed Tag
------- -- -- - ----------- -------------------- ------- ------- ---------- ---
855     B  A  A DISK        28-jun-2013 22:01:42 1       1       YES        INC0_FRI
856     B  A  A DISK        28-jun-2013 22:01:48 1       1       YES        INC0_FRI
857     B  A  A DISK        28-jun-2013 22:01:50 1       1       YES        INC0_FRI
858     B  A  A DISK        28-jun-2013 22:01:52 1       1       YES        INC0_FRI
859     B  A  A DISK        28-jun-2013 22:01:56 1       1       YES        INC0_FRI
860     B  A  A DISK        28-jun-2013 22:01:57 1       1       YES        INC0_FRI
861     B  A  A DISK        28-jun-2013 22:01:59 1       1       YES        INC0_FRI
862     B  A  A DISK        28-jun-2013 22:02:03 1       1       YES        INC0_FRI
863     B  A  A DISK        28-jun-2013 22:02:05 1       1       YES        INC0_FRI
864     B  A  A DISK        28-jun-2013 22:02:06 1       1       YES        INC0_FRI
865     B  0  A DISK        28-jun-2013 22:02:19 1       1       YES        INC0_FRI
866     B  0  A DISK        28-jun-2013 22:02:23 1       1       YES        INC0_FRI
867     B  0  A DISK        28-jun-2013 22:02:48 1       1       YES        INC0_FRI
868     B  0  A DISK        28-jun-2013 22:02:57 1       1       YES        INC0_FRI
869     B  0  A DISK        28-jun-2013 22:02:59 1       1       YES        INC0_FRI
870     B  0  A DISK        28-jun-2013 22:02:59 1       1       YES        INC0_FRI
871     B  0  A DISK        28-jun-2013 22:03:01 1       1       YES        INC0_FRI
872     B  0  A DISK        28-jun-2013 22:03:02 1       1       YES        INC0_FRI
873     B  0  A DISK        28-jun-2013 22:03:03 1       1       YES        INC0_FRI
874     B  0  A DISK        28-jun-2013 22:03:07 1       1       YES        INC0_FRI
875     B  A  A DISK        28-jun-2013 22:03:09 1       1       YES        INC0_FRI
876     B  F  A DISK        28-jun-2013 22:03:10 1       1       YES        INC0_FRI
877     B  F  A DISK        28-jun-2013 22:03:13 1       1       NO         TAG20130628T220311

RMAN> exit

Oracle® Database Backup and Recovery Reference 11g Release 1 (11.1)

About these ads

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

The Rubric Theme. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 272 other followers

%d bloggers like this: