My dream

RMAN—work through.

1. Use DBCA to create a database as target database suppose its name is 10g2T.

2. Use DBCA to create a database as catalog database suppose its name is 10g2.

3. Login 10g2 and create user and catalog.

dos>set oracle_sid=10g2

dos>sqlplus “/  as sysdba”

sys@10g2>create user rman_user identified by rman_user default tablespace user
s temporary tablespace temp;

sys@10g2>grant connect, resource, recover_catalog_owner to rman_user;

dos>set oracle_sid=10g2
dos>rman target /
rman> create catalog tablespace users;

4. Connect 10g2T (target database) through RMAN and register the database.

dos> set oracle_sid=10g2T
dos> RMAN target / catalog rman_user/rman_user@10g2
rman>Register database;

5. backup the target database (10g2T) in RMAN

rman>

run
{
allocate channel c1 type disk;
backup database format 'D:\oracle\rman\10g2t\db_%u_%d_%s';
backup format 'D:\oracle\rman\10g2t\log_t%t_s%s_p%p'
(archivelog all);
}

6. Test the restore & Recover in RMAN.

 
 
6.1 shutdown 10g2T abort. and then startup it in nomount.
6.2 delete all control files, datafiles. redo log files.
6.3 connect RMAN:
      dos> set oracle_sid=10g2T
      dos> rman target / catalog rman_user/rman_user@10g2
      rman> set dbid 2615281366;

RMAN> restore controlfile to 'D:\oracle\rman\10g2t\10g2tcf.ctl' from 'D:\oracle\
rman\10g2t\CFC-1106701862-20100910-01';

Starting restore at 10-SEP-10
using channel ORA_DISK_1

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 10-SEP-10

copy the controlfile to right path and rename it to control01.ctl and copy it to 02, 03.ctl.

RMAN > sql “alter database mount”; – mount 10g2T

RMAN> restore database;

Starting restore at 10-SEP-10
released channel: ORA_DISK_1
Starting implicit crosscheck backup at 10-SEP-10
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK
Crosschecked 5 objects
Finished implicit crosscheck backup at 10-SEP-10

Starting implicit crosscheck copy at 10-SEP-10
using channel ORA_DISK_1
Finished implicit crosscheck copy at 10-SEP-10

searching for all files in the recovery area
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: D:\ORACLE\FLASH_RECOVERY_AREA\10G2T\ARCHIVELOG\2010_09_10\O1_MF_1_15_
68N8RHDP_.ARC

using channel ORA_DISK_1

the filename for datafile 5 is missing in the control file
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to D:\ORACLE\ORADATA\10G2T\SYSTEM01.DBF
restoring datafile 00002 to D:\ORACLE\ORADATA\10G2T\UNDOTBS01.DBF
restoring datafile 00003 to D:\ORACLE\ORADATA\10G2T\SYSAUX01.DBF
restoring datafile 00004 to D:\ORACLE\ORADATA\10G2T\USERS01.DBF
channel ORA_DISK_1: reading from backup piece D:\ORACLE\RMAN\10G2T\DB_05LNINKD_1
0G2T_5
channel ORA_DISK_1: restored backup piece 1
piece handle=D:\ORACLE\RMAN\10G2T\DB_05LNINKD_10G2T_5 tag=TAG20100910T195908
channel ORA_DISK_1: restore complete, elapsed time: 00:00:45
Finished restore at 10-SEP-10

RMAN> restore archivelog all;

Starting restore at 10-SEP-10
using channel ORA_DISK_1

archive log thread 1 sequence 11 is already on disk as file D:\ORACLE\FLASH_RECO
VERY_AREA\10G2T\ARCHIVELOG\2010_09_10\O1_MF_1_11_68N0G6B8_.ARC
archive log thread 1 sequence 12 is already on disk as file D:\ORACLE\FLASH_RECO
VERY_AREA\10G2T\ARCHIVELOG\2010_09_10\O1_MF_1_12_68N13LTV_.ARC
archive log thread 1 sequence 13 is already on disk as file D:\ORACLE\FLASH_RECO
VERY_AREA\10G2T\ARCHIVELOG\2010_09_10\O1_MF_1_13_68N6XO1Y_.ARC
archive log thread 1 sequence 14 is already on disk as file D:\ORACLE\FLASH_RECO
VERY_AREA\10G2T\ARCHIVELOG\2010_09_10\O1_MF_1_14_68N7G10H_.ARC
archive log thread 1 sequence 15 is already on disk as file D:\ORACLE\FLASH_RECO
VERY_AREA\10G2T\ARCHIVELOG\2010_09_10\O1_MF_1_15_68N8RHDP_.ARC
restore not done; all files readonly, offline, or already restored
Finished restore at 10-SEP-10

RMAN> recover database;

Starting recover at 10-SEP-10
using channel ORA_DISK_1

starting media recovery

archive log thread 1 sequence 14 is already on disk as file D:\ORACLE\FLASH_RECO
VERY_AREA\10G2T\ARCHIVELOG\2010_09_10\O1_MF_1_14_68N7G10H_.ARC
archive log thread 1 sequence 15 is already on disk as file D:\ORACLE\FLASH_RECO
VERY_AREA\10G2T\ARCHIVELOG\2010_09_10\O1_MF_1_15_68N8RHDP_.ARC
archive log filename=D:\ORACLE\FLASH_RECOVERY_AREA\10G2T\ARCHIVELOG\2010_09_10\O
1_MF_1_14_68N7G10H_.ARC thread=1 sequence=14
archive log filename=D:\ORACLE\FLASH_RECOVERY_AREA\10G2T\ARCHIVELOG\2010_09_10\O
1_MF_1_15_68N8RHDP_.ARC thread=1 sequence=15
creating datafile fno=5 name=D:\ORACLE\ORADATA\10G2T\10G2T_IDX01.DBF
archive log filename=D:\ORACLE\FLASH_RECOVERY_AREA\10G2T\ARCHIVELOG\2010_09_10\O
1_MF_1_15_68N8RHDP_.ARC thread=1 sequence=15
unable to find archive log
archive log thread=1 sequence=16
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 09/10/2010 21:45:57
RMAN-06054: media recovery requesting unknown log: thread 1 seq 16 lowscn 577746

SYS@10g2t > alter database open resetlogs;

Database altered.

 

Till now the database has been successfully restored/recovered.

7. Others.

  reference: Backup and Recovery Reference

  Sybex.OCP.Oracle.10g.Administration.II.

posted on 2010-09-10 22:22  robin hu  阅读(251)  评论(0)    收藏  举报