In case of shutdown abort, restore all control files (excluding data files and redo files)

Source: Internet
Author: User
Preparations
The following describes how to insert into test1 values (7) if the database is fully restored );
SQL> insert into test1 values (3 );

1 row created.

SQL> commit
2;

Commit complete.

SQL> insert into test1 values (4 );

1 row created.

SQL> commit;

Commit complete.

SQL>
SQL> alter system switch logfile;

System altered.

SQL> conn internal
Connected.
SQL> archive log list;
Database Log mode archive Mode
Automatic Archival Enabled
Archive destination D:/backupdb/archive
Oldest online log sequence 8
Next log sequence to archive 10
Current Log sequence 10
SQL>
SQL> select * From test1;

A
----------
1
2
3
4

SQL> insert into test1 values (5 );

1 row created.

SQL> commit;

Commit complete.

SQL> insert into test1 values (6 );

1 row created.

SQL> alter system switch logfile;

System altered.

SQL>
SQL> conn internal
Connected.
SQL> Conn Lunar/Lunar
Connected.
SQL> insert into test1 values (7 );

1 row created.

SQL> shutdown abort;
ORA-01031: insufficient privileges
SQL> conn internal
Connected.
SQL> shutdown abort;
Oracle instance shut down.
SQL>

Delete the control file and copy the Hot Standby control file.
Mount Database
SQL> startup Mount
Oracle instance started.

Total system global area 25856028 bytes
Fixed size 75804 bytes
Variable Size 8925184 bytes
Database buffers 16777216 bytes
Redo buffers 77824 bytes
ORA-01991: Invalid password file 'd:/oracle1/ora81/database/pwdbackup. ora'

Rebuild the password file as prompted
SQL> host
Microsoft Windows 2000 [version 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.

E:/> Cd D:/oracle1/ora81/Database

E:/> D:

D:/oracle1/ora81/database> Del pwdbackup. ora

D:/oracle1/ora81/database> dir
The volume in drive D is program
The serial number of the volume is the D0E6-FA1C

D:/oracle1/ora81/database directory

<Dir>.
<Dir> ..
<Dir> Archive
40 initbackup. ora
Inittest. ora
31,744 oradba.exe
206 oradim. Log
1,536 pwdtest. ora
33,576 bytes for five files
3 directories, 2,775,724,032 available bytes

D:/oracle1/ora81/database>
D:/oracle1/ora81/database> orapwd file = D:/oracle1/ora81/database/pwdbackup. ora Password = Oracle entries = 10;

D:/oracle1/ora81/database> exit

Back up control files with to trace
SQL> alter Database Backup controlfile to trace;

Database altered.
SQL> shutdown immediate
ORA-01109: Database not open

Database dismounted.
Oracle instance shut down.
SQL>

Find the control file and edit it.
Startup nomount
Create controlfile reuse Database "backup" noresetlogs archivelog
Maxlogfiles 32
Maxlogmembers 2
Maxdatafiles 254
Maxinstances 1
# Maxloghistory 453
Logfile
Group 1 'd:/backupdb/redo01.log 'size 1 m,
Group 2 'd:/backupdb/redo02.log 'size 1 m,
Group 3 'd:/backupdb/redo03.log 'size 1 m
Datafile
'D:/backupdb/system01.dbf ',
'D:/backupdb/rbs01.dbf ',
'D:/backupdb/users01.dbf ',
'D:/backupdb/temp01.dbf ',
'D:/backupdb/tools01.dbf ',
'D:/backupdb/indx01.dbf'
Character Set zhs16gbk
;
Recover Database
Alter system archive log all;
Alter database open;

Recreate the control file and restore the database (recovery successful !)
SQL> @ D:/backupdb/udump/ora02092. SQL
ORA-01081: cannot start already-running Oracle-shut it down first

Cluster altered.

Media recovery complete.

System altered.

Database altered.

SQL>
SQL> Conn Lunar/Lunar
Connected.
SQL> select * From test1;

A
----------
1
2
3
4
5
6
7

7 rows selected.

SQL>
Recovery successful!

Note:
If all the control files (excluding data files and redo files) are lost after Shutdown abort, you need to use the hot standby control file to restore the database, to completely recover (data that has been restored to the commit in redo), perform the following steps:
1. Mount the database,
2. Backup controlfile to trace
3. Modify the generated control file
4. nomount
5. Recreate the control file,

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.