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

certleader.com

Q1. Which three statements are true when the listener handles connection requests to an Oracle 12c database instance with multithreaded architecture enabled In UNIX? 

A. Thread creation must be routed through a dispatcher process 

B. The local listener may spawn a now process and have that new process create a thread 

C. Each Oracle process runs an SCMN thread. 

D. Each multithreaded Oracle process has an SCMN thread. 

E. The local listener may pass the request to an existing process which in turn will create a thread. 

Answer: A,D,E 

Q2. You create a new pluggable database, HR_PDB, from the seed database. Which three tablespaces are created by default in HR_PDB? 

A. SYSTEM 

B. SYSAUX 

C. EXAMPLE 

D. UNDO 

E. TEMP 

F. USERS 

Answer: A,B,E 

Explanation: * A PDB would have its SYSTEM, SYSAUX, TEMP tablespaces.It can also contains other user created tablespaces in it. * 

* Oracle Database creates both the SYSTEM and SYSAUX tablespaces as part of every database. 

* tablespace_datafile_clauses 

Use these clauses to specify attributes for all data files comprising the SYSTEM and SYSAUX tablespaces in the seed PDB. 

Incorrect: 

Not D: a PDB can not have an undo tablespace. Instead, it uses the undo tablespace belonging to the CDB. 

Note: 

* Example: CONN pdb_admin@pdb1 

SELECT tablespace_name FROM dba_tablespaces; TABLESPACE_NAME 

SYSTEM SYSAUX TEMP USERS 

SQL> 

Q3. Your database has the SRV1 service configured for an application that runs on middle-tier application server. The application has multiple modules. You enable tracing at the service level by executing the following command: 

SQL > exec DBMS_MONITOR.SERV_MOD_ACT_TRACE_ENABLE (‘SRV1’); 

The possible outcome and actions to aggregate the trace files are as follows: 

1. The command fails because a module name is not specified. 

2. A trace file is created for each session that is running the SRV1 service. 

3. An aggregated trace file is created for all the sessions that are running the SRV1 service. 

4. The trace files may be aggregated by using the trcess utility. 

5. The trace files be aggregated by using the tkprof utility. 

Identify the correct outcome and the step to aggregate by using tkprof utility? 

A. 1 

B. 2 and 4 

C. 2 and 5 

D. 3 and 4 

E. 3 and 5 

Answer:

Explanation: Tracing information is present in multiple trace files and you must use the trcsess tool to collect it into a single file. 

Incorrect: 

Not 1: Parameter service_name 

Name of the service for which tracing is enabled. 

module_name 

Name of the MODULE. An optional additional qualifier for the service. 

Note: 

* The procedure enables a trace for a given combination of Service, MODULE and ACTION name. The specification is strictly hierarchical: Service Name or Service Name/MODULE, or Service Name, MODULE, and ACTION name must be specified. Omitting a qualifier behaves like a wild-card, so that not specifying an ACTION means all ACTIONs. Using the ALL_ACTIONS constant achieves the same purpose. 

* SERV_MOD_ACT_TRACE_ENABLE Procedure 

This procedure will enable SQL tracing for a given combination of Service Name, MODULE and ACTION globally unless an instance_name is specified. 

* DBMS_MONITOR.SERV_MOD_ACT_TRACE_ENABLE( 

service_name IN VARCHAR2, 

module_name IN VARCHAR2 DEFAULT ANY_MODULE, 

action_name IN VARCHAR2 DEFAULT ANY_ACTION, 

waits IN BOOLEAN DEFAULT TRUE, 

binds IN BOOLEAN DEFAULT FALSE, 

instance_name IN VARCHAR2 DEFAULT NULL); 

Q4. You are about to plug a multi-terabyte non-CDB into an existing multitenant container database (CDB). 

The characteristics of the non-CDB are as follows: 

Version: Oracle Database 11g Release 2 (11.2.0.2.0) 64-bit Character set: AL32UTF8 National character set: AL16UTF16 O/S: Oracle Linux 6 64-bit 

The characteristics of the CDB are as follows: 

Version: Oracle Database 12c Release 1 64-bit Character Set: AL32UTF8 National character set: AL16UTF16 O/S: Oracle Linux 6 64-bit 

Which technique should you use to minimize down time while plugging this non-CDB into the CDB? 

A. Transportable database 

B. Transportable tablespace 

C. Data Pump full export/import 

D. The DBMS_PDB package 

E. RMAN 

Answer:

Explanation: * Overview, example: 

-Log into ncdb12c as sys 

-Get the database in a consistent state by shutting it down cleanly. 

-Open the database in read only mode 

-Run DBMS_PDB.DESCRIBE to create an XML file describing the database. 

-Shut down ncdb12c 

-Connect to target CDB (CDB2) 

-Check whether non-cdb (NCDB12c) can be plugged into CDB(CDB2) 

-Plug-in Non-CDB (NCDB12c) as PDB(NCDB12c) into target CDB(CDB2). 

-Access the PDB and run the noncdb_to_pdb.sql script. 

-Open the new PDB in read/write mode. 

* You can easily plug an Oracle Database 12c non-CDB into a CDB. Just create a PDB manifest file for the non-CDB, and then use the manifest file to create a cloned PDB in the CDB. 

* Note that to plugin a non-CDB database into a CDB, the non-CDB database needs to be of version 12c as well. So existing 11g databases will need to be upgraded to 12c before they can be part of a 12c CDB. 

Q5. In your multitenant container database (CDB) with two pluggable database (PDBs). You want to create a new PDB by using SQL Developer. 

Which statement is true? 

A. The CDB must be open. 

B. The CDB must be in the mount stage. 

C. The CDB must be in the nomount stage. 

D. Alt existing PDBs must be closed. 

Answer:

Explanation: 

* Creating a PDB Rather than constructing the data dictionary tables that define an empty PDB from scratch, and then populating its Obj$ and Dependency$ tables, the empty PDB is created when the CDB is created. (Here, we use empty to mean containing no customer-created artifacts.) It is referred to as the seed PDB and has the name PDB$Seed. Every CDB non-negotiably contains a seed PDB; it is non-negotiably always open in read-only mode. This has no conceptual significance; rather, it is just an optimization device. The create PDB operation is implemented as a special case of the clone PDB operation. The size of the seed PDB is only about 1 gigabyte and it takes only a few seconds on a typical machine to copy it. 

Q6. Examine this command: 

SQL > exec DBMS_STATS.SET_TABLE_PREFS (‘SH’, ‘CUSTOMERS’, ‘PUBLISH’, ‘false’); 

Which three statements are true about the effect of this command? 

A. Statistics collection is not done for the CUSTOMERS table when schema stats are gathered. 

B. Statistics collection is not done for the CUSTOMERS table when database stats are gathered. 

C. Any existing statistics for the CUSTOMERS table are still available to the optimizer at parse time. 

D. Statistics gathered on the CUSTOMERS table when schema stats are gathered are stored as pending statistics. 

E. Statistics gathered on the CUSTOMERS table when database stats are gathered are stored as pending statistics. 

Answer: C,D,E 

Explanation: * SET_TABLE_PREFS Procedure 

This procedure is used to set the statistics preferences of the specified table in the specified schema. 

* Example: Using Pending Statistics Assume many modifications have been made to the employees table since the last time statistics were gathered. To ensure that the cost-based optimizer is still picking the best plan, statistics should be gathered once again; however, the user is concerned that new statistics will cause the optimizer to choose bad plans when the current ones are acceptable. The user can do the following: 

EXEC DBMS_STATS.SET_TABLE_PREFS('hr', 'employees', 'PUBLISH', 'false'); 

By setting the employees tables publish preference to FALSE, any statistics gather from now on will not be automatically published. The newly gathered statistics will be marked as pending. 

Q7. Your multitenant container database has three pluggable databases (PDBs): PDB1, PDB2, and PDB3. 

Which two RMAN commands may be; used to back up only the PDB1 pluggable database? 

A. BACKUP PLUGGABLE DATABASE PDB1 while connected to the root container 

B. BACKUP PLUGGABLE DATABASE PDB1 while connected to the PDB1 container 

C. BACKUP DATABASE while connected to the PDB1 container 

D. BACKUP DATABASE while connected to the boot container 

E. BACKUP PLUGGABLE database PDB1 while connected to PDB2 

Answer: A,C 

Explanation: To perform operations on a single PDB, you can connect as target either to the root or directly to the PDB. 

* (A) If you connect to the root, you must use the PLUGGABLE DATABASE syntax in your RMAN commands. For example, to back up a PDB, you use the BACKUP PLUGGABLE DATABASE command. 

* (C)If instead you connect directly to a PDB, you can use the same commands that you would use when connecting to a non-CDB. For example, to back up a PDB, you would use the BACKUP DATABASE command. 

Reference: Oracle Database Backup and Recovery User's Guide 12c, About Backup and Recovery of CDBs 

Q8. You plan to migrate your database from a File system to Automata Storage Management (ASM) on same platform. 

Which two methods or commands would you use to accomplish this task? 

A. RMAN CONVERT command 

B. Data Pump Export and import 

C. Conventional Export and Import 

D. The BACKUP AS COPY DATABASE . . . command of RMAN 

E. DBMS_FILE_TRANSFER with transportable tablespace 

Answer: A,D 

Explanation: A: 

1. Get the list of all datafiles. 

. Use the convert datafile command to convert the datafile from the file system to ASM. 

Note: RMAN Backup of ASM Storage 

There is often a need to move the files from the file system to the ASM storage and vice versa. This may come in handy when one of the file systems is corrupted by some means and then the file may need to be moved to the other file system. 

D: Migrating a Database into ASM 

* To take advantage of Automatic Storage Management with an existing database you must migrate that database into ASM. This migration is performed using Recovery Manager (RMAN) even if you are not using RMAN for your primary backup and recovery strategy. 

* Example: 

Back up your database files as copies to the ASM disk group. 

BACKUP AS COPY INCREMENTAL LEVEL 0 DATABASE FORMAT '+DISK' TAG 'ORA_ASM_MIGRATION' 

Reference: Migrating Databases To and From ASM with Recovery Manager 

Q9. Examine the parameters for your database instance: 

Which three statements are true about the process of automatic optimization by using cardinality feedback? 

A. The optimizer automatically changes a plan during subsequent execution of a SQL statement if there is a huge difference in optimizer estimates and execution statistics. 

B. The optimizer can re optimize a query only once using cardinality feedback. 

C. The optimizer enables monitoring for cardinality feedback after the first execution of a query. 

D. The optimizer does not monitor cardinality feedback if dynamic sampling and multicolumn statistics are enabled. 

E. After the optimizer identifies a query as a re-optimization candidate, statistics collected by the collectors are submitted to the optimizer. 

Answer: A,C,D 

Explanation: C: During the first execution of a SQL statement, an execution plan is generated as usual. 

D: if multi-column statistics are not present for the relevant combination of columns, the optimizer can fall back on cardinality feedback. 

(not B)* Cardinality feedback. This feature, enabled by default in 11.2, is intended to improve plans for repeated executions. 

optimizer_dynamic_sampling optimizer_features_enable 

* dynamic sampling or multi-column statistics allow the optimizer to more accurately estimate selectivity of conjunctive predicates. 

Note: 

* OPTIMIZER_DYNAMIC_SAMPLING controls the level of dynamic sampling performed by the optimizer. Range of values. 0 to 10 

* Cardinality feedback was introduced in Oracle Database 11gR2. The purpose of this feature is to automatically improve plans for queries that are executed repeatedly, for which the optimizer does not estimate cardinalities in the plan properly. The optimizer may misestimate cardinalities for a variety of reasons, such as missing or inaccurate statistics, or complex predicates. Whatever the reason for the misestimate, cardinality feedback may be able to help. 

Q10. Which two statements are true when row archival management is enabled? 

A. The ORA_ARCHIVE_STATE column visibility is controlled by the ROW ARCHIVAL VISIBILITY session parameter. 

B. The ORA_ARCHIVE_STATE column is updated manually or by a program that could reference activity tracking columns, to indicate that a row is no longer considered active. 

C. The ROW ARCHIVAL VISIBILITY session parameter defaults to active rows only. 

D. The ORA_ARCHIVE_STATE column is visible if referenced in the select list of a query. 

E. The ORA_ARCHIVE_STATE column is updated automatically by the Oracle Server based on activity tracking columns, to Indicate that a row is no longer considered active. 

Answer: A,B 

Explanation: A: Below we see a case where we set the row archival visibility parameter to "all" thereby allowing us to see all of the rows that have been logically deleted: 

alter session set row archival visibility = all; 

We can then turn-on row invisibility back on by changing row archival visibility = "active": alter session set row archival visibility = all; 

B: To use ora_archive_state as an alternative to deleting rows, you need the following settings and parameters: 

1. Create the table with the row archival clause 

create table mytab (col1 number, col2 char(200)) row archival; 

2. Now that the table is marked as row archival, you have two methods for removing rows, a permanent solution with the standard delete DML, plus the new syntax where you set ora_archive_state to a non-zero value: 

update mytab set ora_archive_state=2 where col2='FRED' 

3. To make "invisible rows" visible again, you simply set the rows ora_archive_state to zero: 

update mytab set ora_archive_state=0 where col2='FRED' Note: 

* Starting in Oracle 12c, Oracle provides a new feature that allow you to "logically delete" a row in a table without physically removing the row. This effectively makes deleted rows "invisible" to all SQL and DML, but they can be revealed at any time, providing a sort of "instant" rollback method. 

To use ora_archive_state as an alternative to deleting rows.