一次的TSM 沒CATALOG 恢復到另外庫的實驗記錄.

zhulch發表於2007-02-14

只是在別人沒有恢復成功的基礎上,自己隨便測試再次恢復,請在生產系統,慎重考慮

[@more@]


[test:oratest] /oratest/home>
[test:oratest] /oratest/home> sqlplus "/as sysdba"

SQL*Plus: Release 10.2.0.2.0 - Production on Wed Feb 14 13:34:31 2007

Copyright (c) 1982, 2005, Oracle. All Rights Reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 1241513984 bytes
Fixed Size 2070912 bytes
Variable Size 318768768 bytes
Database Buffers 905969664 bytes
Redo Buffers 14704640 bytes
Database mounted.
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: '/devtest2/oradata/test/redo01.log'


## 由於是從別的庫TSM 恢復過來的,沒有恢復完全,出現REDO 還指向原來的位置情況

SQL> select group#,sequence#,archived,status from v$log;

GROUP# SEQUENCE# ARC STATUS
---------- ---------- --- ----------------
1 2 NO CURRENT
3 0 YES UNUSED
2 1 YES INACTIVE

## 發現壞的REDO 是當前,並且還沒有歸檔


## 採取了清除unarchived logfile group 1,是失敗(因為根本沒哪個路徑也沒哪個檔案)


SQL> alter database clear unarchived logfile group 1;
alter database clear unarchived logfile group 1
*
ERROR at line 1:
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: '/devtest2/oradata/test/redo01.log'
ORA-27037: unable to obtain file status
IBM AIX RISC System/6000 Error: 2: No such file or directory
Additional information: 3


SQL> alter database clear unarchived
2 ;

*
ERROR at line 2:
ORA-01900: LOGFILE keyword expected


SQL> recover database until cancel;
Media recovery complete.
SQL> select * from v$log;

GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS
---------- ---------- ---------- ---------- ---------- --- ----------------
FIRST_CHANGE# FIRST_TIM
------------- ---------
1 1 0 536870912 1 NO CLEARING_CURRENT
2631250 12-DEC-06

3 1 0 536870912 1 YES CLEARING
0

2 1 0 536870912 1 YES UNUSED
0 07-DEC-06


## 採取Drop logfile group 1; 但失敗


SQL> alter database drop logfile group 1;
alter database drop logfile group 1
*
ERROR at line 1:
ORA-01623: log 1 is current log for instance test (thread 1) - cannot drop
ORA-00312: online log 1 thread 1: '/devtest2/oradata/test/redo01.log'

## 檢視所有的REDO LOGFILE 都是保留原來的位置(根本都不存在了)

SQL> select * from v$logfile;

GROUP# STATUS TYPE
---------- ------- -------
MEMBER
--------------------------------------------------------------------------------
IS_
---
3 ONLINE
/devtest2/oradata/test/redo03.log
NO

2 ONLINE
/devtest2/oradata/test/redo02.log
NO

GROUP# STATUS TYPE
---------- ------- -------
MEMBER
--------------------------------------------------------------------------------
IS_
---

1 ONLINE
/devtest2/oradata/test/redo01.log
NO

##增加新的LOGFILE GROUP 4 ,5 ,6 到本地的位置

SQL> alter database add logfile group 4 ('/testdata/oradata/test/redo04.log')
size 1024k;
alter database add logfile group 4 ('/testdata/oradata/test/redo04.log') size
1024k
*
ERROR at line 1:
ORA-00336: log file size 2048 blocks is less than minimum 8192 blocks


SQL> alter database add logfile group 4 ('/testdata/oradata/test/redo04.log')
size 5m;

Database altered.

SQL> alter database add logfile group 5 ('/testdata/oradata/test/redo05.log')
size 5m;

Database altered.


## 試圖透過切換日誌,把壞的REDO GROUP 換掉,失敗
SQL> alter system switch logfile;
alter system switch logfile
*
ERROR at line 1:
ORA-01109: database not open


##再次檢視RELOG
SQL> select * from v$log;

GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS
---------- ---------- ---------- ---------- ---------- --- ----------------
FIRST_CHANGE# FIRST_TIM
------------- ---------
1 1 0 536870912 1 NO CLEARING_CURRENT
2631250 12-DEC-06

2 1 0 536870912 1 YES UNUSED
0 07-DEC-06

5 1 0 5242880 1 YES UNUSED
0


GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS
---------- ---------- ---------- ---------- ---------- --- ----------------
FIRST_CHANGE# FIRST_TIM
------------- ---------
4 1 0 5242880 1 YES UNUSED
0

3 1 0 536870912 1 YES CLEARING
0


## drop logfile group 2,3 (Y原來的位置), 1 失敗
SQL> alter database drop logfile group 2;

Database altered.

SQL> alter database drop logfile group 3;

Database altered.

SQL> alter database drop logfile group 1;
alter database drop logfile group 1
*
ERROR at line 1:
ORA-01623: log 1 is current log for instance test (thread 1) - cannot drop
ORA-00312: online log 1 thread 1: '/devtest2/oradata/test/redo01.log'


## 重起 DB
SQL> shutdown immedaite
SP2-0717: illegal SHUTDOWN option
SQL> shutdown immediate
ORA-01109: database not open


Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 1241513984 bytes
Fixed Size 2070912 bytes
Variable Size 318768768 bytes
Database Buffers 905969664 bytes
Redo Buffers 14704640 bytes
Database mounted.
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open

## 根據提示做alter database resetlogs;

SQL> alter database resetlogs;
alter database resetlogs
*
ERROR at line 1:
ORA-02231: missing or invalid option to ALTER DATABASE


SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-19510: failed to set size of 499712 blocks for file
"/devtest2/oradata/test/redo01.log" (blocksize=512)
ORA-27059: could not reduce file size
IBM AIX RISC System/6000 Error: 28: No space left on device
Additional information: 1
ORA-19502: write error on file "/devtest2/oradata/test/redo01.log", blockno
491521 (blocksize=512)
ORA-27063: number of bytes read/written is incorrect
IBM AIX RISC System/6000 Error: 28: No space left on device
Additional information: -1
Additional information: 1048576

## 再次試圖DROP GROUP 1

SQL> alter database drop logfile group 1;
alter database drop logfile group 1
*
ERROR at line 1:
ORA-01623: log 1 is current log for instance test (thread 1) - cannot drop
ORA-00312: online log 1 thread 1: '/devtest2/oradata/test/redo01.log'


## 再次檢查LOGFILE
SQL> select * from v$log;

GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS
---------- ---------- ---------- ---------- ---------- --- ----------------
FIRST_CHANGE# FIRST_TIM
------------- ---------
1 1 0 536870912 1 NO CLEARING_CURRENT
2631250 12-DEC-06

5 1 0 5242880 1 YES UNUSED
0

4 1 0 5242880 1 YES UNUSED
0


SQL> alter system switch logfile;
alter system switch logfile
*
ERROR at line 1:
ORA-01109: database not open


SQL> alter database open noresetlogs;
alter database open noresetlogs
*
ERROR at line 1:
ORA-01588: must use RESETLOGS option for database open


SQL> alter database add logfile group 6 ('/testdata/oradata/test/redo06.log')
size 5m;

Database altered.

S


SQL> select * from v$log;

GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS
---------- ---------- ---------- ---------- ---------- --- ----------------
FIRST_CHANGE# FIRST_TIM
------------- ---------
1 1 0 536870912 1 NO CLEARING_CURRENT
2631250 12-DEC-06

6 1 0 5242880 1 YES UNUSED
0

5 1 0 5242880 1 YES UNUSED
0


GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS
---------- ---------- ---------- ---------- ---------- --- ----------------
FIRST_CHANGE# FIRST_TIM
------------- ---------
4 1 0 5242880 1 YES UNUSED
0


SQL> recover database until cancel
ORA-00283: recovery session canceled due to errors
ORA-01610: recovery using the BACKUP CONTROLFILE option must be done


SQL> recover database until cancel;
ORA-00283: recovery session canceled due to errors
ORA-01610: recovery using the BACKUP CONTROLFILE option must be done


SQL> recover database using BACKUP CONTROLFILE until cancel;
ORA-00279: change 2671121 generated at 12/13/2006 03:05:43 needed for thread 1
ORA-00289: suggestion :
/oratest/app/oracle/product/10.2.0/dbs/arch/1_2_608543727.dbf
ORA-00280: change 2671121 for thread 1 is in sequence #2


Specify log: {=suggested | filename | AUTO | CANCEL}
auto
ORA-00308: cannot open archived log
'/oratest/app/oracle/product/10.2.0/dbs/arch/1_2_608543727.dbf'
ORA-27037: unable to obtain file status
IBM AIX RISC System/6000 Error: 2: No such file or directory
Additional information: 3


ORA-00308: cannot open archived log
'/oratest/app/oracle/product/10.2.0/dbs/arch/1_2_608543727.dbf'
ORA-27037: unable to obtain file status
IBM AIX RISC System/6000 Error: 2: No such file or directory
Additional information: 3


SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-19510: failed to set size of 499712 blocks for file
"/devtest2/oradata/test/redo01.log" (blocksize=512)
ORA-27059: could not reduce file size
IBM AIX RISC System/6000 Error: 28: No space left on device
Additional information: 1
ORA-19502: write error on file "/devtest2/oradata/test/redo01.log", blockno
491521 (blocksize=512)
ORA-27063: number of bytes read/written is incorrect
IBM AIX RISC System/6000 Error: 28: No space left on device
Additional information: -1
Additional information: 1048576


SQL> show parameter spfile;

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string /oratest/app/oracle/product/10
.2.0/dbs/spfiletest.ora
SQL> alter system set _allow_resetlogs_corruption=TRUE
2 ;
alter system set _allow_resetlogs_corruption=TRUE
*
ERROR at line 1:
ORA-00911: invalid character


SQL> shutdown immediate
ORA-01109: database not open


Database dismounted.
ORACLE instance shut down.
SQL> quit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64
bit Production
With the Partitioning, OLAP and Data Mining options
[test:oratest] /oratest/home> cd $ORACLE_HOME

[test:oratest] /oratest/app/oracle/product/10.2.0> cd dbs
[test:oratest] /oratest/app/oracle/product/10.2.0/dbs> ls
alert_test.log init.ora lktest spfiletest.ora
arch inittest.ora orapwtest
hc_test.dat initdw.ora snapcf_test.f
[test:oratest] /oratest/app/oracle/product/10.2.0/dbs> vi inittest.ora
test.__db_cache_size=905969664
test.__java_pool_size=16777216
test.__large_pool_size=16777216
test.__shared_pool_size=285212672
test.__streams_pool_size=0
*.audit_file_dest='/oratest/app/oracle/admin/test/adump'
*.background_dump_dest='/oratest/app/oracle/admin/test/bdump'
*.compatible='10.2.0.2.0'
*.control_files='/testdata/oradata/test/control01.ctl','/testdata/oradata/csei
nd/control02.ctl','/testdata/oradata/test/control03.ctl'
*.core_dump_dest='/oratest/app/oracle/admin/test/cdump'
*.db_block_size=8192
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='test'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=testXDB)'
*.job_queue_processes=10
*.open_cursors=300
*.pga_aggregate_target=409993216
*.processes=200
*.remote_login_passwordfile='EXCLUSIVE'
*.sessions=225
"inittest.ora" 25 lines, 936 characters
test.__java_pool_size=16777216
test.__large_pool_size=16777216
test.__shared_pool_size=285212672
test.__streams_pool_size=0
*.audit_file_dest='/oratest/app/oracle/admin/test/adump'
*.background_dump_dest='/oratest/app/oracle/admin/test/bdump'
*.compatible='10.2.0.2.0'
*.control_files='/testdata/oradata/test/control01.ctl','/testdata/oradata/csei
nd/control02.ctl','/testdata/oradata/test/control03.ctl'
*.core_dump_dest='/oratest/app/oracle/admin/test/cdump'
*.db_block_size=8192
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='test'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=testXDB)'
*.job_queue_processes=10
*.open_cursors=300
*.pga_aggregate_target=409993216
*.processes=200
*.remote_login_passwordfile='EXCLUSIVE'
*.sessions=225
*.sga_target=1231028224

*.undo_management='AUTO'

*.undo_tablespace='UNDOTBS1'


test.__java_pool_size=16777216
test.__large_pool_size=16777216
test.__shared_pool_size=285212672
test.__streams_pool_size=0
*.audit_file_dest='/oratest/app/oracle/admin/test/adump'
*.background_dump_dest='/oratest/app/oracle/admin/test/bdump'
*.compatible='10.2.0.2.0'
*.control_files='/testdata/oradata/test/control01.ctl','/testdata/oradata/csei
nd/control02.ctl','/testdata/oradata/test/control03.ctl'
*.core_dump_dest='/oratest/app/oracle/admin/test/cdump'
*.db_block_size=8192
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='test'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=testXDB)'
*.job_queue_processes=10
*.open_cursors=300
*.pga_aggregate_target=409993216
*.processes=200
*.remote_login_passwordfile='EXCLUSIVE'
*.sessions=225
*.sga_target=1231028224

*.undo_management='AUTO'

*.undo_tablespace='UNDOTBS1'

*.remote_login_passwordfile='EXCLUSIVE'
*.sessions=225
*.sga_target=1231028224
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='/oratest/app/oracle/admin/test/udump'
## 增加
_allow_resetlogs_corruption=TRUE


"inittest.ora" 27 lines, 971 characters
[test:oratest] /oratest/app/oracle/product/10.2.0/dbs>
[test:oratest] /oratest/app/oracle/product/10.2.0/dbs>
[test:oratest] /oratest/app/oracle/product/10.2.0/dbs>
[test:oratest] /oratest/app/oracle/product/10.2.0/dbs> sqlplus "/as sysdba"

SQL*Plus: Release 10.2.0.2.0 - Production on Wed Feb 14 13:57:15 2007

Copyright (c) 1982, 2005, Oracle. All Rights Reserved.

Connected to an idle instance.

SQL> create spfile from pfile;

File created.

SQL> startup
ORACLE instance started.

Total System Global Area 1241513984 bytes
Fixed Size 2070912 bytes
Variable Size 318768768 bytes
Database Buffers 905969664 bytes
Redo Buffers 14704640 bytes
Database mounted.
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open


SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-19510: failed to set size of 499712 blocks for file
"/devtest2/oradata/test/redo01.log" (blocksize=512)
ORA-27059: could not reduce file size
IBM AIX RISC System/6000 Error: 28: No space left on device
Additional information: 1
ORA-19502: write error on file "/devtest2/oradata/test/redo01.log", blockno
491521 (blocksize=512)
ORA-27063: number of bytes read/written is incorrect
IBM AIX RISC System/6000 Error: 28: No space left on device
Additional information: -1
Additional information: 1048576


SQL> recover database until cancel;
ORA-00283: recovery session canceled due to errors
ORA-01610: recovery using the BACKUP CONTROLFILE option must be done


SQL> recover database using backup controlfile until cancel;
ORA-00279: change 2671121 generated at 12/13/2006 03:05:43 needed for thread 1
ORA-00289: suggestion :
/oratest/app/oracle/product/10.2.0/dbs/arch/1_2_608543727.dbf
ORA-00280: change 2671121 for thread 1 is in sequence #2


Specify log: {=suggested | filename | AUTO | CANCEL}
cancel
ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01190: control file or data file 1 is from before the last RESETLOGS
ORA-01110: data file 1: '/testdata/oradata/test/system01.dbf'


ORA-01112: media recovery not started


SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-19510: failed to set size of 499712 blocks for file
"/devtest2/oradata/test/redo01.log" (blocksize=512)
ORA-27059: could not reduce file size
IBM AIX RISC System/6000 Error: 28: No space left on device
Additional information: 1
ORA-19502: write error on file "/devtest2/oradata/test/redo01.log", blockno
491521 (blocksize=512)
ORA-27063: number of bytes read/written is incorrect
IBM AIX RISC System/6000 Error: 28: No space left on device
Additional information: -1
Additional information: 1048576


SQL> alter system switch logfile;
alter system switch logfile
*
ERROR at line 1:
ORA-01109: database not open


SQL> select * from v$log;

GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS
---------- ---------- ---------- ---------- ---------- --- ----------------
FIRST_CHANGE# FIRST_TIM
------------- ---------
1 1 0 536870912 1 NO CLEARING_CURRENT
2631250 12-DEC-06

6 1 0 5242880 1 YES UNUSED
0

5 1 0 5242880 1 YES UNUSED
0


GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS
---------- ---------- ---------- ---------- ---------- --- ----------------
FIRST_CHANGE# FIRST_TIM
------------- ---------
4 1 0 5242880 1 YES UNUSED
0


SQL> alter database backup controlfile to trace;

Database altered.

SQL> quit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64
bit Production
With the Partitioning, OLAP and Data Mining options
[test:oratest] /oratest/app/oracle/product/10.2.0/dbs> cd $ORACLE_BASE
[test:oratest] /oratest/app/oracle> ls
admin oraInventory product
[test:oratest] /oratest/app/oracle> cd admin
[test:oratest] /oratest/app/oracle/admin> ls
test
[test:oratest] /oratest/app/oracle/admin> cd *
[test:oratest] /oratest/app/oracle/admin/test> ls
adump bdump cdump dpdump pfile udump
[test:oratest] /oratest/app/oracle/admin/test> cd udump

[test:oratest] /oratest/app/oracle/admin/test/udump> ls -rtl
total 872

