---
title: "ORA-00942: 表或视图不存在"
author: "dbcore"
date: "2011-10-26T09:49:27Z"
tags: []
categories: ["数据库"]
slug: "ora-00942"
draft: false
lastmod: "2011-10-26T09:53:20Z"
id: 1215395
url: "https://dbcore.iteye.com/blog/1215395"
---

SQL> conn hr/***
SQL> select username,sid,serial#,module,action from v$session;
 
select username,sid,serial#,module,action from v$session
 
ORA-00942: 表或视图不存在

解决：

sqlplus "sys/*** as sysdba"
SQL> grant select on  gv$session to hr;
grant select on  gv$session to hr
                 *
第 1 行出现错误:
ORA-02030: 只能从固定的表/视图查询

SQL> grant select on  sys.v_$session to hr;

授权成功。

sqlplus "hr/***"
SQL> select username,sid,serial#,module,action from v$session;
 
USERNAME                              SID    SERIAL# MODULE                                           ACTION
------------------------------ ---------- ---------- ------------------------------------------------ --------------------------------
                                        1          1                                                  
                                        2          1