OCP 1Z0 053 25

25.You enabled Flashback Data Archive on the INVENTORY table. Which DDL operation is supported on 
the table after enabling Flashback Data Archive? 
A. Drop the table. 
B. Partition the table 
C. Truncate the table. 
D. Add a column to the table. 
E. Rename a column in the table. 
Answer: D 

http://docs.oracle.com/cd/B28359_01/appdev.111/b28424/adfns_flashback.htm#BJFJHDAG

DDL Statements Not Allowed on Tables Enabled for Flashback Data Archive

Using any of the following DDL statements on a table enabled for Flashback Data Archive causes error ORA-55610:

  • ALTER TABLE statement that does any of the following:

    • Drops, renames, or modifies a column

    • Performs partition or subpartition operations

    • Converts a LONG column to a LOB column

    • Includes an UPGRADE TABLE clause, with or without an INCLUDING DATA clause

  • DROP TABLE statement

  • RENAME TABLE statement

  • TRUNCATE TABLE statement



不知是否新版本有改进,测试结果不一样

版本

SQL> select * from v$version where rownum <=1;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - Production
1 row selected

SQL> CREATE TABLE employee (EMPNO NUMBER(4) NOT NULL, ENAME VARCHAR2(10),
  2    JOB VARCHAR2(9), MGR NUMBER(4)) FLASHBACK ARCHIVE;
Table created

SQL> insert into employee(empno) values(11);
1 row inserted

SQL> commit;
Commit complete

SQL> select systimestamp from dual;
SYSTIMESTAMP
--------------------------------------------------------------------------------
30-JUN-14 08.10.33.031000 PM +08:00
1 row selected

新增字段

SQL> alter table employee add new_col number;
Table altered

SQL> delete from employee;
1 row deleted

SQL> commit;
Commit complete

SQL> SELECT empno FROM employee
  2  AS OF TIMESTAMP TO_TIMESTAMP('2014-6-30 20:10.33', 'YYYY-MM-DD HH24:MI:SS');
EMPNO
-----
   11
1 row selected


删除字段

SQL> alter table employee drop column new_col;
Table altered

SQL> 
SQL> SELECT empno FROM employee
  2  AS OF TIMESTAMP TO_TIMESTAMP('2014-6-30 20:10.33', 'YYYY-MM-DD HH24:MI:SS');
EMPNO
-----
   11
1 row selected

truncate

SQL> truncate table employee;
Table truncated

SQL> 
SQL> SELECT empno FROM employee
  2  AS OF TIMESTAMP TO_TIMESTAMP('2014-6-30 20:10.33', 'YYYY-MM-DD HH24:MI:SS');
EMPNO
-----
   11
1 row selected

rename column

SQL> alter table employee rename column empno to empno2;
Table altered

SQL> SELECT empno2 FROM employee
  2  AS OF TIMESTAMP TO_TIMESTAMP('2014-6-30 20:10.33', 'YYYY-MM-DD HH24:MI:SS');
EMPNO2
------
    11
1 row selected

rename table

SQL> alter table employee rename to emp3;
Table altered

SQL> 
SQL> SELECT empno2 FROM emp3
  2  AS OF TIMESTAMP TO_TIMESTAMP('2014-6-30 20:10.33', 'YYYY-MM-DD HH24:MI:SS');
EMPNO2
------
    11
1 row selected



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值