您的位置:首页 > 其它

OCP 1Z0 053 25

2014-06-30 20:18 239 查看
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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: