RMAN and Specific Media Managers Environment Variables
------------------------------------------------------
Veritas Netbackup :
-----------------
Environment Variables Set Up by NetBackup for Oracle on UNIX
-------------------------------------------------------------
When a schedule executes, NetBackup sets environment variables for the local Oracle
scripts to use when performing a NetBackup operation. These variables can be used to
perform conditional operations inside the script. These variables are set only if the backup
is started from the server (either automatically by the NetBackup scheduler or manually
through the administrator interface).
NB_ORA_SERV : Name of the NetBackup Server (Master one).
NB_ORA_CLASS : Name of the Oracle class.
NB_ORA_CLIENT : Name of Oracle Client Machine , mostly used to redirect the restore to different client.
NB_ORA_FULL : Set to 1 if this is an Automatic Full Backup.
NB_ORA_INCR : Set to 1 if this is an Automatic Differential Incremental Backup.
NB_ORA_CINC : Set to 1 if this is an Automatic Cumulative Incremental Backup.
NB_ORA_SCHEDULED: Set to 1 if a scheduled backup (Automatic Full Backup, Automatic
Differential Incremental Backup, or Automatic Cumulative Incremental Backup).
Example :
---------
run {
allocate channel t1 type 'sbt_tape';
send 'NB_ORA_SCHED=policy_2, NB_ORA_SERV=your_server';
backup
format '%d_hfb_%s_%p_%t.bkp'
filesperset 20
database;
}
Hp's Omniback / Dataprotector:
-----------------------------
Variables to be used in the ENV-clause of the 'allocate channel' command.
OB2BARTYPE - This will be 'Oracle8' for RDBMS 8i and 9i
OB2APPNAME - This is the target database ORACLE_SID
OB2BARLIST - This is the name of the RMAN script
OB2RETRYCOUNT - This is mandatory from DataProtector 6.0
RMAN script example :
run {
allocate channel 'dev_0' type 'sbt_tape'
parms 'ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=RMAN81T,OB2BARLIST=test_full,OB2RETRYCOUNT=1)';
backup incremental level <incr_level> filesperset 1
format 'test_full<RMAN81T_%s:%t:%p>.dbf'
database
include current controlfile
;
}
Legato's Networker :
--------------------
ENV parameters
NSR_CLIENT : Recommended for a backup of Oracle running on a cluster, OPS, or RAC system.
Recommended for all restores.NetWorker Client resource to use for a backup
or restore session. Might be needed for disaster recovery.
Physical host on which the session runs (default).
NSR_SERVER : Mandatory for a manual backup if the NetWorker server host is different
from the Oracle Server host.Recommended for a local manual backup.
Hostname of the NetWorker server to perform the Oracle backup.
Local physical host(default).
NSR_DATA_VOLUME_POOL
Mandatory if using set duplex command (set to 1, 2, 3, or 4).
Name of volume pool to use for the Oracle backup, including a duplexed
Oracle backup.Note: For a scheduled backup, the NSR_DATA_VOLUME_POOL
setting takes precedence over any pool associated with the scheduled
backup group. Most appropriate pool,selected by the NetWorker server (default).
RMAN script example :
run {
allocate channel t1 type 'SBT_TAPE';
send 'NSR_ENV=(NSR_SERVER=mars.legato.com,
NSR_DATA_VOLUME_POOL=MondayFulls)';
backup full filesperset 4
format '/FULL_%d_%u/'
(database);
release channel t1;
}
Precedence Rules :
Environment variables are set for channels allocated during the RMAN
session in the following order:
1. In the PARMS option of the ALLOCATE CHANNEL command in the RMAN script
or in the CONFIGURE CHANNEL command (Oracle9i and above).
2. In the RMAN SEND command on the operating system command line.
3. In the SEND command in the run job of the RMAN script.
Note: In Oracle9i, the send option does not follow these rules. If both the send
command on the operating system command line and the send option in the
configure channel command are used at the same time, only the send option
is executed by Oracle.
To prevent confusion and simplify the task of setting environment variables in
a specific order, do not mix these different ways of setting environment
variables in the same RMAN session.
In the following example, the NSR_SERVER and NSR_CLIENT variables are
set in this order:
NSR_SERVER is set to server2 (by parms option), changed to server1 (by
rman send), and finally changed to server3 (by send channel).
NSR_CLIENT is set to client2 (by parms option), changed to client1 (by
rman send), and finally changed to client3 (by send channel).
$ rman send 'NSR_ENV=(NSR_SERVER=server1,NSR_CLIENT=client1)'
(RMAN script:)
RMAN> run {
allocate channel t1 type 'SBT_TAPE'
parms 'ENV=(NSR_SERVER=server2, NSR_CLIENT=client2)';
send channel t1 'NSR_ENV=(NSR_SERVER=server3,NSR_CLIENT=client3)';
}
Tivoli Storage Manager :
------------------------
The only environment variable TDP for Oracle Version 2.2 recognizes within an RMAN script
is the fully qualified path name to the tdpo.opt file. Therefore, existing RMAN scripts
must be edited to use TDPO_OPTFILE=fully qualified path and file name of options
file variable in place of other environment variables.
For example:
allocate channel t1 type 'sbt_tape' parms
'ENV=(TDPO_OPTFILE=/home/rman/scripts/tdpo.opt)'
If a fully qualified path name is not provided, TDP for Oracle uses the tdpo.opt file
located in the TDP for Oracle default installation directory. If this file does not exist,
TDP for Oracle proceeds with default values.
All backups taken with RMAN are stored on the TSM Server together with the node
name (TDPO_NODE) of the backup host. This information is stored in the TDPO client configuration
file called "TDPO_OPTFILE", which is referenced by RMAN at allocating a tape (SBT_TAPE) channel.
RMAN> allocate channel tivoli type 'SBT_TAPE'
parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
OR
RMAN> configure channeldevice type 'SBT_TAPE'
parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
Please note, that TDPO_OPTFILE is case sensitive and must be provided in UPPERCASE only.
TDPO_NODE : It specifies a node name for TDP for Oracle sessions to the TSM server.
The default value is the value returned by the UNIX hostname command.
TDPO_OWNER : It specifies a session-owner name and object owner name. The default value
is the value returned by the UNIX id command.
TDPO_FS : It specifies a file space name on the TSM server which TDP for Oracle uses
for backup, delete, and restore operations.
Also note that there is a current restriction where multiple channels cannot be allocated at exactly
the same time, across different RMAN sessions. Doing so may clear any ENV parameters that are
used in a session's channel allocations. The best practice is to allocate channels in a serial fashion.
Example
This script allocates 1 channel to the Tivoli Storage Manager server:
run
{
allocate channel t1 type 'sbt_tape' parms
'ENV=(TDPO_OPTFILE=/orc8/scripts/tdpo.opt)';
backup
filesperset 5
format 'df_%t_%s_%p'
(database);
release channel t1;
}
Oracle.disksbt API to disk:
---------------------------
The Oracle DiskSbt API is designed for TESTING purposes ONLY and
can NOT be used for any database backup.
Oracle.Disksbt can be used to write to disk using sbt_tape channel as follows,
RMAN> run {
allocate channel 'tape_1' type 'sbt_tape'
parms 'SBT_LIBRARY=oracle.disksbt, ENV=(BACKUP_DIR=/tmp/)';
BACKUP DATAFILE 1;
}
OR
RMAN> configure channel device type 'sbt_tape'
parms 'SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/tmp/)';
Thursday, May 1, 2014
RMAN and Specific Media Managers Environment Variables
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment