QUESTION 215-Temporal Validity feature

Which three statements are true about the use of the In-Database Archiving and Temporal  Validity feature of Oracle Database 12c?
A. Temporal Validity spans the time between a row insert and a subsequent update or delete for the same  row.
B. Both Transaction Time and Temporal Validity time dimensions may be used as filters in the same query.
C. Inactive rows that have been archived are always invisible.
D. Temporal Validity time is based on the times specified by the application.
E In-Database Archiving is based on application-managed setting of the life-cycle state.
B.事务时间和时间有效性时间维度都可以用作同一查询中的过滤器。
D.时间有效性时间基于应用程序指定的时间。
E。在数据库中归档是基于应用程序管理设置的生命周期状态。
Correct Answer: BD
与 QUESTION 228相同,答案为BDE

在应用程序开发中,有时会碰到这样一个场景:设置一条记录的生效时间范围,比如某个产品信息,在某个时间段内是有效的,一般设计表时会在表中增加valid_start和valid_end这两个字段来限制,并通过设置这两个字段来实现具体产品的生效范围,如果查看当前生效的记录,则需要通过时间进行过滤。

Oracle 12.1.0.1引入了Temporal Validity(时间有效性),通过这一特性,在不增加列的情况下可以实现时间有效性的的判断,下面将对这一特性进行演示。

创建有valid-time维度的表

(1)显式指定两个date-time列

SQL> create table emp(empno number,salary number,deptid number,name varchar2(20),user_time_start date,user_time_end date,period for user_time (user_time_start,user_time_end));

(2)隐式的vaild-time列

SQL> create table emp2(empno number,salary number,deptid number,name varchar2(20), period for user_time);

vaild-time维度使用关键字"period for"指定。
如果使用隐式的valid-time列,不需要指两个日期列,oracle会创建两个隐藏列,并自动加上valid-time维度的前缀名。例如上一个例子中的前缀名是:user_time

时间有效期管理(Temporal Validity)以下简称 TV,TV 的功能大致上可以这样描述:在表中手动或者自动建两个时间类型的字段,一个表示有效期的开始时间,一个表示有效期的结束时间,就可以通过设置让只有在有效期内的记录才会被选择出来。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值