Oracle 11g 课后答案,孙凤栋

更新时间:2023-12-03 15:45:01 阅读量: 教育文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

第一章

1 简答题

(1) Oracle 11g 数据库的企业版、标准版、个人版之间有什么区别?分别适用于什么环境?

(2)常用的数据库类型有哪几种?有何区别?分别适用于什么类型的应用?

(3)说明Oracle数据库的命名规则。

1. 命名只能使用英文字母,数字和下划线,除个别通用的要避免使用缩写,多个单词组成的中间以下划线分割;

2. 除数据库名称长度为1-8个字符,其余为1-30个字符,Database link名称也不要超过30个字符;

3. 避免使用Oracle的保留字如level、关键字如type; 4. 名表之间相关列名尽量同名; 5. 数据库的命名:网上数据库命名为“OLPS”+表示站点的2-4个字符,后台数据库命名为“BOPS”+表示站点的2-4个字符。测试数据库命名为“OLPS|BOPS”+“TEST”,开发数据库命名为“OLPS|BOPS”+“TEST”,用模式(SCHEMA/USER)的不同来区分不同的站点。 6. INDEX命名:table_name+column_name+index_type(1 byte)+idx,各部分以下划线(_)

分割。多单词组成的column name,取前几个单词首字母,加末单词组成column_name。 7. SEQUENCE命名:seq_+table_name。 (4)说明Oracle数据库各个服务的作用。

第二章

1.简答题

(1)简述利用OEM可以进行哪些数据库管理操作。 在OEM(Oracle Enterprise Manager)中,可以对方案中的各种数据库对象进行管理,如添加表、修改表和删除表等。

(2).简述利用SQL Plus工具可以进行哪些数据库管理与开发操作

(3).简述利用SQL Developer可以对数据库进行哪些类型的操作

(4).简述利用网络配置助手ONCA可以进行哪些网络配置操作

(5).简述利用网络管理工具ONM可以进行哪些网络管理操作。

第三章

1 简答题

(l)简述Oracle数据库体系结构的构成。

(2)简述Oracle数据库物理存储结构的组成。

(3)简述Oracle数据库逻辑存储结构的组成及相互关系。

它们之间的关系如图所示,一个或多个连续的的Oracle数据块构成区,一个或多个区构成段,一个或多个段构成表空间,所有表空间构成数据库。 (4)简述Oracle数据库内存结构的组成及各个内存区的作用。

(5)简述Oracle数据库后台进程的组成及各个后台进程的功能。

(6)简述Oracle数据库后台进程DBWR何时启动。

(7)简述Oracle数据库后台进程LGWR何时启动。

2 选择题

(1)An Oracle instance is:

A .Oracle Memory Structures B. Oracle UO Structures C. Oracle Background Processes· D. All of the Above (2)The SGA consists of the following items:

A. Buffer Cache B. Shared Pool C. Redo Log Buffer D. All of the Above

(3) The area that stores the blocks recently used by SQL statements is called: A. Shared Pool B .Buffer Cache C. PGA D. UGA

(4)Which of the following is not a background server process in an Oracle server? A.IM3 WR B.DBCM C. LGWR D. SMON (5)Which of following is a valid background server processes in Oracle?

A .ARCH B .LGWR C. DBWR D. All of the above (6)The process that writcs the modified blocks to the data files is: A .DBWR B.LG WR C. PMON D. SMON

(7)The process that records information about the changes made by all transactions that

commit is: A.DBWR B. SMON C. CKPT D. None of the above (8)Oracle does not consider a transaction committed until: A. The data is written back to the disk by DBWR

B. The LGWR successfully writes the changes to redo C. PMON process commits the process changes D.SMON process Writes the data

(9) The process that performs internal operations like tablespace coalescing is: A. PMON B. SMON C. DBWR D.ARCH (10) The process that manages the connectivity of user sessions is: A. PMON B. SMON C. SERV D. NETS (11)Rollback segments are used for:

A. read consistency B. rolling back transactions C. recovering the database D. all of the above (12) Rollback segment stores:

A. old values of the data changed by each transaction B. new values of the data changed by each transaction

C. both old and new values of the data changed by each transaction D. none

(13)collection of segments is a (an):

A.EXTENT B. SEGMENT C. TABLESPACE D. DATABASE

