Oracle.1Z0-052-0

一、源題
QUESTION 1
The instance abnormally terminates because of a power outage. Which statement is true about redo log files during instance recovery?
A. Inactive and current redo log files are required to accomplish recovery
B. Online and archived redo files are required to accomplish instance recovery
C. All redo log entries after the last checkpoint are applied from redo log files to data files
D. All redo log entries recorded in the current log file until the checkpoint position are applied to data files
Correct Answer: C
二、題目翻譯
實例因為斷電異常中止。哪些是關于redo日志在實例恢復期間的正確描述?
A. Inactive和current狀態的redo日志需要完成恢復
B. Online和Archived日志需要實例恢復
C. 最后一個checkpoint之后的所有redo信息都要應用到數據文件
D. 所有記錄在current狀態日志中直到檢查點位置的redo信息應用于數據文件
答案:C
三、題目解析
實例恢復是進程應用記錄在online redo log的信息去重建最近一次檢查點的之后的變更。
參考官方文檔:
http://docs.oracle.com/cd/E11882_01/server.112/e40540/startup.htm#CNCPT1301
這個是屬于實例恢復,實例恢復不需要DBA的干預。
Oracle DB 會自動從實例故障中進行恢復。實例所需要做的就是正常啟動。如果Oracle
Restart 已啟用并且配置為監視該數據庫,則該啟動操作會自動進行。實例會裝載控制文件,
然后嘗試打開數據文件。如果實例發現數據文件在關閉期間尚未同步,則會使用重做日志
組中包含的信息將數據文件前滾到關閉時的狀態,此時利用的重做日志信息即是自最后一次檢查點以來所有的重做信息。然后,將打開數據庫,并回退所有未提交的事務處理。

一、源題
QUESTION 2
Examine the command: SQL>ALTER USR skd ACCOUNT LOCK; Which two statements are true after the command is executed? (Choose two.)
A. The SKD user cannot log in to the database instance
B. The objects owned by the SKD user are not accessible to any user
C. The other users can access the objects owned by the SKD user, on which they have access
D. The password for the SKD user expires and the user is forced to change the password at the next log in
Correct Answer: AC
二、題目翻譯
檢查命令:
SQL>ALTER USR skd ACCOUNT LOCK;
哪兩個語句是正確的命令執行之后?(選擇兩個)
A. SKD用戶不能登錄數據庫實例
B. SKD擁有的對象不能被任何用戶訪問
C. 訪問過SKD的用戶,可以訪問SKD用戶擁有的對象
D. SKD用戶的密碼過期并且下次登錄時強制更改密碼

答案:AC
三、題目解析
四、測試

--創建兩個測試用戶SKD和SKD2
SQL> create user SKD identified by oracle;

User created.

SQL> create user SKD2 identified by oracle;

User created.
SQL> grant dba to skd;

Grant succeeded.
--SKD用戶創建測試表
SQL> conn skd/oracle
Connected.
SQL>  create table object as select * from dba_objects;

Table created.
--使用sys用戶給SKD上鎖
SQL> conn / as sysdba;
Connected.
SQL>  alter user SKD account lock;

User altered.
--嘗試登錄SKD用戶
SQL> conn skd/oracle
ERROR:
ORA-28000: the account is locked


Warning: You are no longer connected to ORACLE.
--所以A對,D錯
SQL> conn / as sysdba;
Connected.
SQL> grant dba to skd2;

Grant succeeded.
--使用SKD2用戶嘗試訪問SKD用戶的object表
SQL> conn skd2/oracle
Connected.
SQL> select owner from SKD.object where rownum < 2;

OWNER
------------------------------
SYS
--故B錯,C對

一、源題
QUESTION 3
For which database operation would you need the database to be in the MOUNT state?
A. Renaming the control files
B. Re-creating the control files
C. Dropping a user in your database
D. Dropping a tablespace in your database
E. Configuring the database instance to operate in the ARCHIVELOG or NOARCHIVELOG modes
Correct Answer: E
二、題目翻譯
數據庫在mount狀態期間能做什么操作?
A. 重命名控制文件
B. 重建控制文件
C. 刪除用戶
D. 刪除表空間
E. 配置數據庫為ARCHIVELOG或NOARCHIVELOG模式

答案:E
三、題目解析
ACD需要在數據庫處于open狀態
B需要數據庫處于nomount狀態
數據庫在mount期間可以執行以下操作:

  • 啟用或禁用redo日志歸檔選項
  • 執行完整的數據庫恢復

參考文檔:
http://docs.oracle.com/cd/E11882_01/server.112/e25494/start.htm#ADMIN11142

一、源題
QUESTION 4
The job to gather optimizer statistics for objects runs as part of the automatic maintenance window in your database instance. At a certain point of time, the maintenance window closes before the statistics are gathered for all objects. Which statement is true in this scenario?
A. The statistics collection continues until all objects are processed.
B. The job is terminated and the statistics collected are restored to a time before the job started.
C. This produces an error and the statistics collected are locked until the next time that the maintenance window is opened.
D. The job is terminated and the statistics for the remaining objects are collected the next time that the
maintenance window is opened.
Correct Answer: D
二、題目翻譯
收集優化器統計信息的作業作為你數據庫實例自動維護窗口的一部分。在一個確定的時間點,自動維護窗口關閉在所有的對象的統計信息收集完成之前。哪句描述是正確的在以下場景?
A. 統計信息收集繼續直到所有的對象處理
B. 作業中止并且統計信息收集還原到作業開始的時間點
C. 產生一個錯誤并且統計信息收集鎖住直到下次維護窗口打開
D. 作業中止并且剩余對象的統計信息繼續收集在下次維護窗口打開的時候

答案:D
三、題目解析
一個作業在你的數據庫實例的自動維護窗口中為一些對象正在搜集優化統計信息,在一個特定的時間點,所有對象的統計信息還沒有搜集完,維護窗口就關閉了,此時,這個作業被終止,剩下的統計信息的搜集將在下次維護窗口打開的時候繼續搜集。

參考官方文檔:
http://docs.oracle.com/cd/E11882_01/server.112/e25494/tasks.htm#ADMIN0235

一、源題
QUESTION 5
You want to move all objects of the APPS user in the test database to the DB_USR schema of the production database. Which option of IMPDP would you use to accomplish this task?
A. FULL
B. SCHEMAS
C. TRANSFORM
D. REMAP_SCHEMA
E. REMAP_TABLESPACE
Correct Answer: D
二、題目翻譯
你想移動測試庫中APPS用戶的所有對象到生產數據庫的DB_USR用戶。哪個IMPDP的選項可以完成這個任務?
A. FULL
B. SCHEMAS
C. TRANSFORM
D. REMAP_SCHEMA
E. REMAP_TABLESPACE

答案:D
三、題目解析
A是全庫導入
B是導入某個用戶
C是去掉表空間和存儲子句
D是將一個用戶導入另一個用戶
E 是將數據從一個表空間導入另一個表空間

參考官方文檔:
http://docs.oracle.com/cd/E11882_01/server.112/e22490/dp_import.htm#SUTIL903

