首页 文章

使用来自另一个模式的模式获取oracle scn

提问于
浏览
0

我在我的数据库上有2个模式,一个admin(包含所有表)和第二个模式,它有权从admin中选择,更新,删除同义词表 . (我使用的是11G)

我正在使用管理架构 . 我想要做的是,在操作完成之前获取scn:

SELECT current_scn FROM V$DATABASE;

然后完成了一些操作,之后我尝试使用我在操作之前存储它的scn进行选择:

SELECT * FROM myTable AS OF SCN 2312312;

然后

ORA-01031: insufficient privileges
01031. 00000 -  "insufficient privileges"
*Cause:    An attempt was made to perform a database operation without
           the necessary privileges.
*Action:   Ask your database administrator or designated security
           administrator to grant you the necessary privileges

这个错误即将到来 .

1 回答

  • 1

    您需要授予用户对表运行闪回查询的权限 .

    grant flashback 
       on myTable
       to someUser;
    

    或者,您可以授予用户对任何表运行闪回查询的权限

    grant flashback any table
       to someUser
    

    一般来说,审计人员在看到各种特权时会相当紧张,但这个特权是相当安全的 . 您可能还想在 dbms_flashback 包上授予权限 .

    该文档对administrative tasks to enable flashback features有一个很好的概述 .

相关问题