RMAN restore and recovery using manual backups [message #62524] |
Mon, 26 July 2004 11:09 |
Kevin Darden
Messages: 6 Registered: July 2004
|
Junior Member |
|
|
Is it possible for RMAN to use "user managed" backups? If the datafiles, archivelogs, redo logs, control files are backed up using OS commands, can I then register these files with RMAN and use RMAN to restore and recover a database? Thanks in advance.
|
|
|
Re: RMAN restore and recovery using manual backups [message #62598 is a reply to message #62524] |
Mon, 02 August 2004 08:04 |
Frank Naude
Messages: 4581 Registered: April 1998
|
Senior Member |
|
|
Hi,
Indeed you can! Use the RMAN "CATALOG" command to register your backupcopies and archivelogs in the RMAN catalog. If the catalog is aware of your user-managed copies, it can consider them when a recovery and/or restore is required.
Here is a quick test you can try (on a test database obviously!):
-- Create test tablespace with test data...
create tablespace test datafile '/app/oracle/test1.dbf' size 10M;
create table test_tab (a date) tablespace test;
insert into test_tab values (SYSDATE);
commit;
-- Backup the tablespace...
alter tablespace test begin backup;
! cp /app/oracle/test1.dbf /app/oracle/test1.dbf.bak
alter tablespace test end backup;
-- catalog the backup datafile copy in RMAN...
! echo "CATALOG DATAFILECOPY '/app/oracle/test1.dbf.bak';" >rman.cmd
! rman target / catalog rman/rman cmdfile rman.cmd
-- Destroy the datafile!!!
! rm /app/oracle/test1.dbf
alter database datafile '/app/oracle/test1.dbf' offline drop;
-- Restore the datafile using RMAN...
! echo "restore datafile '/app/oracle/test1.dbf';" >rman.cmd
! echo "recover datafile '/app/oracle/test1.dbf';" >>rman.cmd
! rman target / catalog rman/rman cmdfile rman.cmd
alter database datafile '/app/oracle/test1.dbf' online;
-- Check if the data is back...
select * from test_tab;
Best regards.
Frank
|
|
|