How to setup RMAN under Windows
Create RMAN Catalogue steps
• Select database for catalogue.
• Create catalogue owner RMANC, default tablespace TOOLS.
• Grant RECOVERY_CATALOG_OWNER role to RMANC.
• Run the RMAN executable, being the same version as the catalogue database codeset and connect to the catalogue as the RMANC user.
• Issue the CREATE CATALOG command.
At RMAN repository Database
SQL> create user rmanc identified by xxxxxxxx Temporary tablespace TEMP Default tablespace TOOLS quota unlimited on TOOLS; SQL> grant RECOVERY_CATALOG_OWNER to RMANC; %RMAN catalog RMANC/xxxxxxxx@catdb rman> CREATE CATALOG
At Target Database which need to be backed up thru RMAN
Before registering a target database, create the target rman user in the target database.
SQL> connect / as sysdba SQL> create user RMANT identified by xxxxxxxx Default tablespace TOOLS Temporary tablespace TEMP; SQL> grant SYSDBA,CREATE SESSION to RMANT;
Initialisation Parameters
To improve backup performance following parameters must be set….
• BACKUP_TAPE_IO_SLAVES = TRUE
For 8i
• LARGE_POOL_SIZE = (4 *
<number> *
DB_BLOCK_SIZE *
DB_FILE_DIRECT_IO_COUNT *
<level>
) +
(4 *
<number> *
<size>
)
For 9i
• LARGE_POOL_SIZE= <number>*
(16MB +
<size>
)
The size of a tape buffer is determined by the RMAN parameter BLKSIZE.
BLKSIZE is OS dependant, but performance benefits can be made by explicitly setting it higher. 4M seems to offer improved performance. When testing a new backup, try differing values, in conjunction with the above calculation for LARGE_POOL_SIZE, to determine the optimal setting.
Net Requirements
RMAN requires a dedicated server connection to the target database.
Targetdb_rman.domain =
(DESCRIPTION=
(ADDRESS=(PROTOCOL=TCP)(HOST=host)(PORT=1521))
(CONNECT_DATA=(SERVICE_NAME=dbname.db_domain)(SERVER=DEDICATED))
)
The above should be configured on both the target and catalogue servers. The server hosting the target database also requires a Net configuration for the catalogue database, as this is where the RMAN commands are normally issued.
Database registration
To register the target database, issue the following commands.
> rman TARGET rmanc/xxxxxxxx@targetdb CATALOG rmant/xxxxxxxx@cataloguedb rman> REGISTER DATABASE; To check successful registration, issue the following command whilst still in RMAN; rman> REPORT SCHEMA; RMAN> report schema; Report of database schema File K-bytes Tablespace RB segs Datafile Name ---- ---------- -------------------- ------- ------------------- 1 524288 SYSTEM YES G:\ORACLE\ORADATA\TKNWP\SYSTEM01.DB F 2 524288 UNDOTBS YES G:\ORACLE\ORADATA\TKNWP\UNDOTBS01.D BF 3 20480 GENESYS_CONFIG_DATA NO I:\ORACLE\ORADATA\TKNWP\GENESYS_CON FIG_DATA_01.DBF 4 20480 GENESYS_LOGS_DATA NO G:\ORACLE\ORADATA\TKNWP\GENESYS_LOG S_DATA_01.DBF 5 131072 TOOLS NO H:\ORACLE\ORADATA\TKNWP\TOOLS_01.DB F 6 25600 USERS NO H:\ORACLE\ORADATA\TKNWP\USERS_01.DB F 7 256000 PERFSTAT NO G:\ORACLE\ORADATA\TKNWP\PERFSTAT_01 .DBF
Post-Recovery/Standby failover Tasks
If a resetlogs command has been issued, or a standby database has been activated, this needs to be reflected in the recovery catalogue. Any operations in RMAN after these operations will fail with the ‘target database incarnation not found in recovery catalog’ error. This is due to the resetlogs command, resetting the SCN’s. As the database Id is still the same, we need to issue the ‘reset database’ command to align the recovery catalogue with the database.
> rman TARGET rmanc/xxxxxxxx@targetdb CATALOG rmant/xxxxxxxx@cataloguedb
rman> RESET DATABASE;
To check;
rman> list incarnation of database;
Monitoring an RMAN Backup
To view the progress of a backup, the v$ views can be queried. Here is an example of a monitoring script:
Execute this whilst the backup is processing:
SELECT sid, serial#, context, sofar, totalwork, round(sofar/totalwork*100,2) "% Complete" FROM v$session_longops WHERE opname LIKE 'RMAN%' AND opname NOT LIKE '%aggregate%' AND totalwork != 0 AND sofar <totalwork>/ SID SERIAL# CONTEXT SOFAR TOTALWORK % Complete ------ ---------- ---------- ---------- ---------- ---------- 8 19 1 10377 36617 28.34 SQL>/ SID SERIAL# CONTEXT SOFAR TOTALWORK % Complete ---- ---------- ---------- ---------- ---------- ---------- 8 19 1 21513 36617 58.75 SQL>/ SID SERIAL# CONTEXT SOFAR TOTALWORK % Complete ----- ---------- ---------- ---------- ---------- ---------- 8 19 1 29641 36617 80.95 SQL>/ SID SERIAL# CONTEXT SOFAR TOTALWORK % Complete ----- ---------- ---------- ---------- ---------- ---------- 8 19 1 35849 36617 97.9 SQL>/ no rows selected
The views V$BACKUP_ASYNC_IO and V$BACKUP_SYNC_IO contain detailed information on backup operations. This data is not persistent. If there is data in the V$BACKUP_SYNC_IO view, then you need to investigate why the backups are not running asynchronously. Check BACKUP_TAPE_IO_SLAVES is set.
Leave a Reply
You must be logged in to post a comment.