您的位置:首页 > 产品设计 > UI/UE

1Z0-051 QUESTION 37 关于drop table

2014-05-12 01:08 351 查看
37. You issued the following command to drop the PRODUCTS table: 

SQL> DROP TABLE products; 

What is the implication of this command? (Choose all that apply.) 

A. All data along with the table structure is   deleted. 

B. The   pending transaction in the session   is   committed. 

C. All indexes on the table will remain but they are   invalidated. 

D. All views and synonyms will remain but they are   invalidated. 

E. All data in the table are   deleted but the   table structure will   remain. 
Answer: ABD

解析:

A选项正确,删除表时表结构也删除了;

B选项正确,因为drop table是DDL语句,会自动提交;

C选项错误,删除表时候索引一起删除;

D选项正确,删除表时,视图和同义词会保留,但无效;

E选项错误,删除表时,结构也删除了。

官方文档参考:

http://docs.oracle.com/cd/E11882_01/server.112/e41084/statements_9003.htm#SQLRF54943

All table indexes and domain indexes are dropped, as well as any triggers defined on the table, regardless of who created them or whose schema contains them. If table is partitioned, then any corresponding local index partitions are also dropped.

If the table is a base table for a view, a container or master table of a materialized view, or if it is referenced in a stored procedure, function, or package, then the database invalidates these dependent objects but does not drop them. You cannot use these
objects unless you re-create the table or drop and re-create the objects so that they no longer depend on the table.

If you choose to re-create the table, then it must contain all the columns selected by the subqueries originally used to define the materialized views and all the columns referenced in the stored procedures, functions, or packages. Any users previously granted
object privileges on the views, stored procedures, functions, or packages need not be regranted these privileges.

If the table is a master table for a materialized view, then the materialized view can still be queried, but it cannot be refreshed unless the table is re-created so that it contains all the columns selected by the defining query of the materialized view.

If the table has a materialized view log, then the database drops this log and any other direct-path INSERT refresh information associated with the table.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: