温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

Oracle 控制文件

发布时间:2020-08-10 01:53:22 来源:ITPUB博客 阅读:120 作者:Davis_itpub 栏目:关系型数据库
<div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> <span style="background-color:inherit;line-height:1.5;">Oracle 控制文件&nbsp;</span> </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> <br style="background-color:inherit;" /> </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> 一. &nbsp;Oracle 控制文件内容 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> 我们可以通过v$controlfile_record_section 视图查看控制文件里包含的内容。 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> SQL&gt; select type from v$controlfile_record_section; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> TYPE </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -------------------------------------------------------- </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> DATABASE </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> CKPT PROGRESS </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> REDO THREAD </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> REDO LOG </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> DATAFILE </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> FILENAME </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> TABLESPACE </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> TEMPORARY FILENAME </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> RMAN CONFIGURATION </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> LOG HISTORY </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> OFFLINE RANGE </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> ARCHIVED LOG </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> BACKUP SET </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> BACKUP PIECE </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> BACKUP DATAFILE </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> BACKUP REDOLOG </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> DATAFILE COPY </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> BACKUP CORRUPTION </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> COPY CORRUPTION </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> DELETED OBJECT </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> PROXY COPY </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> BACKUP SPFILE </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> DATABASE INCARNATION </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> FLASHBACK LOG </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> RECOVERY DESTINATION </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> INSTANCE SPACE RESERVATION </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> REMOVABLE RECOVERY FILES </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> RMAN STATUS </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> THREAD INSTANCE NAME MAPPING </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> MTTR </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> DATAFILE HISTORY </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> STANDBY DATABASE MATRIX </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> GUARANTEED RESTORE POINT </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> RESTORE POINT </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> DATABASE BLOCK CORRUPTION </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> ACM OPERATION </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> FOREIGN ARCHIVED LOG </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> 37 rows selected. </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> 二. 可以通过dump看到控制文件内 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> 2.1 直接dump controlfile </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; &nbsp; &nbsp; &nbsp;alter system set events'immediate trace name controlf level 10' </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> 2.2. 使用alter database backup controlfile to filename </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; &nbsp; &nbsp; &nbsp;以上两种方法生成的dump文件是不可读的即乱码。 只有生成trace后,才是可读的。 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> 2.2. 使用alter database backup controlfile to trace </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; &nbsp; &nbsp; &nbsp;生成的trace 文件在udump目录下,可以通过日期来判断。 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; &nbsp; &nbsp; &nbsp;SQL&gt;show parameteruser_dump_dest </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp;也可以使用如下SQL 查询对应的trace 文件: </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> SELECT a.VALUE ||b.symbol|| c.instance_name|| '_ora_' ||d.spid|| '.trc' </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;trace_file </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; FROM (SELECT VALUE </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FROMv$parameter </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; &nbsp; &nbsp; &nbsp; WHERE name = 'user_dump_dest') a, </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; &nbsp; &nbsp; &nbsp;(SELECT SUBSTR (VALUE, -6, 1)symbol </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FROMv$parameter </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; &nbsp; &nbsp; &nbsp; WHERE name = 'user_dump_dest') b, </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; &nbsp; &nbsp; &nbsp;(SELECTinstance_name FROMv$instance) c, </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; &nbsp; &nbsp; &nbsp;(SELECTspid </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FROMv$session s,v$process p,v$mystat m </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; &nbsp; &nbsp; &nbsp; WHERE s.paddr= p.addrAND s.sid = m.sid AND m.statistic#= 0) d </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> TRACE_FILE </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -------------------------------------------------------------------------------- </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> /u01/app/oracle/admin/dave/udump/dave_ora_7215.trc </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> 整个Trace 的内容如下: </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> [oracle@qs-dmm-rh3 udump]$ cat dave_ora_7215.trc </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> /u01/app/oracle/admin/dave/udump/dave_ora_7215.trc </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 -Production </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> With the Partitioning, OLAP, Data Mining and Real ApplicationTesting options </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> System name: &nbsp; &nbsp;Linux </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> Node name: &nbsp; &nbsp; &nbsp;qs-dmm-rh3 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> Release: &nbsp; &nbsp; &nbsp; &nbsp;2.6.18-194.el5 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> Version: &nbsp; &nbsp; &nbsp; &nbsp;#1 SMP Tue Mar16 21:52:43 EDT 2010 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> Machine: &nbsp; &nbsp; &nbsp; &nbsp;i686 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> Instance name: dave </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> Redo thread mounted by this instance: 0 &lt;none&gt; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> Oracle process number: 15 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> Unix process pid: 7215, image: oracle@qs-dmm-rh3 (TNS V1-V3) </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> *** ACTION NAME:() 2011-03-17 22:05:46.401 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> *** MODULE NAME:(sqlplus@qs-dmm-rh3 (TNS V1-V3)) 2011-03-1722:05:46.401 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> *** SERVICE NAME:() 2011-03-17 22:05:46.401 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> *** SESSION ID:(159.1) 2011-03-17 22:05:46.401 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> ORA-01160: file is not a data file </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> ORA-01110: data file : '/u01/app/oracle/oradata/dave/temp01.dbf' </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> *** 2011-03-17 22:08:25.791 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> Control file created with size 370 blocks </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> *** 2011-03-17 22:10:21.444 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> tkcrrsarc: (WARN) Failed to find ARCH for message (message:0x1) </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> tkcrrpa: (WARN) Failed initial attempt to send ARCH message(message:0x1) </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> kwqmnich: current time:: 14: 10: 24 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> kwqmnich: instance no 0 check_only flag 1 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> kwqmnich: initialized job cache structure </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> krvscm(+): Validating controlfile with logical metadata </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> krvscm(+): Initial controlfile state </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> krvscm(+): &nbsp; kccdiflg [400001]kccdifl2 [1000] </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> krvscm(+): &nbsp; kccdi2ldscn[0x0000.00000000] </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> krvscm(+): &nbsp; kccdi2lrscn[0x0000.00000000] </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> krvscm(+): Inspecting logical metadata </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> krvscm(+): Metadata state </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> krvscm(+): &nbsp; hasPrepSwitchSta[0] </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> krvscm(+): &nbsp; hasPrepSwitchPri[0] </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> krvscm(+): &nbsp; hasReceivedDict[0] </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> krvscm(+): &nbsp; hasDumpedDict [0] </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> krvscm(+): &nbsp; hasCommittedBor[0] </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> krvscm(+): &nbsp;hasSwitchedFromPri [0] </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> krvscm(+): &nbsp; hasStartedTa [0] </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> krvscm(+): &nbsp; hasValidSess [0] </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> krvscm(+): &nbsp; hasTxnConsistency[0] </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> krvscm(+): &nbsp;hasCleanlyShutdown [0] </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> krvscm(+): Generating new controlfile state from metadata </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> krvscm(+): Updating controlfile with new state </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> krvscm(+): New controlfile state </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> krvscm(+): &nbsp; kccdiflg [400001]kccdifl2 [1000] </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> krvscm(+): &nbsp; kccdi2ldscn[0x0000.00000000] </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> krvscm(+): &nbsp; kccdi2lrscn[0x0000.00000000] </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> krvscm(+): Updating SGA associated with controlfile state </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> krvscm(+): Validation complete </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> *** 2011-03-17 22:13:21.115 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- The following are current System-scope REDO Log Archival related </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- parameters and can be included in the database initializationfile. </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- LOG_ARCHIVE_DEST='' </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- LOG_ARCHIVE_DUPLEX_DEST='' </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- LOG_ARCHIVE_FORMAT=%t_%s_%r.dbf </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- DB_UNIQUE_NAME="dave_st" </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- LOG_ARCHIVE_CONFIG='SEND, RECEIVE' </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- LOG_ARCHIVE_CONFIG='DG_CONFIG=("dave_pd")' </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- LOG_ARCHIVE_MAX_PROCESSES=2 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- STANDBY_FILE_MANAGEMENT=AUTO </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- STANDBY_ARCHIVE_DEST=/u01/archivelog </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- FAL_CLIENT=dave_st </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- FAL_SERVER=dave_pd </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- LOG_ARCHIVE_DEST_2='SERVICE=dave_pd' </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- LOG_ARCHIVE_DEST_2='OPTIONAL REOPEN=120 NODELAY' </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- LOG_ARCHIVE_DEST_2='LGWR NOAFFIRM NOEXPEDITE NOVERIFYASYNC=61440' </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- LOG_ARCHIVE_DEST_2='REGISTER NOALTERNATE NODEPENDENCY' </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- LOG_ARCHIVE_DEST_2='NOMAX_FAILURE NOQUOTA_SIZE NOQUOTA_USED' </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- LOG_ARCHIVE_DEST_2='DB_UNIQUE_NAME=dave_pd' </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- LOG_ARCHIVE_DEST_2='VALID_FOR=(STANDBY_LOGFILE,STANDBY_ROLE)' </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- LOG_ARCHIVE_DEST_STATE_2=ENABLE </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- LOG_ARCHIVE_DEST_1='LOCATION=/u01/archivelog' </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- LOG_ARCHIVE_DEST_1='OPTIONAL REOPEN=300 NODELAY' </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- LOG_ARCHIVE_DEST_1='ARCH NOAFFIRM NOEXPEDITE NOVERIFY SYNC' </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- LOG_ARCHIVE_DEST_1='REGISTER NOALTERNATE NODEPENDENCY' </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- LOG_ARCHIVE_DEST_1='NOMAX_FAILURE NOQUOTA_SIZE NOQUOTA_USED' </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- LOG_ARCHIVE_DEST_1='DB_UNIQUE_NAME=dave_st' </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- LOG_ARCHIVE_DEST_1='VALID_FOR=(PRIMARY_ROLE,ONLINE_LOGFILES)' </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- LOG_ARCHIVE_DEST_STATE_1=ENABLE </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- Below are two sets of SQL statements, each of which creates a new </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- control file and uses it to open the database. The first setopens </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- the database with the NORESETLOGS option and should be used onlyif </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- the current versions of all online logs are available. The second </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- set opens the database with the RESETLOGS option and should beused </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- if online logs are unavailable. </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- The appropriate set of statements can be copiedfrom the trace into </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- a script file, edited as necessary, andexecuted when there is a </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- need to re-create the control file. </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- &nbsp; &nbsp; Set#1. NORESETLOGS case </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> --对使用noresetlogs 的说明 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- The following commands will create a new control file and use it </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- to open the database. </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- Data used by Recovery Manager will be lost. </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- Additional logs may be required for media recovery of offline </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- Use this only if the current versions of all online logs are </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- available. </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- After mounting the created controlfile, the following SQL </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- statement will place the database in the appropriate </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- protection mode: </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- &nbsp;ALTER DATABASE SET STANDBYDATABASE TO MAXIMIZE PERFORMANCE </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> STARTUP NOMOUNT </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> CREATE CONTROLFILE REUSE DATABASE "DAVE" NORESETLOGS &nbsp;ARCHIVELOG </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; &nbsp;MAXLOGFILES 16 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; &nbsp;MAXLOGMEMBERS 2 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; &nbsp;MAXDATAFILES 30 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; &nbsp;MAXINSTANCES 1 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; &nbsp;MAXLOGHISTORY 292 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> LOGFILE </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; GROUP 1'/u01/app/oracle/oradata/dave/redo01.log' SIZE 50M, </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; GROUP 2'/u01/app/oracle/oradata/dave/redo02.log' SIZE 50M, </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; GROUP 3'/u01/app/oracle/oradata/dave/redo03.log' SIZE 50M </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- STANDBY LOGFILE </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> DATAFILE </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp;'/u01/app/oracle/oradata/dave/system01.dbf', </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp;'/u01/app/oracle/oradata/dave/undotbs01.dbf', </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; '/u01/app/oracle/oradata/dave/sysaux01.dbf', </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp;'/u01/app/oracle/oradata/dave/users01.dbf' </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> CHARACTER SET ZHS16GBK </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> ; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> --以上是创建控制文件的语法 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- Commands to re-create incarnation table </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- Below log names MUST be changed to existing filenames on </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- disk. Any one log file from each branch can be used to </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- re-create incarnation records. </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- ALTER DATABASE REGISTER LOGFILE '/u01/archivelog/1_1_746031707.dbf'; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- Recovery is required if any of the datafiles are restoredbackups, </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- or if the last shutdown was not normal orimmediate. </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> RECOVER DATABASE </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- All logs need archiving and a log switch isneeded. </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> ALTER SYSTEM ARCHIVE LOG ALL; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- Database can now be opened normally. </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> ALTER DATABASE OPEN; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- Commands to add tempfiles to temporary tablespaces. </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- Online tempfiles have complete space information. </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- Other tempfiles may require adjustment. </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> ALTER TABLESPACE TEMP ADD TEMPFILE '/u01/app/oracle/oradata/dave/temp01.dbf' </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; &nbsp; &nbsp;SIZE 32505856 &nbsp;REUSE AUTOEXTEND OFF; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> --这里是要注意的地方,重建控制文件的时候,不能写上临时表空间,等控制文件创建完毕之后,在手工的执行SQL加上临时表空间。 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- End of tempfile additions. </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- &nbsp; &nbsp; Set#2. RESETLOGS case </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> --第二种情况,使用resetlogs 的说明 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- The following commands will create a new control file and use it </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- to open the database. </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- Data used by Recovery Manager will be lost. </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- The contents of online logs will be lost and all backups will </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- be invalidated. Use this only if online logs are damaged. </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- After mounting the created controlfile, the following SQL </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- statement will place the database in the appropriate </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- protection mode: </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- &nbsp;ALTER DATABASE SET STANDBYDATABASE TO MAXIMIZE PERFORMANCE </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> STARTUP NOMOUNT </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> CREATE CONTROLFILE REUSE DATABASE "DAVE" RESETLOGS &nbsp;ARCHIVELOG </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; &nbsp;MAXLOGFILES 16 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; &nbsp;MAXLOGMEMBERS 2 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; &nbsp;MAXDATAFILES 30 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; &nbsp;MAXINSTANCES 1 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; &nbsp;MAXLOGHISTORY 292 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> LOGFILE </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; GROUP 1'/u01/app/oracle/oradata/dave/redo01.log' SIZE 50M, </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; GROUP 2'/u01/app/oracle/oradata/dave/redo02.log' SIZE 50M, </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; GROUP 3 '/u01/app/oracle/oradata/dave/redo03.log' &nbsp;SIZE 50M </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- STANDBY LOGFILE </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> DATAFILE </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp;'/u01/app/oracle/oradata/dave/system01.dbf', </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp;'/u01/app/oracle/oradata/dave/undotbs01.dbf', </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp;'/u01/app/oracle/oradata/dave/sysaux01.dbf', </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp;'/u01/app/oracle/oradata/dave/users01.dbf' </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> CHARACTER SET ZHS16GBK </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> ; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- Commands to re-create incarnation table </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- Below log names MUST be changed to existing filenames on </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- disk. Any one log file from each branch can be used to </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- re-create incarnation records. </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- ALTER DATABASE REGISTER LOGFILE '/u01/archivelog/1_1_746031707.dbf'; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- Recovery is required if any of the datafilesare restored backups, </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- or if the last shutdown was not normal or immediate. </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> RECOVER DATABASE USING BACKUP CONTROLFILE </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- Database can now be opened zeroing the online logs. </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> ALTER DATABASE OPEN RESETLOGS; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- Commands to add tempfiles to temporary tablespaces. </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- Online tempfiles have complete space information. </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- Other tempfiles may require adjustment. </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> ALTER TABLESPACE TEMP ADD TEMPFILE'/u01/app/oracle/oradata/dave/temp01.dbf' </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; &nbsp; &nbsp;SIZE 32505856 &nbsp;REUSE AUTOEXTEND OFF; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- End of tempfile additions. </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> 注意里面的几个参数: </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> (1) MAXDATAFILES </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; &nbsp; &nbsp; &nbsp;The MAXDATAFILES optionof CREATE DATABASE determines the number of data files a database can have.With Oracle Real Application Clusters, databases tend to have more data filesand log files than an exclusive mounted database. </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> (2) MAXINSTANCES </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; &nbsp; &nbsp; &nbsp;The MAXINSTANCES optionof CREATE DATABASE limits the number of instances that can access a databaseconcurrently. The default value for this option underz/OS is 15. Set MAXINSTANCES to a value greater than the maximum numberof instances you expect to run concurrently. </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> (3)MAXLOGFILE and MAXLOGMEMBERS </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; &nbsp; &nbsp; &nbsp;The MAXLOGFILES optionof CREATE DATABASE specifies the maximum number of redo log groups that can becreated for the database. The MAXLOGMEMBERS option specifies the maximum numberof members or number of copies per group. Set MAXLOGFILES to the maximum numberof instances you plan to run concurrently multiplied by the maximum anticipatednumber of groups per thread. </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> (4)MAXLOGHISTORY </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; &nbsp; &nbsp; &nbsp;The MAXLOGHISTORY optionof CREATE DATABASE specifies the maximum number of redolog files that can be recorded in the log history of the control file.The log history is used for automatic media recovery of Oracle Real ApplicationClusters. </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; &nbsp; &nbsp; &nbsp;ForOracle Real Application Clusters, set MAXLOGHISTORY to a large value, such as100. The control file can then store information about this number ofredo log files. When the log history exceeds this limit, the Oracle serveroverwrites the oldest entries in the log history. Thedefault for MAXLOGHISTORY is 0 (zero), which disables log history. </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> 这4个参数中,我们在创建DB 时需要注意的是MAXDATAFILES 和MAXLOGHISTORY。 因为默认值较小。 在创建DB 时就需要把这2个参数设置成较大值。 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; &nbsp; &nbsp; &nbsp;比如MAXDATAFILES 设置成8k,MAXLOGHISTORY 设置成1k。 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> 与这几个参数相关的错误: </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> ORA-01164: MAXLOGFILES may not exceed string </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> Cause: MAXLOGFILES specified on the command line too large. </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> Action: Resubmit the command with a smaller MAXLOGFILES </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> ORA-01165:MAXDATAFILES may not exceed string </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> Cause: MAXDATAFILES specified on the command line too large. </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> Action: Resubmit the command with a smaller MAXDATAFILES </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> ORA-01166:file number string is larger than string (string) </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> Cause: File mentioned in CREATE CONTROLFILE has a file number whichis larger than that specified for MAXDATAFILES or MAXLOGFILES. </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> Action: Increase the maximum specified on the command line. </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> 三. 控制文件的重建 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; &nbsp; &nbsp; &nbsp;不到最后时刻,如三个控制文件都已损坏,又没有控制文件的备份。还是不要重建控制文件,处理不好就会有数据丢失。 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> (1)db 启动到mount状态 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; &nbsp; &nbsp; &nbsp;SQL&gt; startup nomount </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> (2)创建控制文件 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> create controlfile reuse database dave noresetlogsarchivelog </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> LOGFILE </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> GROUP 1 '/u01/app/oracle/oradata/dave/redo01.log', </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> GROUP 2 '/u01/app/oracle/oradata/dave/redo02.log', </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> GROUP 3 '/u01/app/oracle/oradata/dave/redo03.log' </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> DATAFILE </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> '/u01/app/oracle/oradata/dave/sysaux01.dbf', </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> '/u01/app/oracle/oradata/dave/system01.dbf', </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> '/u01/app/oracle/oradata/dave/undotbs01.dbf', </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> '/u01/app/oracle/oradata/dave/users01.dbf' </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> CHARACTER SET ZHS16GBK; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> 我这里使用的是noresetlogs,所以直接open数据库就可以了: </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> SQL&gt;alter database open; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> 如果是resetlogs 创建的控制文件,那么我们就需要使用: </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> SQL&gt;alter database open resetlogs; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> 来打开DB. </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> (3)添加TEMP 表空间 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> SQL&gt; ALTER TABLESPACE TEMP ADD TEMPFILE'/u01/app/oracle/oradata/dave/temp01.dbf' size 100M; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> Tablespace altered. </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> 注意: </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; &nbsp; &nbsp; &nbsp;如果使用resetlogs 打开的数据库,就需要对DB做一次备份。 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; &nbsp; &nbsp; &nbsp;resetlogs命令表示一个数据库逻辑生存期的结束和另一个数据库逻辑生存期的开始,每次使用resetlogs命令的时候,SCN不会被重置,不过oracle会重置日志序列号,而且会重置联机重做日志内容. </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; &nbsp; &nbsp; &nbsp;这样做是为了防止不完全恢复后日志序列会发生冲突(因为现有日志和数据文件间有了时间差)。 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> 四. 不重建控制文件的情况清理控制文件中记录 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> 控制文件将内部数据记录分为两类:循环重用记录 和 非循环重用记录。 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> (1)循环重用记录包含可以从控制文件中删除的信息。如: RMAN 备份记录,归档日志历史信息,循环重用记录可以被删除,并且不会影响产品数据库。 &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> (2)非循环重用记录是那些不能被删除的记录。 非循环重用记录包括 数据文件列表 和日志文件列表。 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; &nbsp; 我们可以通过重建控制文件或者设置control_file_record_keep_time=0来重用这些记录。 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> 4.1 手工清理v$archived_log记录 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> 参考: </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> Removingentries in v$archived_log referencing a particluar DEST_ID [ID 845361.1] </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> 示例: </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> SQL&gt; archive log list; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> Database log mode &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Archive Mode </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> Automatic archival &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Enabled </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> Archive destination &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;USE_DB_RECOVERY_FILE_DEST </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> Oldest online log sequence &nbsp; &nbsp; 1 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> Next log sequence to archive &nbsp; 3 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> Current log sequence &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 3 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> 我们查看当前的archivelist是3个。 实际上个数据库我做过多次的open resetlogs。所以我们查询v$archived_log视图,会查看到很多之前的信息。 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> SQL&gt; select resetlogs_id,sequence# fromv$archived_log order by 1; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> RESETLOGS_ID &nbsp;SEQUENCE# </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> ------------ ---------- </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 806357067 &nbsp; &nbsp; &nbsp; &nbsp; 50 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 806357067 &nbsp; &nbsp; &nbsp; &nbsp; 51 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 806357067 &nbsp; &nbsp; &nbsp; &nbsp; 52 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 806357067 &nbsp; &nbsp; &nbsp; &nbsp; 53 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 806357067 &nbsp; &nbsp; &nbsp; &nbsp; 54 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 806357067 &nbsp; &nbsp; &nbsp; &nbsp; 56 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 806357067 &nbsp; &nbsp; &nbsp; &nbsp; 54 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 806357067 &nbsp; &nbsp; &nbsp; &nbsp; 51 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 806357067 &nbsp; &nbsp; &nbsp; &nbsp; 50 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 806357067 &nbsp; &nbsp; &nbsp; &nbsp; 53 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 806357067 &nbsp; &nbsp; &nbsp; &nbsp; 52 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 806357067 &nbsp; &nbsp; &nbsp; &nbsp; 55 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 810588833 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 810588833 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 810588833 &nbsp; &nbsp; &nbsp; &nbsp; 11 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 810588833 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;9 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 810588833 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;3 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 810588833 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;4 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 810588833 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;5 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 810588833 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;6 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 810588833 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;7 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 810588833 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;8 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 810588833 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;9 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 810588833 &nbsp; &nbsp; &nbsp; &nbsp; 10 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 811750169 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 811750169 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 811750169 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 811767774 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 811767774 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;3 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 811767774 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;5 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 811767774 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;4 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 811767774 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 811767774 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 811767774 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;3 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 811767774 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;5 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 811767774 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;4 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 811767774 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;4 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 811767774 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;3 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 811767774 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 811773498 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 811773498 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 811773498 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;6 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 811773498 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;3 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 811773498 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;4 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 811773498 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;5 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 811773498 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;9 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 811773498 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 811773498 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 811773498 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 811773498 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 811773498 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;8 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 811773498 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;7 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 811773498 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 811773498 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 811867931 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; 811867931 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> 56 rows selected. </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> SQL&gt; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> 我们可以使用dbms_backup_restore.resetCfileSection清除控制文件中的相关记录: </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> SQL&gt; execute sys.dbms_backup_restore.resetCfileSection(11); </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> PL/SQL procedure successfully completed. </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> 验证: </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> SQL&gt; select resetlogs_id,sequence# fromv$archived_log order by 1; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> no rows selected </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> 这里所有的记录都被删除了。 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> SQL&gt; archive log list; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> Database log mode &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Archive Mode </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> Automatic archival &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Enabled </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> Archive destination &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;USE_DB_RECOVERY_FILE_DEST </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> Oldest online log sequence &nbsp; &nbsp; 1 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> Next log sequence to archive &nbsp; 3 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> Current log sequence &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 3 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> SQL&gt; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> <br style="background-color:inherit;" /> </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> 注意: </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; &nbsp; 我们清空这部分信息,并不影响我们RMAN的恢复,只要归档文件物理存在就可以了。 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> 可以用rman的catalog将现有的archive log注册进来 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> RMAN&gt; catalog start with '/data/archivelog'; &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> <br style="background-color:inherit;" /> </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> 4.2 手工清理v$rman_status 记录 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> v$rman_status视图记录了如下类型的操作: </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> SQL&gt; select distinct operation from v$rman_status; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> OPERATION </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> ------------------------------------------------------------------ </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> RESTORE </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> RESTORING AND APPLYING LOGS </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> RMAN </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> INCREMENTAL BACKUP RESTORE </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> DELETE </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> REPORT </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> VERIFYING FILES FOR RECOVERY </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> RECOVER </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> ALTER DB </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> STARTING MEDIA RECOVERY </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> BACKUP </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> LIST </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> 12 rows selected. </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> SQL&gt; select count(*) from v$rman_status; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp;COUNT(*) </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> ---------- </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; &nbsp; &nbsp; 141 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> --清除RMAN_STATUS 记录 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> SQL&gt; execute sys.dbms_backup_restore.resetCfileSection(28); </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> PL/SQL procedure successfully completed. </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> --验证: </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> SQL&gt; select count(*) from v$rman_status; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp;COUNT(*) </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> ---------- </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; &nbsp; &nbsp; &nbsp; 0 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> 4.3 关于resetCfileSection函数中ID号的说明 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> 在4.1和4.2中我们分别使用了11和28的id。 我们这里看一下这里为什么是这2个号。 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> 在如下的脚本: </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> $ORACLE_HOME/rdbms/admin/dbmsbkrs.sql </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> 我们可以看到dbms_backup_restore包的创建代码。 在这段代码中给了我们定义的说明。 </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> -- Valid record types are defined as thefollowing constants: </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp;RTYP_DB_INFO &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; constant binary_integer := &nbsp; 0; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp;RTYP_CKPTPROG &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;constant binary_integer := &nbsp; 1; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp;RTYP_THREAD &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;constant binary_integer := &nbsp; 2; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp;RTYP_LOGFILE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; constant binary_integer := &nbsp; 3; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp;RTYP_DATAFILE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;constant binary_integer := &nbsp; 4; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp;RTYP_FILENAME &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;constant binary_integer := &nbsp; 5; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp;RTYP_TABLESPACE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;constant binary_integer := &nbsp; 6; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp;RTYP_RESERVED1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; constant binary_integer := &nbsp; 7; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp;RTYP_TEMPFILE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;constant binary_integer := &nbsp; 7; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp;RTYP_RMAN_CONFIGURATION &nbsp; &nbsp; &nbsp; &nbsp;constant binary_integer := &nbsp; 8; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp;RTYP_LOG_HISTORY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; constant binary_integer := &nbsp; 9; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp;RTYP_OFFLINE_RANGE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; constant binary_integer := &nbsp;10; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; RTYP_ARCHIVED_LOG &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; constant binary_integer := &nbsp;11; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp;RTYP_BACKUP_SET &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;constant binary_integer := &nbsp;12; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp;RTYP_BACKUP_PIECE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;constant binary_integer := &nbsp;13; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp;RTYP_BACKUP_DFILE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;constant binary_integer := &nbsp;14; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp;RTYP_BACKUP_LOG &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;constant binary_integer := &nbsp;15; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp;RTYP_DFILE_COPY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; constant binary_integer := &nbsp;16; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp;RTYP_BACKUP_DFILE_CORR &nbsp; &nbsp; &nbsp; &nbsp; constant binary_integer := &nbsp;17; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp;RTYP_DFILE_COPY_CORR &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; constant binary_integer := &nbsp;18; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp;RTYP_DELETED_OBJECT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;constant binary_integer := &nbsp;19; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp;RTYP_RESERVED3 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;constant binary_integer := &nbsp;20; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp;RTYP_PROXY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; constant binary_integer := &nbsp;20; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp;RTYP_RESERVED4 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; constant binary_integer := &nbsp;21; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp;RTYP_BACKUP_SPFILE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; constant binary_integer := &nbsp;21; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp;RTYP_DB2 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; constant binary_integer := &nbsp;22; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp;RTYP_INCARNATION &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; constant binary_integer := &nbsp;23; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp;RTYP_FLASHBACK &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; constant binary_integer := &nbsp;24; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp;RTYP_RA_INFO &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; constant binary_integer := &nbsp;25; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp;RTYP_INST_RSVT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; constant binary_integer := &nbsp;26; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp;RTYP_AGED_FILES &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;constant binary_integer := &nbsp;27; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; RTYP_RMAN_STATUS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;constant binary_integer := &nbsp;28; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp;RTYP_THREAD_INST &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; constant binary_integer := &nbsp;29; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp;RTYP_MTR &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; constant binary_integer := &nbsp;30; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp;RTYP_DFH &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; constant binary_integer := &nbsp;31; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp;RTYP_SDM &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; constant binary_integer := &nbsp;32; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp;RTYP_RSP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; constant binary_integer := &nbsp;33; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp;RTYP_NRR &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; constant binary_integer := &nbsp;34; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp;RTYP_BLOCK_CORRUPTION &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;constant binary_integer := &nbsp;35; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp;RTYP_ACM_OPERATION &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; constant binary_integer := &nbsp;36; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp;RTYP_FOREIGN_ARCHIVED_LOG &nbsp; &nbsp; &nbsp; constantbinary_integer := &nbsp;37; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> &nbsp; </div> <div style="font-family:微软雅黑;font-size:14px;line-height:21px;white-space:normal;widows:auto;background-color:#FFFFFF;"> 通过以上的说明,可以理解,我们这里为什么ID是11和28了。 </div> <div> <br /> </div>
向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI