Record an oracle database Restoration

Source: Internet
Author: User
A customer added a data file to the sysaux tablespace, but deleted the data file at the operating system layer rm. what's even worse is that the disk where the Archive was located is damaged, the archive required for recovery is not expected, and has not been performed for more than a year.

A customer added a data file to the sysaux tablespace, but deleted the data file at the operating system layer rm. what's even worse is that the disk where the Archive was located is damaged, the archive required for recovery is not expected, and has not been performed for more than a year.

A customer added a data file to the sysaux tablespace, but deleted the data file at the operating system layer rm. what's even worse is that the disk where the Archive was located is damaged, it is hopeless to restore the archive required, and database backup has not been performed for more than a year,
The recovery process is as follows: (re-simulate the recovery process on the virtual machine)


1. The data file status is as follows:
SQL> select file #, name, status from v $ datafile;

FILE # NAME STATUS
---------------------------------------------------------
1/oracle/CRM/ZBCRM/system01.dbf SYSTEM
2/oracle/CRM/ZBCRM/sysaux01.dbf ONLINE
3/oracle/CRM/ZBCRM/undotbs01.dbf ONLINE
4/oracle/CRM/ZBCRM/users01.dbf ONLINE
5/oracle/CRM/ZBCRM/sysaux02.dbf RECOVER

2. regenerate the data files deleted at the operating system layer.
SQL> alter database create datafile '/oracle/CRM/ZBCRM/sysaux02.dbf ';

Database altered.

Note: On the Hong Kong server, when we use alter database create datafile to create a data file, the data file header scn and rba. seq numbers are obtained from the scn and rba recorded in the control file when the data file is created. seq number.

3. The data file header information is as follows:
SQL> select hxfil, fhscn, fhrba_seq from x $ kcvfh;

Hxfil fhscn FHRBA_SEQ
------------------------------------
1 1047892 18
2 1047892 18
3 1047892 18
4 1047892 18
5 1026926 1
It can be clearly seen that the data file no. 5 needs to be restored from the archive with seq 1. The space in Hong Kong is available, but the archive with seq # = 1 and later does not exist. The VM, therefore, the following Recovery fails:
SQL> recover datafile 5;
ORA-00283: recovery session canceled due to errors
ORA-01110: data file 5: '/oracle/CRM/ZBCRM/sysaux02.dbf'
ORA-01157: cannot identify/lock data file 5-see DBWR trace file
ORA-01110: data file 5: '/oracle/CRM/ZBCRM/sysaux02.dbf'


4. Use bbed to adjust the following offsets of the data file No. 5:
Ub4 kcvfhcpc @ 140 ------ checkpoint count
Ub4 kcvfhccc @ 148 ------ always 1 less than the checkpoint count
Ub4 kcvcptim @ 492 ------ checkpoint time
Ub4 kscnbas @ 484 ------ low position of scn
Ub2 kscnwrp @ 488 ------ high position of scn
[Oracle @ oracle ~] $ Bbed parfile = bbed. par
Password:

BBED: Release 2.0.0.0.0-Limited Production on Thu Jul 25 14:26:45 2013

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

*************!!! For Oracle Internal Use only !!! ***************

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.