文档内容
|
|
症状 |
|
|
原因 |
|
|
解决方案 |
适用于:
Oracle Database - Enterprise Edition - 版本 12cBETA2 和更高版本本文档所含信息适用于所有平台
症状
在 rman 命令行中运行 SQL 语句查询用户表时碰到如下错误。
RMAN> select * from scott.dept;
using target database control file instead of recovery catalog
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of sql statement command at 12/31/2012 23:08:48
ORA-01031: insufficient privileges
using target database control file instead of recovery catalog
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of sql statement command at 12/31/2012 23:08:48
ORA-01031: insufficient privileges
原因
在 rman 命令行中不支持运行查询用户表的 SQL 语句。
解决方案
RMAN 是一个用来备份数据库的 Oracle 工具。从 12c 开始,可以通过 rman 命令行运行一些和备份有关的 SQL 语句,比如查询 datafile 的状态(比如查询 V$DATAFILE_HEADER)。如果要通过 SQL 语句查询用户表,那么需要使用 SQL*Plus,如下:
SQL> select * from scott.dept;
DEPTNO DNAME LOC
---------- -------------- -------------
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
4 rows selected.
DEPTNO DNAME LOC
---------- -------------- -------------
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
4 rows selected.