1Z0-062 Exam - Oracle Database 12c: Installation and Administration

certleader.com

Q1. The user SCOTT owns the CUST table that is placed in the SALES tablespace. The user SCOTT opens a session and executes commands as follows: 

SQL> INSERT INTO cust VALUES(101, 'JACK'); 

1 row created. 

SQL> INSERT INTO cust VALUES(102, 'SMITH'); 

1 row created. 

As a DBA, you execute the following command from another session: 

ALTER TABLESPACE sales READ ONLY; 

Which statement is true regarding the effect of this command on the transaction in Scott's session? 

A. The command fails as a transaction is still pending. 

B. The transaction in Scott's session is rolled back and the tablespace becomes readonly. 

C. The command waits and the user SCOTT can execute data manipulation language (DML) statements only as part of the current transaction. 

D. The command hangs until all transactions on the objects in the tablespace commit or rollback, and then the tablespace is placed in readonly mode. 

Answer:

Q2. Examine the following command: 

CREATE TABLE (prod_id number(4), Prod_name varchar2 (20), 

Category_id number(30), 

Quantity_on_hand number (3) INVISIBLE); 

Which three statements are true about using an invisible column in the PRODUCTS table? 

A. The %ROWTYPE attribute declarations in PL/SQL to access a row will not display the invisible column in the output. 

B. The DESCRIBE commands in SQL *Plus will not display the invisible column in the output. 

C. Referential integrity constraint cannot be set on the invisible column. 

D. The invisible column cannot be made visible and can only be marked as unused. 

E. A primary key constraint can be added on the invisible column. 

Answer: A,B,E 

Explanation: AB: You can make individual table columns invisible. Any generic access of a table does not show the invisible columns in the table. For example, the following operations do not display invisible columns in the output: 

* SELECT * FROM statements in SQL 

* DESCRIBE commands in SQL*Plus 

* %ROWTYPE attribute declarations in PL/SQL 

* Describes in Oracle Call Interface (OCI) 

Incorrect: 

Not D: You can make invisible columns visible. 

You can make a column invisible during table creation or when you add a column to a table, and you can later alter the table to make the same column visible. 

Reference: Understand Invisible Columns 

Q3. On your Oracle 12c database, you Issue the following commands to create indexes 

SQL > CREATE INDEX oe.ord_customer_ix1 ON oe.orders (customers_id, sales_rep_id) INVISIBLE; 

SQL> CREATE BITMAP INDEX oe.ord_customer_ix2 ON oe.orders (customers_id, sales_rep_id); 

Which two statement are correct? 

A. Both the indexes are created; however, only the ORD_COSTOMER index is visible. 

B. The optimizer evaluates index access from both the Indexes before deciding on which index to use for query execution plan. 

C. Only the ORD_CUSTOMER_IX1 index is created. 

D. Only the ORD_CUSTOMER_IX2 index is created. 

E. Both the indexes are updated when a new row is inserted, updated, or deleted In the orders table. 

Answer: A,E 

Explanation: 11G has a new feature called Invisible Indexes. An invisible index is invisible to the optimizer as default. Using this feature we can test a new index without effecting the execution plans of the existing sql statements or we can test the effect of dropping an index without dropping it. 

Q4. Your multitenant container (CDB) containing three pluggable databases (PDBs) is running in ARCHIVELOG mode. You find that the SYSAUX tablespace is corrupted in the root container. 

The steps to recover the tablespace are as follows: 

1. Mount the CDB. 

2. Close all the PDBs. 

3. Open the database. 

4. Apply the archive redo logs. 

5. Restore the data file. 

6. Take the SYSAUX tablespace offline. 

7. Place the SYSAUX tablespace online. 

8. Open all the PDBs with RESETLOGS. 

9. Open the database with RESETLOGS. 

10. Execute the command SHUTDOWN ABORT. 

Which option identifies the correct sequence to recover the SYSAUX tablespace? 

A. 6, 5, 4, 7 

B. 10, 1, 2, 5, 8 

C. 10, 1, 2, 5, 4, 9, 8 

D. 10, 1, 5, 8, 10 

Answer:

Explanation: RMAN> ALTER TABLESPACE sysaux OFFLINE IMMEDIATE; RMAN> RESTORE TABLESPACE sysaux; RMAN> RECOVER TABLESPACE sysaux; RMAN> ALTER TABLESPACE sysaux ONLINE; 

* Example: 

While evaluating the 12c beta3 I was not able to do the recover while testing “all pdb files lost”. 

Cannot close the pdb as the system datafile was missing… 

So only option to recover was: 

Shutdown cdb (10) 

startup mount; (1) 

restore pluggable database 

recover pluggable database 

alter database open; 

alter pluggable database name open; 

Oracle support says: You should be able to close the pdb and restore/recover the system tablespace of PDB. 

* Inconsistent backups are usually created by taking online database backups. You can also make an inconsistent backup by backing up data files while a database is closed, either: 

/ Immediately after the crash of an Oracle instance (or, in an Oracle RAC configuration, all instances) / After shutting down the database using SHUTDOWN ABORT 

Inconsistent backups are only useful if the database is in ARCHIVELOG mode and all archived redo logs created since the backup are available. 

* Open the database with the RESETLOGS option after finishing recovery: SQL> ALTER DATABASE OPEN RESETLOGS; 

Q5. To enable the Database Smart Flash Cache, you configure the following parameters: 

DB_FLASH_CACHE_FILE = ‘/dev/flash_device_1’ , ‘/dev/flash_device_2’ 

DB_FLASH_CACHE_SIZE=64G 

What is the result when you start up the database instance? 

A. It results in an error because these parameter settings are invalid. 

B. One 64G flash cache file will be used. 

C. Two 64G flash cache files will be used. 

D. Two 32G flash cache files will be used. 

Answer:

Q6. Which three statements are true about a job chain? 

A. It can contain a nested chain of jobs. 

B. It can be used to implement dependency-based scheduling. 

C. It cannot invoke the same program or nested chain in multiple steps in the chain. 

D. It cannot have more than one dependency. 

E. It can be executed using event-based or time-based schedules. 

Answer: A,B,E 

Reference: http://docs.oracle.com/cd/B28359_01/server.111/b28310/scheduse009.htm#ADMIN12459 

Q7. In your multitenant container database (CDB) containing pluggable database (PDBs), the 

HR user executes the following commands to create and grant privileges on a procedure: 

CREATE OR REPLACE PROCEDURE create_test_v (v_emp_id NUMBER, v_ename VARCHAR2, v_SALARY NUMBER, v_dept_id NUMBER) 

BEGIN 

INSERT INTO hr.test VALUES (V_emp_id, V_ename, V_salary, V_dept_id); 

END; 

GRANT EXECUTE ON CREATE_TEST TO john, jim, smith, king; 

How can you prevent users having the EXECUTE privilege on the CREATE_TEST procedure from inserting values into tables on which they do not have any privileges? 

A. Create the CREATE_TEST procedure with definer’s rights. 

B. Grant the EXECUTE privilege to users with GRANT OPTION on the CREATE_TEST procedure. 

C. Create the CREATE_TEST procedure with invoker’s rights. 

D. Create the CREATE_TEST procedure as part of a package and grant users the EXECUTE privilege the package. 

Answer:

Explanation: If a program unit does not need to be executed with the escalated privileges of the definer, you should specify that the program unit executes with the privileges of the caller, also known as the invoker. Invoker's rights can mitigate the risk of SQL injection. 

Incorrect: 

Not A: By default, stored procedures and SQL methods execute with the privileges of their owner, not their current user. Such definer-rights subprograms are bound to the schema in which they reside. 

not B: Using the GRANT option, a user can grant an Object privilege to another user or to PUBLIC. 

Q8. In your production database, data manipulation language (DML) operations are executed on the SALES table. 

You have noticed some dubious values in the SALES table during the last few days. You are able to track users, actions taken, and the time of the action for this particular period but the changes in data are not tracked. You decide to keep track of both the old data and new data in the table long with the user information. 

What action would you take to achieve this task? 

A. Apply fine-grained auditing. 

B. Implement value-based auditing. 

C. Impose standard database auditing to audit object privileges. 

D. Impose standard database auditing to audit SQL statements. 

Answer:

Q9. Examine the query and its output: 

SQL> SELECT REASON, metric_value FROM dba_outstanding_alerts; 

REASONMETRIC_VALUE 

Tablespace [TEST] is [28 perce 28.125 nt] full 

Metrics "Current Logons Count"29 

Metrics "Database Time Spent99.0375405 waiting (%)" is at 99.03754 for event class "Application" db_recovery_file_dest_size of97 4294967296 bytes is 97.298 used and has 116228096 remaining bytes available. 

After 30 minutes, you execute the same query: 

SQL> SELECT reason, metric_value FROM dba_outstanding_alerets; 

REASONMETRIC_VALUE 

Tablespace [TEST] is [28 percs 28.125 nt] full 

What might have caused three of the alerts to disappear? 

A. The threshold alerts were cleared and transferred to d0A_alert_history. 

B. An Automatic Workload Repository (AWR) snapshot was taken before the execution of the second 

C. An Automatic Database Diagnostic Monitor (ADOM) report was generated before the execution of the second query. 

D. The database instance was restarted before the execution of the second query. 

Answer:

Q10. You execute the following PL/SQL: 

Which two statements are true? 

A. Fine-Grained Auditing (FGA) is enabled for the PRICE column in the PRODUCTS table for SELECT statements only when a row with PRICE > 10000 is accessed. 

B. FGA is enabled for the PRODUCTS.PRICE column and an audit record is written whenever a row with PRICE > 10000 is accessed. 

C. FGA is enabled for all DML operations by JIM on the PRODUCTS.PRICE column. 

D. FGA is enabled for the PRICE column of the PRODUCTS table and the SQL statements is captured in the FGA audit trial. 

Answer: A,B 

Explanation: DBMS_FGA.add_policy 

* The DBMS_FGA package provides fine-grained security functions. 

* ADD_POLICY Procedure 

This procedure creates an audit policy using the supplied predicate as the audit condition. 

Incorrect: 

Not C: object_schema 

The schema of the object to be audited. (If NULL, the current log-on user schema is assumed.)