作者:陈珍贵263483 | 来源:互联网 | 2014-07-11 17:33
OracleError:PLS-00201identifier'DBMS_FLASHBA的问题在使用PL/SQL包dbms_flashback做闪回查询时,不能直接使用‘SYS’用户来调用:01SQL>execdbms_flashback.enable_at
Oracle Error:PLS-00201 identifier'DBMS_FLASHBA的问题
在使用PL/SQL包dbms_flashback做闪回查询时,不能直接使用‘SYS’用户来调用:
01
SQL> exec dbms_flashback.enable_at_time(systimestamp-interval '15' minute);
02
03
BEGIN dbms_flashback.enable_at_time(systimestamp-interval '15' minute); END;
04
05
*
06
07
ERROR at line 1:
08 www.2cto.com
09
ORA-08185: Flashback not supported for user SYS
10
11
ORA-06512: at "SYS.DBMS_FLASHBACK", line 3
12
13
ORA-06512: at line 1
切换成需要进行闪回查询的普通用户,不过在此之前需要对此用户进行授权。如不授权会出现如下错误:
01
SQL> exec dbms_flashback.enable_at_time(systimestamp-interval '15' minute);
02
03
BEGIN dbms_flashback.enable_at_time(systimestamp-interval '15' minute); END;
04
05
*
06
07
ERROR at line 1:
08 www.2cto.com
09
ORA-06550: line 1, column 7:
10
11
PLS-00201: identifier 'DBMS_FLASHBACK' must be declared
12
13
ORA-06550: line 1, column 7:
14
15
PL/SQL: Statement ignored
授权:
01
SQL> conn / as sysdba
02
03
Connected.
04
05
SQL> grant execute on dbms_flashback to scotto;
06
07
Grant succeeded.
08
09
SQL> conn scotto/scotto;
10 www.2cto.com
11
Connected.
12
13
SQL> exec dbms_flashback.enable_at_time(systimestamp - interval '15' minute);
14
15
PL/SQL procedure successfully completed.
16
17
SQL>