一、源題
QUESTION 6
You executed the following command to create a password file in the database server: $ orapwd file = orapworcl entries = 5 ignorecase=N
Which statement describes the purpose of the above password file?
A. It records usernames and passwords of users when granted the DBA role
B. It contains usernames and passwords of users for whom auditing is enabled
C. It is used by Oracle to authenticate users for remote database administrator
D. It records usernames and passwords of all users when they are added to OSDBA or OSOPER operating groups
Correct Answer: C
二、題目翻譯
執行下面命令創建一個密碼文件
$ orapwd file = orapworcl entries = 5 ignorecase=N
哪些描述是正確的關于上面的密碼文件?
A. 當授予DBA角色的時候記錄用戶的用戶名和密碼
B. 包含啟用了審計的用戶的用戶名和密碼
C. Oracle用來對遠程的數據庫管理員進行身份驗證
D. 用來記錄加入OSDBA或OSOPER組的所有用戶的用戶名和密碼

答案:C
三、題目解析
Oracle的口令文件的作用是存放所有sysdba或者sysoper權限連接數據庫的用戶的口令。
是否使用口令文件,是通過oracle提供的一個參數remote_login_passwordfile來控制的

SQL> show parameter remote_login_passwordfile

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
remote_login_passwordfile            string      EXCLUSIVE

remote_login_passwordfile有none,shared,exclusive 3個值,none表示不使用口令文件, exclusive表示實例獨占使用口令文件,也就是各自實例使用單獨的口令文件,shared表示多個實例共享一個口令文件。

參考官方文檔:
http://docs.oracle.com/cd/E11882_01/server.112/e25494/dba.htm#ADMIN11060

一、源題
QUESTION 7
Which two statements are true regarding the MRKT tablespace? (Choose two.)

SQL> CREATE BIGFILE TABLESPACE MRKT 2 DATAFILE '/u01/app/oracle/oradata/orcl/mrkt.dbf' 
size 10M 
LOGGING 3 
EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO; 
Tablespace created. 
SQL> ALTER DATABASE DEFAULT TABLESPACE MRKT; 
Database altered.

A. No more data files can be added to the tablespace.
B. Segment space is managed by free lists in the tablespace.
C. A user created without being assigned a default tablespace uses this tablespace.
D. The tablespace can be dropped with the current setting with segments present in it.
Correct Answer: AC
二、題目翻譯
哪兩句關于MRKT表空間的描述是正確的?(選擇兩個)

SQL> CREATE BIGFILE TABLESPACE MRKT 2 DATAFILE '/u01/app/oracle/oradata/orcl/mrkt.dbf' size 10M LOGGING 3 EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;
Tablespace created. 
SQL> ALTER DATABASE DEFAULT TABLESPACE MRKT;
Database altered.

A. 不能再添加數據文件到表空間
B. 段空間在表空間中是自由列表管理
C. 創建用戶不指定默認表空間將使用這個表空間
D. 表空間可以刪除在當前的配置下

答案:AC
三、題目解析
BIGFILE只能有一個數據文件,A對
ALTER DATABASE DEFAULT TABLESPACE MRKT;將默認表空間修改成MRKT,C對
創建MRKT的時候,Oracle自動創建本地管理表空間和自動段空間管理(ASSM)。B錯
默認表空間不能直接drop,D錯

一、源題
QUESTION 8
View the Exhibit and examine the privileges granted to the MGR_ROLE role. The user SKD has been granted the CONNECT and RESOURCE roles only. The database administrator (DBA) grants MGR_ROLE to the user SKD by executing the command: SQL> GRANT MGR_ROLE TO SKD WITH ADMIN OPTION; Which statement is true about the user SKD after he/she is granted this role?

image.png

A. The user SKD can grant only the MGR_ROLE role to other users, but not the privileges in it
B. The user SKD can revoke the MGR_ROLE only from the users for whom he/she is the grantor
C. The user SKD can grant the privileges in the MGR_ROLE role to other users but not with ADMIN OPTION
D. The user SKD can grant the privileges in the MGR_ROLE role to other users, but cannot revoke privileges from them
Correct Answer: A
二、題目翻譯
觀察下面的表并檢查賦予MGR_ROLE角色的權限。用戶SKD只被授予CONNECT和RESOURCE角色。DBA授權MGR_ROLE給SKD用戶使用下面命令:
SQL> GRANT MGR_ROLE TO SKD WITH ADMIN OPTION;
下面哪些描述是正確的關于SKD被授予這個角色之后?
A. SKD只能授予其他用戶MGR_ROLE角色,不能是角色里的權限
B. SKD只可以從它授予的用戶的MGR_ROLE角色
C. SKD可以授予其他用戶MGR_ROLE角色中的權限不使用ADMIN選項
D. SKD可以授權其他用戶MGR_ROLE角色中的權限,但是不能收回權限

答案:A
三、題目解析
四、測試

SQL> create user SKD identified by SKD;

User created.

SQL> grant connect,resource to SKD;

Grant succeeded.

SQL> create role MGR_ROLE;

Role created.

SQL>  grant create role to MGR_ROLE;

Grant succeeded.

SQL>  grant create user to MGR_ROLE;

Grant succeeded.

SQL> grant select any table to MGR_ROLE;

Grant succeeded.
--查dba_sys_privs、dba_role_privs,dba_tab_privs三個視圖看用戶到底有哪些權限
SQL> select * from dba_role_privs where  grantee='MGR_ROLE';

no rows selected

SQL> set linesize 200
SQL> select * from role_sys_privs where role='MGR_ROLE'; 

ROLE                           PRIVILEGE                                ADM
------------------------------ ---------------------------------------- ---
MGR_ROLE                       SELECT ANY TABLE                         NO
MGR_ROLE                       CREATE ROLE                              NO
MGR_ROLE                       CREATE USER                              NO

SQL> select * from role_tab_privs where role='MGR_ROLE'; 

no rows selected
--WITH ADMIN OPTION的意思是被授予該權限的用戶有權將某個權限(如MGR_ROLE)授予其他用戶或角色,取消是不級聯的。
SQL> GRANT MGR_ROLE TO SKD WITH ADMIN OPTION;

Grant succeeded.

SQL>  create user user1 identified by test1;

User created.

SQL> grant create session to user1;

Grant succeeded.

SQL> conn SKD/SKD
Connected.

SQL> grant MGR_ROLE to user1;

Grant succeeded.

SQL> grant create user to user1;
grant create user to user1
*
ERROR at line 1:
ORA-01031: insufficient privileges

SQL>  revoke MGR_ROLE from user1;

Revoke succeeded.
--A正確,可以授權給MGR_ROLE給別的用戶,但不能把MGR_ROLE里面的權限如create user授權給別的用戶。
--B錯誤,可以級聯回收,可以回收不是SKD自己授予的。
--C錯,錯誤。The user SKD can grant the privileges in the MGR_ROLE role to other users。根據A答案,SKD不能將MGR_ROLE角色里的權限給別的用戶。
D,也可以回收權限。

一、源題
QUESTION 9
After performing a clean shut down of the database instance for maintenance, you mount the database and then execute a command to open the database: SQL> ALTER DATABASE OPEN; Which two statements are true? (Choose two.)
A. The online redo log files and online data files are opened
B. All the online data files headers are checked for consistency
C. Instance recovery is performed before opening the database
D. The path and existence of all the log file members are checked
Correct Answer: AB
二、題目翻譯
執行一次干凈的關閉數據庫之后,你mount數據庫,然后執行下面命令:
SQL> ALTER DATABASE OPEN;
哪兩個說法是正確的?(選擇兩個)
A. 在線redo log和在線數據文件被打開
B. 所有的在線數據文件頭檢查一致性
C. 實例恢復執行在數據庫打開之前
D. 檢查所有日志文件成員的路徑和存在