(14) Which of the following three portions of s data block are collectively called as Overhead? A. table directoiy,row diectory and row data

B. data block header, table directory and free space C. table dinxtory.rvw directory and data block header D. data block headerrow data and row header (15 ) The data dictionary tables and views are stored in: A. USERS tablespace B. SYSTEM tablespace C. TEMPORARY tablespace D. any of the three

(16) Identify the memory component from which memory may be allocated for:

Session memory for the shared serverBuffers for 1/0 slavesOracle Database Recovery Manage (RMAN)backup and restore operations

A. Large Pool B. Redo Log Buffer

C. Database Buffer Cache D. Program Global Area (PGA)

(17) Which two statements are true about Shared SQL Area and Private SQL Area? (Choose two) A. Shared SQL Area will be allocated in the shared pool B. Shared SQL Area will be allocated when a session starts C. Shared SQL Area will be allocated in the large pool always

D. The whole of Private SQL Area will be allocated in the Program Global Area (PGA) always

E. Shared SQL Area and Private SQL Area will be allocated in the PGA or large pool

F. The number of Private SQL Area allocations is dependent on the OPEN_CURSORS parameter

(18) Which is the correct description of a pinned buffer in the database buffer cache? A. The buffer is currently being accessed B. The buffer is empty and has not been used

C.The contents of the buffer have changed and must be flushed to the disk by the DBWn process

D. The buffer is a candidate for immediate aging out and its contents are with the block

第五章

1.简答题

(1)说明数据库表空间的种类及不同类型表空间的作用。 类型:永久性表空间(PERMANENT TABLESPACE)、临时表空间(TEMP TABLESPACE)、撤销表空间(UNDO TABLESPACE)

? 永久性表空间用于保留用户的任何段或应用跨越一个会话或事务的数据。

? 临时表空间是指专门存储临时数据的表空间,这些临时数据在会话结束时会自动释

放。

? 从Oracle 9i开始,Oracle数据库中引入撤销表空间,专门用于回退段的自动管理,

由数据库自动进行回退段的创建、分配与优化。

(2)说明数据库、表空间、数据文件及数据库对象之间的关系. 数据库,表空间,及数据文件关系密切,但同时又有很多区别:

? 一个Oracle数据库是由一个或多个表空间(tablespace)的逻辑存储单位构成的,这些表空间共同来存储数据库的数据

? Oracle数据库的每个表空间由一个或多个被称为数据文件(datafile)的物理文件构成,这些文件由Oracle所在的操作系统管理。

? 数据库的数据实际存储在构成各个表空间的数据文件中。 (3)说明Oracle数据库数据文件的作用。

? Oracle数据库的数据文件是用于保存数据库中数据的文件,系统数据、数据字典数

据、临时数据、索引数据、应用数据等都物理地存储在数据文件中。

(4)说明Oracle数据库控制文件的作用.

控制文件保存数据库的物理结构信息,包括数据库名称、数据文件的名称与状态、重做日志文件的名称与状态等.在数据库启动时,数据库实例依赖初始化参数定位控制文件,然后根据控制文件的信息加载数据文件和重做日志文件,最后打开数据文件和重做日志文件. (5)说明Oracle数据库重做日志文件的作用。 重做日志文件是以重做记录的形式记录、保存用户对教据库所进行的修改操作,包括用户执行DDL、DML语句的操作。如果用户只对数据库进行查询操作,那么查询信息是不会记录到重做日态文件中的。

(6)说明Oracle数据库归档的必要性及如何进行归档设置.

归档是数据库恢复及热备份的基础.只用当数据库归档模式时,才可以进行热备份和完全恢复。

进行归档设且包括归档模式设置(ARCHI V FLOG)、归档方式设置以及归档路径的设置等。

(7)说明Oracle数据库重做日志文件的工作方法.

每个数据库至少需要两个重做日志文件,采用循环写的方式进行下作。当一个重做日志文件在进行归档时,还有另一个重做日志文件可用.当一个重做日志文件被写满后,后台进程LGWR开始写入下一个重做日志文件,即日志切换,同时产生一个“日志序列号”,井将这个号码分配给即将开始使用的重做日志文件。当所有的日志文件都写满后.LGW4R进程再重新写入第一个日志文件。

(8)说明采用多路复用控制文件的必要性及其工作方式.

答:采用多路复用控制文件可避免由于一个控制文件的损坏而导致数据库无法正常启动。在数据库启动时根据一个控制文件打开数据库,在数据库运行时多路复用控制文件采用镜像的方式进行写操作,保持所有控制文件的同步。

(9)简述数据库归档目标设置的方法及注意事项。 设置方法

? 设置初始化参数LOG_ARCHIVE_DEST和LOG_ARCHIVE_DUPLEX_DEST ? 设置初始化参数LOG_ARCHIVE_DEST_n ? 设置归档文件命名方式

注意事项:

? 使用初始化参数LOG_ARCHIVE_DEST和LOG_ARCHIVE_DUPLEX_DEST只能设置两个本

地的归档目标,一个主归档目标和一个辅助归档目标。

? 初始化参数LOG_ARCHIVE_DEST_n最多可以设置31个归档目标,即n取值范围为1-31。

其中1-10可以用于指定本地的或远程的归档目标,11-31只能用于指定远程的归档目标。

? 设置初始化参数LOG_ARCHIVE_DEST_n时,需要使用关键字LOCATION或SERVICE指

明归档目标是本地的还是远程的。

? 可以使用关键字OPTIONAL(默认)或MANDATORY指定是可选归档目标还是强制归

档目标。强制归档目标的归档必须成功进行,否则数据库将挂起。

3.选择题

(l) When will the rollback information applied in the event of a database crash? A. before the crash occurs

B. after the recovery is complete

C. immediately after re-opening the database before the recovery D. rollback information is never applied if the database crashes

(2)When the database is open, which of the following tablcspace must be online? A. SYSTEM B. TEMPORARY C. ROLLBACK D. USERS

(3)Sorts can be managed efficiently by assigning tablespace to sort operations? A. SYSTEM B. TEMPORARY C. ROLLBACK D. USERS (4) The sort segment of a temporary tablespace is created: A. at the time of the first sort operation

B. when the TEMPORARY tablespace is created C.when the memory required for sorting is 1KB D.all of the above

(5) Which of the following segments is self administered?

A. TEMPORARY B. ROLLBACK C.CACHE D. INDEX

(6) What is the default temporary tablespace, if no temprary tablespase is defined?

A. ROLLBACK B. USERS C.INDEX D. SYSTEM

(7)Which two statements about online redo log members in a group is true? A. All files in all groups are the same size. B. All members in a group are the same size.

C. The members should be on different disk drivers.

D. The rollback segment size determines the member size.

(8)Which command does a DBA user to list the current status of archiving? A.. ARCHIVE LOG LIST B. FROM ARCHIVE LOGS

C. SELECT * FROM V$THREAD

D. SELECT * FROM ARCHIVE-LOG-LIST

(9) How many control files are required to create a database? A. One B. Two C. Three D. None

(10) Complete the following sentence:The recommended configuration for control files is? A. One control file per database B. One control file per disk

C. Two control files on two disks D. Two control files on one disk

(11) When you create a control file, the database has to be:

A. Mounted B. Not mounted C. Open D. Restricted

(12) Which data dictionary view shows that the database is in ARCHIVELOG mode? A. V$INSTANCE B. V$LOG C. V$DATABASE D. V$THREAD

(13) What is the biggest advantage of having the control files on different disks? A.Database performance B. Guards against failure C. Faster archiving

D.Writes are concurrent,so having control file on different writes disks speeds up control files writes

(14)Which file is used to record all changes made to the database and is used only when performing an instance recovery?

A. Archive log file B. Redo log file c. Control file D. Alert log file (15) How many ARCn processes can be associated with an instance? A. Five B. Four C. Ten D.Operating system dependent

(16) Which two parameters cannot be used together to specify the archive destination? A. LOG_ARCHIVE DEST and LOG-ARCHIVE DUPLEX DEST B. LOG_ARCHIVE_DEST and LOG ARCHIVE DEST 1 C. LOG ARCHIVE_DEST and LOG ARCHIVE DEST 2

D. None of the above;you can specify all the atchive destination parameters

(17) You want to set the following initialization parameters for your database instance: LOG_ARCHIVE_DEST_I ='LOCATION=/diskl/arch' LOG_ARCHIVE_DEST_2 ='LOCATION=/disk2/arch' LOG_ARCHIVE_DEST_3 ='LOACTION=/disk3/arch'

LOG_ARCHIVE_DEST_4='LOCATION=/disk4/arch MANDATORY' Identify the statement that correctly describes this setting. A. The MANDATORY location must be a flash recovery area

B. The optional destinations may not use the flash recovery area

C. This setting is not allowed because the first destination is not set as MANDATORY

D. The online redo log file is not allowed to be overwritten if the archived log created in the fourth destination

(18) Which two statements correctly describe the relation between a data file and the logical

database structures? (Choose two) A. An extent cannot spread across data files B. A segment cannot spread across data files C. A data file can belong to only one tablespace D. A data file can have only one segment created in it

E. A data block can spread across multiple data files as it can consist of multiple operating system (OS) blocks. \

(19) Which two statements are true regarding a tablespace? (Choose two.) A. It can span multiple databases B. It can consist of multiple data files C. It can contain blocks of different files

D. It can contains segments of different sizes E. It can contains apart of nonpartitioned segment

(20) You configured the Flash Recovery Area for your database. The database instance tut been started in ARCHIVELOG mode and the LOG ARCHIVE_DEST 1 parameter is not set What will be the implications on the archiving and the location of archive redo log files? A. Archiving will be disabled because the destination for the redo log files is missing

B. The database instance will shut down and the error details will be logged in the alert log file C. Archiving will be enabled and the destination for the archived redo log file will be set to the Flash Recovery Area implicitly

D. Archiving will be enabled and the location for the archive redo log file will be created in the default location SORACLE_HOME/log

(21)Which statements listed below describe the data dictionary views? 1 These are stored in the SYSTEM tablespace 2 These are the based on the virtual tables 3 These are owned by the SYS user

4 These can be queried by a normal user only if 07_DICTIONARY_ACCESSIBLILITY parameter isset to TRUE

5 The VSFIXED TABLE view can be queried to list the names of these views A. 1 and 3 B. 2,3 and 5 C. 1,2, and 5 D. 2,3,4 and 5

( 22) Which two statements are true regarding undo tablespaces? (Choose two.) A. The database can have more than one undo tablespace

B. The UNDO TABLESPACE parameter is valid in both automatic and manual undo management C. Undo segments automatically grow and shrink as needed. acting as circular storage buffer for their assigned transactions

D. An undo tablespace is automatically created if the UNDO TABLESPACE parameter is not set and the UNDO_MANAGEMENT parameter is set to AUTO during the database instance start up

第六章

1.简答题

(1)简述Oracle数据库中创建表的方法有哪几种。、

参考答案:1.利用create table创建;2.利用子查询创建。 (2)简述表中约束的作用、种类及定义方法. 参考答案:

作用:实现一些业务规则,防止无效的垃圾数据进入数据库,维护数据库的完整性(完整性指正确性与一致性)。从而使数据库的开发和维护都更加容易。 种类及定义:

1. 主键约束 alter table 表名 add constraint P_PK primary key(ID); 2. 唯一性约束 alter table 表名 add constraint P_UK unique(name); 3. 检查约束 alter table 表名 add constraint P_CK check(条件);

4. 外键约束 alter table 表名 add constraint P_FK foreign key(外键名) references 表名(列

名) on delete cascade; 5. 添加空/非空约束

Alter table 表名 modify resume not null; Alter table 表名 modify resume null; 6. 删除约束

alter table 表名 drop unique(列名)/constraint P_CK/constraint P_PK cascade. (3)简述索引作用、分类及使用索引需要注意的事项。 参考答案:

作用:提高数据检索效率的数据库对象,能够为数据库的查询提供快捷的存取路径,减少磁盘I/O。索引不依赖于表,是由系统自动维护和使用的,不需要用户参与。

分类:B-树索引、位图索引、函数索引、唯一性索引与非唯一性索引、单列索引与复合索引 注意事项:1.导入数据后在创建索引;2.在适当的表和列上创建适当的索引;3.合理的设置索引中的列的顺序,应将频繁使用的列放在其他列的前面。 (4)简述视图的作用及分类. 参考答案:

作用:1.可以限制对基表数据的访问,只允许用户通过视图看到表中的部分数据。 2.可以使复杂的查询简单化。

3.提供了数据的透明性,用户并不知道数据来自于何处。 4.提供了对相同数据的不同显示。 分类:简单视图和复杂视图。 (5)简述序列的作用及其使用方法. 参考答案:

作用:1.可以为表中的记录自动产生唯一序号。 2.由用户创建并且可以被多个用户共享。

3.典型应用是生成主键值,用于标识记录的唯一性。 4.允许同时生成多个序列号,而每一个序列号是唯一的。 5.使用缓存可以加速序列的访问速度。 使用方法:1.序列具有CURRVAL和NEXTVAL两个伪列。CURRVAL返回序列的当前值,NEXTVAL在序列中增加新值并返回此值。

2.可通过sequence_name.CURRVAL和sequence_name.NEXTVAL形式来应用序列。 (6)简述表分区的必要性及表分区方法的异同.

参考答案:必要性:1.提高数据的安全性;2.提高数据的并行操作能力;3.简化数据的管理;4.操作的透明性。 分区方法及异同:

范围分区: 每条记录根据其分区列值所在的范围决定存储到哪个分区中。

列表分区: 列表分区列的值不能划分范围且分区列的取值是有少数值的集合。 散列分区: 基于分区列值的HASH算法,将数据均匀分布到指定的分区中。

复合分区: 结合两种基本分区方法,先采用一个分区方法对表或索引进行分区,然后再采用另一个分区方法将分区再分成若干个子分区。每个分区的子分区都是数据的一个逻辑子集。 (7)简述索引分区的类别与分区方法。 参考答案:

1. 本地分区索引 create index 索引名_local on 表名(列名) local; 2. 全局分区索引 create index索引名_global on 表名(列名) global partition by range(列名)

(参数设置);

3. 全局非分区索引 create index 索引名_index on 表名(列名) tablespace index;

3.选择题

(l) Which command is used to drop a constraint?

A. ALTER TABLE MODIFY CONSTRAINT B. DROP CONSTRAINT

C. ALTER TABLE DROP CONSTRAINT D. ALTER CONSTRAINT DROP (2) Which component is not part of the ROWID?

A. TABLESPACE B. Data file number C.OBJECT ID D.Block ID

(3) What is the difference between a unique constraint and a primary key constraint?

A. A unique key constraint requires a unique index to enforce the constraint,whereas a primary key constraint can enforce uniqueness using a unique key of or nonunique index B. A primary key column can be NULL,but a unique key column cannot be NULL C. A primary key constraint can use an existing index ,but a unique constraint always creates an index

D. A unique constraint column can be NULL,but primary key columnscannot be NULL (4) What is a Schema?

A. Physical Organization of Objects in the Database B. A Logical Organization of Objects in the Database C. A Scheme Of lndcxing D. None of the above

(5) Choose two answers that are true.When a table is created with the NOLOGGING option: A. Direct-path loads using the SQL*Loader utility are not recorded in the redo log file B. Direct-load inserts are not recorded in the redo log file

C. Inserts and updates to the table are not recorded in the redo log file

D. Conventional-path loads using the SQL*Loader utility are not recorded in the redo log file 6) Bitmap indexes are best suited for columns with:

A. High selectivity B. Low selectivity C. High inserts D. high updates (7) What schema objects can PUBLIC own? Choose two.

A. Database links B. Rollback segments C. Synonyms D. Tables (8) The ALTER TABLE statement cannot be used to: A. Move the table from one tablespace to another

B. Change the initial extent size of the table C. Rename the table D. Disable triggers

E. Resize the table below the HWM

(9)Which constraints does not automatically create an index? A. PRIMARY KEY B. FOREIGN KEY C. UNIQUE (10)Which method is not the partition of the table? A. RANGE E3. LIST C. FUNCTIOIN D. HASH

(11)Examine the command that is used to create a table: SQL>CREATE TABLE orders ( oid NUMBER(6) PRIMARY KEY, odate DATE,

ocode NUMBER(6), oamt NUMBER(10,2) )TABLESPACE users;

Which two statements are true about the effect of the above command? (Choose two.) A. CHECK constraint is created on the OID column B. NOT NULL constraint is created on the OID column

C. The ORDERS table is the only object createsd in the USERS tablespace

D. The ORDERS table and a unique index are created in the USERS tabkspace

E. The ORDERS table is created in the USERS tablespace and a unique index is created on the OID column in the SYSTEM tablespace

(12) Which three statements are correct about temporary tables? (Choose three.) A. Indexes and views can be created on temporary tables

B. Both the data and structure of temporary tables can be exported

C. Temporary tables are always created in a user's temporary tablespace

D. The data inserted into a temporary table in a session is available to other sessions

E. Data Manipulation Language (DML) locks arc never acquired on the data of temporary Tables

第八章

2. 选择题

(1) Which single-row function could you use to return a specific portion of a character string? A. INSERT B. SUBSTR C. LPAD D. LEAST

(2) Which function(s) accept arguments of any datatype? Select all that apply. A. SUBSTR B. NVL C. ROUND D. DECODE E.SIGN (3) What will be returned from SIGN(ABS(NVL(-23,0)))?

A. 1 B. 32 C. -1 D. 0 E.NULL

(4) Which functions could you use to strip leading characters from a character string?Select two A. LTRIM B. SUBSTR C.RTRIM D.INSERT E.MOD (5) Which line of code has an error?

A. SELECT dname,ename B.FROM emp e,dept d C. WHERE emp.deptno=dept.deptno D.ORDER BY 1,2

(6) which of the following statements will not implicitly begin a transaction? A. INSERT B. UPDATE C. DELETE D. SELECT FOR UPDATE E. None of the above,they all implicitly begin a transction (7) Consider the following query:

SELECT dname, ename FROM dept d,emp e WHERE d.deptno=e.deptno ORDER BY dname. ename; What type of join is shown?

A. Self-join B. Equijoin C.Outer join D.Non-equijoin

(8) When using multiple tables to query information, in which clause do you specify the table names? A. HAVING B. GROUP BY C. WHERE D. FROM

(9) Which two operators are not allowed when using an outer join between two tables? A. OR B. AND C. IN D. =

(10) If you are selecting data from table A(with three rows) and table B(with four rows) using \A. 7 B. 1 C. 0 D. 12

(11) You need to load information about new customers from the NEW_CUST table into the tables CUST and CUST_SPECIAL. If a new customer has a credit limit greater than 10,000, then the details have to be inserted into CUST_SPECIAL. All new customer details have to be inserted into the CUST table. Which technique should be used to load the data most efficiently? A. external table B. the MERGE command

C. the multitable INSERT command D. INSERT using WITH CHECK OPTION (12) Evaluate the following SQL statement: ALTER TABLE emp SET UNUSED (mgr_id);

Which statement is true regarding the effect of the above SQL statement? A. Any synonym existing on the EMP table would have to be recreated.

B. Any constraints defined on the MGR_ID column would be removed by the above command.

C. Any views created on the EMP table that include the MGR_ID column would have to be dropped and recreated.

D. Any index created on the MGR_ID column would continue to exist until the DROP UNUSED COLUMNS command is executed.

(13)In which scenario would you use the ROLLUP operator for expression or columns within a GROUP BY clause?

A. to find the groups forming the subtotal in a row

B. to create group wise grand totals for the groups specified within a GROUP BY clause C. to create a grouping for expressions or columns specified within a GROUP BY clause in one direction,from right to left for calculating the subtotals

D. to create a grouping for expressions or columns specified within a GROUP BY clause in all possible directions, which is cross tabular report for calculating the subtotals

( 14) Which two statements are true regarding the execution of the correlated subqueries? (Choose two.)

A.The nested query executes after the outer query returns the row, B.The nested query executor first and then the outer query executes.

C.The outer query executes only once for the result returned by the query.

D.Each row returned by the outer query is evaluated for the results returned by the inner query.

(15) OE and SCOTT are the users in the database. The ORDERS table is owned by OB. Evaluate the statements issued by the DBA in the following sequence: CREATE ROLE rl;

GRANT SELECT,INSERT ON oe.orders TO rl: GRANT ri TO Scott;

GRANT SELECT ON oc.orders TO Scott; REVOKE SELECT ON oe.orders FROM scott;

What would be the outcome alter executing the statements? A. SCOTT would be able to query the OE.ORDERS table. B. SCOTT would not be able to query the OE.ORDERS table.

C. The REVOKE statement would remove the SELECT privilege from SCOTT as as from the role R1.

D. The REVOKE statement would give an error because the SELECT privilege has been granted to the role R1.

(16) EMPDET is an external table containing the columns EMPNO and ENAME. Which command would work in relation to the EMPDET table?

A. UPDATE empdect SET ename ='Amit' WHERE empno= 1234; B. DELETE FROM empdet WHERE ename LIKE 'J%';

C. CREATE VIEW empvu AS SELECT *FROM empdept; D. CREATE INDEX empdet_idx ON empdet(empno);

第十章

2.选择题

(1) You need to remove the database trigger trg_emp.Which command do you use to remove the trigger in the SQL Plus environment?

A. DROP TRIGGER tr&_emp B.DELETE TRIGGER trL_emp

C. REMOVE TRIGGER trg_emp D.ALTER TRIGGER trg_emp REMOVE (2) Which statement about triggers is true?

A. You use an application trigger to fire when a DELETE statement occurs B. You use a database trigger to fire when an INSERT statement occurs C. You use a system event trigger to fire when an UPDATE statement occurs D. You use an INSTEAD OF trigger to fire when a SELECT statement occurs (3) Which three statements are true regarding database triggers?

A. A database trigger is a PUSQL block, C, or Java procedure associated with a table,view, schema, or the database `

B. A database trigger needs to be executed explicitly whenever a particular event takes place C. A database trigger executes implicitly whenever a particular event takes place

D. A database trigger fires whenever a data event (such as DML) or system event (such as logon, shutdown) occurs on a schema or database

E. With a schema, triggers fire for each event for all users; with a database, triggers fire for each

event for that specific user

(4) Which two statements about the overloading feature of packages are true? A. Only local or packaged subprograms can be overloaded

B. Overloading allows different functions with the same name that differ only in their return types

C. Overloading allows different subprograms with the same name,number, type and order of parameters

D. Overloading allows different subprograms with the same name and same number or type of parameters

E. Overloading allows different subprograms with same name, but different in either number, type or order of parameters

(5)Which two statements about packages arc true? A. Packages can be nested

B. You can pass parameters to packages

C. A package is loaded into memory each time it is invoked

D. The contents of packages can be shared by many applications

E. You can achieve information hiding by making package constructs private 6) Which two statements about packages arE true?

A. Both the specification and body are required components of a package B. The package specification is optional, but the package body is required C. The package specification is required, but the package body is optional D. the specification and body of the package are stored toget ei in the database E. the specification and body of the package arc stored scpo iately in the database (7) You have a row level BEFORE UPDATE trigger on the EMP table. This trigger contains SELECT statement on the EMP table to ensure that the new salary value falls within the

and maximum salary for a given job title. What happens when you try to update a salary value in EMP table?

A. The trigger fires successfully

B. The trigger fails because it needs to be a row level AFTER UPDATE trigger

C. The trigger fails because a SELECT statement on the table being updated is notallowed

D. The trigger fails because you cannot use the minimum and maximum functions in a BEFORE UPDATE trigger

(8) Which part of a database trigger determines the number of times the trigger body executes? A. trigger type B. trigger body C. trigger event D. triggertimimg

(9) Given a function CALCTAX CREATE OR REPLACE FUNCTION calctax (sal NUMBER) RETURN NUMBER Is BEGIN

RETURN (sal * 0.05); END;

If you want to run the above function from the SQL\A. You need to execute the commandCALCTAX(1000);.

B. You need to execute the command EXECUTE FUNCTION calctax;

C. You need to create a SQL*Plus environment variable X and issue the command:X =CALCTAX(1000);.

D. You need to create a SQL*Plus environment variable X and issue the commandEXECUTE:X = CALCTAX;.

E. You need to create a SQL* Plus environment variable X and issue the commanEXECUTE:X := CALCTAX(1000);

(10) Which two statements are true regarding a PUSQL package body? (Choose two.) A. It cannot be created without a package specification. B. It cannot invoke subprograms defined in other packages.

C. It can contain only the subprograms defined in the package specification.

D. It can be changed and recompiled without making the package specification invalid.

本文来源:https://www.bwwdw.com/article/3gxt.html

Top