Which two statements are true when row-archival management is enabled?
A. The ORA_ARCHIVE_STATE column may only be updated by users with the DBA role set.
B. The ORA_ARCHIVE_STATE column is updated in an overnight maintenance job based on activity tracking.
C. The ROW ARCHIVAL VISIBILITY session parameter defaults to active rows
D. The ORA_ARCHIVE_STATE column may only be queried by users with the DBA role set.
E. The ORA_ARCHIVE_STATE column is only displayed if it is referenced in the column select list of aquery.
Correct Answer:
CE
参数ROW ARCHIVAL VISIBILITY设置
在会话级别设置该参数,可实现对已归档数据行的可见性,该参数有两个值,分别为:
- ACTIVE:默认值,设置该参数后,执行查询时数据库返回active数据行;
- ALL:该值该参数后,执行查询时,数据库返回所有数据行;
ORA_ARCHIVE_STATE
在允许row archival后,系统会自动会表增加栏位ORA_ARCHIVE_STATE,用来表示数据可用性情况。
如果我们用select * from t1这种方式,这个栏位是不会被显示的,只有显式指定栏位,才会在结果集中显示栏位.
我通过显式指定,可以查出ora_archive_state,默认值为0,表示该行对应用程序可见.
现在我们回到之前的需求场景中来,比如现在计划a=1的这条记录,对应用程序不可见.
update t1 set ora_archive_state=1 where a=1;