_金沙澳门官网
7727.com
封闭
新澳门金沙网址
88128.cc

服务范围

当前位置:首页 > 服务范围

手工规复掌握文件的深入剖析

会商话题:
1、正在规复常察看这些静态能视图$database,v$datafile,v$datafile_header,v$logg,说说这些字段的意义及它们之间的干系?
 v$database.CHECKPOINT_CHANGE#
    v$database.CONTROLFILE_SEQUENCE#
    v$database.CONTROLFILE_CHANGE#
    v$datafile.CHECKPOINT_CHANGE#
    v$datafile_header. CHECKPOINT_CHANGE#
    v$log.FIRST_CHANGE#
 
2、操纵alter database backup controlfile to '/backup/control.bin';号令备份出来的掌握文件仕进规复常,为何一定要顶用resetlogs才气翻开库?


3、oracle10g前的版本顶用resetlogs翻开库前,一定要仕进备份呢?假如出仕进备份,特长从前的备份集取归档还能做规复吗?假如妙规复,怎样操纵?

4、规复掌握文件常只管顶用什么方法能够制止顶用resetlogs翻开库?


5、说说什么是incarnation,看了面信息能理出一些干系不服?
RMAN> list incarnation;
using target database control file instead of recovery catalog

List of Database Incarnations
DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1       1       OCM      2198689775       PARENT  1          13-AUG-09
2       2       OCM      2198689775       PARENT  754488     22-MAY-13
3       3       OCM      2198689775       PARENT  897324     22-MAY-13
6       6       OCM      2198689775       PARENT  1007335    22-MAY-13
5       5       OCM      2198689775       ORPHAN  1007335    22-MAY-13
4       4       OCM      2198689775       ORPHAN  1007394    22-MAY-13
7       7       OCM      2198689775       PARENT  1009245    22-MAY-13
8       8       OCM      2198689775       CURRENT 1009729    22-MAY-13

sys@OCM> select INCARNATION#,RESETLOGS_CHANGE#,PRIOR_RESETLOGS_CHANGE#,STATUS,RESETLOGS_ID,PRIOR_INCARNATION# from v$database_incarnation;

INCARNATION# RESETLOGS_CHANGE# PRIOR_RESETLOGS_CHANGE# STATUS  RESETLOGS_ID PRIOR_INCARNATION#
------------ ----------------- ----------------------- ------- ------------ ------------------
           1                 1                       0 PARENT     694825248                  0
           2            754488                       1 PARENT     816080562                  1
           3            897324                  754488 PARENT     816088996                  2
           4           1007394                  897324 ORPHAN     816100587                  3
           5           1007335                  897324 ORPHAN     816101053                  3
           6           1007335                  897324 PARENT     816101409                  3
           7           1009245                 1007335 PARENT     816103204                  6
           8           1009729                 1009245 CURRENT    816103967                  7

sys@OCM> show parameter log_archive_format

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
log_archive_format                   string      %t_%s_%r.dbf

  参考方法:
 

掌握文件规复的尝试步调:
1、用户手工办理高低备份掌握文件
sys@OCM>  alter database backup controlfile to '/backup/control.bin';

Database altered.

2、敌数据库仕进一些操纵,好比日记切换,完全检查点对等
sys@OCM> alter system switch logfile;

System altered.

sys@OCM> /

System altered.

sys@OCM> /

System altered.

sys@OCM> alter system checkpoint;

System altered.


3、删除全部掌握文件
sys@OCM> select * from v$controlfile;

STATUS  NAME                                                                                                       IS_ BLOCK_SIZE FILE_SIZE_BLKS
------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --- ---------- --------------
        /u01/app/oracle/oradata/ocm/control01.ctl                                                                  NO        16384            630
        /u01/app/oracle/oradata/ocm/control02.ctl                                                                  NO        16384            630


[oracle@ocm backup]$ cd /u01/app/oracle/oradata/ocm/
[oracle@ocm ocm]$ rm -rf control0*


4、数据库宕机
sys@OCM> shutdown abort;
ORACLE instance shut down.


5、严重动身数据库,报错
sys@OCM> startup
ORACLE instance started.

Total System Global Area  849530880 bytes
Fixed Size                  1339824 bytes
Variable Size             562040400 bytes
Database Buffers          281018368 bytes
Redo Buffers                5132288 bytes
ORA-00205: error in identifying control file, check alert log for more info


5、检察告警日记
ALTER DATABASE   MOUNT
ORA-00210: cannot open the specified control file
ORA-00202: control file: '/u01/app/oracle/oradata/ocm/control02.ctl'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file $or$ directory
Additional information: 3
ORA-00210: cannot open the specified control file
ORA-00202: control file: '/u01/app/oracle/oradata/ocm/control01.ctl'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file $or$ directory
Additional information: 3


6、开端复原掌握文件
sys@OCM> show parameter contr

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time        integer     7
control_files                        string      /u01/app/oracle/oradata/ocm/co
                                                 ntrol01.ctl, /u01/app/oracle/o
                                                 radata/ocm/control02.ctl


[oracle@ocm ocm]$ cp /backup/control.bin /u01/app/oracle/oradata/ocm/control01.ctl
[oracle@ocm ocm]$ cp /backup/control.bin /u01/app/oracle/oradata/ocm/control02.ctl


7、启动数据库参加mount
sys@OCM> alter database mount;

Database altered.


8、开端规复sys@OCM> alter database open;
alter database open
*
ERROR at line 1:
ORA-01589: must use RESETLOGS $or$ NORESETLOGS option for database open


sys@OCM> 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/ocm/system01.dbf'


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


sys@OCM> recover database using backup controlfile;
ORA-00279: change 2658485 generated at 06/04/2013 20:29:44 needed for thread 1
ORA-00289: suggestion : /arch/1_9_816970610.dbf
ORA-00280: change 2658485 for thread 1 is in sequence #9


Specify log: {<RET>=suggested | filename | AUTO | CANCEL}

ORA-00279: change 2658498 generated at 06/04/2013 23:28:05 needed for thread 1
ORA-00289: suggestion : /arch/1_10_816970610.dbf
ORA-00280: change 2658498 for thread 1 is in sequence #10
ORA-00278: log file '/arch/1_9_816970610.dbf' no longer needed for this recovery


Specify log: {<RET>=suggested | filename | AUTO | CANCEL}

ORA-00279: change 2658501 generated at 06/04/2013 23:28:05 needed for thread 1
ORA-00289: suggestion : /arch/1_11_816970610.dbf
ORA-00280: change 2658501 for thread 1 is in sequence #11
ORA-00278: log file '/arch/1_10_816970610.dbf' no longer needed for this recovery


Specify log: {<RET>=suggested | filename | AUTO | CANCEL}

ORA-00279: change 2658504 generated at 06/04/2013 23:28:10 needed for thread 1
ORA-00289: suggestion : /arch/1_12_816970610.dbf
ORA-00280: change 2658504 for thread 1 is in sequence #12
ORA-00278: log file '/arch/1_11_816970610.dbf' no longer needed for this recovery


Specify log: {<RET>=suggested | filename | AUTO | CANCEL}

ORA-00279: change 2658507 generated at 06/04/2013 23:28:10 needed for thread 1
ORA-00289: suggestion : /arch/1_13_816970610.dbf
ORA-00280: change 2658507 for thread 1 is in sequence #13
ORA-00278: log file '/arch/1_12_816970610.dbf' no longer needed for this recovery


Specify log: {<RET>=suggested | filename | AUTO | CANCEL}

ORA-00308: cannot open archived log '/arch/1_13_816970610.dbf'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file $or$ directory
Additional information: 3


sys@OCM> select * from v$logfile;

    GROUP# STATUS  TYPE    MEMBER                                                                                     IS_
---------- ------- ------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---
         3         ONLINE  /u01/app/oracle/oradata/ocm/redo03.log                                                     NO
         2         ONLINE  /u01/app/oracle/oradata/ocm/redo02.log                                                     NO
         1         ONLINE  /u01/app/oracle/oradata/ocm/redo01.log                                                     NO

sys@OCM> select * from v$log;

    GROUP#    THREAD#  SEQUENCE#      BYTES  BLOCKSIZE    MEMBERS ARC STATUS           FIRST_CHANGE# FIRST_TIM NEXT_CHANGE# NEXT_TIME
---------- ---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- --------- ------------ ---------
         1          1          7   52428800        512          1 YES INACTIVE               2609828 04-JUN-13      2633069 04-JUN-13
         3          1          9   52428800        512          1 NO  CURRENT                2653255 04-JUN-13   2.8147E+14
         2          1          8   52428800        512          1 YES INACTIVE               2633069 04-JUN-13      2653255 04-JUN-13

sys@OCM> recover database using backup controlfile;
ORA-00279: change 2658507 generated at 06/04/2013 23:28:10 needed for thread 1
ORA-00289: suggestion : /arch/1_13_816970610.dbf
ORA-00280: change 2658507 for thread 1 is in sequence #13


Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
/u01/app/oracle/oradata/ocm/redo01.log
Log applied.
Media recovery complete.
sys@OCM> alter database open resetlogs;

Database altered.

 

 

金沙澳门官网
9159.com金沙游艺场
版权所有:Copyright © 网联互通(澳门)电子商务有限责任公司 地址:澳门市房山区顶风街9商标坊百合大厦A坐230
京ICP备11027125商标-1 合作伙伴: