zoukankan      html  css  js  c++  java
  • 意外删除Oracle数据文件(dbf),恢复oralce库的解决办法Oracle错误代码:ORA01033

    系统环境:
    1、操作系统:Windows 2000 Server,
    2、数据库: Oracle 8i R2 (8.1.6) for NT 企业版
    3、安装路径:C:\ORACLE

    错误现象:
    因误操作,数据库中某一数据文件被误删,
    控制面板的Oracle相关服务显示已启动,但用SQL*Plus无法连接,
    显示以下错误
    ORA-01033: ORACLE initialization or shutdown in progress

    模拟现象:

    create tablespace test datafile
    'c:\test.ora' size 5M
    AUTOEXTEND ON NEXT 1M MAXSIZE UNLIMITED
    default storage (initial 128K next 1M pctincrease 0)
    /

    关闭所有服务stop.bat

    net stop "OracleWebAssistant0"
    net stop "OracleOraHome81TNSListener"
    net stop "OracleServiceORADB"

    shutdown

    在操作系统中删除test.ora文件

    重新启动服务start.bat

    net start "OracleWebAssistant0"
    net start "OracleOraHome81TNSListener"
    net start "OracleServiceORADB"

    服务里OracleServiceORADB显示已启动,但用SQL*Plus无法连接,
    显示ORA-01033: ORACLE initialization or shutdown in progress


    解决方法:

    先让该数据文件脱机,就可以打开数据库
    C:\>svrmgrl
    svrmgrl>connect internal/oracle
    svrmgrl>shutdown
    svrmgrl>startup mount

    --ARCHIVELOG模式命令,文件名要大写
    svrmgrl>alter database datafile 'C:\TEST.ORA' offline;

    --NOARCHIVELOG模式命令
    svrmgrl>alter database datafile 'C:\TEST.ORA' offline drop;

    svrmgrl>alter database open;


    --查询数据文件联、脱机状态
    SQL> select file#,name,status from v$datafile;

    SQL> drop tablespace test;

    表空间已丢弃。

  • 相关阅读:
    Codeforces Gym 100463D Evil DFS
    codeforces Gym 100187J J. Deck Shuffling dfs
    Codeforces Round #308 (Div. 2) C. Vanya and Scales dfs
    Codeforces Round #306 (Div. 2) B. Preparing Olympiad dfs
    Codeforces Round #402 (Div. 2)D. String Game 二分
    hdu 4499 Cannon dfs
    cdoj 15 Kastenlauf dfs
    hdu5254 棋盘占领 dfs
    zoj 3620 Escape Time II dfs
    CDOJ 215 吴队长征婚 DFS+剪枝
  • 原文地址:https://www.cnblogs.com/liubiqu/p/174192.html
Copyright © 2011-2022 走看看