[20141218]关于dual.txt

简介: [20141218]关于dual.txt --昨天在群里有人问,数据库在mount状态下,打入什么命令,可以导致在后续执行alter database open的时候,数据库crash。

[20141218]关于dual.txt

--昨天在群里有人问,数据库在mount状态下,打入什么命令,可以导致在后续执行alter database open的时候,数据库crash。
--实际上最简单的方法就是desc dual就可以出现这种现象,就是ora-4043错误。

--做一个测试:

SYS@test> @ &r/ver1
PORT_STRING                    VERSION        BANNER
------------------------------ -------------- ----------------------------------------------------------------
x86_64/Linux 2.4.xx            10.2.0.4.0     Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi


SYS@test> startup mount
ORACLE instance started.
Total System Global Area    473956352 bytes
Fixed Size                    2084776 bytes
Variable Size               176160856 bytes
Database Buffers            285212672 bytes
Redo Buffers                 10498048 bytes
Database mounted.
SYS@test> desc dual
ERROR:
ORA-04043: object dual does not exist

SYS@test> host oerr ora 4043
04043, 00000, "object %s does not exist"
// *Cause:  An object name was specified that was not recognized by the system.
//          There are several possible causes:
//          - An invalid name for a table, view, sequence, procedure, function,
//          package, or package body was entered. Since the system could not
//          recognize the invalid name, it responded with the message that the
//          named object does not exist.
//          - An attempt was made to rename an index or a cluster, or some
//          other object that cannot be renamed.
// *Action: Check the spelling of the named object and rerun the code. (Valid
//          names of tables, views, functions, etc. can be listed by querying
//          the data dictionary.)


SYS@test> alter database open ;
alter database open
*
ERROR at line 1:
ORA-01092: ORACLE instance terminated. Disconnection forced

SYS@test> select open_mode from v$database ;
ERROR:
ORA-03114: not connected to ORACLE


--这个是因为在mount状态下,仅仅少量的视图可以访问,当访问到不存在的表与视图时,这部分信息已经加载到shared pool。
--开机以后,访问到这些对象被认为是不正常的,而dual表在open状态要使用,其结果直接导致实例crash。

--换成这样,就可以正常启动。

SYS@test> startup mount
ORACLE instance started.

Total System Global Area    473956352 bytes
Fixed Size                    2084776 bytes
Variable Size               176160856 bytes
Database Buffers            285212672 bytes
Redo Buffers                 10498048 bytes
Database mounted.
SYS@test> desc dual
ERROR:
ORA-04043: object dual does not exist

SYS@test> alter system flush shared_pool;
System altered.

SYS@test> alter database open ;
Database altered.


--可以测试别的视图看看,比如dba_tables看看。

SYS@test> startup mount
ORACLE instance started.
Total System Global Area    473956352 bytes
Fixed Size                    2084776 bytes
Variable Size               176160856 bytes
Database Buffers            285212672 bytes
Redo Buffers                 10498048 bytes
Database mounted.

SYS@test> select count(*) from dba_tables;
select count(*) from dba_tables
                     *
ERROR at line 1:
ORA-01219: database not open: queries allowed on fixed tables/views only

SYS@test> alter database open ;

Database altered.

SYS@test> select count(*) from dba_tables;
    COUNT(*)
------------
        1595

--这样没有问题。如果执行desc dba_tables看看。


SYS@test> startup mount
ORACLE instance started.
Total System Global Area    473956352 bytes
Fixed Size                    2084776 bytes
Variable Size               176160856 bytes
Database Buffers            285212672 bytes
Redo Buffers                 10498048 bytes
Database mounted.
SYS@test> desc dba_tables
ERROR:
ORA-04043: object dba_tables does not exist


SYS@test> alter database open ;

Database altered.

SYS@test> select count(*) from dba_tables;
select count(*) from dba_tables
                     *
ERROR at line 1:
ORA-00942: table or view does not exist

SYS@test> alter system flush shared_pool;
System altered.

SYS@test> select count(*) from dba_tables;
    COUNT(*)
------------
        1595

--总之,如果在mount后出现,ora-04043错误,最简单的方法就是在open前,执行一次alter system flush shared_pool;。

目录
相关文章
|
Oracle 关系型数据库 OLAP
[20180628]expdp与rows=n.txt
[20180628]expdp与rows=n.txt --//想导出一些表结构,使用错参数rows=n,才发现expdp会自动修正这个错误,使用content=metadata_only代替.
1797 0
|
SQL Oracle 关系型数据库
[20180511]PLSQL与fetchsize.txt
[20180511]PLSQL与fetchsize.txt --//测试看看PLSQL中cursor的fetchsize: 1.环境: SCOTT@book> @ ver1 PORT_STRING                    VERSION  ...
1135 0
|
SQL Oracle 关系型数据库
[20180310]12c exp 无法dirct的情况.txt
[20180310]12c exp 无法dirct的情况.txt --//前一阵子测试.exp 无法dirct的情况的链接: http://blog.itpub.net/267265/viewspace-2151290/ --//12c 改进增加字段与缺省值的情况,允许不要加not null修改表块.
1441 0
|
SQL Oracle 关系型数据库
[20180226]exp 无法dirct的情况.txt
[20180226]exp 无法dirct的情况.txt http://blog.csdn.net/leshami/article/details/9146023 传统路径导出 VS 直接路径导出(oracle exp direct=y) 1、两者的差异 a、 Conventional path Export     传统路径模式使用SQL SELECT语句抽取表数据。
1199 0
|
Oracle 关系型数据库 OLAP
[20180224]expdp query 写法问题.txt
[20180224]expdp query 写法问题.txt --//如果使用expdp/impdp导入导出,如果参数复杂,最好的建议使用参数文件.避免各种问题.通过简单的例子说明问题.
1186 0
|
Oracle 关系型数据库 数据库
[20171127]dual.txt
[20171127]dual.txt --//我曾经提到如果在nomount,mount阶段,desc dual,启动到open阶段时,数据库会直接崩溃. --//链接:http://blog.
808 0
[20171110]toad 小技巧.txt
[20171110]toad 小技巧.txt --//前几天的事情,一大早要求查询记录操作异常,本来想使用logminer查询,我们redo文件太大,使用logminer分析很慢.
968 0
|
算法 关系型数据库 Oracle
[20170414]round(sysdate,'day').txt
[20170414]round(sysdate,'day').txt http://www.itpub.net/thread-2086507-1-1.html SCOTT@book> @ &r/ver1 PORT_STRING                  ...
1096 0
|
关系型数据库 Oracle
[20170410]11G ora_sql_txt是否有效.txt
[20170410]11G ora_sql_txt是否有效.txt --链接问的问题: http://www.itpub.net/thread-2086256-1-1.
1173 0
|
监控 Oracle 关系型数据库
[20170203]关于flashback的问题.txt
[20170203]关于flashback的问题.txt --今天生产系统遇到的问题,dataguard机器磁盘空间不足,需要释放磁盘空间,无论如何删除日志,空间回收都是很少.
869 0