Oracle ACE Pro
Oracle Solution Architect
Oracle E-Business Suite
Oracle Cloud Infrastructure
Oracle Fusion Middleware
Oracle Database Administration
Oracle Weblogic Administration
Oracle ACE Pro
Oracle Solution Architect
Oracle E-Business Suite
Oracle Cloud Infrastructure
Oracle Fusion Middleware
Oracle Database Administration
Oracle Weblogic Administration
Architecture-R11i vs R12
Here is the list of key most RMAN commands that are used for Backup and related activities:
LIST Commands are generic RMAN commands that will show/list various types of information when executed within RMAN utility.
RMAN> list backup;
It lists all the backups taken using RMAN utility.
RMAN> list backup of database;
The above command lists out all the (individual) files that are in the backup.
RMAN> list backup of tablespace system;
The above command lists out all the files that are in the backup that belong to the tablespace ‘system’.
RMAN> list backup of control file;
The above command lists out all backups of the control file.
CONFIGURE commands in RMAN are used to configure/setup various initial settings:
RMAN>CONFIGURE RETENTION POLICY TO REDUNDANCY2;
The above commands indicates how many days the backup copies need to be retained. Default is 1 day.
RMAN> CONFIGURE RETENTION POLICY CLEAR;
The above command resets the Retention policy to the default value of 1 day.
CONFIGURE BACKUP OPTIMIZATION ON;
The above command verifies to make sure that identical files are NOT backed up to the device specified.
CONFIGURE BACKUP OPTIMIZATION CLEAR;
The above command resets the Optimization option to the default value.
Show commands are used to show/display the configuration setting values.
RMAN> show all;
The above command shows all the current configuration settings on the screen.
RMAN> show retention policy;
The above command shows the current retention policy.
RMAN> show default device type;
The above command shows the default device type configured for backups.
RMAN> show datafile backup copies;
The above command shows the number of backup copies available in the target database.
Backup commands are the real commands which do the actual backup work.
RMAN> backup database;
The above command backs up the database (target).
RMAN> backup database include current controlfile plus archive log;
The above command backs up the target database and the current control file and archive log files.
Report commands list/report specific information. The difference between report and list command is report command output is in a better format.
RMAN> report obsolete;
The above command reports which backups can be deleted.
Delete commands delete/remove specific items from the server, repository catalog.
RMAN> delete obsolete;
The above command deletes all the backups that are older based on the retention policy setup.
DECLARE
v_itemcount INTEGER;
BEGIN
SELECT Count(*)
INTO v_itemcount
FROM all_objects AO
WHERE AO.owner = USER
AND AO.object_type NOT IN ( ‘INDEX’ )
AND AO.object_name NOT LIKE ‘BIN$%’;
WHILE ( v_itemcount > 0 ) LOOP
FOR v_cmd IN (SELECT ‘drop ‘
|| AO.object_type
|| ‘ ‘
|| AO.object_name
|| Decode(AO.object_type, ‘TABLE’,
‘ CASCADE CONSTRAINTS’,
”) AS DROPCMD
FROM all_objects AO
WHERE AO.owner = USER
AND AO.object_type NOT IN ( ‘INDEX’ )
AND AO.object_name NOT LIKE ‘BIN$%’) LOOP
BEGIN
EXECUTE IMMEDIATE v_cmd.dropcmd;
EXCEPTION
WHEN OTHERS THEN
NULL; — ignore errors
END;
END LOOP;
SELECT Count(*)
INTO v_itemcount
FROM all_objects AO
WHERE AO.owner = USER
AND AO.object_type NOT IN ( ‘INDEX’ )
AND AO.object_name NOT LIKE ‘BIN$%’;
END LOOP;
EXECUTE IMMEDIATE ‘purge recyclebin’;
END;
All Rights Reserved