答案:AB
三、題目解析
打開數據庫過程包括執行以下任務:
? 打開數據文件
? 打開聯機重做日志文件
如果嘗試打開數據庫時任一數據文件或聯機重做日志文件不存在,則Oracle 服務器返回錯誤。
在最后這個階段,Oracle 服務器會驗證是否可以打開所有數據文件和聯機重做日志文件,還會檢查數據庫的一致性。如有必要,系統監視器(SMON) 后臺進程將啟動實例恢復。

一、源題
QUESTION 10
Examine the command that is used to create a table: SQL> CREATE TABLE orders ( oid NUMBER(6) PRIMARY KEY, odate DATE, ccode NUMBER (6), oamt NUMBER(10,2) ) TABLESPACE users; Which two statements are true about the effect of the above command? (Choose two.)
A. A CHECK constraint is created on the OID column.
B. A NOT NULL constraint is created on the OID column.
C. The ORDERS table is the only object created in the USERS tablespace.
D. The ORDERS table and a unique index are created in the USERS tablespace.
E. The ORDERS table is created in the USERS tablespace and a unique index is created on the OID column in the SYSTEM tablespace.
Correct Answer: BD
二、題目翻譯
執行下面命令創建一個表:
SQL> CREATE TABLE orders ( oid NUMBER(6) PRIMARY KEY,
odate DATE, ccode NUMBER (6),
oamt NUMBER(10,2) )
TABLESPACE users;
哪兩句是描述正確的(選擇兩個)?
A. CHECK約束被創建在OID列上
B. NOT NULL約束被創建在OID列上
C. ORDERS表是唯一創建在USERS表空間上的對象
D. ORDERS表和唯一索引被創建在USERS表空間
E. ORDERS表被創建在USERS表空間,唯一索引被創建OID列在SYSTEM表空間中

答案:BD
三、題目解析
加在OID列上的是主鍵約束,包含唯一約束和非空約束,A錯,B對
因為OID上有主鍵索引,所以會自動創建唯一索引,也在USERS表空間,CE錯,D對

一、源題
QUESTION 11
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
Correct Answer: AF
二、題目翻譯
哪兩句是正確的關于共享SQL區和私有SQL區?(選擇2個)
A. 共享SQL區被分配在共享池
B. 共享SQL區被分配當啟動會話時
C. 共享SQL區總是被分配到大池
D. 私有SQL區總是被分配到PGA
E. 共享SQL區和私有SQL區被分配到PGA或者大池
F. 私有SQL區分配取決于參數OPEN_CURSORS

答案:AF
Shared SQL Area存儲著SQL的執行計劃等信息,可以被多個session共享,該component存儲在SGA中
Private SQL Area 包括綁定變量等信息,每個session的這類信息都不一樣,為session所獨有(PGA)。且在Private SQL Area 存儲一個指向shared SQL area ( SGA )中共享SQL的指針,與OPEN_CURSORS參數相關。

一、源題
QUESTION 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 are never acquired on the data of temporary tables
Correct Answer: ACE
二、題目翻譯
哪三句話是正確的關于臨時表?(選擇3個)
A. 索引和視圖可以被創建在臨時表
B. 臨時的數據和表結構都能被導出
C. 臨時表總是創建在臨時表空間
D. 在一個會話中插入數據到臨時表對另一個會話可用
E. 臨時表不需要DML鎖

答案:ACE
三、題目解析
在臨時表中可以創建索引、視圖及觸發器,還可以使用“Export and Import(導出和導入)”或“Data Pump(數據泵)”導出和導入臨時表的定義。但是,即使使用了ROWS 選項,也不會導出數據。
A,可以對臨時表創建索引,視圖,觸發器,正確
B,可以用 export 和 import 工具導入導出表的定義和數據,錯誤,不能導出數據。
C,一個用戶的臨時表就放在當前用戶的臨時表空間中,創建臨時表后并不產生任何 segments分配,與普通表不同,正確。
D,被插入臨時表的數據能被其他會話訪問,錯誤。臨時表中的數據是基于一個會話或者一個事務的,其他的會話不能訪問到。
E,在臨時表中,DML鎖永遠不需要,正確。
臨時表可專用于事務處理,也可專用于會話。對于專用于事務處理的臨時表而言,數據存在于事務處理期間;對于專用于會話的臨時表而言,數據存在于會話期間。在這兩種情況下,會話插入的數據專用于會話。每個會話僅可查看和修改自己的數據。因此,臨時表的數據從不會獲得DML 鎖。

參考官方文檔:
http://docs.oracle.com/cd/E11882_01/server.112/e25494/tables.htm#ADMIN11633

一、源題
QUESTION 13
Which two kinds of failures make the Data Recovery Advisor (DRA) generate a manual checklist? (Choose two.)
A. Failure when no standby database is configured
B. Failure because a data file is renamed accidentally
C. Failure that requires no archive logs to be applied for recovery
D. Failure due to loss of connectivity-for example, an unplugged disk cable
Correct Answer: BD
二、題目翻譯
哪兩種故障導致DRA產生手動清單?(選擇2個)
A. 當沒有配置備用數據庫時發生故障
B. 因為數據文件意外的重命名導致的故障
C. 因為沒有歸檔日志應用于恢復產生的故障
D. 由于丟失連接導致的故障,例如沒插電纜的磁盤
答案:BD
三、題目解析
DRA會顯示兩種類型的故障
? 需要人工干預的故障,例如,未插入磁盤電纜的連接故障
? 可以通過撤銷以前的錯誤操作快速修復的故障,例如:錯誤的重命名了數據文件

參考官方文檔
http://docs.oracle.com/cd/E11882_01/backup.112/e10642/rcmrepai.htm#BRADV246

一、源題
QUESTION 14
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.
Correct Answer: AC
二、題目翻譯
哪兩句是正確的關于描述數據文件和數據庫邏輯結構關系?(選擇2個)
A. extent不能跨數據文件
B. segment不能跨數據文件
C. 一個數據文件只能屬于一個表空間
D. 一個數據文件只能創建一個段
E. 一個數據塊可以跨多個數據文件,因為它由多個操作系統塊組成

答案:AC
三、題目解析
Extent不能跨數據文件,segment可以,A錯,B對
每個表空間都可以有一個或多個數據文件,但一個數據文件只能屬于一個表空間,c對
一個數據文件可以有多個段,并且段能跨數據文件,D錯
數據塊不能跨數據文件,E錯

參考官方文檔:
http://docs.oracle.com/cd/E11882_01/server.112/e40540/logical.htm#CNCPT004

一、源題
QUESTION 15
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 a part of nonpartitioned segment
Correct Answer: BD
二、題目翻譯
哪兩句關于表空間的描述是正確的?(選擇兩個)
A. 可以跨多個數據庫
B. 可以由多個數據文件組成
C. 可以包含不同大小的數據塊
D. 可以包含不同大小的段
E. 可以包含非分區段的一部分

答案:BD
三、題目解析
表空間在物理上將所有邏輯結構的數據都存儲在表空間中。
表空間不能跨數據庫,A錯
每個表空間都可以有一個或多個數據文件,但一個數據文件只能屬于一個表空間,B對
數據庫的數據塊大小是固定的,C錯
段是由一系列的區組成的,而區又是由一系列的塊組成的,塊的大小是固定的,所以段的大小不固定,D對
非分區段能跨數據文件,但是不能跨表空間,E錯
參考官方文檔:
http://docs.oracle.com/cd/E11882_01/server.112/e40540/logical.htm#CNCPT004

一、源題
QUESTION 16
Which two statements are true regarding Oracle Data Pump? (Choose two.)
A. EXPDP and IMPDP are the client components of Oracle Data Pump
B. DBMS_DATAPUMP PL/SQL packages can be used indedendently of the DATA Pump clients
C. Oracle Data Pump export and import operations can be performed only by users with the SYSDBA
privilege
D. Oracle Data Pump imports can be done from the export files generated in the Original Export Release 9.x
E. EXPDP and IMPDP use the procedures provided by DBMS_METADATA to execute export and import commands
Correct Answer: AB
二、題目翻譯
哪些是正確的關于Oracle Data Pump?(選擇兩個)
A. EXPDP和IMPDP是Oracle Data Pump的客戶端組件
B. DBMS_DATAPUMP PL/SQL可以獨立Data Pump client之外使用
C. Oracle Data Pump的導入和導出操作只能由有SYSDBA權限的用戶執行
D. Oracle Data Pump可以導入由9.x版本的Original Export產生的導出文件
E. EXPDP和IMPDP使用DBMS_METADATA執行導出和導入命令

答案:AB
三、題目解析
Data Pump包含三個部分:DBMS_DATAPUMP,DBMS_METADATA,,客戶端命令行EXPDP和IMPDP,所以A正確
DBMS_DATAPUMP和DBMS_METADATA都可以獨立于Data Pump client使用,B正確

參考官方文檔:
http://docs.oracle.com/cd/E11882_01/server.112/e22490/dp_overview.htm#SUTIL801

一、源題
QUESTION 17
Identify the two situations in which the alert log file is updated with details. (Choose two.)
A. Running a query on a table returns "ORA-600: Internal Error"
B. Inserting a value in a table returns "ORA-01722: Invalid Number" "First Test, First Pass" - www.lead2pass.com 8
Oracle 1Z0-052 Exam
C. Creating a table returns "ORA-00955: name is already used by an existing object'
D. Inserting a value in a table returns "ORA-00001: unique constraint (SYS.PK_TECHP) violated."
E. Rebuilding an index using ALTER INDEX ... REBUILD fails with an error "ORA-01578: ORACLE data block corrupted (file # 14, block @ 50)."
F. Rebuilding an index using ALTER INDEX .... REBUILD fails with an error "ORA-01578: ORACLE data block corrupted (file #14, block #50)."
Correct Answer: AE
二、題目翻譯
鑒別兩種情況下告警日志更新細節。(選擇兩個)
A. 在一個表運行查詢返回”ORA-600:Internal Error”
B. 在一個表插入值返回”ORA-01722: Invalid Number”
C. 創建一個表返回”ORA-00955:name is already used by an existing object”
D. 在一個表插入值返回"ORA-00001: unique constraint (SYS.PK_TECHP) violated."
E. 重建索引使用ALTER INDEX ... REBUILD失敗,報"ORA-01578: ORACLE data block corrupted (file # 14, block @ 50)."
F. 重建索引使用ALTER INDEX ... REBUILD失敗,報"ORA-01578: ORACLE data block corrupted (file # 14, block # 50)."

答案:AF
三、題目解析
每個數據庫都有一個alert_<sid >.log文件。此文件位于數據庫所在的服務器中,如果設置了$ORACLE_BASE,則此文件默認存儲在$ORACLE_BASE/diag/rdbms/<db_name>/<SID>/trace中。
數據庫預警文件是按時間順序列出消息的日志文件,例如:
? 啟動時使用的任何非默認初始化參數
? 已發生的所有內部錯誤( ORA-600) 、塊損壞錯誤( ORA-1578 ) 和死鎖錯誤( ORA-60 )
? 管理操作,如SQL 語句CREATE 、ALTER、DROP DATABASE 和TABLESPACE,以及Enterprise Manager 或SQL*Plus 語句STARTUP、SHUTDOWN 、ARCHIVE LOG和RECOVER
? 與共享服務器和分派程序進程的功能相關的多個消息和錯誤
? 自動刷新實體化視圖時發生的錯誤

一、源題
QUESTION 18
Which two statements are true about alerts? (Choose two.)
A. Clearing an alert sends the alert to the alert history
B. Response actions cannot be specified with server-generated alerts
C. The nonthreshold alerts appear in the DBA_OUTSTANDING_ALERTS view
D. Server-generated alerts notify the problems that cannot be resolved automatically and require administrators to be notified
Correct Answer: AD
二、題目翻譯
哪兩個語句是正確的關于告警日志?(選擇兩個)
A. 清除告警日志發送告警到告警歷史
B. 響應動作不會產生指定的服務器告警
C. 閾值警報出現在視圖DBA_OUTSTANDING_ALERTS中
D. 服務器告警通知不能自動解決和需要管理員注意的問題

答案:AD
三、題目解析
告警有兩種,一種是trace和alert文件,一種是Server-Generated Alerts
這道題應該說的是第二種情況
Server-Generated Alerts是數據庫產生的一種告警,它可能包括解決這個告警的方法,當告警清除后還會生成通知消息,當問題出現或者沒有匹配到期望的閾值的時候就會自動生成告警,這些閾值都是可以定義的,比如
1.每秒的物理讀
2.每秒的用戶提交
3.sql服務響應時間
一些沒有基于閾值的比如
1.快照太舊
2.恢復會話掛起
3.恢復區的使用
A:正確,當告警清除后會從DBA_OUTSTANDING_ALERTS刪除,并且在DBA_ALERT_HISTORY中添加
B:錯誤,會產生
C:錯誤,一些沒有基于閾值的也會警報
D:正確,發現的問題不會自動處理,需要DBA人工干預
參考官方文檔:
http://docs.oracle.com/cd/E11882_01/server.112/e25494/monitoring.htm#ADMIN11247

一、源題
QUESTION 19
Examine the following steps performed on a database instance:

  1. The DBA grants the CREATE TABLE system privilege to the SKD user with ADMIN OPTION
  2. The SKD user creates a table
  3. The SKD user grants the CREATE TABLE system privilege to the HR user
  4. The HR user creates a table
  5. The DBA revokes the CREATE TABLE system privilege from SKD
    Which statement is true after step 5 is performed?
    A. The table created by SKD is not accessible and SKD cannot create new tables
    B. The tables created by SKD and HR remain, but both cannot create new tables
    C. The table created by HR remains and HR still has the CREATE TABLE system privilege
    D. The table created by HR remains and HR can grant the CREATE TABLE system privilege to other
    users
    Correct Answer: C
    二、題目翻譯
    檢查下面在數據庫實例執行的步驟:
  6.    DBA授予SKD用戶CREATE TABLE權限使用ADMIN OPTION
    
  7.    SKD用戶創建一個表
    
  8.    SKD用戶授予CREATE TABLE系統權限給HR用戶
    
  9.    HR用戶創建一個表
    
  10.    DBA收回SKD的CREATE TABLE系統權限
    

哪些語句是正確的上述5步執行之后?
A. SKD創建的表是不可訪問的并且SKD不能創建新表
B. SKD和HR創建的表仍然在,但都不能創建新表
C. HR創建的表存在且HR仍然有CREATE TABLE系統權限
D. HR創建的表存在且HR可以授予其它用戶CREATE TABLE系統權限
三、題目解析
答案:C
SKD創建的表是可以訪問的,但是不能創建新表,A錯
系統權限的收回不是級聯的,所以不會影響HR用戶的權限,HR可以創建新表,B錯,C對
SKD授予HR權限時沒有使用with admin option,故HR用戶不能授予其他用戶權限,D錯

參考官方文檔:
http://docs.oracle.com/cd/E11882_01/network.112/e36292/authorization.htm

一、源題
QUESTION 20
You execute this command to drop the ITEM table, which has the primary key referred in the ORDERS table: SQL> DROP TABLE scott.item CASCADE CONSTRAINTS PURGE; Which two statements are true about the effect of the command? (Choose two.)
A. No flashback is possible to bring back the ITEM table.
B. The ORDERS table is dropped along with the ITEM table.
C. The dependent referential integrity constraints in the ORDERS table are disabled.
D. The dependent referential integrity constraints in the ORDERS table are removed.
E. The table definition of the ITEM table and associated indexes are placed in the recycle bin.
Correct Answer: AD
二、題目翻譯
執行下面命令刪除ITEM表,主鍵被ORDERS表參照:
SQL> DROP TABLE scott.item CASCADE CONSTRAINTS PURGE;
哪些語句是正確的關于上述命令的影響?(選擇兩個)
A. 不能使用flashback找回ITEM表
B. ORDERS表隨ITEM表一起刪除
C. ORDERS表的參照性完整約束失效
D. ORDERS表的參照性完整約束刪除
E. ITEM的表定義和相關的索引被放到回收站
三、題目解析
答案:AD
由于使用了PURGE,不會講表和相關的對象放入回收站,因此flashback不能用,A對,E錯
指定CASCADE CONSTRAINTS 語句是指刪除所有的參照完整性約束包括主鍵約束和唯一性約束。
如果不指定此語句,則參照完整性約束還存在,drop table時會返回一個錯誤。C錯,D對
B錯誤,如果想實現這個需要級聯刪除,
參考文檔:
http://docs.oracle.com/cd/E11882_01/server.112/e41084/statements_9003.htm#SQLRF01806
四、測試

SQL> conn scott/oracle
SQL> drop table emp1;
SQL> create table emp1 as select * from emp;
SQL> create table dept1 as select * from dept;
----使用了on delete cascade語句,用于刪除父表一條記錄的時候,子表記錄也要刪除
SQL> alter table emp1 add constraint fk_deptno1 foreign key (deptno) references dept1(deptno) on delete cascade;
SQL> alter table emp1 drop constraint fk_deptno1;
----這里使用了on delete set null語句,當父表刪除的時候,子表記錄就會設置為空
SQL> alter table emp1 add constraint fk_deptno1 foreign key (deptno) references dept1(deptno) on delete set null;
SQL> drop table emp1 cascade constraints purge;

一、源題
QUESTION 21
View the Exhibit and examine the privileges granted to the SL_REP user. The EMP table is owned by the SCOTT user. The SL_REP user executes the following command: SQL> GRANT SELECT ON scott.emp TO hr;

image.png

Which statement describes the outcome of the command?
A. The command executes successfully
B. The command produces an error because the EMP table is owned by SCOTT
C. The command produces an error because SL_REP has the GRANT ANY OBJECT PRIVILEGE without ADMIN_OPTION
D. The command produces an error because SL_REP does not have the SELECT privilege with GRANT_OPTION on the EMP table
Correct Answer: A
二、題目翻譯
查看下圖并檢查授予SL_REP用戶的權限。EMP表的擁有者是SCOTT用戶。SL_REP用戶執行下面的命令:
SQL> GRANT SELECT ON scott.emp TO hr;
哪些關于輸出結果的命令是正確的?
A. 命令執行成功
B. 命令產生一個錯誤因為EMP表的擁有者是SCOTT
C. 命令產生一個錯誤因為SL_REP用戶GRANT ANY OBJECT PRIVILEGE沒使用ADMIN_OPTION
D. 命令產生一個錯誤因為SL_REP沒有SELECT權限在EMP表上

答案:A
三、題目解析
A對,因為SL_REP用戶擁有GRANT ANY OBJECT PRIVILEGE權限,所以可以授予別的用戶SELECT權限
四、測試

SQL> conn / as sysdba
Connected.
--1、創建SL_REP用戶
SQL> create user sl_rep identified by oracle;

User created.
--2、授予相應的權限
SQL> grant connect,resource to sl_rep;

Grant succeeded.

SQL> grant grant any object privilege to sl_rep;

Grant succeeded.
--3、執行上面的命令
SQL> conn sl_rep/oracle
Connected.
SQL> grant select on scott.emp to hr;

Grant succeeded.

一、源題
QUESTION 22
You executed this command to create a temporary table:
SQL> CREATE GLOBAL TEMPORARY TABLE report_work_area ( startdate DATE, enddate DATE, class CHAR(20) ) ON COMMIT PRESERVE ROWS;
Which statement is true about the rows inserted into the REPORT_WORK_AREA table during a transaction?
A. The rows stay in the table only until session termination
B. The rows stay in the table only until the next transaction starts on the table
C. The rows are visible to all current sessions after the transaction in committed
D. The rows stay available for subsequent sessions after the transaction is committed
Correct Answer: A
二、題目翻譯
執行下面命令創建一個臨時表:
SQL> CREATE GLOBAL TEMPORARY TABLE report_work_area
( startdate DATE,
enddate DATE,
class CHAR(20)
) ON COMMIT PRESERVE ROWS;
哪些語句是正確的關于一個事務中,在表REPORT_WORK_AREA中插入行?
A. 表中的行保持直到會話中止
B. 表中的行保持直到下個事務開始
C. 事務提交后行是可見的對所有當前會話來說
D. 事務提交后行依舊可用對后續會話

答案:A
三、題目解析
因為使用了ON COMMIT PRESERVE ROWS;即指定插入行的生存期為會話的持續時間
ON COMMIT DELETE ROWS :指定插入行的生存期僅為事務處理的持續時間

參考官方文檔:
http://docs.oracle.com/cd/E11882_01/server.112/e25494/tables.htm#ADMIN11633
四、測試

--即指定插入行的生存期為會話的持續時間
SQL>  CREATE GLOBAL TEMPORARY TABLE report_work_area
  2  ( startdate DATE, 
  3  enddate DATE, 
  4  class CHAR(20) 
  5  ) ON COMMIT PRESERVE ROWS;

Table created.

SQL> insert into report_work_area values ('23-jan-2007','25-may-2008','一班');

1 row created.

SQL> insert into report_work_area values ('23-oct-2007','25-nov-2008','一班');

1 row created.
--提交了事務,還有記錄
SQL> commit;

Commit complete.

SQL> select * from report_work_area;

STARTDATE          ENDDATE            CLASS
------------------ ------------------ --------------------
23-JAN-07          25-MAY-08          一班
23-OCT-07          25-NOV-08          一班
--刪除之前的表report_work_area
SQL> drop table report_work_area;

Table dropped.
--指定插入行的生存期僅為事務處理的持續時間
SQL> CREATE GLOBAL TEMPORARY TABLE report_work_area
( startdate DATE, 
  3  enddate DATE, 
  4  class CHAR(20) 
  5  ) ON COMMIT delete rows;

Table created.

SQL> insert into report_work_area values ('23-oct-2007','25-nov-2008','一班');

1 row created.

SQL> insert into report_work_area values ('23-jan-2007','25-may-2008','一班');

1 row created.
--提交了事務,記錄沒有了,因為只持續到事務結束
SQL> commit;

Commit complete.

SQL> select * from report_work_area;

no rows selected

一、源題
QUESTION 23
You want to access employee details contained in flat files as part of the EMPLOYEE table. You plan to add a new column to the EMPLOYEE table to achieve this. Which data types would you use for the new column?
A. CLOB
B. BLOB
C. BFILE
D. LONG RAW
Correct Answer: C
答案:C
二、題目翻譯
你想把包含在平面文件中的員工詳細信息作為EMPLOYEE表的一部分。你打算添加一個新的列實現。哪種數據類型你需要使用在新的列?
A. CLOB
B. BLOB
C. BFILE
D. LONG RAW
答案:C
三、題目解析
CLOB字符型大對象。一般存儲大數量文本信息。存儲單字節,固定寬度的數據。
BLOB二進制大對象。存儲在數據庫里的大對象,一般是圖像聲音等文件。
BFILE二進制文件,存儲在數據庫外的操作系統文件,只讀的。把此文件當二進制處理。
LONG RAW 為未加工的可變長二進制數據,最長2G(不建議使用)

一、源題
QUESTION 24
The HR user creates a stand-alone procedure as follows and grants the EXECUTE privilege on the procedure to many database users:

CREATE OR REPLACE PROCEDURE create_dept ( v_deptno NUMBER, v_dname VARCHAR2, v_mgr NUMBER, v_loc NUMBER) 
BEGIN
 INSERT INTO hr.departments VALUES (v_deptno, v_dname, v_mgr, v_loc); 
END; 

The users having permission to execute the procedure are able to insert records into the DEPARTMENTS table even though they do not have the INSERT privilege on the table. You want only those users who have privileges on the DEPARTMENTS table to be able to execute the procedure successfully. What would you suggest to the PL/SQL developers to achieve this?
A. Create the procedure with definer's right.
B. Create the procedure with invoker's right.
C. Grant the EXECUTE privilege with GRANT OPTION on the procedure to selected users.
D. Create the procedure as part of a PL/SQL package and grant the EXECUTE privilege on the package to selected users.
Correct Answer: B
二、題目翻譯
HR用戶創建一個標準存儲過程并授予EXECUTE權限給數據庫用戶:
CREATE OR REPLACE PROCEDURE create_dept ( v_deptno NUMBER, v_dname VARCHAR2, v_mgr NUMBER, v_loc NUMBER)
BEGIN
INSERT INTO hr.departments VALUES (v_deptno, v_dname, v_mgr, v_loc);
END;

用戶擁有權限執行過程也能夠插入記錄到DEPARTMENTS表,即使它沒有INSERT表的權限。你想擁有DEPARTMENTS表權限的用戶能成功執行過程。你建議PL/SQL開發人員如何實現?
A. 創建過程使用definer身份
B. 創建過程使用invoker身份
C. 使用GRANT OPTION授予EXECUTE權限給選擇的用戶
D. 創建過程作為包的一部分并且授予package EXECUTE權限給選擇的用戶

答案:B
三、題目解析
A: 錯誤,應創建調用者權限,而不是定義者權限
B: 正確
C: 錯誤,默認是以定義者權限創建存儲過程,那么有execute權限就可以向部門表insert數據 不能實現需求grant option權限是指可以把存儲過程權限授權給其它人
D: 錯誤,存儲過程可單獨創建,不需要放到包里,這樣也不能實現題里的需求

一、源題
QUESTION 25
View the Exhibit to examine the details for an incident. Which statement is true regarding the status of the incident?

image.png

A. The DBA is working on the incident and prefers that the incident be kept in the ADR
B. The incident is now in the Done state and the ADR can select the incident to be purged
C. The incident has been newly created and is in the process of collecting diagnostic information
D. The data collection for the incident is complete and the incident can be packaged and sent to Oracle Support
Correct Answer: D
二、題目翻譯
查看圖表檢查incident的詳細信息。哪些語句是正確的關于incident的狀態?
A. DBA正在處理incident并且更喜歡將incident保存在ADR中
B. Incident現在處于Done狀態并且ADR可以選擇清理incident
C. Incident被新建并且正在收集診斷信息
D. Incident收集信息已經完成并且可以被打包發送給Oracle Support

答案:D
三、題目解析
使用Enterprise Manager 支持工作臺,可以通過執行以下常規步驟來調查、報告并(在某些情況下)解決問題:

  1. 在Enterprise Manager 的“Database(數據庫)”主頁上,復查嚴重錯誤預警。選擇一個預警查看詳細資料。
  2. 分析問題詳細信息并查看針對問題所記錄的所有意外事件的列表。可顯示自動運行的所有健康狀況檢查的查找結果。
  3. (可選)運行附加健康狀況檢查并調用SQL Test Case Builder,該程序將收集與SQL 問題相關的所有必需數據,并且以Oracle 技術支持能夠再現該問題的方式對這些信息進行打包。
  4. 使用My Oracle Support 創建一個服務請求并(可選)隨問題信息一起記錄服務請求號。
  5. 調用意外事件打包服務,該服務可以對收集到的有關某個問題的所有診斷數據進行打包,可以選擇將這些數據上載到Oracle 技術支持。上載之前可以對數據進行編輯,刪除敏感信息。
  6. 可以在支持工作臺中維護一份服務請求的活動日志。可運行Oracle 指導以幫助修復SQL 故障或損壞的數據。
  7. 為一個、一些或所有意外事件設置狀態,以便關閉問題

參考官方文檔:
http://docs.oracle.com/cd/E11882_01/server.112/e25494/diag.htm#ADMIN12484

http://docs.oracle.com/cd/E11882_01/server.112/e10897/problems.htm#ADMQS12110

一、源題
QUESTION 26
What can you achieve by implementing reverse key index?
A. Reverse the bytes of each column indexed including the row ID
B. Store a bitmap for each key value instead of a list of row IDs in the leaf node
C. Prevent contention on the highest leaf block when using sequences to generate keys
D. Remove repeated key values from the index to fit more index entries in a given amount of disk space
Correct Answer: C
二、題目翻譯
你可以通過反向鍵索引實現什么?
A. 反轉每個索引列的字節包括row ID
B. 存儲每個鍵值的位圖代替葉節點的一系統row ID
C. 避免爭用最高的葉子塊當使用序列產生鍵值時
D. 刪除重復的索引鍵值適合更多的索引條目在給定數量的磁盤空間

答案:C
三、題目解析
A改變的是字符順序,不是列順序
B描述的是bitmap index
C正確
D Remove repeated key values 可以嘗試用函數索引 substr()達到

參考官方文檔:
http://docs.oracle.com/cd/E11882_01/server.112/e40540/indexiot.htm#CNCPT1181

一、源題
QUESTION 27
You executed the following command to perform a backup of the USERS tablespace:
SQL> ALTER TABLESPACE users BEGIN BACKUP;
ALTER TABLESPACE users BEGIN BACKUP * ERROR at line 1: ORA-01123: cannot start online backup; media recovery not enabled
What could be the reason for this error?
A. The MTTR Advisor is disabled.
B. The database is in NOARCHIVELOG mode.
C. The tablespace is already in backup mode.
D. The Flash Recovery Area is not configured.
Correct Answer: B
二、題目翻譯
執行下面的命令備份USERS表空間
SQL> ALTER TABLESPACE users BEGIN BACKUP;
ALTER TABLESPACE users BEGIN BACKUP

ERROR at line 1:
ORA-01123: cannot start online backup;
media recovery not enabled
什么導致整個錯誤
A. MTTR Advisor禁用
B. 數據庫處于NOARCHIVELOG模式
C. 表空間已經處于備份模式
D. Flash Recovery Area沒有配置

答案:B
三、題目解析
對數據庫進行熱備,必須處于歸檔模式。
出現這個報錯是因為數據庫沒有開歸檔,所以B對

