zoukankan      html  css  js  c++  java
  • 误删系统表(drop dual)后数据库再次启动报错的解决办法

    SYS@orcl> drop table dual;

    SYS@orcl> select * from dual;
    select * from dual
                  *
    ERROR at line 1:
    ORA-00980: synonym translation is no longer valid

    SYS@orcl> shutdow immediate

    SYS@orcl> startup
    ORACLE instance started.

    Total System Global Area  171966464 bytes
    Fixed Size                   787988 bytes
    Variable Size             145488364 bytes
    Database Buffers           25165824 bytes
    Redo Buffers                 524288 bytes
    Database mounted.
    ORA-01092: ORACLE instance terminated. Disconnection forced

    分析:报错原因可能是打开数据库时 检查系统完整性时报错,解决办法:修改初始化参数使得打开数据库时不检查系统完整性,

    此时需要新建一个pfile初始化参数文件 设置初始化参数

    replication_dependency_tracking = FALSE(具体含义有待研究)

    创建该文件有两种方式

    1、通过spfile创建

    SYS@orcl> create pfile='d:\pfile.bak' from spfile;
    ERROR:
    ORA-03114: not connected to ORACLE

    SYS@orcl> conn / as sysdba

    SYS@orcl> create pfile='d:\pfile.bak' from spfile;

    File created.

    手动打开该文件 在最后一行添加如下内容:

    replication_dependency_tracking = FALSE

    保存。

    2、手动创建

    手动创建文件'd:\pfile.bak' ,打开文件 在文件中添加以下内容:

    SPFILE= 'F:\oracle\product\10.1.0\Db_1\database\SPFILEORCL.ORA'
    replication_dependency_tracking = FALSE

    保存。

    此种引用方式需要了解一下 pfile 与spfile 文件的联系与区别(有待研究)

    重新启动数据库:

    SYS@orcl> startup pfile='d:\pfile.bak';
    ORA-24324: service handle not initialized
    ORA-01041: internal error. hostdef extension doesn't exist

    SYS@orcl> shutdown immediate
    ORA-24324: service handle not initialized
    ORA-01041: internal error. hostdef extension doesn't exist

    SYS@orcl> conn / as sysdba
    Connected to an idle instance.
    SYS@orcl> shutdown immediate
    ORA-01034: ORACLE not available
    ORA-27101: shared memory realm does not exist

    SYS@orcl> shutdown abort
    ORACLE instance shut down.

    SYS@orcl> startup pfile='d:\pfile.bak';
    ORACLE instance started.

    Total System Global Area  171966464 bytes
    Fixed Size                   787988 bytes
    Variable Size             145488364 bytes
    Database Buffers           25165824 bytes
    Redo Buffers                 524288 bytes
    Database mounted.
    Database opened.

    SYS@orcl> select * from dual;
    select * from dual
                  *
    ERROR at line 1:
    ORA-00980: synonym translation is no longer valid

    SYS@orcl> create table SYS.DUAL
      2  (
      3    DUMMY VARCHAR2(1)
      4  )
      5  tablespace SYSTEM
      6    pctfree 10
      7    pctused 40
      8    initrans 1
      9    maxtrans 255
     10    storage
     11    (
     12      initial 16K
     13      minextents 1
     14      maxextents unlimited
     15    );

    SYS@orcl> grant select on SYS.DUAL to PUBLIC with grant option;

    SYS@orcl> insert into dual (DUMMY)
      2  values ('X');

    SYS@orcl> commit;

    SYS@orcl> select * from dual;

    D
    -
    X

    SYS@orcl> shutdown immediate
    Database closed.
    Database dismounted.
    ORACLE instance shut down.

    SYS@orcl> startup
    ORACLE instance started.

    Total System Global Area  171966464 bytes
    Fixed Size                   787988 bytes
    Variable Size             145488364 bytes
    Database Buffers           25165824 bytes
    Redo Buffers                 524288 bytes
    Database mounted.
    Database opened.

    SYS@orcl> select * from dual;

    D
    -
    X

    SYS@orcl>

    结束!

    坚持每天学习
  • 相关阅读:
    C#综合揭秘——细说多线程(上)
    Tinyxml2学习
    GNSS数据下载网站整理,包括gamit、bernese更新文件地址[2020.04更新]
    c#中xml增删查改
    C#比较两个对象中的指定字段值是否相等
    C#数据导出帮助类
    ajax文件下载
    C#中使用NPOI进行DataTable和Excel互转
    使用 ICSharpCode.SharpZipLib.Zip压缩解压文件
    C#DataTable转List<T>互转
  • 原文地址:https://www.cnblogs.com/jsnewland/p/2262707.html
Copyright © 2011-2022 走看看