Cold backup Recovery for Oracle 11g

Source: Internet
Author: User

The two days to restore Oracle really headaches, my environment is cenos5.3+oracle11g, the official server's database instance path is:/app/oracle/oradata/databar, originally only backed up the files in this directory:

Control01.ctl
Redo01.log
Redo02.log
Redo03.log
Sysaux01.dbf
System01.dbf
Temp01.dbf
Undotbs01.dbf
Users01.dbf

The Oracle program for the new environment is installed under a completely different path:/u01/app/oracle, which later uses the DBCA tool under the Linux command to create the database (SID has the same name as the official server: "Databar") and keep the SYS user's password consistent with the original information. Before creating a new database administrator account, incidentally, the Linux graphical interface of the DBCA tool to create a database is slow enough, experienced should be directly with the command line to create. After you create the database, the new data files are stored in the/u01/app/oracle/oradata/databar directory and then restored as follows:
Shutdown Oracle Database, overwriting previous data files with data files and deleting control files and redo log files;

Second, switch to Oracle user and enter Sqlplus, connect to Oracle with SYS user;

Third, first close and then start the database, but do not mount data files;
sql> shutdown immediate;
sql> startup Nomount;

This column more highlights: http://www.bianceng.cnhttp://www.bianceng.cn/database/Oracle/

Iv. reconstruction of control documents;
CREATE controlfile Reuse DATABASE "Databar" Resetlogs Noarchivelog
--set STANDBY to maximize performance
Maxlogfiles 50
Maxlogmembers 5
Maxdatafiles 100
Maxinstances 1
Maxloghistory 226
LOGFILE
GROUP 1 '/u01/app/oracle/oradata/databar/redo01.log ' SIZE 100M,
GROUP 2 '/u01/app/oracle/oradata/databar/redo02.log ' SIZE 100M,
GROUP 3 '/u01/app/oracle/oradata/databar/redo03.log ' SIZE 100M
--standby LOGFILE
DataFile
'/u01/app/oracle/oradata/databar/users01.dbf ',
'/u01/app/oracle/oradata/databar/undotbs01.dbf ',
'/u01/app/oracle/oradata/databar/system01.dbf ',
'/U01/APP/ORACLE/ORADATA/DATABAR/SYSAUX01.DBF '
--character SET ZHS16GBK (omitted as the case may be)
;
(Specify all the data files here, note that here temporarily do not specify temporary table space to use the file, namely temp01.dbf ', otherwise will report ORA-01503: error)
The above statement, you need to specify the path to use single quotes, or you will report the following error:
LogFile with double quotes: Ora-00972:identifier is too long
DataFile with double quotes: ora-01967:invalid option for CREATE controlfile.

V. Create the control file successfully, execute the following statement to open the database, plus the Resetlogs parameter is to regenerate redo log files;
sql> ALTER DATABASE open resetlogs;
If the following error occurs:
ALTER DATABASE open Resetlogs
*
Line 1th Error:
ORA-01194: File 1 requires more recovery to maintain consistency
ORA-01110: Data file 1: '/U01/APP/ORACLE/ORADATA/DATABAR/SYSTEM01.DBF '
The workaround is as follows:
sql> ALTER DATABASE open resetlogs;
ALTER DATABASE open Resetlogs
*
ERROR at line 1:
Ora-01194:file 1 needs more recovery to be consistent
Ora-01110:data file 1: '/U01/APP/ORACLE/ORADATA/DATABAR/SYSTEM01.DBF '
If the above error occurs, enter the following statement:
Sql> Set Wrap off
Sql> set Lin 300
Sql> select File#,ts#,status,name from V$datafile;
#查看下当前数据文件的状态
And then execute the following SQL statement
sql> recover database until cancel;
Ora-00283:recovery session canceled due to errors
Ora-01610:recovery using the BACKUP controlfile option must is done
If you execute the following SQL statement after the execution of the SQL statement above fails
sql> Recover database using Backup controlfile until cancel; After executing the following SQL statement, you will get a hint below.
Ora-00279:change 476049 generated at 01/08/2010 12:35:18 for thread 1
Ora-00289:suggestion:/u01/app/oracle/flash_recovery_area/databar/archivelog/2010_08_01/2010_01_08o1_mf_1_18_%u _. ARC
Ora-00280:change 476049 for thread 1 was in sequence #18

Specify log: {=suggested | AUTO | CANCEL}
#在此处先填写日志文件REDO01. LOG's specific path (in the fourth step of the build control file in the script), and then enter, if there is an error, then execute
#recover database using Backup controlfile until cancel;
#然后在填写 REDO02. The specific path of LOG ""
#直到输入文件路径回车之后出现以下成功提示:
Log applied.
Media recovery complete.

Vi. execute the following statement open the database, plus the Resetlogs parameter is to regenerate the redo log file; * Note that you must execute this SQL statement
sql> ALTER DATABASE open resetlogs;
Database altered.

Add temporary table spaces to the instance and reuse them:
Sql> alter tablespace TEMP add Tempfile '/u01/app/oracle/oradata/databar/temp01. DBF ' reuse;

Now that the database recovery is complete, IMP can also be used to import the latest data on the official server.

This article comes from "Life is not, fighting is endless!" "Blog, please be sure to keep this source http://soulful.blog.51cto.com/468033/367942

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.