Rman Recovery Case--loss of SPFile recovery

Source: Internet
Author: User
Tags exit log connect reserved version variable backup
Recover 1.1. Loss of SPFile Recovery
Prerequisite: Automatic backup of database control files has been configured and reliable backups have been made:

Rman> CONFIGURE controlfile autobackup on;



New RMAN configuration parameters:

CONFIGURE Controlfile autobackup on;

A new RMAN configuration parameter was successfully stored

Starting resync for full recovery directory

Complete all Resync



Rman>



rman> CONFIGURE controlfile autobackup FORMAT for DEVICE TYPE DISK to ' D:\RMANTEST\%F ';



New RMAN configuration parameters:

CONFIGURE controlfile autobackup FORMAT for DEVICE TYPE DISK to ' D:\RMANTEST\%F ';

A new RMAN configuration parameter was successfully stored

Starting resync for full recovery directory

Complete all Resync



Rman>



Rman> Show All;



The RMAN configuration parameters are:

CONFIGURE RETENTION POLICY to redundancy 1; # Default

CONFIGURE BACKUP optimization off; # Default

CONFIGURE DEFAULT DEVICE TYPE to DISK;

CONFIGURE Controlfile autobackup on;

CONFIGURE controlfile autobackup FORMAT for DEVICE TYPE DISK to ' D:\RMANTEST\%F ';

CONFIGURE DEVICE TYPE DISK PARALLELISM 1;

CONFIGURE datafile BACKUP copies for DEVICE TYPE DISK to 1; # Default

CONFIGURE Archivelog BACKUP copies for DEVICE TYPE DISK to 1; # Default

CONFIGURE maxsetsize to unlimited; # Default

CONFIGURE SNAPSHOT controlfile NAME to ' D:\ORACLE92\DATABASE NCFTEST1. ORA '; # Default



Rman>



Rman> run{

2> Backup Database

3> tag ' full_db_20041007 '

4> format ' D:\rmantest\full_dbtest_yyyymmdd%_u%.bak '

5> include current controlfile;

6> Backup Archivelog All

7> tag ' Arch_bak '

8> format ' D:\rmantest\arch_yyyymmdd%_u%.bak '

9> delete input;}



Start Backup in July-October-04

Allocated channel: Ora_disk_1

Channel Ora_disk_1:sid=13 Devtype=disk

Channel Ora_disk_1: Starting full data file backup set

Channel Ora_disk_1: Specifying Data files in Backup set

The backup set includes the current control file

Enter the data file fno=00001 name=d:\oracle92\test1 YSTEM01. Dbf

Enter the data file fno=00002 name=d:\oracle92\test1\undotbs01. Dbf

Enter the data file fno=00006 Name=d:\oracle92\test1\rman01. Dbf

Enter the data file fno=00003 name=d:\oracle92\test1\indx01. Dbf

Enter the data file fno=00005 name=d:\oracle92\test1\users01. Dbf

Enter the data file fno=00004 name=d:\oracle92\test1\tools01. Dbf

Channel Ora_disk_1: Starting segment 1 in July-October-04

Channel Ora_disk_1: Completed segment 1 in July-October-04

Segment handle=d:\rmantest\full_dbtest_yyyymmdd%_u%. BAK Comment=none

Channel Ora_disk_1: Backup set completed, after time: 00:01:06

Completed backup in July-October-04



Start Backup in July-October-04

The current log is archived

Using channel Ora_disk_1

Channel Ora_disk_1: Starting archive log backup set

Channel Ora_disk_1: Specifying archive logs in Backup set

Enter archive log thread =1 sequence = 15 record id=20 timestamp =538928248

Channel Ora_disk_1: Starting segment 1 in July-October-04

Channel Ora_disk_1: Completed segment 1 in July-October-04

Segment handle=d:\rmantest\arch_yyyymmdd%_u%. BAK Comment=none

Channel Ora_disk_1: Backup set completed, after time: 00:00:02

Channel Ora_disk_1: Deleting archive logs

Archive log file name =d:\oracle92\admin\test1\arch\arc00015.001 record id=20 timestamp =538928248

Completed backup in July-October-04



Start Control File and SPFILE autobackup in July-October-04

Duan Handle=d:\rmantest\c-910599446-20041007-00 Comment=none

Complete control File and SPFILE autobackup in July-October-04



Rman>








1.1.1. Move the current spfile to another location to simulate spfile loss
Rman> host;



