1. Trang chủ
  2. » Công Nghệ Thông Tin

Tài liệu OCA: Oracle Database 11g Administrator Certified Associate Study Guide- P10 pptx

50 357 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 50
Dung lượng 1,01 MB

Nội dung

Review Questions 381 5. You create a view based on the EMPLOYEES table using the following SQL. CREATE VIEW MYVIEW AS SELECT * FROM EMPLOYEES; You modify the table to add a column named EMP_SSN. What do you need to do to have this new column appear in the view? A. Nothing. Since the view definition is selecting all columns, the new column will appear in the view automatically. B. Recompile the view using ALTER VIEW MYVIEW RECOMPILE. C. Re-create the view using CREATE OR REPLACE VIEW. D. Add the column to the view using ALTER VIEW MYVIEW ADD EMP_SSN. 6. Which is a valid status of a constraint created on a view? A. DISABLE VALIDATE B. DISABLE NOVALIDATE C. ENABLE NOVALIDATE D. All of the above 7. The SALARY column of the EMPLOYEE table is defined as NUMBER(8,2), and the COMMIS- SION_PCT column is defined as NUMBER(2,2). A view is created with the following code: CREATE VIEW EMP_COMM AS SELECT LAST_NAME, SALARY * NVL(COMMISSION_PCT,0) Commission FROM EMPLOYEES; What is the datatype of the COMMISSION column in the view? A. NUMBER (8,2) B. NUMBER (10,2) C. NUMBER D. FLOAT 8. Which clause in the SELECT statement is not supported in a view definition subquery? A. GROUP BY B. HAVING C. CUBE D. FOR UPDATE OF E. ORDER BY 95127c07.indd 381 2/17/09 12:33:21 PM Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. 382 Chapter 7 N Creating Schema Objects 9. The EMPLOYEE table has the following columns: EMP_ID NUMBER (4) EMP_NAME VARCHAR2 (30) SALARY NUMBER (6,2) DEPT_ID VARCHAR2 (2) Which query will show the top five highest-paid employees? A. SELECT * FROM (SELECT EMP_NAME, SALARY FROM EMPLOYEE ORDER BY SALARY ASC) WHERE ROWNUM <= 5; B. SELECT EMP_NAME, SALARY FROM (SELECT * FROM EMPLOYEE ORDER BY SALARY DESC) WHERE ROWNUM < 5; C. SELECT * FROM (SELECT EMP_NAME, SALARY FROM EMPLOYEE ORDER BY SALARY DESC) WHERE ROWNUM <= 5; D. SELECT EMP_NAME, SALARY (SELECT * FROM EMPLOYEE ORDER BY SALARY DESC) WHERE ROWNUM = 5; 95127c07.indd 382 2/17/09 12:33:21 PM Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. Review Questions 383 10. The EMPLOYEE table has the following columns: EMP_ID NUMBER (4) PRIMARY KEY EMP_NAME VARCHAR2 (30) SALARY NUMBER (6,2) DEPT_ID VARCHAR2 (2) A view is defined using the following SQL: CREATE VIEW EMP_IN_DEPT10 AS SELECT * FROM EMPLOYEE WHERE DEPT_ID = ‘HR’; Which INSERT statement will succeed through the view? A. INSERT INTO EMP_IN_DEPT10 VALUES (1000, ‘JOHN’,1500,’HR’); B. INSERT INTO EMP_IN_DEPT10 VALUES (1001, NULL,1700,’AM’); C. INSERT INTO EMP_IN_DEPT10 VALUES (1002, ‘BILL’,2500,’AC’); D. All of the above 11. To be able to modify a join view, the view definition should not contain which of the fol- lowing in the top-level query? (Choose all that apply.) A. A DISTINCT operator B. An ORDER BY clause C. Aggregate functions such as SUM, AVG, and COUNT D. A WHERE clause E. A GROUP BY clause F. A ROWNUM pseudocolumn 12. Which statement will create a sequence that starts with 0 and gets smaller one whole num- ber at a time? A. create sequence desc_seq start with 0 increment by -1 maxvalue 1; B. create sequence desc_seq increment by -1; C. create sequence desc_seq start with 0 increment by -1; D. Sequences can only increase. 13. Which statement is most correct in describing what happens to a synonym when the under- lying object is dropped? A. The synonym’s status is changed to INVALID. B. You can’t drop the underlying object if a synonym exists unless the CASCADE clause is used in the DROP statement. C. The synonym is automatically dropped with the underlying object. D. Nothing happens to the synonym. 95127c07.indd 383 2/17/09 12:33:21 PM Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. 384 Chapter 7 N Creating Schema Objects 14. There is a public synonym named PLAN_TABLE for SYSTEM.PLAN_TABLE. Which of the fol- lowing statements will remove this public synonym from the database? A. drop table system.plan_table; B. drop synonym plan_table; C. drop table system.plan_table cascade; D. drop public synonym plan_table; 15. A developer reports that she is receiving the following error: SELECT key_seq.currval FROM dual; ERROR at line 1: ORA-08002: sequence KEY_SEQ.CURRVAL is not yet defined Which of the following statements does the developer need to run to fix this condition? A. create sequence key_seq; B. create synonym key_seq; C. select key_seq.nextval from dual; D. grant create sequence to public; 16. Bitmapped indexes are best suited to which type of environment? A. High-cardinality columns B. Online transaction processing (OLTP) applications C. Full-table scan access D. Low- to medium-cardinality columns 17. Which clauses in a SELECT statement can an index be used for? (Choose all that apply.) A. SELECT B. FROM C. WHERE D. HAVING 95127c07.indd 384 2/17/09 12:33:21 PM Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. Review Questions 385 18. You need to generate artificial keys for each row inserted into the PRODUCTS table. You want the first row to use a sequence value of 1000, and you want to make sure that no sequence value is skipped. Which of the following statements will meet these requirements? A. CREATE SEQUENCE product_key2 START WITH 1000 INCREMENT BY 1 NOCACHE; B. CREATE SEQUENCE product_key2 START WITH 1000 NOCACHE; C. CREATE SEQUENCE product_key2 START WITH 1000 NEXTVAL 1 NOCACHE; D. Options A and B meet the requirements. E. None of the above statements meet all the requirements. 19. Which statement will display the last number generated from the EMP_SEQ sequence? A. select emp_seq.curr_val from dual; B. select emp_seq.currval from dual; C. select emp_seq.lastval from dual; D. select last_number from all_sequences where sequence_name =’EMP_SEQ’; E. You cannot get the last sequence number generated. 20. Which statement will create a sequence that will rotate through 100 values in a round-robin manner? A. create sequence roundrobin cycle maxvalue 100; B. create sequence roundrobin cycle to 100; C. create sequence max_value 100 roundrobin cycle; D. create rotating sequence roundrobin min 1 max 100; 95127c07.indd 385 2/17/09 12:33:21 PM Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. 386 Chapter 7 N Creating Schema Objects Answers to Review Questions 1. B. A view is dropped using the DROP VIEW view_name; command. 2. A. You can perform an INSERT, UPDATE, or DELETE operation on the columns involving only one base table at a time. There are also some restrictions on the DML operations you perform on a join view. 3. D. Since the view definition includes a DISTINCT clause, only queries are allowed on the view. 4. B, E. The OR REPLACE option in the CREATE VIEW statement is used to modify the defini- tion of the view. The FORCE option can be used to create the view with errors. The ALTER VIEW statement is used to compile a view or to add or modify constraints on the view. 5. C. When you modify the base table, the view becomes invalid. Oracle will recompile the view the first time it is accessed. Recompiling the view will make it valid, but the new col- umn will not be available in the view. This is because when you create the view using *, Oracle expands the column names and stores the column names in the dictionary. 6. B. Since the constraints on the view are not enforced by Oracle, the only valid status of a constraint can be DISABLE NOVALIDATE. You must specify this status when creating con- straints on a view. 7. C. When numeric operations are performed using numeric datatypes in the view definition, the resulting column will be a floating datatype, which is NUMBER without any precision or scale. 8. D. The FOR UPDATE OF clause is not supported in the view definition. The FOR UPDATE clause locks the rows, so it is not allowed. 9. C. You can find the top five salaries using an inline view with the ORDER BY clause. The Oracle 11g Optimizer understands the top-n rows query. Option B would have been correct if you had ROWNUM <= 5 in the WHERE clause. 10. D. The view is based on a single table, and the only constraint on the table is the primary key. Although the view is defined with a WHERE clause, you have not enforced that check while using DML statements through the WITH CHECK OPTION clause. 11. A, C, E, F. To be able to update a base table using the view, the view definition should not have a DISTINCT clause, a GROUP BY clause, a START WITH clause, a CONNECT BY clause, ROWNUM, set operators (UNION, UNION ALL, INTERSECT, or MINUS), or a subquery in the SELECT clause. 12. A. For a descending sequence, the default START WITH value is –1, and the default MAXVALUE value is –1. To start the sequence with 0, you must explicitly override both of these defaults. 13. A. When the underlying object is dropped, the synonym will become INVALID. You can see the status of the synonym by querying the USER_OBJECTS dictionary view. 95127c07.indd 386 2/17/09 12:33:21 PM Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. Answers to Review Questions 387 14. D. To remove a public synonym, use the DROP PUBLIC SYNONYM statement. The DROP TABLE statement will remove a table from the database but will not drop any synonyms on the table. The synonym will become invalid. 15. C. A sequence is not yet initialized if NEXTVAL has not yet been selected from it within the current session. It has nothing to do with creating a sequence, creating a synonym, or grant- ing privileges. 16. D. Bitmapped indexes are not suited for high-cardinality columns (those with highly selec- tive data). OLTP applications tend to need row-level locking, which is not available with bitmap indexes. Full-table scans do not use indexes. Bitmap indexes are best suited to multiple combinations of low- to medium-cardinality columns. 17. A, C. The obvious answer is C, but an index also can be used for the SELECT clause. If an index contains all the columns needed to satisfy the query, the table does not need to be accessed. 18. D. Both options A and B produce identical results, because the INCREMENT BY 1 clause is the default if it is not specified. Option C is invalid because NEXTVAL is not a valid keyword within a CREATE SEQUENCE statement. 19. B. Option D is close, but it shows the greatest number in the cache, not the latest generated. The correct answer is from the sequence itself, using the pseudocolumn CURRVAL. 20. A. The keyword CYCLE will cause the sequence to wrap and reuse numbers. The keyword MAXVALUE will set the largest value the sequence will cycle to. The name roundrobin is there to confuse to you. 95127c07.indd 387 2/17/09 12:33:22 PM Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. 95127c07.indd 388 2/17/09 12:33:22 PM Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. PART II Oracle Database 11g: Administration I 95127c08.indd 389 2/17/09 12:45:14 PM Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. 95127c08.indd 390 2/17/09 12:45:15 PM Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. [...]... 00:00:01 00:00:00 ora_j000_11GR11 ora_pmon_11GR11 ora_vktm_11GR11 ora_diag_11GR11 ora_dbrm_11GR11 ora_psp0_11GR11 ora_dia0_11GR11 ora_mman_11GR11 ora_dbw0_11GR11 ora_lgwr_11GR11 ora_ckpt_11GR11 ora_smon_11GR11 ora_reco_11GR11 ora_mmon_11GR11 ora_mmnl_11GR11 ora_d000_11GR11 Oracle 11g Architecture  oracle oracle oracle oracle oracle oracle oracle oracle oracle oracle oracle oracle $ 3470 3482 3484 3486... here: $ ps -ef | grep 11GR11 oracle 2517 1 0 20:22 ? oracle 3436 1 0 Jun06 ? oracle 3438 1 0 Jun06 ? oracle 3442 1 0 Jun06 ? oracle 3444 1 0 Jun06 ? oracle 3446 1 0 Jun06 ? oracle 3450 1 0 Jun06 ? oracle 3452 1 0 Jun06 ? oracle 3454 1 0 Jun06 ? oracle 3456 1 0 Jun06 ? oracle 3458 1 0 Jun06 ? oracle 3460 1 0 Jun06 ? oracle 3462 1 0 Jun06 ? oracle 3464 1 0 Jun06 ? oracle 3466 1 0 Jun06 ? oracle 3468 1 0 Jun06... Install the Oracle software by using Oracle Universal Installer (OUI) With this chapter, you’ll start learning Oracle Database 11g (Oracle 11g) database administration This chapter and the remaining chapters of the book will discuss the objectives for the Oracle 11g Administration I OCA certification exam With the release of Oracle 11g, Oracle Corporation has delivered a powerful and featurerich database. .. 00:00:00 00:00:00 00:00:00 00:00:00 00:00:02 00:00:00 411 ora_s000_11GR11 ora_arc0_11GR11 ora_arc1_11GR11 ora_arc2_11GR11 ora_arc3_11GR11 ora_smco_11GR11 ora_fbda_11GR11 ora_qmnc_11GR11 ora_q000_11GR11 ora_q001_11GR11 ora_cjq0_11GR11 ora_w000_11GR11 This output shows that several background processes are running on the Linux server for the 11GR11 database The dynamic view V$BGPROCESS shows the background processes... created in Oracle to define business processes Database link Database links are used to communicate between databases to share data You use SQL to create database objects and to interact with application data In the next section, I will discuss the tools available to access and administer Oracle 11g database Interacting with Oracle 11g SQL is the language used to interact with the Oracle 11g database. .. Introducing Oracle Database 11g Components and Architecture Oracle Database 11g: Administration I exam objectives covered in this chapter: ÛÛ Exploring the Oracle Database Architecture NN Explain the Memory Structures NN Describe the Process Structures NN Overview of Storage Structures ÛÛ Preparing the Database Environment NN Identify the tools for Administering an Oracle Database NN Plan an Oracle Database. .. the child table Oracle enforces the parent-child relationship between tables using constraints Oracle Database 11g Objects Every RDBMS supports a variety of database objects Oracle 11g supports the entire set of database objects required for a relational database, such as tables, views, constraints, and so on It also supports a wide range of objects specific to the Oracle Database 11g, such as packages,... the DBA to administer an Oracle 11g database The common tools are as follows: NN SQL*Plus, which is a command-line interface utility NN SQL Developer, a GUI tool NN Oracle Enterprise Manager Database Control, a GUI tool 396  Chapter 8    Introducing Oracle Database 11g Components and Architecture n Using SQL*Plus and SQL Developer, you interact directly with the Oracle 11g database using SQL statements... the Oracle Database 11g and how to install the Oracle 11g software Exam objectives are subject to change at any time without prior notice and at Oracle s sole discretion Please visit Oracle s Training and Certification website at http://education .oracle. com/pls/web_prod-plq-dad/ db_pages.getpage?page_id=41&p_exam_id=1Z0_052 for the most current exam-objectives listing Oracle Database Fundamentals Databases... processes The server process communicates with the Oracle instance on behalf of the user The Oracle instance is examined in the next section 402  Chapter 8    Introducing Oracle Database 11g Components and Architecture n The Oracle Instance An Oracle database instance consists of Oracle s main memory structure, called the system global area (SGA), and several Oracle background processes It is with the SGA . Introducing Oracle Database 11g Components and Architecture ORACLE DATABASE 11g: ADMINISTRATION I EXAM OBJECTIVES COVERED IN THIS CHAPTER: Exploring the Oracle Database. access and administer Oracle 11g database. Interacting with Oracle 11g SQL is the language used to interact with the Oracle 11g database. Many tools are

Ngày đăng: 15/12/2013, 05:15

TỪ KHÓA LIÊN QUAN