Configure RMAN
=================
prerequisite : Enable Archive Logs. Click here to see
1. CREATE TABLESAPCE FOR CATELOG
CREATE TABLESPACE TB_RMAN
DATAFILE '/rman/app/orarman/oradata/rman/rman01.dbf'
SIZE 100M AUTOEXTEND ON;
2. CREATE USER RMAN...
CREATE USER RMANPRODDB IDENTIFIED BY rmanproddb DEFAULT TABLESPACE TB_RMAN
TEMPORARY TABLESPACE TEMP
QUOTA UNLIMITED ON TB_RMAN;
SQL> grant RECOVERY_CATALOG_OWNER to rman;
Grant succeeded.
SQL> grant connect, resource to rman;
Grant succeeded.
3. CREATE THE CATALOG
[root@ebizstb Desktop]# su - oraebiz
[oraebiz@ebizstb ~]$ tnsping rman
TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 10-MAR-2017 15:48:35
Copyright (c) 1997, 2013, Oracle. All rights reserved.
Used parameter files:
/ebiz/ebizdb/tech_st/11.2.0/network/admin/PRODDB_ebiz/sqlnet_ifile.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = stb.expolanka.com)(PORT = 1525))) (CONNECT_DATA = (SERVICE_NAME = rman.expolanka.com)))
OK (40 msec)
[oraebiz@ebizstb ~]$ rman catalog rmanproddb/rmanproddb@rman
Recovery Manager: Release 11.2.0.4.0 - Production on Fri Mar 10 15:51:33 2017
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to recovery catalog database
RMAN> create catalog;
recovery catalog created
RMAN> exit
Recovery Manager complete.
[oraebiz@ebizstb ~]$ rman target sys/erporacle321@proddb catalog rmanproddb/rmanproddb@rman
Recovery Manager: Release 11.2.0.4.0 - Production on Fri Mar 10 15:53:23 2017
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: PRODDB (DBID=26011804)
connected to recovery catalog database
RMAN> register database;
database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
5) Configuration of RMAN Parameters.
RMAN configuration parameters for database with db_unique_name VISDB are:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 1 DAYS;
CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/data/FRA_visdb/VISDB/rman_backup/full_%u_%s_%p';
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/vis/visdb/tech_st/11.2.0/dbs/snapcf_VISDB.f'; # default
6) RMAN backup script
[root@vis Desktop]# cat /PRODBACKUP/rman/runrman.sh
dt=`date +%d%m%y`
logfile="Rman"$dt".log"
echo "Start RMAN Backup of Vis8070 Instance on `date`
" 2>&1 >> /PRODBACKUP/rman/log/$logfile
su - oravis -c "rman target sys/erporacle321 catalog
rmanvis/r@rman << EOF
RESYNC CATALOG;
#RECOVER COPY OF DATABASE WITH TAG 'OSS';
#BACKUP DEVICE TYPE DISK INCREMENTAL LEVEL 1 FOR RECOVER OF
COPY WITH TAG 'OSS' DATABASE;
#BACKUP DEVICE TYPE DISK ARCHIVELOG ALL;
#BACKUP AS BACKUPSET DATABASE PLUS ARCHIVELOG;
#DELETE NOPROMPT OBSOLETE DEVICE TYPE DISK;
BACKUP AS COMPRESSED BACKUPSET INCREMENTAL LEVEL 0 DATABASE;
#BACKUP AS COMPRESSED BACKUPSET INCREMENTAL LEVEL 0 WITH TAG
'FULL_BACKUP' DATABASE;
DELETE NOPROMPT EXPIRED BACKUP;
DELETE NOPROMPT EXPIRED ARCHIVELOG ALL;
DELETE NOPROMPT OBSOLETE REDUNDANCY 1;
#DELETE NOPROMPT OBSOLETE;
#DELETE NOPROMPT ARCHIVELOG ALL;
EXIT;
EOF" 2>&1 >> /PRODBACKUP/rman/log/$logfile
echo "Complete RMAN Backup of Vis8070 on `date` "
2>&1 >> /PRODBACKUP/rman/log/$logfile
#sh /PRODBACKUP/rman/dump/dump.sh 2>&1 >>
/PRODBACKUP/rman/log/$logfile
echo "End Backing up recovery catalog on `date` "
2>&1 >> /PRODBACKUP/rman/log/$logfile
cat /PRODBACKUP/rman/log/$logfile 2>&1 | mail
-s "Vis8070 - Daily Online Backup" pramuditha@expolanka.com
No comments:
Post a Comment