用非dba账号(但赋予了DBA角色)登录一个新的10g数据库想看下版本号,
SQL> desc v$instance;
ERROR:
ORA-04043: object "SYS"."V_$INSTANCE" does not exist
奇怪,之前有个9i的库,同样的账号就可以查看呢???
分析:
这里显示的是"SYS"."V_$INSTANCE"对象不存在,我们知道,当账户没有某个对象的权限时,查询该对象,可能返回的就是对象不存在的错误(我觉得有时还是有点歧义,或者说有点误导的)。如下是04043的说明,也没有提到是因为无权限的原因。
ORA-04043: object string 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"."V_$INSTANCE"不存在,就登录sys,
SQL> desc V$INSTANCE
Name Null? Type
----------------------------------------- -------- ----------------------------
INSTANCE_NUMBER NUMBER
INSTANCE_NAME VARCHAR2(16)
HOST_NAME VARCHAR2(64)
VERSION VARCHAR2(17)
STARTUP_TIME DATE
STATUS VARCHAR2(12)
PARALLEL VARCHAR2(3)
THREAD# NUMBER
ARCHIVER VARCHAR2(7)
LOG_SWITCH_WAIT VARCHAR2(15)
LOGINS
SQL> desc v$instance;
ERROR:
ORA-04043: object "SYS"."V_$INSTANCE" does not exist
奇怪,之前有个9i的库,同样的账号就可以查看呢???
分析:
这里显示的是"SYS"."V_$INSTANCE"对象不存在,我们知道,当账户没有某个对象的权限时,查询该对象,可能返回的就是对象不存在的错误(我觉得有时还是有点歧义,或者说有点误导的)。如下是04043的说明,也没有提到是因为无权限的原因。
ORA-04043: object string 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"."V_$INSTANCE"不存在,就登录sys,
SQL> desc V$INSTANCE
Name Null? Type
----------------------------------------- -------- ----------------------------
INSTANCE_NUMBER NUMBER
INSTANCE_NAME VARCHAR2(16)
HOST_NAME VARCHAR2(64)
VERSION VARCHAR2(17)
STARTUP_TIME DATE
STATUS VARCHAR2(12)
PARALLEL VARCHAR2(3)
THREAD# NUMBER
ARCHIVER VARCHAR2(7)
LOG_SWITCH_WAIT VARCHAR2(15)
LOGINS