-rw-r----- 1 oratest dba 15601 Feb 14 14:00 test_ora_319692.trc
[test:oratest] /oratest/app/oracle/admin/test/udump> ora_319692.trc <
/oratest/app/oracle/admin/test/udump/test_ora_319692.trc
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
ORACLE_HOME = /oratest/app/oracle/product/10.2.0
System name: AIX
Node name: PEKAX134
Release: 3
Version: 5
Machine: 00002A14D100
Instance name: test
Redo thread mounted by this instance: 1
Oracle process number: 15
Unix process pid: 319692, image: (TNS V1-V3)

*** 2007-02-14 13:57:58.401
*** SERVICE NAME:() 2007-02-14 13:57:58.400
*** SESSION ID:(214.3) 2007-02-14 13:57:58.400
Prior to RESETLOGS processing...
ALTER SYSTEM ARCHIVE LOG ALL USING BACKUP CONTROLFILE start
*** 2007-02-14 13:57:58.401 3845 kcrr.c
Archiving online redo logfile /devtest2/oradata/test/redo01.log
******************************************************
******************************************************
WARNING: Archival will be performed using 2 passes.
The first pass will attempt to determine the end-of-file
of the online redo logfile. The end-of-file is determined
by identifying what is described as a "corrupt" block
header. This will be reported as an ORA-00354 error.
However, this is not really a corrupt block - it is the
end of the redo data.
The second pass will then archive the online redo logfile
using the identified end-of-file information.
******************************************************
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: '/devtest2/oradata/test/redo01.log'
ORA-27037: unable to obtain file status
IBM AIX RISC System/6000 Error: 2: No such file or directory
Additional information: 3
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: '/devtest2/oradata/test/redo01.log'
ORA-27037: unable to obtain file status
IBM AIX RISC System/6000 Error: 2: No such file or directory
Additional information: 3
logfile 1 open failed:313
logfile 1 open failed:313
*** 2007-02-14 13:57:58.401 3845 kcrr.c
Archiving online redo logfile /testdata/oradata/test/redo04.log
******************************************************
WARNING: Archival will be performed using 2 passes.
The first pass will attempt to determine the end-of-file
of the online redo logfile. The end-of-file is determined
by identifying what is described as a "corrupt" block
header. This will be reported as an ORA-00354 error.
However, this is not really a corrupt block - it is the
end of the redo data.
The second pass will then archive the online redo logfile
using the identified end-of-file information.
******************************************************
Logfile 4 is not used
*** 2007-02-14 13:57:58.402 3845 kcrr.c
Archiving online redo logfile /testdata/oradata/test/redo05.log
******************************************************
WARNING: Archival will be performed using 2 passes.
The first pass will attempt to determine the end-of-file
of the online redo logfile. The end-of-file is determined
by identifying what is described as a "corrupt" block
by identifying what is described as a "corrupt" block
header. This will be reported as an ORA-00354 error.
However, this is not really a corrupt block - it is the
end of the redo data.
The second pass will then archive the online redo logfile
using the identified end-of-file information.
******************************************************
Logfile 5 is not used
*** 2007-02-14 13:57:58.402 3845 kcrr.c
Archiving online redo logfile /testdata/oradata/test/redo06.log
******************************************************
WARNING: Archival will be performed using 2 passes.
The first pass will attempt to determine the end-of-file
of the online redo logfile. The end-of-file is determined
by identifying what is described as a "corrupt" block
header. This will be reported as an ORA-00354 error.
However, this is not really a corrupt block - it is the
end of the redo data.
The second pass will then archive the online redo logfile
using the identified end-of-file information.
******************************************************
Logfile 6 is not used
Logfile 6 is not used
No logfiles qualified for archival
ORA-00392: log 1 of thread 1 is being cleared, operation not allowed
ORA-00312: online log 1 thread 1: '/devtest2/oradata/test/redo01.log'
*** 2007-02-14 13:57:58.402 60639 kcrr.c
Archive all online redo logfiles failed:392
ALTER SYSTEM ARCHIVE LOG ALL USING BACKUP CONTROLFILE complete
*** 2007-02-14 13:57:58.406
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: '/devtest2/oradata/test/redo01.log'
ORA-27037: unable to obtain file status
IBM AIX RISC System/6000 Error: 2: No such file or directory
Additional information: 3
*** 2007-02-14 13:58:53.100
Recovery target incarnation = 3, activation ID = 0
Influx buffer limit = 53541 (50% x 107082)
Successfully allocated 3 recovery slaves
Using 93 overflow buffers per recovery slave
Start recovery at thread 1 ckpt scn 2671121 logseq 2 block 100787
*** 2007-02-14 13:58:53.205
Media Recovery add redo thread 1
*** 2007-02-14 13:58:57.015
*** 2007-02-14 13:58:57.015
Media Recovery drop redo thread 1
*** 2007-02-14 13:59:15.311
Prior to RESETLOGS processing...
ALTER SYSTEM ARCHIVE LOG ALL USING BACKUP CONTROLFILE start
*** 2007-02-14 13:59:15.311 3845 kcrr.c
Archiving online redo logfile /devtest2/oradata/test/redo01.log
******************************************************
WARNING: Archival will be performed using 2 passes.
The first pass will attempt to determine the end-of-file
of the online redo logfile. The end-of-file is determined
by identifying what is described as a "corrupt" block
header. This will be reported as an ORA-00354 error.
However, this is not really a corrupt block - it is the
end of the redo data.
The second pass will then archive the online redo logfile
using the identified end-of-file information.
******************************************************
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: '/devtest2/oradata/test/redo01.log'
ORA-27037: unable to obtain file status
IBM AIX RISC System/6000 Error: 2: No such file or directory
IBM AIX RISC System/6000 Error: 2: No such file or directory
Additional information: 3
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: '/devtest2/oradata/test/redo01.log'
ORA-27037: unable to obtain file status
IBM AIX RISC System/6000 Error: 2: No such file or directory
Additional information: 3
logfile 1 open failed:313
*** 2007-02-14 13:59:15.312 3845 kcrr.c
Archiving online redo logfile /testdata/oradata/test/redo04.log
******************************************************
WARNING: Archival will be performed using 2 passes.
The first pass will attempt to determine the end-of-file
of the online redo logfile. The end-of-file is determined
by identifying what is described as a "corrupt" block
header. This will be reported as an ORA-00354 error.
However, this is not really a corrupt block - it is the
end of the redo data.
The second pass will then archive the online redo logfile
using the identified end-of-file information.
******************************************************
Logfile 4 is not used
Logfile 4 is not used
*** 2007-02-14 13:59:15.312 3845 kcrr.c
Archiving online redo logfile /testdata/oradata/test/redo05.log
******************************************************
WARNING: Archival will be performed using 2 passes.
The first pass will attempt to determine the end-of-file
of the online redo logfile. The end-of-file is determined
by identifying what is described as a "corrupt" block
header. This will be reported as an ORA-00354 error.
However, this is not really a corrupt block - it is the
end of the redo data.
The second pass will then archive the online redo logfile
using the identified end-of-file information.
******************************************************
Logfile 5 is not used
*** 2007-02-14 13:59:15.312 3845 kcrr.c
Archiving online redo logfile /testdata/oradata/test/redo06.log
******************************************************
WARNING: Archival will be performed using 2 passes.
The first pass will attempt to determine the end-of-file
of the online redo logfile. The end-of-file is determined
by identifying what is described as a "corrupt" block
by identifying what is described as a "corrupt" block
header. This will be reported as an ORA-00354 error.
However, this is not really a corrupt block - it is the
end of the redo data.
The second pass will then archive the online redo logfile
using the identified end-of-file information.
******************************************************
Logfile 6 is not used
No logfiles qualified for archival
ORA-00392: log 1 of thread 1 is being cleared, operation not allowed
ORA-00312: online log 1 thread 1: '/devtest2/oradata/test/redo01.log'
*** 2007-02-14 13:59:15.313 60639 kcrr.c
Archive all online redo logfiles failed:392
ALTER SYSTEM ARCHIVE LOG ALL USING BACKUP CONTROLFILE complete
*** 2007-02-14 13:59:15.316
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: '/devtest2/oradata/test/redo01.log'
ORA-27037: unable to obtain file status
IBM AIX RISC System/6000 Error: 2: No such file or directory
Additional information: 3
*** 2007-02-14 14:00:21.373
-- The following are current System-scope REDO Log Archival related
-- The following are current System-scope REDO Log Archival related
-- parameters and can be included in the database initialization file.
--
-- LOG_ARCHIVE_DEST=''
-- LOG_ARCHIVE_DUPLEX_DEST=''
--
-- LOG_ARCHIVE_FORMAT=%t_%s_%r.dbf
--
-- DB_UNIQUE_NAME="test"
--
-- LOG_ARCHIVE_CONFIG='SEND, RECEIVE, NODG_CONFIG'
-- LOG_ARCHIVE_MAX_PROCESSES=2
-- STANDBY_FILE_MANAGEMENT=MANUAL
-- STANDBY_ARCHIVE_DEST=?/dbs/arch
-- FAL_CLIENT=''
-- FAL_SERVER=''
--
-- LOG_ARCHIVE_DEST_1='LOCATION=/oratest/app/oracle/product/10.2.0/dbs/arch'
-- LOG_ARCHIVE_DEST_1='MANDATORY NOREOPEN NODELAY'
-- LOG_ARCHIVE_DEST_1='ARCH NOAFFIRM EXPEDITE NOVERIFY SYNC'
-- LOG_ARCHIVE_DEST_1='NOREGISTER NOALTERNATE NODEPENDENCY'
-- LOG_ARCHIVE_DEST_1='NOMAX_FAILURE NOQUOTA_SIZE NOQUOTA_USED NODB_UNIQUE_NAME'