一、源題
QUESTION 28
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 O7_DICTIONARY_ACCESSIBLILITY parameter is set to TRUE
  5. The V$FIXED_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
    Correct Answer: A
    二、題目翻譯
    下列哪些語句描述的是數據字典視圖?
  6.    存儲在SYSTEM表空間
    
  7.    基于虛擬表
    
  8.    SYS用戶擁有
    
  9.    可以被正常的用戶查詢,只要O7_DICTIONARY_ACCESSIBLILITY參數設置為TRUE
    
  10.    V$FIXED_TABLE可以被查詢列出這些視圖的名字
    

A. 1和3
B. 2,3和5
C. 1,2和5
D. 2,3,4和5

答案:A
三、題目解析
1,3它們都被存在system表空間以及owner都是sys用戶
2動態性能視圖以基于數據庫服務器內部的內存結構構建的虛擬表為基礎
4 O7_DICTIONARY_ACCESSIBILTY設置為TRUE,則如果用戶授予了如select any table等權限,即使不是dba或sysdba用戶也可以訪問數據字典。設置為FLASE,則普通用戶不能訪問
5 V$FIXED_TABLE只能查詢動能性能視圖所有的名稱。

SQL> show parameter DICTIONARY

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
O7_DICTIONARY_ACCESSIBILITY          boolean     FALSE
SQL> select * from V$FIXED_TABLE where rownum<5;

NAME                            OBJECT_ID TYPE   TABLE_NUM
------------------------------ ---------- ----- ----------
X$KQFTA                        4294950912 TABLE          0
X$KQFVI                        4294950913 TABLE          1
X$KQFVT                        4294951149 TABLE          2
X$KQFDT                        4294950914 TABLE          3

SQL> select * from V$FIXED_TABLE where rownum<10;

NAME                            OBJECT_ID TYPE   TABLE_NUM
------------------------------ ---------- ----- ----------
X$KQFTA                        4294950912 TABLE          0
X$KQFVI                        4294950913 TABLE          1
X$KQFVT                        4294951149 TABLE          2
X$KQFDT                        4294950914 TABLE          3
X$KQFCO                        4294951036 TABLE          4
X$KQFOPT                       4294952712 TABLE          5
X$KYWMPCTAB                    4294952922 TABLE          6
X$KYWMWRCTAB                   4294953009 TABLE          7
X$KYWMCLTAB                    4294952923 TABLE          8

9 rows selected.

一、源題
QUESTION 29
View the Exhibit to examine the error that occurred during the database startup. You opened an RMAN session for the database. To repair the failure, you executed the following command as the first RMAN command:
RMAN> REPAIR FAILURE;

image.png

Which statement describes the consequence of this command?
A. The command performs the recovery and closes the failure
B. The command only displays the advice and the RMAN script required for recovery
C. The command executes the RMAN script to repair the failure and remove the entry from the Automatic Diagnostic Repository (ADR)
D. The command produces an error because the ADVISE FAILURE command was not executed before the REPAIR FAILURE command
Correct Answer: D
二、題目翻譯
查看圖表查看數據庫啟動期間發生的錯誤。你打開一個數據庫的RMAN會話。去修復這個故障,你執行下面的命令作為第一個RMAN命令:
RMAN> REPAIR FAILURE;
哪個語句描述命令的結果?

A. 命令執行recovery并且關閉故障
B. 命令只顯示建議和恢復需要的RMAN腳本
C. 命令執行RMAN腳本修復故障并從ADR刪除信息
D. 命令產生一個錯誤因為ADVISE FAILURE命令沒有在REPAIR FAILURE之前執行

答案:D
三、題目解析
執行步驟
list failure
advise failure
repair failure
change failure
ADR(automatic diagnostic repository) 自動診斷存儲庫,ADR提供了大量新的信息以及新的工具以方便數據庫管理

一、源題
QUESTION 30
You execute this command to drop the ITEM table, which has the primary key referred in the ORDERS table:
SQL> DROP TABLE scott.item CASCADE CONSTRAINTS PURGE;
Which two statements are true about the effect of the command? (Choose two.)
A. No flashback is possible to bring back the ITEM table
B. The ORDERS table is dropped along with the ITEM table
C. The dependent referential integrity constraints in the ORDERS table are disabled
D. The dependent referential integrity constraints in the ORDERS table are removed
E. The table definition of the ITEM table and associated indexes are placed in the recycle bin
Correct Answer: AD

一、源題
QUESTION 31
You plan to move data from a flat file to a table in your database. You decide to use SQL*Loader direct path load method to perform this task. The table in which you plan to load data in an important table having various integrity constraint defined on it. Which constraints will remain enabled by default during this operation? (Choose all that apply.)
A. CHECK
B. UNIQUE
C. NOT NULL
D. PRIMARY KEY
E. FOREIGN KEY

二、題目翻譯
你打算從平面文件移動數據到你的數據庫。你決定使用SQL*Loader直接路徑加載方法來執行該任務。你打算加載數據的重要表上定義的有各種完整性約束。哪些約束將默認啟動在這個操作期間?(選擇所有適用的)
A. CHECK
B. UNIQUE
C. NOT NULL
D. PRIMARY KEY
E. FOREIGN KEY

答案:BCD
三、題目解析


image.png

一、源題
QUESTION 32
What is the effect of this command?
SQL> AUDIT DROP ANY TABLE BY scott BY SESSION WHENEVER SUCCESSFUL;
A. One audit record is created for every successful DROP TABLE command executed in the session of SCOTT
B. One audit record is generated for the session when SCOTT grants the DROP ANY TABLE privilege to other users
C. One audit record is created for the whole session if user SCOTT successfully drops one or more tables in his session
D. One audit record is created for every session of any other user in which a table owned by SCOTT is dropped successfully
E. One audit record is created for every successful DROP TABLE command executed by any user to drop tables owned by SCOTT
Correct Answer: C
三、題目解析
指定審計選項
SQL 語句審計:AUDIT table;
上面顯示的語句可審計影響表的任何數據定義語言(DDL) 語句,包括CREATE TABLE、DROP TABLE和TRUNCATE TABLE等。
也可按用戶名或者按成功或失敗來設置SQL 語句審計的重點:
SQL> AUDIT TABLE BY hr WHENEVER NOT SUCCESSFUL;
系統權限審計:可用來審計行使的任何系統權限(如DROP ANY TABLE)。可按用戶名或者成功或失敗設置審計的重點。
默認情況下,審計設置為BY ACCESS。
每次行使經審計的系統權限時,都會生成一條審計記錄。
可選擇使用BY SESSION子句將這些記錄組成一組,以便每個會話只生成一條記錄。
(這樣,如果一個用戶針對另一個用戶的表發出了多條更新語句,則只收集一條審計記錄。)
使用BY SESSION子句來限制由于審計系統權限而對性能和存儲產生的影響。
系統權限審計(非重點和重點):
AUDIT select any table, create any trigger;
AUDIT select any table BY hr BY SESSION;
對象權限審計:可用來審計關于表、視圖、過程、序列、目錄和用戶定義數據類型的操作。
這種審計類型可按成功或失敗設置審計的重點,而且可以按會話或訪問權限分組。
與系統權限審計不同,默認情況下,對象權限審計按會話分組。
如果要為每個操作分別生成一條審計線索記錄,必須顯式指定BY ACCESS。
對象權限審計(非重點和重點):
AUDIT ALL on hr.employees;
AUDIT UPDATE,DELETE on hr.employees BY ACCESS;

