激情五月天婷婷,亚洲愉拍一区二区三区,日韩视频一区,a√天堂中文官网8

<ul id="buwfs"><strike id="buwfs"><strong id="buwfs"></strong></strike></ul>
    <output id="buwfs"></output>
  • <dfn id="buwfs"><source id="buwfs"></source></dfn>
      <dfn id="buwfs"><td id="buwfs"></td></dfn>
      <div id="buwfs"><small id="buwfs"></small></div>
      <dfn id="buwfs"><source id="buwfs"></source></dfn>
      1. <dfn id="buwfs"><td id="buwfs"></td></dfn>
        始創(chuàng)于2000年 股票代碼:831685
        咨詢熱線:0371-60135900 注冊(cè)有禮 登錄
        • 掛牌上市企業(yè)
        • 60秒人工響應(yīng)
        • 99.99%連通率
        • 7*24h人工
        • 故障100倍補(bǔ)償
        全部產(chǎn)品
        您的位置: 網(wǎng)站首頁(yè) > 幫助中心>文章內(nèi)容

        Oracle控制文件的損壞或完全丟失的恢復(fù)辦法

        發(fā)布時(shí)間:  2012/9/24 17:02:36

        控制文件丟失了,需要DBA處理。
            1,控制文件大小不對(duì)。  將正常的cp給不正常的。指定正確的來(lái)運(yùn)行。
            2,控制文件版本不對(duì)   千萬(wàn)要記住要先cp全部的控制文件備份后在來(lái)cp
            3,控制文件某個(gè)丟失,至少存在一個(gè)
            4,控制文件都丟失,-
         

            5,有但是很old

        1,控制文件大小不對(duì)。
        下面我們修給一個(gè)控制文件的內(nèi)容使大小不一樣。
        [Oracle@huang ~]$ vim /sof/oracle/oradata/orcl/control01.ctl
        SQL> shutdown immediate;
        ORA-00227: corrupt block detected in control file: (block 1, # blocks 1)
        ORA-00202: control file: '/sof/Oracle/oradata/orcl/control01.ctl'
        SQL> shutdown abort;
        Oracle instance shut down.
        SQL> startup
        Oracle instance started.

        Total System Global Area 1090519040 bytes
        Fixed Size                  1267020 bytes
        Variable Size             704645812 bytes
        Database Buffers          369098752 bytes
        Redo Buffers               15507456 bytes
        ORA-00205: error in identifying control file, check alert log for more info
        這里提示了控制文件有錯(cuò)誤。
        SQL> show parameter control_f

        NAME                                 TYPE        VALUE
        ------------------------------------ ----------- ------------------------------
        control_file_record_keep_time        integer     7
        control_files                        string      /sof/Oracle/oradata/orcl/contr
                                                         ol01.ctl, /sof/Oracle/oradata/
                                                         orcl/control02.ctl, /sof/oracl
                                                         e/oradata/orcl/control03.ctl
        SQL> ho ls -l /sof/Oracle/oradata/orcl/  這里我們查看到日志文件中,有兩個(gè)大小一樣,說(shuō)明這兩個(gè)是正常的。
        total 1536352
        -rw------- 1 Oracle oinstall   7110639 Jan  4 16:00 control01.ctl
        -rw------- 1 Oracle oinstall   7389184 Jan  4 16:01 control02.ctl
        -rw------- 1 Oracle oinstall   7389184 Jan  4 16:01 control03.ctl
        SQL> ho cp /sof/Oracle/oradata/orcl/control01.ctl /sof/oracle/oradata/orcl/control01.ct.bak

        SQL> ho cp /sof/Oracle/oradata/orcl/control02.ctl /sof/oracle/oradata/orcl/control01.ctl

        SQL> shutdown immediate;
        ORA-01507: database not mounted


        Oracle instance shut down.
        SQL> startup
        Oracle instance started.

        Total System Global Area 1090519040 bytes
        Fixed Size                  1267020 bytes
        Variable Size             704645812 bytes
        Database Buffers          369098752 bytes
        Redo Buffers               15507456 bytes
        Database mounted.
        Database opened.
        現(xiàn)在數(shù)據(jù)庫(kù)就能正常的運(yùn)行了。

        2,控制文件版本不對(duì)
        SQL> startup
        Oracle instance started.

        Total System Global Area 1090519040 bytes
        Fixed Size                  1267020 bytes
        Variable Size             704645812 bytes
        Database Buffers          369098752 bytes
        Redo Buffers               15507456 bytes
        Database mounted.
        Database opened.
        SQL> alter system set control_files='/sof/Oracle/oradata/orcl/control02.ctl' scope=spfile;

        System altered.

        Database opened.
        SQL> shutdown immediate;
        Database closed.
        Database dismounted.
        Oracle instance shut down.
        SQL> startup
        Oracle instance started.

        Total System Global Area 1090519040 bytes
        Fixed Size                  1267020 bytes
        Variable Size             704645812 bytes
        Database Buffers          369098752 bytes
        Redo Buffers               15507456 bytes
        Database mounted.
        Database opened.
        SQL> show parameter control_f

        NAME                                 TYPE        VALUE
        ------------------------------------ ----------- ------------------------------
        control_file_record_keep_time        integer     7
        control_files                        string      /sof/Oracle/oradata/orcl/contr
                                                         ol02.ctl
        SQL> alter system set control_files='/sof/Oracle/oradata/orcl/control02.ctl','/sof/oracle/oradata/orcl/control01.ctl','/sof/oracle/oradata/orcl/control03.ctl'  scope=spfile;

        System altered.
        SQL> shutdown immediate;
        Database closed.
        Database dismounted.
        Oracle instance shut down.
        SQL> startup
        Oracle instance started.

        Total System Global Area 1090519040 bytes
        Fixed Size                  1267020 bytes
        Variable Size             704645812 bytes
        Database Buffers          369098752 bytes
        Redo Buffers               15507456 bytes
        ORA-00214: control file '/sof/Oracle/oradata/orcl/control02.ctl' version 1036
        inconsistent with file '/sof/Oracle/oradata/orcl/control01.ctl' version 1020
        現(xiàn)在就提示了控制文件的版本好不一致的問(wèn)題。注意提示的版本號(hào)那個(gè)更高。
        SQL> ho cp /sof/Oracle/oradata/orcl/control01.ctl /sof/oracle/oradata/orcl/control01.ctl.bak

        SQL> ho cp /sof/Oracle/oradata/orcl/control02.ctl /sof/oracle/oradata/orcl/control01.ctl
        SQL> startup
        ORA-01081: cannot start already-running Oracle - shut it down first
        SQL> shutdown immediate;
        ORA-01507: database not mounted


        Oracle instance shut down.
        SQL> startup
        Oracle instance started.

        Total System Global Area 1090519040 bytes
        Fixed Size                  1267020 bytes
        Variable Size             704645812 bytes
        Database Buffers          369098752 bytes
        Redo Buffers               15507456 bytes
        ORA-00214: control file '/sof/Oracle/oradata/orcl/control02.ctl' version 1036
        inconsistent with file '/sof/Oracle/oradata/orcl/control03.ctl' version 1020

        SQL> ho cp /sof/Oracle/oradata/orcl/control03.ctl /sof/oracle/oradata/orcl/control03.ctl.bak

        SQL> ho cp /sof/Oracle/oradata/orcl/control02.ctl /sof/oracle/oradata/orcl/control03.ctl

        SQL> startup
        Oracle instance started.

        Total System Global Area 1090519040 bytes
        Fixed Size                  1267020 bytes
        Variable Size             704645812 bytes
        Database Buffers          369098752 bytes
        Redo Buffers               15507456 bytes
        Database mounted.
        Database opened.
        上面就說(shuō)明成了。

        4,控制文件都丟失,
        5,有但是很old

        SQL> alter database backup controlfile to trace as '/tmp/luo.txt'
          2  ;

        Database altered.
        得到建立日志文件的腳本,以后我們數(shù)據(jù)庫(kù)建好后就要做。
        下面就是重建控制文件。

        千萬(wàn)記住下面這個(gè)命令。
        如果控制文件全部丟失,版本過(guò)老,在我們重建控制文件之前需要備份故障的狀態(tài)。

        SQL> shutdown immediate;
        Database closed.
        Database dismounted.
        Oracle instance shut down.
        [Oracle@huang ~]$ cp /sof/oracle/oradata/orcl/ /sof/oracle/oradata/orcl.bak -rf
        [Oracle@huang ~]$ rm /sof/oracle/oradata/orcl/control0* -rf
        [Oracle@huang ~]$ ls /sof/oracle/oradata/orcl
        orcl/     orcl.bak/
        [Oracle@huang ~]$ ls /sof/oracle/oradata/orcl
        orcl/     orcl.bak/
        [Oracle@huang ~]$ ls /sof/oracle/oradata/orcl/
        example01.dbf  redo02.log  sysaux01.dbf  temp01.dbf     users01.dbf
        redo01.log     redo03.log  system01.dbf  undotbs01.dbf

        [Oracle@huang ~]$ sqlplus / as sysdba
        [uniread] Loaded history (945 lines)

        SQL*Plus: Release 10.2.0.4.0 - Production on Mon Jan 4 16:57:00 2010

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

        Connected to an idle instance.

        SQL> startup
        Oracle instance started.

        Total System Global Area 1090519040 bytes
        Fixed Size                  1267020 bytes
        Variable Size             704645812 bytes
        Database Buffers          369098752 bytes
        Redo Buffers               15507456 bytes
        ORA-00205: error in identifying control file, check alert log for more info

         

        去除所有的--和空格行,和開頭的空格。

        [Oracle@huang ~]$ grep -v ^-- /tmp/luo.txt|grep -v ^$ >/tmp/luo1.txt
        [Oracle@huang ~]$ vim /tmp/luo1.txt
        [Oracle@huang ~]$ sed -n '1,23'p /tmp/luo1.txt >/tmp/luo2.txt
        截取下面兩行和之間的內(nèi)容。注意是下面行是第一次出現(xiàn)的時(shí)候
        STARTUP NOMOUNT
        ..................
        SIZE 30408704  REUSE AUTOEXTEND ON NEXT 655360  MAXSIZE 32767M;

        [Oracle@huang ~]$ sed -i 's/^ //' /tmp/luo2.txt
        [Oracle@huang ~]$ sed -i 's/^ //' /tmp/luo2.txt
        [Oracle@huang ~]$ sed -i 's/^ //' /tmp/luo2.txt
        [Oracle@huang ~]$ sed -i 's/^ //' /tmp/luo2.txt
        [Oracle@huang ~]$ sed -i 's/^ //' /tmp/luo2.txt
        [Oracle@huang ~]$ vim /tmp/luo2.txt
        確定時(shí)候空格和--開頭的行就刪除了。


        SQL> shutdown abort;
        Oracle instance shut down.
        SQL> @/tmp/luo2.txt 我們運(yùn)行剛才的那個(gè)腳本就可以重新的建立起控制文件
        Oracle instance started.

        Total System Global Area 1090519040 bytes
        Fixed Size                  1267020 bytes
        Variable Size             704645812 bytes
        Database Buffers          369098752 bytes
        Redo Buffers               15507456 bytes

        Control file created.

        Media recovery complete.

        Database altered.


        Tablespace altered.

        SQL> ho ls /sof/Oracle/oradata/orcl/
        control01.ctl  example01.dbf  redo03.log     temp01.dbf    
        control02.ctl  redo01.log     sysaux01.dbf   undotbs01.dbf 
        control03.ctl  redo02.log     system01.dbf   users01.dbf

        上面就是控制文件的幾種恢復(fù)方法。

         


        本文出自:億恩科技【mszdt.com】

        服務(wù)器租用/服務(wù)器托管中國(guó)五強(qiáng)!虛擬主機(jī)域名注冊(cè)頂級(jí)提供商!15年品質(zhì)保障!--億恩科技[ENKJ.COM]

      2. 您可能在找
      3. 億恩北京公司:
      4. 經(jīng)營(yíng)性ICP/ISP證:京B2-20150015
      5. 億恩鄭州公司:
      6. 經(jīng)營(yíng)性ICP/ISP/IDC證:豫B1.B2-20060070
      7. 億恩南昌公司:
      8. 經(jīng)營(yíng)性ICP/ISP證:贛B2-20080012
      9. 服務(wù)器/云主機(jī) 24小時(shí)售后服務(wù)電話:0371-60135900
      10. 虛擬主機(jī)/智能建站 24小時(shí)售后服務(wù)電話:0371-60135900
      11. 專注服務(wù)器托管17年
        掃掃關(guān)注-微信公眾號(hào)
        0371-60135900
        Copyright© 1999-2019 ENKJ All Rights Reserved 億恩科技 版權(quán)所有  地址:鄭州市高新區(qū)翠竹街1號(hào)總部企業(yè)基地億恩大廈  法律顧問(wèn):河南亞太人律師事務(wù)所郝建鋒、杜慧月律師   京公網(wǎng)安備41019702002023號(hào)
          0
         
         
         
         

        0371-60135900
        7*24小時(shí)客服服務(wù)熱線