*** 2007-02-14 13:59:15.316
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: '/devtest2/oradata/test/redo01.log'
ORA-27037: unable to obtain file status
IBM AIX RISC System/6000 Error: 2: No such file or directory
Additional information: 3
*** 2007-02-14 14:00:21.373
-- The following are current System-scope REDO Log Archival related
-- parameters and can be included in the database initialization file.
--
-- LOG_ARCHIVE_DEST=''
-- LOG_ARCHIVE_DUPLEX_DEST=''
--
-- LOG_ARCHIVE_FORMAT=%t_%s_%r.dbf
--
-- DB_UNIQUE_NAME="test"
--
-- LOG_ARCHIVE_CONFIG='SEND, RECEIVE, NODG_CONFIG'
-- LOG_ARCHIVE_MAX_PROCESSES=2
-- STANDBY_FILE_MANAGEMENT=MANUAL
-- STANDBY_ARCHIVE_DEST=?/dbs/arch
-- FAL_CLIENT=''

-- FAL_SERVER=''

--

-- LOG_ARCHIVE_DEST_1='LOCATION=/oratest/app/oracle/product/10.2.0/dbs/arch'

-- LOG_ARCHIVE_DEST_1='MANDATORY NOREOPEN NODELAY'

-- LOG_ARCHIVE_DEST_1='ARCH NOAFFIRM EXPEDITE NOVERIFY SYNC'

-- LOG_ARCHIVE_DEST_1='NOREGISTER NOALTERNATE NODEPENDENCY'

-- LOG_ARCHIVE_DEST_1='NOMAX_FAILURE NOQUOTA_SIZE NOQUOTA_USED NODB_UNIQUE_NAME'
-- LOG_ARCHIVE_DEST_1='NOMAX_FAILURE NOQUOTA_SIZE NOQUOTA_USED NODB_UNIQUE_NAME'

-- LOG_ARCHIVE_DEST_1='VALID_FOR=(PRIMARY_ROLE,ONLINE_LOGFILES)'

-- LOG_ARCHIVE_DEST_STATE_1=ENABLE

--

-- Below are two sets of SQL statements, each of which creates a new

-- control file and uses it to open the database. The first set opens

-- the database with the NORESETLOGS option and should be used only if

-- the current versions of all online logs are available. The second

-- set opens the database with the RESETLOGS option and should be used

-- if online logs are unavailable.

-- The appropriate set of statements can be copied from the trace into

-- a script file, edited as necessary, and executed when there is a

-- need to re-create the control file.

--

-- Set #1. NORESETLOGS case

--

-- The following commands will create a new control file and use it

-- to open the database.

-- Data used by Recovery Manager will be lost.

-- Additional logs may be required for media recovery of offline

-- Use this only if the current versions of all online logs are

-- available.

-- WARNING! The current control file needs to be checked against

-- the datafiles to insure it contains the correct files. The

-- commands printed here may be missing log and/or data files.

-- Another report should be made after the database has been

-- successfully opened.

-- After mounting the created controlfile, the following SQL

-- statement will place the database in the appropriate

-- protection mode:

-- ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PERFORMANCE

STARTUP NOMOUNT

CREATE CONTROLFILE REUSE DATABASE "test" NORESETLOGS ARCHIVELOG

MAXLOGFILES 16

MAXLOGMEMBERS 3

MAXDATAFILES 100

MAXINSTANCES 8

MAXLOGHISTORY 292

LOGFILE

GROUP 1 '/devtest2/oradata/test/redo01.log' SIZE 512M,

GROUP 4 '/testdata/oradata/test/redo04.log' SIZE 5M,

GROUP 5 '/testdata/oradata/test/redo05.log' SIZE 5M,

GROUP 6 '/testdata/oradata/test/redo06.log' SIZE 5M

-- STANDBY LOGFILE

DATAFILE

'/testdata/oradata/test/system01.dbf',

