我是 Oracle 数据库 11g R2 的新手,这是为了获取数据库表空间的信息。我像这样运行下一个代码.sql
:
select TABLESPACE_NAME,
INITIAL_EXTENT,
NEXT_EXTENT,
MIN_EXTENTS,
MAX_EXTENTS,
PCT_INCREASE,
STATUS,
CONTENTS
from dba_tablespaces
order by TABLESPACE_NAME ;
并且工作正常,但是当我尝试在存储过程中运行时:
CREATE OR REPLACE PROCEDURE TABLE_SPACE_INFO AS
BEGIN
select TABLESPACE_NAME,
INITIAL_EXTENT,
NEXT_EXTENT,
MIN_EXTENTS,
MAX_EXTENTS,
PCT_INCREASE,
STATUS,
CONTENTS
from dba_tablespaces
order by TABLESPACE_NAME ;
END TABLE_SPACE_INFO;
我得到一个编译错误:
Error(3,3): PL/SQL: SQL Statement ignored
Error(11,7): PL/SQL: ORA-00942: table or view does not exist
解决方案是什么,为什么它错了?