• Non ci sono risultati.

Identifying Backups

Backups created with RMAN are cataloged z/OS data sets. A separate data set is produced for each copy of each backup piece. You specify the data set name for each backup using the FORMAT parameter of the RMAN BACKUP command.

Although you can specify a fixed z/OS data set name for FORMAT, the parameter is designed to be used as a template: various substitution variables (identified by a

"%" prefix) can be included in the FORMAT string, and these are replaced with specific values each time the RMAN script executes.

You can use any of the substitution variables shown in Table 6–1 as portions of a template data set name in order to form distinct, valid z/OS data set names:

Table 6–1 FORMAT Parameter Substitution Variables

Variable Description

%c specifies the copy number of the backup piece within a set of duplexed backup pieces. If you did not issue the set duplex command, then this variable will be 1. If you issued set duplex, the variable identifies the copy number: 1, 2, 3, or 4.

Recovery Manager on z/OS

%d specifies the database name. Note: The database name substitution variables (%d and %n) use the database name specified in the CREATE DATABASE command (or in the init.ora parameter file). The database name can be up to eight characters long and must start with a letter (or #, $, or @) and only contain letters, numbers, the special characters #, $, @ or the hyphen ('-') in the second and subsequent positions to be valid as a

standalone part of a data set name (as in 'ORACLE.BACKUP.%d'). If the database name starts with a number but is otherwise valid and is less than eight characters long, a letter (or #, $, or @) can be placed in the pattern before the %d (as in 'ORACLE.BACKUP.X%d'). Thus, if the %d will be used in the FORMAT string, care should be taken in choosing the database name in the CREATE DATABASE command to ensure that it is valid in a z/OS data set name.

%n specifies the database name, padded on the right with 'X' characters to a total length of eight characters. For example, if PROD1 is the database name, then PROD1XXX is the padded database name. (See the note under %d, above.)

%p specifies the backup piece number within the backup set. This value starts at one for each backup set and is incremented by one as each backup piece is created. The number will never exceed four digits (9999 maximum).

%s specifies the backup set number. This number is a counter in the control file that is incremented for each backup set. The counter value starts at one and is unique for the lifetime of the control file. If you restore a backup control file, then duplicate values can result. Also, CREATE CONTROLFILE initializes the counter back to one. If this value exceeds 9,999,999, only the right seven digits of the number will be used. The number will be from one to seven digits long.

%t specifies the backup set timestamp, which is a four-byte binary unsigned integer value derived as the number of seconds elapsed since a fixed reference time. The combination of %s and %t can be used to form a unique name for the backup set. The unsigned binary integer is formatted into a string in this format: Tsssssss. The sssssss is a base-32 representation of the number using the letters A-V and the numbers 0-9. The generated value will always be eight characters in length.

%u specifies an eight-character name constituted by compressed representations of the backup set number and the time the backup set was created. This will always be eight characters in length and it will start with a letter so it will be valid within a z/OS data set name. Note: In Oracle8i, the variable was '.*%u' which generated '.Axxxx.Axxxx'. The '.*%u' is still accepted, but now generates '.xxxxxxxx' (just as if '.%u' were specified).

%D specifies the current day of the month from the Gregorian Calendar in DD format.

Table 6–1 (Cont.) FORMAT Parameter Substitution Variables Variable Description

Recovery Manager on z/OS

%F specifies that dbid (a numeric value that identifies an Oracle database), year, month, day and sequence be combined so that the generated name is unique and repeatable.

When %F is used in combination with another string or variable, the generated format is: Iiiiiiii.Dyymmdd.Sss.

The iiiiiii is a base-32 representation of the dbid using the letters A-V and the numbers 0-9 and will always be seven characters. The yy, mm, and dd are the year, month and day, respectively. The ss is a hexadecimal representation of the sequence.

When %F is used alone, it generates a complete data set name:

&ORAPREFD..&ORASRVN..OBKCF.Iiiiiiii.Dyymmdd.Sss

In addition, when RMAN's control file autobackup feature is used, %F is the default format for the control file backup name.

%M specifies the current month from the Gregorian Calendar in MM format.

%T stands for year, month and day in the format YYMMDD. This will always be six characters in length. The first two characters of year are dropped (2008 becomes 08).

%U specifies a convenient shorthand for

&ORAPREFD..&ORASRVN..ORABKUP.%u.P%p.C%c that guarantees uniqueness in generated backup filenames. If you do not specify a format, RMAN uses %U by default. Note: For more information on &ORAPREFD and &ORASRVN, see Appendix C, "Oracle Database for z/OS System Symbols".

%Y specifies the current year from the Gregorian Calendar in YYYY format.

%% stands for % (i.e. %%Y is actually the string %Y).

Note: Several of the substitution variables generate numbers only, and should not be used immediately after a period in the FORMAT string, or an invalid data set name will result. For example, %s generates a one-digit to seven-digit number. In a FORMAT string, a period and a letter (or #, $, or @) have to precede the %s to make it valid in a data set name (for example, 'ORACLE.BACKUP.S%s').

Table 6–1 (Cont.) FORMAT Parameter Substitution Variables Variable Description

Recovery Manager on z/OS

You can also use Oracle Database for z/OS system symbols (identified by a "&"

prefix) to form parts of the data set name. This allows a single FORMAT string to produce distinct backup data set names over multiple pieces and copies, and over multiple uses of the same RMAN script. Refer to Appendix C, "Oracle Database for z/OS System Symbols", for more information.

When you code the FORMAT parameter, you should combine appropriate high-level data set name qualifiers, %u, other RMAN substitution variables, and Oracle Database for z/OS system symbols to form a complete, meaningful data set name. Both RMAN substitution variables and Oracle Database for z/OS system symbols are translated into their current values as the BACKUP command is processed at the server. The Oracle server saves the names of backups in the RMAN catalog or in the database control file, so you do not need to supply, or even know, the names of backups in order to perform an RMAN RESTORE.

The following example is a more complex FORMAT parameter for Oracle Database for z/OS:

FORMAT '&ORAPREFD..BKUP.%d.%u.P%p.C%c'

Variables in the previous example are defined, as follows:

A data set name that is produced from this format specification might look as follows:

ORA3ADBF.BKUP.ORA3DB.G6ENPJ03.P3.C1