'/testdata/oradata/test/undotbs01.dbf',

'/testdata/oradata/test/sysaux01.dbf',

'/testdata/oradata/test/users01.dbf',

'/testdata/oradata/test/users02.dbf',

'/testdata/oradata/test/CSEALL01.dbf'

CHARACTER SET UTF8

;

-- Commands to re-create incarnation table

-- Below log names MUST be changed to existing filenames on

-- disk. Any one log file from each branch can be used to

-- re-create incarnation records.

-- ALTER DATABASE REGISTER LOGFILE '/oratest/app/oracle/product/10.2.0/dbs/arch/

-- ALTER DATABASE REGISTER LOGFILE '/oratest/app/oracle/product/10.2.0/dbs/arch/
1_1_582541177.dbf';

-- ALTER DATABASE REGISTER LOGFILE '/oratest/app/oracle/product/10.2.0/dbs/arch/

-- ALTER DATABASE REGISTER LOGFILE '/oratest/app/oracle/product/10.2.0/dbs/arch/
1_1_607278274.dbf';

-- ALTER DATABASE REGISTER LOGFILE '/oratest/app/oracle/product/10.2.0/dbs/arch/

-- ALTER DATABASE REGISTER LOGFILE '/oratest/app/oracle/product/10.2.0/dbs/arch/
1_1_608543727.dbf';

-- Recovery is required if any of the datafiles are restored backups,

-- or if the last shutdown was not normal or immediate.

RECOVER DATABASE

-- All logs need archiving and a log switch is needed.

ALTER SYSTEM ARCHIVE LOG ALL;

-- Database can now be opened normally.

ALTER DATABASE OPEN;

-- Commands to add tempfiles to temporary tablespaces.

-- Online tempfiles have complete space information.
-- Online tempfiles have complete space information.
:q!
[test:oratest] /oratest/app/oracle/admin/test/udump> sqlplus "/as sysdba"

SQL*Plus: Release 10.2.0.2.0 - Production on Wed Feb 14 14:02:45 2007

Copyright (c) 1982, 2005, Oracle. All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options

SQL> STARTUP NOMOUNT
ORA-01081: cannot start already-running ORACLE - shut it down first
SQL> shutdown immediate
ORA-01109: database not open


Database dismounted.
ORACLE instance shut down.
SQL> STARTUP NOMOUNT
ORACLE instance started.

Total System Global Area 1241513984 bytes
Fixed Size 2070912 bytes
Variable Size 318768768 bytes
Database Buffers 905969664 bytes
Redo Buffers 14704640 bytes
SQL> CREATE CONTROLFILE REUSE DATABASE "test" RESETLOGS ARCHIVELOG
2 MAXLOGFILES 16
MAXLOGMEMBERS 3 3
MA 4 XDATAFILES 100
MAX 5 INSTANCES 8
6 MAXLOGHISTORY 292
LOGFILE 7
8 GROUP 4 '/testdata/oradata/test/redo04.log' SIZE 5M,
GR 9 OUP 5 '/testdata/oradata/test/redo05.log' SIZE 5M,
10 GROUP 6 '/testdata/oradata/test/redo06.log' SIZE 5M
11 -- STANDBY LOGFILE
DATAFILE
'/testd 12 13 ata/oradata/test/system01.dbf',
14 '/testdata/oradata/test/undotbs01.dbf',
'/te 15 stdata/oradata/test/sysaux01.dbf',
'/testdat 16 a/oradata/test/users01.dbf',
'/test 17 data/oradata/test/users02.dbf',
' 18 /testdata/oradata/test/CSEALL01.dbf'
CHAR 19 ACTER SET UTF8
; 20

Control file created.

SQL> recover database;
ORA-00283: recovery session canceled due to errors
ORA-01610: recovery using the BACKUP CONTROLFILE option must be done


SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open


SQL> alter database open; resetlogs;
alter database open; resetlogs
*
ERROR at line 1:
ORA-00911: invalid character


SQL> alter database open resetlogs;

Database altered.

SQL> select * from dba_users;


-------------------------------- --------- ---------
DEFAULT_TABLESPACE TEMPORARY_TABLESPACE CREATED
------------------------------ ------------------------------ ---------
PROFILE INITIAL_RSRC_CONSUMER_GROUP
------------------------------ ------------------------------
EXTERNAL_NAME
--------------------------------------------------------------------------------
DEFAULT DEFAULT_CONSUMER_GROUP

23 rows selected.

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7318139/viewspace-899592/,如需轉載,請註明出處,否則將追究法律責任。

相關文章