一、源題
QUESTION 33
User A executes the following command to drop a large table in your database: SQL> DROP TABLE trans;
While the drop table operation is in progress; user B executes the following command on the same table;
SQL> DELETE FROM trans WHERE tr_type='SL';
Which statement is true regarding the DELETE command?
A. It fails to delete the records because the records are locked in the SHARE mode
B. It deletes the rows successfully because the table is locked in the SHARE mod
C. It fails to delete the records because the table is locked in EXCLUSIVE mode
D. It deletes the rows successfully because the table is locked in SHARE ROW EXCLUSIVE mode
Correct Answer: C
二、題目翻譯
用戶A執行下面的命令刪除數據庫中的大表:
SQL> DROP TABLE trans;
當刪除表操作正在進行時;用戶B執行下面的命令在相同的表;
SQL> DELETE FROM trans WHERE tr_type='SL';
哪些語句是正確的關于DELETE命令?
A. 刪除記錄失敗因為記錄被鎖處于SHARE模式
B. 刪除行成功因為表被鎖處于SHARE模式
C. 刪除記錄失敗因為表被鎖處于EXCLUSIVE模式
D. 刪除行成功因為表被鎖處于SHARE ROW EXCLUSIVE模式

答案:C
三、題目解析
當執行alter table,drop table,drop index,truncate table,lock exclusive的時候會造成exclusive鎖,因此B錯,C對
當執行lock share row exclusive的時候會造成共享排他鎖,排除D
當執行insert,update,delete,lock row share的時候會造成行級排他鎖,在提交前不允許做dml操作,因此排除A

參考官方文檔:
http://docs.oracle.com/cd/E11882_01/server.112/e40540/consist.htm#CNCPT1339

一、源題
QUESTION 34
In which situation may the UNDO_RETENTION parameter be ignored, even if it is set to a value?
A. When the data file of the undo tablespace is autoextensible
B. When there are more than one undo tablespace available in the database
C. When the undo tablespace is of a fixed size and retention guarantee is not enabled
D. When the undo tablespace is autoextensible and retention guarantee is not enabled
Correct Answer: C
二、題目翻譯
在什么情況下UNDO_RETENTION參數即使設置了,也不起作用?
A. 當undo表空間的數據文件是自動擴展的時候
B. 當數據庫有不只一個undo表空間可用的時候
C. 當undo表空間是固定尺寸且retention guarantee沒有啟用的時候
D. 當undo表空間是自動擴展且retention guarantee沒有啟用的時候

答案:C
三、題目解析
此題考的是UNDO_RETENTION 即使設置了值,在哪些情況下會忽略。
在固定大小的還原表空間,且沒有設置retention guarantee 強制保留,UNDO_RETENTION 就會被忽略。如果設置了retention guarantee ,即使是固定大小的表空間,也不會忽略UNDO_RETENTION,但有可能出現事務失敗。

參考官方文檔:
http://docs.oracle.com/cd/E11882_01/server.112/e40402/initparams265.htm#REFRN10225

一、源題
QUESTION 35
You perform differential incremental level 1 backups of your database on each working day and level 0 backup on Sunday to tape: Which two statements are true about differential incremental backups? (Choose two.)
A. The backup performed on Sundays contains all the blocks that have ever been used in the database
B. The backup performed on Sundays contains all the blocks that have changed since the last level 1 backup
C. The backup performed on each working day contains all the blocks that have changed since the last level 0 backup
D. The backup performed on Monday contains all the blocks that have changed since the level 0 backup and every other working day contains all the blocks that have changed since the level 1 backup
Correct Answer: AD
二、題目翻譯
你在你的數據庫工作日執行level 1差異增量備份,在周日執行level 0差異增量備份到磁帶上;
哪兩句是正確的關于差異增量備份?(選擇兩個)

A. 每周日執行的備份包括數據庫使用過的所有的塊
B. 每周日執行的備份包括所有自從上次level 1備份改變的塊
C. 工作日執行的備份包括所有自從上次level 0備份改變的塊
D. 周一執行的備份包括自從level 0備份改變的塊和其它工作日自從level 1備份改變的塊

答案:AD
三、題目解析
執行增量備份操作時,首先需要的是增量基本備份(incremental base backup),即level 0,今后所有的增量備份都是基于這個基本備份的。
0級增量備份會備份所有曾經在此數據庫中使用的塊。
從星期一到星期六的每一天,1級增量備份備份最近1或0級增量備份以來所有更改過的塊。周一備份周日0級備份以來變化的塊,周二備份周一1級備份改變的塊,等等。

參考官方文檔:
http://docs.oracle.com/cd/E11882_01/backup.112/e10642/rcmcncpt.htm#sthref707

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。
  • 序言:七十年代末,一起剝皮案震驚了整個濱河市,隨后出現的幾起案子,更是在濱河造成了極大的恐慌,老刑警劉巖,帶你破解...
    沈念sama閱讀 228,333評論 6 531
  • 序言:濱河連續發生了三起死亡事件,死亡現場離奇詭異,居然都是意外死亡,警方通過查閱死者的電腦和手機,發現死者居然都...
    沈念sama閱讀 98,491評論 3 416
  • 文/潘曉璐 我一進店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人,你說我怎么就攤上這事。” “怎么了?”我有些...
    開封第一講書人閱讀 176,263評論 0 374
  • 文/不壞的土叔 我叫張陵,是天一觀的道長。 經常有香客問我,道長,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 62,946評論 1 309
  • 正文 為了忘掉前任,我火速辦了婚禮,結果婚禮上,老公的妹妹穿的比我還像新娘。我一直安慰自己,他們只是感情好,可當我...
    茶點故事閱讀 71,708評論 6 410
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著,像睡著了一般。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發上,一...
    開封第一講書人閱讀 55,186評論 1 324
  • 那天,我揣著相機與錄音,去河邊找鬼。 笑死,一個胖子當著我的面吹牛,可吹牛的內容都是我干的。 我是一名探鬼主播,決...
    沈念sama閱讀 43,255評論 3 441
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了?” 一聲冷哼從身側響起,我...
    開封第一講書人閱讀 42,409評論 0 288
  • 序言:老撾萬榮一對情侶失蹤,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后,有當地人在樹林里發現了一具尸體,經...
    沈念sama閱讀 48,939評論 1 335
  • 正文 獨居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內容為張勛視角 年9月15日...
    茶點故事閱讀 40,774評論 3 354
  • 正文 我和宋清朗相戀三年,在試婚紗的時候發現自己被綠了。 大學時的朋友給我發了我未婚夫和他白月光在一起吃飯的照片。...
    茶點故事閱讀 42,976評論 1 369
  • 序言:一個原本活蹦亂跳的男人離奇死亡,死狀恐怖,靈堂內的尸體忽然破棺而出,到底是詐尸還是另有隱情,我是刑警寧澤,帶...
    沈念sama閱讀 38,518評論 5 359
  • 正文 年R本政府宣布,位于F島的核電站,受9級特大地震影響,放射性物質發生泄漏。R本人自食惡果不足惜,卻給世界環境...
    茶點故事閱讀 44,209評論 3 347
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧,春花似錦、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 34,641評論 0 26
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至,卻和暖如春,著一層夾襖步出監牢的瞬間,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 35,872評論 1 286
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留,地道東北人。 一個月前我還...
    沈念sama閱讀 51,650評論 3 391
  • 正文 我出身青樓,卻偏偏與公主長得像,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個殘疾皇子,可洞房花燭夜當晚...
    茶點故事閱讀 47,958評論 2 373

推薦閱讀更多精彩內容