APPENDIX
A. Sample
Source Code
PROCEDURE SP_RMANLINE(
ip_rmantuser VARCHAR2,
ip_rmantuserpwd VARCHAR2,
ip_rmancuser VARCHAR2,
ip_rmancuserpwd VARCHAR2,
ip_target VARCHAR2,
ip_rcvcat VARCHAR2,
ip_rman_script_dir VARCHAR2
DEFAULT 'RMAN_SCRIPT_DIR',
ip_rman_batch_dir VARCHAR2
DEFAULT 'RMAN_BATCH_DIR',
ip_Fname VARCHAR2 DEFAULT
'r_backup.rman',
ip_log_dir VARCHAR2 DEFAULT
'RMAN_LOG_DIR',
ip_lvl NUMBER DEFAULT
0,
ip_Cum_Opt VARCHAR2,
ip_Oracle_bin_dir VARCHAR2 DEFAULT
'ORACLE_BIN_DIR',
ip_Comp_Flag VARCHAR2
DEFAULT 'C',
ip_Encr_Flag VARCHAR2
DEFAULT 'on',
ip_Filesps NUMBER DEFAULT
1
) IS
crlf CONSTANT VARCHAR2(10) :=
CHR(13)||CHR(10);
v_exit VARCHAR2(30) :=
'exit'||CHR(13)||CHR(10);
v_user VARCHAR2(30);
v_rmanline VARCHAR2(4000);
v_Fname VARCHAR2(4000);
v_dFname VARCHAR2(4000);
v_Path_Dir VARCHAR2(4000);
v_Bin_Dir VARCHAR2(4000);
v_logPath_Dir VARCHAR2(4000);
v_ts VARCHAR2(20);
v_ts2 VARCHAR2(20);
v_set_nls_date VARCHAR2(128)
:= 'set NLS_DATE_FORMAT=DD-MON-RRRR HH24:MI:SS'||CRLF;
v_PATH VARCHAR2(4000);
v_rmanbkp_name VARCHAR2(30);
v_clean_rmanbkp_name VARCHAR2(30);
v_batch_file VARCHAR2(128);
v_dbatch_file VARCHAR2(128);
RMANfh utl_file.file_type;
dRMANfh utl_file.file_type;
PROCEDURE prcGetTimestamps(ip_Ts1
IN OUT VARCHAR2, ip_Ts2 IN OUT VARCHAR2) IS
BEGIN
SELECT TO_CHAR(SYSDATE,'YYYYMMDDHH24MI') AS cts,
TO_CHAR(SYSDATE,'RRRRMMDDHH24MI') AS cts2
INTO ip_Ts1,
ip_Ts2
FROM dual;
EXCEPTION
WHEN OTHERS THEN
null;
END prcGetTimestamps;
-- Returns the actual directory
path...
FUNCTION getPathDir (ipDir IN
VARCHAR2) RETURN VARCHAR2 IS
lvPathDir VARCHAR2(4000);
BEGIN
SELECT directory_path
INTO lvPathDir
FROM sys.dba_directories
WHERE directory_name = ipDir;
RETURN lvPathDir;
EXCEPTION
WHEN NO_DATA_FOUND THEN
DBMS_OUTPUT.put_line('Invalid File system path or directory name.');
RETURN NULL;
WHEN OTHERS THEN
RAISE;
DBMS_OUTPUT.put_line(SQLERRM);
END getPathDir;
FUNCTION getOracleBinDir RETURN VARCHAR2 IS
lvOraHomeDir VARCHAR2(4000);
lvOraBinDir VARCHAR2(4000);
begin
sys.dbms_system.get_env('ORACLE_HOME', lvOraHomeDir);
lvOraBinDir := lvOraHomeDir||'\bin\';
RETURN lvOraBinDir;
EXCEPTION
WHEN NO_DATA_FOUND THEN
DBMS_OUTPUT.put_line('Invalid File system path or directory name.');
RETURN NULL;
WHEN OTHERS THEN
RAISE;
DBMS_OUTPUT.put_line(SQLERRM);
END getOracleBinDir;
-- Returns the actual directory
path...
FUNCTION setPathDir (ipBinDir IN
VARCHAR2) RETURN VARCHAR2 IS
v_PathDir VARCHAR2(4000);
BEGIN
v_PathDir := 'set PATH='||ipBinDir||CRLF;
RETURN v_PathDir;
EXCEPTION
WHEN NO_DATA_FOUND THEN
DBMS_OUTPUT.put_line('Invalid File system path or directory name.');
RETURN NULL;
WHEN OTHERS THEN
RAISE;
DBMS_OUTPUT.put_line(SQLERRM);
END setPathDir;
-- Generates the RMAN Backup
command line
FUNCTION genRmanLine RETURN
VARCHAR2 IS
v_rmanline_fun VARCHAR2(4000);
BEGIN
SELECT v_Bin_Dir
||'rman target'
||' '
||ip_rmantuser
||'/'
||ip_rmantuserpwd
||DECODE(ip_target,NULL,NULL,'@'||ip_target)
||' '
||DECODE(ip_rcvcat,NULL,'NOCATALOG','CATALOG')
||' '
||DECODE(ip_rcvcat,NULL,NULL,ip_rmancuser)
||DECODE(ip_rcvcat,NULL,NULL,'/')
||DECODE(ip_rcvcat,NULL,NULL,ip_rmancuserpwd )
||DECODE(ip_rcvcat,NULL,NULL,'@'||ip_rcvcat)
||' '
||'@'
||v_Path_Dir
||NVL(ip_Fname,'r_backup.rman')
||' '
||' USING '
||' '
||CHR(39)
||ip_Encr_Flag
||CHR(39)
||' '
||DECODE( UPPER(ip_Comp_Flag) , 'C' ,
CHR(39)||'COMPRESSED'||CHR(39), CHR(39)||' '||CHR(39) )
||'
'
||TO_CHAR(ip_lvl,'9')
||' '
||DECODE( ip_Cum_Opt,'C',
CHR(39)||'CUMULATIVE'||CHR(39), CHR(39)||' '||CHR(39) )
||'
'
||CHR(39)
||instance_name
||CHR(39)
||' '
||LTRIM(TO_CHAR( DECODE ( ip_Filesps,
null, 1, ip_Filesps ),'99999' ))
||' '
||CHR(39)
||instance_name
||DECODE( ip_lvl,1, DECODE( ip_Cum_Opt
, 'C', '_CIL1_' , '_INL1_' ), 0, '_FLL0_', '_FLL0_')
||v_ts
||CHR(39)
||' '
||' LOG='
||v_logPath_Dir
||instance_name
||'_'
||NVL(ip_Fname,'_r_backup')
||DECODE( ip_lvl, 0,'_L0_','_L1_')
||v_ts
||'.log'
INTO
v_rmanline_fun
FROM
sys.V$instance;
RETURN v_rmanline_fun;
EXCEPTION
WHEN OTHERS THEN
raise_application_error(-20102,'Invalid
option.');
END genRmanLine;
PROCEDURE CloseFile(ipFHandle IN
OUT utl_file.file_type) IS
vFHandle utl_file.file_type;
BEGIN
-- closing files
vFHandle := ipFHandle;
if utl_file.is_open(vFHandle)
then
utl_file.fclose(vFHandle);
end if;
dbms_output.put_line('File
closed');
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE(SQLERRM);
END CloseFile;
-- Opens file for reading or writing...
PROCEDURE OpenFile(ipFileHandle IN
OUT UTL_FILE.FILE_TYPE, ipMode IN VARCHAR2, ipDir IN VARCHAR2, ipFname IN
VARCHAR2, ipBfrSz IN INTEGER) IS
BEGIN
ipFileHandle :=
utl_file.fopen(ipDir,ipFname, ipMode,ipBfrSz);
EXCEPTION
WHEN UTL_FILE.INVALID_MODE
THEN
RAISE;
DBMS_OUTPUT.PUT_LINE('Invalid Mode
used.');
CloseFile(ipFHandle => ipFileHandle);
WHEN UTL_FILE.INVALID_PATH
THEN
RAISE;
DBMS_OUTPUT.PUT_LINE('Invalid path being
used.');
CloseFile(ipFHandle =>
ipFileHandle);
WHEN UTL_FILE.ACCESS_DENIED
THEN
RAISE;
DBMS_OUTPUT.PUT_LINE('Access
denied.');
CloseFile(ipFHandle =>
ipFileHandle);
WHEN UTL_FILE.CHARSETMISMATCH
THEN
RAISE;
DBMS_OUTPUT.PUT_LINE('Invalid character
set error');
CloseFile(ipFHandle =>
ipFileHandle);
WHEN UTL_FILE.INTERNAL_ERROR
THEN
RAISE;
DBMS_OUTPUT.PUT_LINE('Internal Write error
occured.');
CloseFile(ipFHandle =>
ipFileHandle);
WHEN
UTL_FILE.INVALID_MAXLINESIZE THEN
RAISE;
DBMS_OUTPUT.PUT_LINE('Buffer
overflow');
CloseFile(ipFHandle =>
ipFileHandle);
WHEN UTL_FILE.READ_ERROR THEN
RAISE;
DBMS_OUTPUT.PUT_LINE('OS Read error
occured.');
CloseFile(ipFHandle =>
ipFileHandle);
WHEN UTL_FILE.WRITE_ERROR
THEN
RAISE;
DBMS_OUTPUT.PUT_LINE('OS Write error
occured.');
CloseFile(ipFHandle =>
ipFileHandle);
WHEN UTL_FILE.INVALID_FILENAME
THEN
RAISE;
DBMS_OUTPUT.PUT_LINE('Invalid file name
used.');
CloseFile(ipFHandle =>
ipFileHandle);
WHEN UTL_FILE.INVALID_FILEHANDLE
THEN
RAISE;
DBMS_OUTPUT.PUT_LINE('Invalid handle
found.');
CloseFile(ipFHandle =>
ipFileHandle);
WHEN UTL_FILE.INVALID_OPERATION
THEN
RAISE;
DBMS_OUTPUT.PUT_LINE('Invalid operation
attempted.');
CloseFile(ipFHandle =>
ipFileHandle);
WHEN OTHERS THEN
RAISE;
DBMS_OUTPUT.PUT_LINE(SQLERRM);
CloseFile(ipFHandle =>
ipFileHandle);
END OpenFile;
-- Procedure to open the output
file
PROCEDURE OpenOutPutFile IS
BEGIN
RMANfh :=
utl_file.fopen(ip_rman_script_dir,ip_Fname,'a',1024);
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.put_line(SQLERRM);
END OpenOutPutFile;
-- Procedure to close the file
PROCEDURE DeleteFile (ipDir IN
VARCHAR2, ipFileName IN VARCHAR2) IS
BEGIN
DBMS_OUTPUT.put_line('Batch Directory is... => '||getPathDir( NVL(
ipDir,ip_rman_batch_dir) ) );
DBMS_OUTPUT.put_line('File Name
is file... => '||ipFileName);
DBMS_OUTPUT.put_line('Deleting file... => '||getPathDir( NVL(
ipDir,ip_rman_batch_dir) )||ipFileName);
utl_file.fremove(location => getPathDir( NVL(
ipDir,ip_rman_batch_dir) ) , filename => ipFileName );
EXCEPTION
WHEN UTL_FILE.INVALID_MODE
THEN
DBMS_OUTPUT.PUT_LINE('Invalid Mode
used.');
WHEN UTL_FILE.INVALID_PATH
THEN
DBMS_OUTPUT.PUT_LINE('Invalid path being
used.');
WHEN UTL_FILE.ACCESS_DENIED
THEN
DBMS_OUTPUT.PUT_LINE('Access
denied.');
WHEN UTL_FILE.INVALID_OFFSET
THEN
DBMS_OUTPUT.PUT_LINE('Invalid offset
occurred.');
WHEN UTL_FILE.CHARSETMISMATCH
THEN
DBMS_OUTPUT.PUT_LINE('Invalid character
set error');
WHEN UTL_FILE.INTERNAL_ERROR
THEN
DBMS_OUTPUT.PUT_LINE('Internal Write error
occured.');
WHEN UTL_FILE.INVALID_FILENAME
THEN
DBMS_OUTPUT.PUT_LINE('Invalid file name
used.');
WHEN UTL_FILE.INVALID_OPERATION
THEN
DBMS_OUTPUT.PUT_LINE('Invalid operation
attempted.');
WHEN OTHERS THEN
raise;
DBMS_OUTPUT.PUT_LINE(SQLERRM);
END DeleteFile;
-- Procedure to write to the
output file
PROCEDURE WriteFile (ipFHandle IN
utl_file.file_type, ipBfr IN VARCHAR2) IS
BEGIN
utl_file.putf(ipFHandle,'%s',ipBfr);
utl_file.fflush(ipFHandle);
EXCEPTION
WHEN UTL_FILE.INVALID_MODE
THEN
DBMS_OUTPUT.PUT_LINE('Invalid Mode
used.');
WHEN UTL_FILE.INVALID_PATH
THEN
DBMS_OUTPUT.PUT_LINE('Invalid path being
used.');
WHEN UTL_FILE.ACCESS_DENIED
THEN
DBMS_OUTPUT.PUT_LINE('Access
denied.');
WHEN UTL_FILE.INVALID_OFFSET
THEN
DBMS_OUTPUT.PUT_LINE('Invalid offset
occurred.');
WHEN UTL_FILE.CHARSETMISMATCH
THEN
DBMS_OUTPUT.PUT_LINE('Invalid character
set error');
WHEN UTL_FILE.INTERNAL_ERROR
THEN
DBMS_OUTPUT.PUT_LINE('Internal Write error
occured.');
WHEN
UTL_FILE.INVALID_MAXLINESIZE THEN
DBMS_OUTPUT.PUT_LINE('Buffer
overflow');
WHEN UTL_FILE.WRITE_ERROR
THEN
DBMS_OUTPUT.PUT_LINE('OS Write error
occured.');
WHEN UTL_FILE.INVALID_FILENAME
THEN
DBMS_OUTPUT.PUT_LINE('Invalid file name
used.');
WHEN UTL_FILE.INVALID_FILEHANDLE
THEN
DBMS_OUTPUT.PUT_LINE('Invalid handle
found.');
WHEN UTL_FILE.INVALID_OPERATION
THEN
DBMS_OUTPUT.PUT_LINE('Invalid operation
attempted.');
WHEN OTHERS THEN
raise;
DBMS_OUTPUT.PUT_LINE(SQLERRM);
END WriteFile;
-- generates and runs the rman
backup job...
PROCEDURE sub_create_bkp (ip_jname
IN VARCHAR2, ip_jtype IN VARCHAR2, ip_jaction IN VARCHAR2) IS
lv_start_time TIMESTAMP;
lv_bkp_time TIMESTAMP;
BEGIN
SELECT current_timestamp +
INTERVAL '0 0:00:30.000' DAY TO SECOND(3) AS vs
INTO
lv_start_time
FROM
dual;
SELECT current_timestamp +
TO_DSINTERVAL('0 0:01:00.000') AS tsbkp
INTO
lv_bkp_time
FROM
dual;
sys.dbms_scheduler.create_job(
job_name =>
ip_jname,
job_type =>
ip_jtype,
job_action => ip_jaction,
start_date => lv_start_time,
job_class =>
'DEFAULT_JOB_CLASS',
comments =>
'Generates and executes an Oracle backup job',
auto_drop => TRUE,
enabled =>
FALSE
);
sys.dbms_scheduler.set_attribute( name => ip_jname, attribute =>
'job_priority', value => 1 );
sys.dbms_scheduler.set_attribute( name => ip_jname,
attribute
=> 'logging_level',
value => DBMS_SCHEDULER.LOGGING_FULL
);
sys.dbms_scheduler.enable( ip_jname );
sys.dbms_lock.sleep(60);
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.put_line(SQLERRM);
END sub_create_bkp;
PROCEDURE sub_cleanup_job
(ip_jname IN VARCHAR2, ip_jtype IN VARCHAR2, ip_jaction IN VARCHAR2) IS
lv_start_time TIMESTAMP;
lv_bkp_time TIMESTAMP;
BEGIN
SELECT current_timestamp +
INTERVAL '0 0:00:20.000' DAY TO SECOND(3) AS vs
INTO
lv_start_time
FROM
dual;
SELECT current_timestamp +
TO_DSINTERVAL('0 0:00:40.000') AS tsbkp
INTO
lv_bkp_time
FROM
dual;
sys.dbms_scheduler.create_job(
job_name =>
ip_jname,
job_type =>
ip_jtype,
job_action => ip_jaction,
start_date => lv_start_time,
job_class => 'DEFAULT_JOB_CLASS',
comments =>
'Cleans up/removes rman backup executable file.',
auto_drop =>
TRUE,
enabled =>
FALSE
);
sys.dbms_scheduler.set_attribute( name => ip_jname, attribute =>
'job_priority', value => 3 );
sys.dbms_scheduler.enable( ip_jname );
sys.dbms_lock.sleep(2);
EXCEPTION
WHEN OTHERS THEN
BEGIN
DeleteFile ( ipDir => ip_rman_batch_dir, ipFileName => v_Fname );
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.put_line('Could not erase
rman file in use. Verify that manual deletion is performed.');
RAISE_APPLICATION_ERROR(-20116,'RMAN
batch file with security information was not permanently deleted.');
DBMS_OUTPUT.put_line(SQLERRM);
END;
END sub_cleanup_job;
PROCEDURE sub_disable_bkpjob
(ip_jname IN VARCHAR2) IS
BEGIN
sys.dbms_scheduler.disable ( name => ip_jname);
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.put_line(SQLERRM);
END sub_disable_bkpjob;
PROCEDURE sub_drop_bkpjob
(ip_jname IN VARCHAR2) IS
BEGIN
sys.dbms_scheduler.drop_job ( job_name => ip_jname);
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.put_line(SQLERRM);
END sub_drop_bkpjob;
FUNCTION funGetJobStatus(ip_jname
IN VARCHAR2 ) RETURN BOOLEAN IS
lv_enabled SYS.dba_scheduler_jobs.enabled%TYPE;
BEGIN
SELECT enabled
INTO lv_enabled
FROM SYS.dba_scheduler_jobs
WHERE job_name = ip_jname;
IF lv_enabled = 'TRUE' THEN
RETURN TRUE;
ELSE
RETURN FALSE;
END IF;
EXCEPTION
WHEN NO_DATA_FOUND THEN
raise_application_error(-20101,'Job was not previously created.');
RETURN NULL;
WHEN OTHERS THEN
DBMS_OUTPUT.put_line(SQLERRM);
RETURN FALSE;
END funGetJobStatus;
FUNCTION JobIsRunning (ip_owner IN
VARCHAR2, ip_jname IN VARCHAR2 ) RETURN BOOLEAN IS
v_resp_jname VARCHAR2(128);
BEGIN
SELECT job_name
INTO v_resp_jname
FROM sys.dba_scheduler_running_jobs
WHERE job_name = ip_jname
AND owner = NVL(ip_owner,'SYS');
IF v_resp_jname IS NOT NULL THEN
RETURN TRUE;
ELSE
RETURN FALSE;
END IF;
EXCEPTION
WHEN NO_DATA_FOUND THEN
RETURN FALSE;
WHEN TOO_MANY_ROWS THEN
RETURN TRUE;
WHEN OTHERS THEN
RAISE_APPLICATION_ERROR(-20117,'Job status is unknown.');
DBMS_OUTPUT.put_line(SQLERRM);
RETURN NULL;
END JobIsRunning;
PROCEDURE
sub_sleep_until_done(ip_owner IN VARCHAR2,ip_jname IN VARCHAR2) IS
BEGIN
sys.dbms_lock.sleep(60);
WHILE JobIsRunning ( ip_owner
=> NVL(ip_owner,'SYS') , ip_jname => ip_jname ) LOOP
BEGIN
sys.dbms_lock.sleep(3);
EXCEPTION
WHEN OTHERS THEN null;
END;
END LOOP;
END sub_sleep_until_done;
PROCEDURE sub_run_bkp (ip_jname IN
VARCHAR2 ) IS
BEGIN
CASE
WHEN ( NOT funGetJobStatus (ip_jname) ) THEN
sys.dbms_scheduler.enable( ip_jname );
sys.dbms_scheduler.run_job( ip_jname );
WHEN funGetJobStatus (ip_jname) THEN
sys.dbms_scheduler.run_job( ip_jname );
ELSE
DBMS_OUTPUT.put_line('Job probably does
not exist.');
END CASE;
END sub_run_bkp;
PROCEDURE sub_write_cmd_line IS
BEGIN
-- writes rman command line
OpenFile(ipFileHandle => RMANfh ,
ipMode => 'a', ipDir =>
NVL(ip_rman_batch_dir,'RMAN_BATCH_DIR'),
ipFname => v_Fname, ipBfrSz
=> 32767);
WriteFile ( ipFHandle => RMANfh, ipBfr => v_set_nls_date );
WriteFile ( ipFHandle => RMANfh, ipBfr => setPathDir (
ipBinDir => v_Bin_Dir ) );
v_Bin_Dir := 'set PATH=echo %PATH%'||CRLF;
WriteFile ( ipFHandle => RMANfh, ipBfr => setPathDir (
ipBinDir => v_Bin_Dir ) );
WriteFile ( ipFHandle => RMANfh , ipBfr => v_rmanline );
WriteFile ( ipFHandle => RMANfh , ipBfr => v_exit);
CloseFile(ipFHandle => RMANfh);
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.put_line(SQLERRM);
END sub_write_cmd_line;
PROCEDURE sub_remove_rbat_file
(ipDir IN VARCHAR2, ipFname IN VARCHAR2) IS
v_CmdLine1 VARCHAR2(4000);
v_CmdLine2 VARCHAR2(4000);
BEGIN
-- v_dFname :=
'del_'||SUBSTR(NVL(ip_Fname,'r_backup'),1,14)||v_ts||'.bat';
v_CmdLine1 := 'set PATH=echo %PATH%'||crlf;
v_CmdLine2 := 'del /q '||getPathDir( NVL( ipDir,ip_rman_batch_dir)
)||v_dFname||crlf;
DBMS_OUTPUT.put_line('Batch Directory is... => '||getPathDir( NVL(
ipDir,ip_rman_batch_dir) ) );
DBMS_OUTPUT.put_line('File Name is file... => '||ipFname);
DBMS_OUTPUT.put_line('Background job is deleting file... =>
'||getPathDir( NVL( ipDir,ip_rman_batch_dir) )||ipFname);
OpenFile(ipFileHandle => dRMANfh , ipMode => 'a', ipDir =>
NVL(ip_rman_batch_dir,'RMAN_BATCH_DIR'), ipFname => v_dFname, ipBfrSz =>
32767);
WriteFile ( ipFHandle => dRMANfh,
ipBfr => v_CmdLine1 );
WriteFile ( ipFHandle => dRMANfh,
ipBfr => v_CmdLine2 );
WriteFile ( ipFHandle => dRMANfh , ipBfr => v_exit);
CloseFile(ipFHandle => dRMANfh );
EXCEPTION
WHEN OTHERS
THEN
null;
END sub_remove_rbat_file;
-- Main Program and entry point...
BEGIN
SELECT user
INTO v_user
FROM sys.dual;
v_Path_Dir := getPathDir (ipDir => ip_rman_script_dir);
v_Bin_Dir := NVL( getPathDir
(ipDir => ip_Oracle_bin_dir), getOracleBinDir() );
v_logPath_Dir := getPathDir (ipDir => ip_log_dir);
prcGetTimestamps(ip_Ts1 => v_ts, ip_Ts2 => v_ts2);
v_rmanline := genRmanLine()||crlf;
DBMS_OUTPUT.put_line(v_rmanline);
v_Fname :=
SUBSTR(NVL(ip_Fname,'r_backup.rman'),1,14)||v_ts||'.bat';
v_dFname :=
SUBSTR(NVL('del_'||ip_Fname,'r_backup.rman'),1,14)||v_ts||'.bat';
-- writes rman command line
sub_write_cmd_line();
dbms_output.put_line(v_rmanline);
v_rmanbkp_name :=
NVL(ip_target,NVL(ip_rcvcat,'ORCL'))||'_RMANBKP_'||v_ts2;
v_batch_file := getPathDir (ipDir => ip_rman_batch_dir)||v_Fname;
sub_create_bkp (ip_jname => v_rmanbkp_name, ip_jtype =>
'EXECUTABLE', ip_jaction => v_batch_file) ;
sub_sleep_until_done(ip_owner => NVL(v_user,'SYS'),ip_jname =>
v_rmanbkp_name );
sub_remove_rbat_file ( ipDir => ip_rman_batch_dir, ipFname =>
v_Fname );
v_clean_rmanbkp_name := NVL(ip_target,NVL(ip_rcvcat,'ORCL'))||'_rmbat_'||v_ts2;
v_dbatch_file := getPathDir (ipDir => ip_rman_batch_dir)||v_dFname;
sub_cleanup_job (ip_jname => v_clean_rmanbkp_name , ip_jtype =>
'EXECUTABLE', ip_jaction => v_dbatch_file );
sub_sleep_until_done(ip_owner => NVL(v_user,'SYS'),ip_jname =>
v_clean_rmanbkp_name );
end SP_RMANLINE;
-- calling main procedure
PROCEDURE SP_CALLRMANLINE IS
begin
SP_RMANLINE(
ip_rmantuser => 'SYS',
ip_rmantuserpwd => '%WINPWD_T%',
ip_rmancuser => 'RMAN',
ip_rmancuserpwd => '%WINPWD_C%',
ip_target => 'ADNIBMSX',
ip_rcvcat => 'ADNIBMSX',
ip_rman_script_dir =>
'RMAN_SCRIPT_DIR',
ip_rman_batch_dir =>
'RMAN_BATCH_DIR',
ip_Fname => 'r_backup.rman',
ip_log_dir => 'RMAN_LOG_DIR',
ip_lvl => 1,
ip_Cum_Opt => 'C',
ip_Oracle_bin_dir =>
'ORACLE_BIN_DIR',
ip_Comp_Flag => 'C',
ip_Encr_Flag => 'ON',
ip_Filesps => 1
);
exception
when others then
dbms_output.put_line(sqlerrm);
end;
B. Sample Log Files (Excerpts)
B.1 Full or Incremental Level 0
Recovery
Manager: Release 11.2.0.3.0 - Production on Wed May 1 16:25:57 2013
Copyright
(c) 1982, 2011, Oracle and/or its affiliates.
All rights reserved.
connected
to target database: ADNIBMSX (DBID=2634802274)
connected
to recovery catalog database
RMAN> #
Will allow for encrpted rman backups without introducing any keys, once the
wallet is opned...
2> #
should pass tag as a partial parameter for the tag name.
3>
4> set
encryption on;
5>
6>
run {
7> allocate channel cH1 type disk;
8> sql 'alter system archive log
current';
9> crosscheck archivelog all;
10> release channel cH1;
11> allocate channel cH1 type disk;
12> allocate channel cH2 type disk;
13> allocate channel cH3 type disk;
14> allocate channel cH4 type disk;
15> set limit channel cH1 kbytes
16577216;
16> set limit channel cH2 kbytes
16577216;
17> set limit channel cH3 kbytes
16577216;
18> set limit channel cH4 kbytes
16577216;
19> BACKUP AS COMPRESSED BACKUPSET
20> INCREMENTAL LEVEL 0
21> FORMAT
'C:\app\oracle\flash_recovery_area\adnibmsx\BACKUPSET\%T_%s_%d_L0_bkp_Db_%s%t%U' tag = adnibmsx_FLL0_201305011625
22> FILESPERSET 1
23> (database);
24> BACKUP AS COMPRESSED BACKUPSET
25> INCREMENTAL LEVEL 0
26> FORMAT
'C:\app\oracle\flash_recovery_area\adnibmsx\BACKUPSET\%T_%s_%d_L0_bkp_Ctl_%s%t%U'
tag = adnibmsx_FLL0_201305011625
27> (current controlfile);
28> sql 'alter system archive log
current';
29> BACKUP AS COMPRESSED BACKUPSET
30> INCREMENTAL LEVEL 0
31> FORMAT
'C:\app\oracle\flash_recovery_area\adnibmsx\BACKUPSET\%T_%s_%d_L0_bkp_Arc_%s%t%U'
tag = adnibmsx_FLL0_201305011625
32> (archivelog all);
33> backup spfile;
34> sql 'alter database backup
controlfile to trace';
35> release channel cH1;
36> release channel cH2;
37> release channel cH3;
38> release channel cH4;
39> }
40> resync catalog;
41> list backupset of database;
42> list backupset of controlfile;
43> list backupset of archivelog all;
44> list restore point all;
45> report schema;
46> validate check logical skip
inaccessible database;
47> restore validate database;
48> restore validate archivelog all;
49> report obsolete;
50> delete noprompt obsolete;
51> exit;
executing
command: SET encryption
allocated
channel: cH1
channel
cH1: SID=536 device type=DISK
sql
statement: alter system archive log current
validation
succeeded for archived log
archived
log file
name=C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\ARCHIVELOG\2013_04_30\O1_MF_1_466_8QZYK67Y_.ARC
RECID=462 STAMP=814108007
validation
succeeded for archived log
archived
log file
name=C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\ARCHIVELOG\2013_04_30\O1_MF_1_467_8QZYKBGQ_.ARC
RECID=463 STAMP=814108010
validation
succeeded for archived log
archived
log file
name=C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\ARCHIVELOG\2013_04_30\O1_MF_1_468_8R05TK4H_.ARC
RECID=464 STAMP=814115495
validation
succeeded for archived log
archived
log file name=C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\ARCHIVELOG\2013_04_30\O1_MF_1_469_8R067B98_.ARC
RECID=465 STAMP=814115897
validation
succeeded for archived log
archived
log file
name=C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\ARCHIVELOG\2013_04_30\O1_MF_1_470_8R06D8FP_.ARC
RECID=466 STAMP=814116077
validation
succeeded for archived log
archived
log file
name=C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\ARCHIVELOG\2013_05_01\O1_MF_1_471_8R2CDMXZ_.ARC
RECID=467 STAMP=814273130
validation
succeeded for archived log
archived
log file name=C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\ARCHIVELOG\2013_05_01\O1_MF_1_472_8R2CY3XS_.ARC
RECID=468 STAMP=814273668
validation
succeeded for archived log
archived
log file
name=C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\ARCHIVELOG\2013_05_01\O1_MF_1_473_8R2CY5JN_.ARC
RECID=469 STAMP=814273669
validation
succeeded for archived log
archived
log file
name=C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\ARCHIVELOG\2013_05_01\O1_MF_1_474_8R2YLR7Q_.ARC
RECID=470 STAMP=814292762
Crosschecked
9 objects
released
channel: cH1
allocated
channel: cH1
channel cH1:
SID=536 device type=DISK
allocated
channel: cH2
channel
cH2: SID=37 device type=DISK
allocated
channel: cH3
channel
cH3: SID=537 device type=DISK
allocated
channel: cH4
channel
cH4: SID=28 device type=DISK
Starting
backup at 01-MAY-2013 16:26:06
channel
cH1: starting compressed incremental level 0 datafile backup set
channel
cH1: specifying datafile(s) in backup set
input
datafile file number=00009 name=C:\APP\ORACLE\ORADATA\ADNIBMSX\MGMT.DBF
channel
cH1: starting piece 1 at 01-MAY-2013 16:26:07
channel
cH2: starting compressed incremental level 0 datafile backup set
channel
cH2: specifying datafile(s) in backup set
input
datafile file number=00001 name=C:\APP\ORACLE\ORADATA\ADNIBMSX\SYSTEM01.DBF
channel
cH2: starting piece 1 at 01-MAY-2013 16:26:08
channel
cH3: starting compressed incremental level 0 datafile backup set
channel
cH3: specifying datafile(s) in backup set
input
datafile file number=00003 name=C:\APP\ORACLE\ORADATA\ADNIBMSX\UNDOTBS01.DBF
channel
cH3: starting piece 1 at 01-MAY-2013 16:26:08
channel
cH4: starting compressed incremental level 0 datafile backup set
channel
cH4: specifying datafile(s) in backup set
input
datafile file number=00005 name=C:\APP\ORACLE\ORADATA\ADNIBMSX\EXAMPLE01.DBF
channel
cH4: starting piece 1 at 01-MAY-2013 16:26:09
channel
cH1: finished piece 1 at 01-MAY-2013 16:30:04
piece
handle=C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\20130501_1359_ADNIBMSX_L0_BKP_DB_1359814292767AFO8I7OV_1_1
tag=ADNIBMSX_FLL0_201305011625 comment=NONE
channel
cH1: backup set complete, elapsed time: 00:03:57
channel
cH1: starting compressed incremental level 0 datafile backup set
channel
cH1: specifying datafile(s) in backup set
input
datafile file number=00002 name=C:\APP\ORACLE\ORADATA\ADNIBMSX\SYSAUX01.DBF
channel
cH1: starting piece 1 at 01-MAY-2013 16:30:06
channel
cH4: finished piece 1 at 01-MAY-2013 16:30:07
piece
handle=C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\20130501_1362_ADNIBMSX_L0_BKP_DB_1362814292768AIO8I7P0_1_1
tag=ADNIBMSX_FLL0_201305011625 comment=NONE
channel
cH4: backup set complete, elapsed time: 00:03:58
channel
cH4: starting compressed incremental level 0 datafile backup set
channel
cH4: specifying datafile(s) in backup set
input
datafile file number=00010 name=C:\APP\ORACLE\ORADATA\ADNIBMSX\MGMT_AD4J.DBF
channel
cH4: starting piece 1 at 01-MAY-2013 16:30:09
channel
cH4: finished piece 1 at 01-MAY-2013 16:31:14
piece
handle=C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\20130501_1364_ADNIBMSX_L0_BKP_DB_1364814293007AKO8I80F_1_1
tag=ADNIBMSX_FLL0_201305011625 comment=NONE
channel
cH4: backup set complete, elapsed time: 00:01:05
channel
cH4: starting compressed incremental level 0 datafile backup set
channel
cH4: specifying datafile(s) in backup set
input
datafile file number=00007 name=C:\APP\ORACLE\ORADATA\ADNIBMSX\HZNENCR01.DBF
channel
cH4: starting piece 1 at 01-MAY-2013 16:31:17
channel
cH4: finished piece 1 at 01-MAY-2013 16:31:52
piece
handle=C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\20130501_1365_ADNIBMSX_L0_BKP_DB_1365814293075ALO8I82J_1_1
tag=ADNIBMSX_FLL0_201305011625 comment=NONE
channel
cH4: backup set complete, elapsed time: 00:00:35
channel
cH4: starting compressed incremental level 0 datafile backup set
channel
cH4: specifying datafile(s) in backup set
input
datafile file number=00006 name=C:\APP\ORACLE\ORADATA\ADNIBMSX\RMANTS01.DBF
channel
cH4: starting piece 1 at 01-MAY-2013 16:31:55
channel
cH2: finished piece 1 at 01-MAY-2013 16:33:12
piece
handle=C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\20130501_1360_ADNIBMSX_L0_BKP_DB_1360814292767AGO8I7OV_1_1
tag=ADNIBMSX_FLL0_201305011625 comment=NONE
channel
cH2: backup set complete, elapsed time: 00:07:04
channel
cH2: starting compressed incremental level 0 datafile backup set
channel
cH2: specifying datafile(s) in backup set
input
datafile file number=00011
name=C:\APP\ORACLE\ORADATA\ADNIBMSX\MGMT_ECM_DEPOT1.DBF
channel
cH2: starting piece 1 at 01-MAY-2013 16:33:14
channel
cH4: finished piece 1 at 01-MAY-2013 16:33:17
piece
handle=C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\20130501_1366_ADNIBMSX_L0_BKP_DB_1366814293113AMO8I83P_1_1
tag=ADNIBMSX_FLL0_201305011625 comment=NONE
channel
cH4: backup set complete, elapsed time: 00:01:22
channel
cH4: starting compressed incremental level 0 datafile backup set
channel
cH4: specifying datafile(s) in backup set
input
datafile file number=00004 name=C:\APP\ORACLE\ORADATA\ADNIBMSX\USERS01.DBF
channel
cH4: starting piece 1 at 01-MAY-2013 16:33:21
channel
cH2: finished piece 1 at 01-MAY-2013 16:33:46
piece
handle=C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\20130501_1367_ADNIBMSX_L0_BKP_DB_1367814293193ANO8I869_1_1
tag=ADNIBMSX_FLL0_201305011625 comment=NONE
channel
cH2: backup set complete, elapsed time: 00:00:32
channel
cH2: starting compressed incremental level 0 datafile backup set
channel
cH2: specifying datafile(s) in backup set
input
datafile file number=00008 name=C:\APP\ORACLE\ORADATA\ADNIBMSX\DATA01.DBF
channel
cH2: starting piece 1 at 01-MAY-2013 16:33:49
channel
cH4: finished piece 1 at 01-MAY-2013 16:33:49
piece
handle=C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\20130501_1368_ADNIBMSX_L0_BKP_DB_1368814293198AOO8I86E_1_1
tag=ADNIBMSX_FLL0_201305011625 comment=NONE
channel
cH4: backup set complete, elapsed time: 00:00:28
channel
cH1: finished piece 1 at 01-MAY-2013 16:33:56
piece
handle=C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\20130501_1363_ADNIBMSX_L0_BKP_DB_1363814293005AJO8I80D_1_1
tag=ADNIBMSX_FLL0_201305011625 comment=NONE
channel
cH1: backup set complete, elapsed time: 00:03:50
channel
cH2: finished piece 1 at 01-MAY-2013 16:33:56
piece
handle=C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\20130501_1369_ADNIBMSX_L0_BKP_DB_1369814293228APO8I87C_1_1
tag=ADNIBMSX_FLL0_201305011625 comment=NONE
channel
cH2: backup set complete, elapsed time: 00:00:07
channel
cH3: finished piece 1 at 01-MAY-2013 16:34:44
piece
handle=C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\20130501_1361_ADNIBMSX_L0_BKP_DB_1361814292768AHO8I7P0_1_1
tag=ADNIBMSX_FLL0_201305011625 comment=NONE
channel cH3:
backup set complete, elapsed time: 00:08:36
Finished
backup at 01-MAY-2013 16:34:44
Starting
backup at 01-MAY-2013 16:34:47
channel
cH1: starting compressed incremental level 0 datafile backup set
channel
cH1: specifying datafile(s) in backup set
including
current control file in backup set
channel
cH1: starting piece 1 at 01-MAY-2013 16:34:52
channel
cH1: finished piece 1 at 01-MAY-2013 16:34:53
piece
handle=C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\20130501_1370_ADNIBMSX_L0_BKP_CTL_1370814293288AQO8I898_1_1
tag=ADNIBMSX_FLL0_201305011625 comment=NONE
channel
cH1: backup set complete, elapsed time: 00:00:01
Finished
backup at 01-MAY-2013 16:34:53
…
channel
ORA_DISK_4: validation complete, elapsed time: 00:00:14
channel
ORA_DISK_1: piece handle=C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\20130430_1323_ADNIBMSX_L0_BKP_ARC_13238141080149BO8CJBE_1_1
tag=ADNIBMSX_FLL0_201304301254
channel
ORA_DISK_1: restored backup piece 1
channel
ORA_DISK_1: validation complete, elapsed time: 00:00:15
channel
ORA_DISK_2: piece
handle=C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\20130430_1324_ADNIBMSX_L0_BKP_ARC_13248141080159CO8CJBF_1_1
tag=ADNIBMSX_FLL0_201304301254
channel
ORA_DISK_2: restored backup piece 1
channel
ORA_DISK_2: validation complete, elapsed time: 00:00:15
Finished
restore at 01-MAY-2013 16:46:50
RMAN
retention policy will be applied to the command
RMAN
retention policy is set to redundancy 2
Report of
obsolete backups and copies
Type Key Completion Time Filename/Handle
--------------------
------ ------------------ --------------------
Backup
Set 11543 30-APR-2013 12:58:42
Backup Piece 11556
30-APR-2013 12:58:42
C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\20130430_1312_ADNIBMSX_L0_BKP_DB_131281410735890O8CIMU_1_1
Backup
Set 11544 30-APR-2013 13:00:26
Backup Piece 11557
30-APR-2013 13:00:26
C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\20130430_1310_ADNIBMSX_L0_BKP_DB_13108141073578UO8CIMT_1_1
Backup Set 11545 30-APR-2013 13:01:58
Backup Piece 11558
30-APR-2013 13:01:58
C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\20130430_1315_ADNIBMSX_L0_BKP_DB_131581410764393O8CIVR_1_1
Backup
Set 11546 30-APR-2013 13:02:50
Backup Piece 11559
30-APR-2013 13:02:50
C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\20130430_1316_ADNIBMSX_L0_BKP_DB_131681410772594O8CJ2D_1_1
Backup
Set 11547 30-APR-2013 13:03:49
Backup Piece 11560
30-APR-2013 13:03:49 C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\20130430_1311_ADNIBMSX_L0_BKP_DB_13118141073578VO8CIMT_1_1
Backup
Set 11548 30-APR-2013 13:04:14
Backup Piece 11561
30-APR-2013 13:04:14 C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\20130430_1317_ADNIBMSX_L0_BKP_DB_131781410778295O8CJ46_1_1
Backup
Set 11549 30-APR-2013 13:04:14
Backup Piece 11562
30-APR-2013 13:04:14
C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\20130430_1318_ADNIBMSX_L0_BKP_DB_131881410783996O8CJ5V_1_1
Backup
Set 11550 30-APR-2013 13:04:33
Backup Piece 11563
30-APR-2013 13:04:33
C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\20130430_1319_ADNIBMSX_L0_BKP_DB_131981410786597O8CJ6P_1_1
Backup
Set 11551 30-APR-2013 13:04:36
Backup Piece 11564
30-APR-2013 13:04:36
C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\20130430_1320_ADNIBMSX_L0_BKP_DB_132081410786698O8CJ6Q_1_1
Backup
Set 11552 30-APR-2013 13:05:25
Backup Piece 11565 30-APR-2013 13:05:25
C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\20130430_1313_ADNIBMSX_L0_BKP_DB_131381410735891O8CIMU_1_1
Archive
Log 11621 30-APR-2013 13:06:47
C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\ARCHIVELOG\2013_04_30\O1_MF_1_466_8QZYK67Y_.ARC
Backup
Set 11553 30-APR-2013 13:05:39
Backup Piece 11566
30-APR-2013 13:05:39
C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\20130430_1314_ADNIBMSX_L0_BKP_DB_131481410755992O8CIT7_1_1
Archive
Log 11629 30-APR-2013 13:06:50
C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\ARCHIVELOG\2013_04_30\O1_MF_1_467_8QZYKBGQ_.ARC
Archive
Log 11758 30-APR-2013 15:11:35
C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\ARCHIVELOG\2013_04_30\O1_MF_1_468_8R05TK4H_.ARC
Archive
Log 11759 30-APR-2013 15:18:17
C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\ARCHIVELOG\2013_04_30\O1_MF_1_469_8R067B98_.ARC
Archive
Log 11760 30-APR-2013 15:21:17
C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\ARCHIVELOG\2013_04_30\O1_MF_1_470_8R06D8FP_.ARC
Archive
Log 11764 01-MAY-2013 10:58:50
C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\ARCHIVELOG\2013_05_01\O1_MF_1_471_8R2CDMXZ_.ARC
Backup
Set 11824 01-MAY-2013 11:07:45
Backup Piece 11826
01-MAY-2013 11:07:45
C:\APP\ORACLE\PRODUCT\11.2.0\DBHOME_4\DATABASE\C-2634802274-20130501-00
Backup
Set 11884 01-MAY-2013 11:09:06
Backup Piece 11887
01-MAY-2013 11:09:06
C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\2013_05_01\O1_MF_NNSNF_TAG20130501T110905_8R2D0LGM_.BKP
Backup
Set 11897 01-MAY-2013 11:09:13
Backup Piece 11899
01-MAY-2013 11:09:13
C:\APP\ORACLE\PRODUCT\11.2.0\DBHOME_4\DATABASE\C-2634802274-20130501-01
Backup
Set 12059 01-MAY-2013 16:34:52
Backup Piece 12061
01-MAY-2013 16:34:52
C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\20130501_1370_ADNIBMSX_L0_BKP_CTL_1370814293288AQO8I898_1_1
RMAN
retention policy will be applied to the command
RMAN
retention policy is set to redundancy 2
using channel
ORA_DISK_1
using
channel ORA_DISK_2
using
channel ORA_DISK_3
using
channel ORA_DISK_4
Deleting
the following obsolete backups and copies:
Type Key Completion Time Filename/Handle
--------------------
------ ------------------ --------------------
Backup
Set 11543 30-APR-2013 12:58:42
Backup Piece 11556
30-APR-2013 12:58:42
C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\20130430_1312_ADNIBMSX_L0_BKP_DB_131281410735890O8CIMU_1_1
Backup
Set 11544 30-APR-2013 13:00:26
Backup Piece 11557
30-APR-2013 13:00:26
C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\20130430_1310_ADNIBMSX_L0_BKP_DB_13108141073578UO8CIMT_1_1
Backup
Set 11545 30-APR-2013 13:01:58
Backup Piece 11558
30-APR-2013 13:01:58
C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\20130430_1315_ADNIBMSX_L0_BKP_DB_131581410764393O8CIVR_1_1
Backup
Set 11546 30-APR-2013 13:02:50
Backup Piece 11559
30-APR-2013 13:02:50 C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\20130430_1316_ADNIBMSX_L0_BKP_DB_131681410772594O8CJ2D_1_1
Backup
Set 11547 30-APR-2013 13:03:49
Backup Piece 11560
30-APR-2013 13:03:49
C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\20130430_1311_ADNIBMSX_L0_BKP_DB_13118141073578VO8CIMT_1_1
Backup
Set 11548 30-APR-2013 13:04:14
Backup Piece 11561
30-APR-2013 13:04:14
C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\20130430_1317_ADNIBMSX_L0_BKP_DB_131781410778295O8CJ46_1_1
Backup
Set 11549 30-APR-2013 13:04:14
Backup Piece 11562
30-APR-2013 13:04:14
C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\20130430_1318_ADNIBMSX_L0_BKP_DB_131881410783996O8CJ5V_1_1
Backup
Set 11550 30-APR-2013 13:04:33
Backup Piece 11563
30-APR-2013 13:04:33
C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\20130430_1319_ADNIBMSX_L0_BKP_DB_131981410786597O8CJ6P_1_1
Backup
Set 11551 30-APR-2013 13:04:36
Backup Piece 11564
30-APR-2013 13:04:36
C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\20130430_1320_ADNIBMSX_L0_BKP_DB_132081410786698O8CJ6Q_1_1
Backup
Set 11552 30-APR-2013 13:05:25
Backup Piece 11565
30-APR-2013 13:05:25 C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\20130430_1313_ADNIBMSX_L0_BKP_DB_131381410735891O8CIMU_1_1
Archive
Log 11621 30-APR-2013 13:06:47
C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\ARCHIVELOG\2013_04_30\O1_MF_1_466_8QZYK67Y_.ARC
Backup
Set 11553 30-APR-2013 13:05:39
Backup Piece 11566
30-APR-2013 13:05:39
C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\20130430_1314_ADNIBMSX_L0_BKP_DB_131481410755992O8CIT7_1_1
Archive
Log 11629 30-APR-2013 13:06:50
C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\ARCHIVELOG\2013_04_30\O1_MF_1_467_8QZYKBGQ_.ARC
Archive
Log 11758 30-APR-2013 15:11:35
C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\ARCHIVELOG\2013_04_30\O1_MF_1_468_8R05TK4H_.ARC
Archive
Log 11759 30-APR-2013 15:18:17 C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\ARCHIVELOG\2013_04_30\O1_MF_1_469_8R067B98_.ARC
Archive
Log 11760 30-APR-2013 15:21:17
C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\ARCHIVELOG\2013_04_30\O1_MF_1_470_8R06D8FP_.ARC
Archive
Log 11764 01-MAY-2013 10:58:50
C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\ARCHIVELOG\2013_05_01\O1_MF_1_471_8R2CDMXZ_.ARC
Backup
Set 11824 01-MAY-2013 11:07:45
Backup Piece 11826
01-MAY-2013 11:07:45
C:\APP\ORACLE\PRODUCT\11.2.0\DBHOME_4\DATABASE\C-2634802274-20130501-00
Backup
Set 11884 01-MAY-2013 11:09:06
Backup Piece 11887
01-MAY-2013 11:09:06
C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\2013_05_01\O1_MF_NNSNF_TAG20130501T110905_8R2D0LGM_.BKP
Backup
Set 11897 01-MAY-2013 11:09:13
Backup Piece 11899
01-MAY-2013 11:09:13
C:\APP\ORACLE\PRODUCT\11.2.0\DBHOME_4\DATABASE\C-2634802274-20130501-01
Backup
Set 12059 01-MAY-2013 16:34:52
Backup Piece 12061
01-MAY-2013 16:34:52 C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\20130501_1370_ADNIBMSX_L0_BKP_CTL_1370814293288AQO8I898_1_1
deleted
backup piece
backup
piece
handle=C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\20130430_1312_ADNIBMSX_L0_BKP_DB_131281410735890O8CIMU_1_1
RECID=944 STAMP=814107362
deleted
backup piece
backup
piece
handle=C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\20130430_1310_ADNIBMSX_L0_BKP_DB_13108141073578UO8CIMT_1_1
RECID=945 STAMP=814107362
deleted
backup piece
backup
piece handle=C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\20130430_1315_ADNIBMSX_L0_BKP_DB_131581410764393O8CIVR_1_1
RECID=946 STAMP=814107658
deleted
backup piece
backup
piece
handle=C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\20130430_1316_ADNIBMSX_L0_BKP_DB_131681410772594O8CJ2D_1_1
RECID=947 STAMP=814107736
deleted
backup piece
backup
piece
handle=C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\20130430_1311_ADNIBMSX_L0_BKP_DB_13118141073578VO8CIMT_1_1
RECID=948 STAMP=814107362
deleted
backup piece
backup
piece handle=C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\20130430_1317_ADNIBMSX_L0_BKP_DB_131781410778295O8CJ46_1_1
RECID=949 STAMP=814107837
deleted
backup piece
backup
piece
handle=C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\20130430_1318_ADNIBMSX_L0_BKP_DB_131881410783996O8CJ5V_1_1
RECID=950 STAMP=814107841
deleted
backup piece
backup
piece
handle=C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\20130430_1319_ADNIBMSX_L0_BKP_DB_131981410786597O8CJ6P_1_1
RECID=951 STAMP=814107869
deleted
backup piece
backup
piece
handle=C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\20130430_1320_ADNIBMSX_L0_BKP_DB_132081410786698O8CJ6Q_1_1
RECID=952 STAMP=814107873
deleted
backup piece
backup
piece handle=C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\20130430_1313_ADNIBMSX_L0_BKP_DB_131381410735891O8CIMU_1_1
RECID=953 STAMP=814107363
deleted
archived log
archived
log file
name=C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\ARCHIVELOG\2013_04_30\O1_MF_1_466_8QZYK67Y_.ARC
RECID=462 STAMP=814108007
deleted backup
piece
backup
piece
handle=C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\20130430_1314_ADNIBMSX_L0_BKP_DB_131481410755992O8CIT7_1_1
RECID=954 STAMP=814107645
deleted
archived log
archived
log file name=C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\ARCHIVELOG\2013_04_30\O1_MF_1_467_8QZYKBGQ_.ARC
RECID=463 STAMP=814108010
deleted
archived log
archived
log file
name=C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\ARCHIVELOG\2013_04_30\O1_MF_1_468_8R05TK4H_.ARC
RECID=464 STAMP=814115495
deleted
archived log
archived
log file
name=C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\ARCHIVELOG\2013_04_30\O1_MF_1_469_8R067B98_.ARC
RECID=465 STAMP=814115897
deleted
archived log
archived
log file
name=C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\ARCHIVELOG\2013_04_30\O1_MF_1_470_8R06D8FP_.ARC
RECID=466 STAMP=814116077
deleted
archived log
archived
log file
name=C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\ARCHIVELOG\2013_05_01\O1_MF_1_471_8R2CDMXZ_.ARC
RECID=467 STAMP=814273130
deleted
backup piece
backup
piece handle=C:\APP\ORACLE\PRODUCT\11.2.0\DBHOME_4\DATABASE\C-2634802274-20130501-00
RECID=975 STAMP=814273664
deleted
backup piece
backup
piece
handle=C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\2013_05_01\O1_MF_NNSNF_TAG20130501T110905_8R2D0LGM_.BKP
RECID=979 STAMP=814273746
deleted
backup piece
backup
piece
handle=C:\APP\ORACLE\PRODUCT\11.2.0\DBHOME_4\DATABASE\C-2634802274-20130501-01
RECID=980 STAMP=814273749
deleted
backup piece
backup
piece handle=C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\BACKUPSET\20130501_1370_ADNIBMSX_L0_BKP_CTL_1370814293288AQO8I898_1_1
RECID=992 STAMP=814293292
Deleted 21
objects
Recovery
Manager complete.
B.2 Incremental Level 1
Recovery Manager: Release
11.2.0.3.0 - Production on Thu May 2 11:03:13 2013
Copyright (c) 1982, 2011, Oracle
and/or its affiliates. All rights
reserved.
connected to target database:
ADNIBMSX (DBID=2634802274)
connected to recovery catalog
database
RMAN> # Will allow for
encrpted rman backups without introducing any keys, once the wallet is opned...
2> # should pass tag as a
partial parameter for the tag name.
3>
4> set encryption on;
5>
6> run {
7> allocate channel cH1 type disk;
8> sql 'alter system archive log
current';
9> crosscheck archivelog all;
10> release channel cH1;
11> allocate channel cH1 type disk;
12> allocate channel cH2 type disk;
13> allocate channel cH3 type disk;
14> allocate channel cH4 type disk;
15> set limit channel cH1 kbytes
16577216;
16> set limit channel cH2 kbytes 16577216;
17> set limit channel cH3 kbytes
16577216;
18> set limit channel cH4 kbytes
16577216;
19> BACKUP AS COMPRESSED BACKUPSET
20> INCREMENTAL LEVEL 1
21> FORMAT 'C:\app\oracle\flash_recovery_area\adnibmsx\BACKUPSET\%T_%s_%d_L1_bkp_Db_%s%t%U' tag = adnibmsx_INL1_201305021102
22> FILESPERSET 1
23> (database);
24> BACKUP AS COMPRESSED BACKUPSET
25> INCREMENTAL LEVEL 1
26> FORMAT
'C:\app\oracle\flash_recovery_area\adnibmsx\BACKUPSET\%T_%s_%d_L1_bkp_Ctl_%s%t%U'
tag = adnibmsx_INL1_201305021102
27> (current controlfile);
28> sql 'alter system archive log
current';
29> BACKUP AS COMPRESSED BACKUPSET
30> INCREMENTAL LEVEL 1
31> FORMAT
'C:\app\oracle\flash_recovery_area\adnibmsx\BACKUPSET\%T_%s_%d_L1_bkp_Arc_%s%t%U'
tag = adnibmsx_INL1_201305021102
32> (archivelog all);
33> backup spfile;
34> sql 'alter database backup controlfile
to trace';
35> release channel cH1;
36> release channel cH2;
37> release channel cH3;
38> release channel cH4;
39> }
40> resync catalog;
41> list backupset of database;
42> list backupset of controlfile;
43> list backupset of archivelog all;
44> list restore point all;
45> report schema;
46> validate check logical skip
inaccessible database;
47> restore validate database;
48> restore validate archivelog all;
49> report obsolete;
50> delete noprompt obsolete;
51> exit;
executing command: SET encryption
starting full resync of recovery
catalog
full resync complete
allocated channel: cH1
channel cH1: SID=537 device
type=DISK
sql statement: alter system
archive log current
validation succeeded for archived
log
archived log file
name=C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\ARCHIVELOG\2013_05_01\O1_MF_1_472_8R2CY3XS_.ARC
RECID=468 STAMP=814273668
validation succeeded for archived
log
archived log file
name=C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\ARCHIVELOG\2013_05_01\O1_MF_1_473_8R2CY5JN_.ARC
RECID=469 STAMP=814273669
validation succeeded for archived
log
archived log file
name=C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\ARCHIVELOG\2013_05_01\O1_MF_1_474_8R2YLR7Q_.ARC
RECID=470 STAMP=814292762
validation succeeded for archived
log
archived log file
name=C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\ARCHIVELOG\2013_05_01\O1_MF_1_475_8R2Z3MF4_.ARC
RECID=471 STAMP=814293299
validation succeeded for archived
log
archived log file
name=C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\ARCHIVELOG\2013_05_01\O1_MF_1_476_8R2Z3O05_.ARC
RECID=472 STAMP=814293301
validation succeeded for archived
log
archived log file
name=C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\ARCHIVELOG\2013_05_01\O1_MF_1_477_8R307R17_.ARC
RECID=473 STAMP=814294456
validation succeeded for archived
log
archived log file
name=C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\ARCHIVELOG\2013_05_01\O1_MF_1_478_8R309GBF_.ARC
RECID=474 STAMP=814294511
validation succeeded for archived
log
archived log file
name=C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\ARCHIVELOG\2013_05_01\O1_MF_1_479_8R309KDR_.ARC
RECID=475 STAMP=814294513
validation succeeded for archived
log
archived log file
name=C:\APP\ORACLE\FLASH_RECOVERY_AREA\ADNIBMSX\ARCHIVELOG\2013_05_02\O1_MF_1_480_8R501S3W_.ARC
RECID=476 STAMP=814359807
Crosschecked 9 objects
released channel: cH1