Microsoft Windows XP [version 5.1.2600]

(C) Copyright 1985-2001 Microsoft Corp.



C:\>move D:\oracle92\database PFILETEST1. ORA D:\oracle92\database\bak PFILETEST1. ORA



C:\>dir D:\oracle92\database PFILETEST1. ORA

The volume in drive D is not labeled.

The serial number of the volume is 644d-03d9



D:\oracle92\database's Directory



File not found



C:\>dir D:\oracle92\database\bak PFILETEST1. ORA

The volume in drive D is not labeled.

The serial number of the volume is 644d-03d9



D:\oracle92\database\bak's Directory



2004-10-04 14:06 2,560 SPFILETEST1. ORA

1 files 2,560 bytes

0 Directory 10,708,807,680 Free bytes



C:\>exit

Host command complete



Rman>


1.1.2. Set Oracle_sid
C:\>set Oracle_sid=test1



C:\>echo Oracle_sid

Oracle_sid



C:\>


1.1.3. Landing Rman
C:\>rman



Recovery Manager: Version 9.2.0.1.0-production



Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.



Rman> Connect Target Lunar/lunar@test1



Connected to target database (not started)



Rman> Connect Catalog Rman/rman@rman



Connecting to the Recovery directory database



Rman>


1.1.4. Set dbid in Rman
To let Rman know which database to look for SPFile

(dbid must be set in case of data shutdown)

Rman> Set dbid=910599446



Executing command: SET DBID



Rman>


1.1.5. To boot the database to the Nomount state
rman> startup Nomount;



Startup failed: Ora-01078:failure in processing system parameters

Lrm-00109:n^7 (4r?*2nj}nd<~ ' D:\ORACLE92\DATABASE\INITTEST1. ORA '



Attempting to start an Oracle routine without a parameter file ...

Oracle routines Started



System global Zone total 97589952 bytes



Fixed Size 453312 bytes

Variable Size 46137344 bytes

Database buffers 50331648 bytes

Redo buffers 667648 bytes



Rman>


1.1.6. To restore a parameter file from an automatic backup
Rman> Show All;



The RMAN configuration parameters are:

CONFIGURE RETENTION POLICY to redundancy 1; # Default

CONFIGURE BACKUP optimization off; # Default

CONFIGURE DEFAULT DEVICE TYPE to DISK;

CONFIGURE Controlfile autobackup on;

CONFIGURE controlfile autobackup FORMAT for DEVICE TYPE DISK to ' D:\RMANTEST\%F ';

CONFIGURE DEVICE TYPE DISK PARALLELISM 1;

CONFIGURE datafile BACKUP copies for DEVICE TYPE DISK to 1; # Default

CONFIGURE Archivelog BACKUP copies for DEVICE TYPE DISK to 1; # Default

CONFIGURE maxsetsize to unlimited; # Default



rman> restore SPFile from Autobackup;



Start Restore in July-October-04



Allocated channel: Ora_disk_1

Channel Ora_disk_1:sid=9 Devtype=disk

Channel Ora_disk_1: Find automatic backups for the following dates: 20041007

Channel Ora_disk_1: Automatic backup found: D:\RMANTEST\c-910599446-20041007-00

Channel Ora_disk_1: Recovery from automatic backup SPFILE completed

Completed restore in July-October-04



Rman> host;





Recovery manager complete.



C:\>dir D:\oracle92\database PFILETEST1. ORA

The volume in drive D is not labeled.

The serial number of the volume is 644d-03d9



D:\oracle92\database's Directory



2004-10-07 14:31 2,560 SPFILETEST1. ORA

1 files 2,560 bytes

0 Directory 10,528,374,784 Free bytes



C:\> exit



Recovery Manager: Version 9.2.0.1.0-production



Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.



Connect to target database: TEST1 (not installed)

Connecting to the Recovery directory database



Rman>


1.1.7. Close the database with shutdown immediate
rman> shutdown immediate;



Oracle routines are closed



Rman>


1.1.8. Restart Database
Rman> Set dbid=910599446



Executing command: SET DBID



Rman> Startup



Connected to target database (not started)

Oracle routines Started

The database is loaded

Database is open



System global Zone total 101784276 bytes



Fixed Size 453332 bytes

Variable Size 75497472 bytes

Database buffers 25165824 bytes

Redo buffers 667648 bytes



Rman>


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.