Tabs

Thursday, January 8, 2015

Restore Controlfile using RMAN


Backup.Bat: -

SET ORACLE_HOME=D:\app\CYBADMIN\product\11.2.0\dbhome_1

SET ORACLE_SID=ORCL

RMAN TARGET SYS/ CMDFILE D:\app\Backup\BACKUP.RCV LOG D:\app\Backup\BACKUP.LOG



Backup.RCV: -

Run {

Allocate channel t1 type disk;

Allocate channel t2 type disk;

Allocate channel t3 type disk;

Allocate channel t4 type disk;

Backup AS COMPRESSED BACKUPSET database format 'D:\app\Backup\Backup\bk_%s_%p_%t'

                        Plus archivelog format 'D:\app\Backup\Backup\al_%s_%p_%t';

Sql "alter database backup controlfile to ''D:\app\Backup\Backup\control.ctl'' REUSE";

Sql "alter database backup controlfile to trace as ''D:\app\Backup\Backup\control.txt'' REUSE";

}



D:\app\Backup>backup.bat

D:\app\Backup>SET ORACLE_HOME=D:\app\CYBADMIN\product\11.2.0\dbhome_1

D:\app\Backup>SET ORACLE_SID=ORCL

D:\app\Backup>RMAN TARGET SYS/ CMDFILE D:\app\Backup\BACKUP.RCV LOG D:\app\Backup\BACKUP.LOG

RMAN> 2> 3> 4> 5> 6> 7> 8> 9> 10> 11>

D:\app\Backup>rman target sys/

Recovery Manager: Release 11.2.0.1.0 - Production on Thu Jan 8 14:19:53 2015

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

target database Password:

connected to target database: ORCL (DBID=1380168819)

RMAN> shutdown immediate

using target database control file instead of recovery catalog

database closed

database dismounted

Oracle instance shut down

RMAN> exit

Recovery Manager complete.


D:\app\Backup>rman target SYS/

Recovery Manager: Release 11.2.0.1.0 - Production on Thu Jan 8 14:20:56 2015

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

target database Password:

connected to target database (not started)



RMAN> startup nomount;

Oracle instance started

Total System Global Area    1603411968 bytes

Fixed Size                     2176168 bytes

Variable Size               1073744728 bytes

Database Buffers             520093696 bytes

Redo Buffers                   7397376 bytes

RMAN> run

{

Allocate channel c1 device type disk;

Restore controlfile from 'D:\app\Backup\Backup\control.ctl';

}

using target database control file instead of recovery catalog

allocated channel: c1

channel c1: SID=134 device type=DISK

Starting restore at 08-JAN-15

channel c1: copied control file copy

output file name=D:\APP\CYBADMIN\ORADATA\ORCL\CONTROL01.CTL

output file name=D:\APP\CYBADMIN\FLASH_RECOVERY_AREA\ORCL\CONTROL02.CTL

Finished restore at 08-JAN-15

released channel: c1

RMAN> alter database mount;

database mounted



RMAN> run {

recover database;

alter database open resetlogs;

}

Starting recover at 08-JAN-15

Starting implicit crosscheck backup at 08-JAN-15

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=134 device type=DISK

Crosschecked 6 objects

Finished implicit crosscheck backup at 08-JAN-15

Starting implicit crosscheck copy at 08-JAN-15

using channel ORA_DISK_1

Crosschecked 10 objects

Finished implicit crosscheck copy at 08-JAN-15

searching for all files in the recovery area

cataloging files...

no files cataloged

using channel ORA_DISK_1

starting media recovery

archived log for thread 1 with sequence 3 is already on disk as file D:\APP\CYBADMIN\ORADATA\ORCL\REDO03.LOG

archived log file name=D:\APP\CYBADMIN\ORADATA\ORCL\REDO03.LOG thread=1 sequence=3

media recovery complete, elapsed time: 00:00:01

Finished recover at 08-JAN-15

database opened

RMAN>

No comments:

Post a Comment

Thank you for your Suggestions...