分类: Oracle
2010-11-16 14:37:54
Create controlfile noresetlogs 选择
Step1:
SQL> alter session set events 'immediate trace name FILE_HDRS level 10' ;
Session altered.
得到控制文件
CREATE CONTROLFILE REUSE DATABASE "T2" NORESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 '/u01/app/oracle/oradata/T2/redo01.log' SIZE 50M,
GROUP 2 '/u01/app/oracle/oradata/T2/redo02.log' SIZE 50M,
GROUP 3 '/u01/app/oracle/oradata/T2/redo03.log' SIZE 50M
-- STANDBY LOGFILE
DATAFILE
'/u01/app/oracle/oradata/T2/system01.dbf',
'/u01/app/oracle/oradata/T2/undotbs01.dbf',
'/u01/app/oracle/oradata/T2/sysaux01.dbf',
'/u01/app/oracle/oradata/T2/users01.dbf',
'/u01/app/oracle/oradata/T2/example01.dbf'
CHARACTER SET WE8ISO8859P1
Step2:
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup nomount
ORACLE instance started.
Total System Global Area 167772160 bytes
Fixed Size 1218316 bytes
Variable Size 62916852 bytes
Database Buffers 100663296 bytes
Redo Buffers 2973696 bytes
SQL>
SQL> CREATE CONTROLFILE REUSE DATABASE "T2" NORESETLOGS ARCHIVELOG
2 MAXLOGFILES 16
3 MAXLOGMEMBERS 3
4 MAXDATAFILES 100
5 MAXINSTANCES 8
6 MAXLOGHISTORY 292
7 LOGFILE
8 GROUP 1 '/u01/app/oracle/oradata/T2/redo01.log' SIZE 50M,
9 GROUP 2 '/u01/app/oracle/oradata/T2/redo02.log' SIZE 50M,
10 GROUP 3 '/u01/app/oracle/oradata/T2/redo03.log' SIZE 50M
11 -- STANDBY LOGFILE
12 DATAFILE
13 '/u01/app/oracle/oradata/T2/system01.dbf',
14 '/u01/app/oracle/oradata/T2/undotbs01.dbf',
15 '/u01/app/oracle/oradata/T2/sysaux01.dbf',
16 '/u01/app/oracle/oradata/T2/users01.dbf',
17 '/u01/app/oracle/oradata/T2/example01.dbf'
18 CHARACTER SET WE8ISO8859P1
19 ;
Control file created.
SQL> alter database mount;
alter database mount
*
ERROR at line 1:
ORA-01100: database already mounted
注意:数据库已经mount
Step3:
SQL> alter database open;
Database altered.
SQL> select open_mode from v$database;
OPEN_MODE
----------
READ WRITE
SQL>
Create controlfile resetlogs 选择
Step1同理
Step2
SQL> CREATE CONTROLFILE REUSE DATABASE "T2" RESETLOGS ARCHIVELOG
2 MAXLOGFILES 16
3 MAXLOGMEMBERS 3
4 MAXDATAFILES 100
5 MAXINSTANCES 8
6 MAXLOGHISTORY 292
7 LOGFILE
8 GROUP 1 '/u01/app/oracle/oradata/T2/redo01.log' SIZE 50M,
9 GROUP 2 '/u01/app/oracle/oradata/T2/redo02.log' SIZE 50M,
10 GROUP 3 '/u01/app/oracle/oradata/T2/redo03.log' SIZE 50M
11 -- STANDBY LOGFILE
12 DATAFILE
13 '/u01/app/oracle/oradata/T2/system01.dbf',
14 '/u01/app/oracle/oradata/T2/undotbs01.dbf',
15 '/u01/app/oracle/oradata/T2/sysaux01.dbf',
16 '/u01/app/oracle/oradata/T2/users01.dbf',
17 '/u01/app/oracle/oradata/T2/example01.dbf'
18 CHARACTER SET WE8ISO8859P1
19 /
Step3:(可选)
SQL> recover database until cancel using backup controlfile;
ORA-00279: change 512367 generated at 12/05/2010 03:34:24 needed for thread 1
ORA-00289: suggestion :
/u01/app/oracle/flash_recovery_area/T2/archivelog/2010_12_05/o1_mf_1_3_%u_.arc
ORA-00280: change 512367 for thread 1 is in sequence #3
Specify log: {
auto
ORA-00308: cannot open archived log
'/u01/app/oracle/flash_recovery_area/T2/archivelog/2010_12_05/o1_mf_1_3_%u_.arc'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3
ORA-00308: cannot open archived log
'/u01/app/oracle/flash_recovery_area/T2/archivelog/2010_12_05/o1_mf_1_3_%u_.arc'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3
step 4
SQL> alter database open resetlogs;
Database altered.
SQL>
alter database backup controlfile to '/' 的恢复
step1
SQL> alter database backup controlfile to '/u01/new.ctl';
Database altered.
step2
SQL> startup mount pfile='/u01/t2.ora'; ORACLE instance started. Total System Global Area 167772160 bytes Fixed Size 1218316 bytes Variable Size 62916852 bytes Database Buffers 100663296 bytes Redo Buffers 2973696 bytes Database mounted.
SQL>recover database using backup controlfile until cancel;
ORA-00279: change 519318 generated at 12/05/2010 05:34:29 needed for thread 1
ORA-00289: suggestion :
/u01/app/oracle/flash_recovery_area/T2/archivelog/2010_12_05/o1_mf_1_2_%u_.arc
ORA-00280: change 519318 for thread 1 is in sequence #2
Specify log: {
/u01/app/oracle/oradata/T2/redo02.log
Log applied.
Media recovery complete.
step4
SQL> alter database open resetlogs;
Database altered.
chinaunix网友2011-06-05 02:07:30
大连法律咨询在线 http://www.fabowang.com 大连律师在线咨询 http://www.fabowang.com 大连法律顾问网 http://www.fabowang.com 大连律师咨询 http://www.fabowang.com