054

65 Questions | Attempts: 31
Share
SettingsSettings
Please wait...
  • 1/65 Questions

    You plan to use adaptive thresholds as part of the performance tuning activity. You decide to increase the window size of the default moving window baseline for all metric observations and comparisons in your database. The following error occurs when you try to increase the window size through Enterprise Manager:   Failed to commit: ORA-13541: system moving window baseline size (1296000) greater than retention (1036800) ORA-06512: at "SYS.DBMS_WORKLOAD_REPOSITORY", line 601 ORA-06512: at line 2   Which action would allow you to perform the preceding task successfully? 

    • Increasing the flashback retention period
    • Increasing the retention period for SQL Management Base
    • Increasing the undo retention period for the database instance
    • Increasing the Automatic Workload Repository (AWR) retention period
Please wait...
054 - Quiz

Quiz Preview

  • 2. 

    Your system has been upgraded from Oracle Database 10g to Oracle Database 11g. You imported SQL Tuning Sets (STS) from the previous version that contains important SQL statements. You are not sure about the elapsed time that the SQL statements will have in the new system due to the version change of the optimizer. Which tool provides a comparative report with respect to the elapsed time in both versions of the optimizer? 

    • SQL Access Advisor

    • SQL Tuning Advisor (STA)

    • SQL Performance Analyzer (SPA)

    • Automatic Workload Repository (AWR) compare period report

    Correct Answer
    A. SQL Performance Analyzer (SPA)
  • 3. 

    Which is the correct description of SQL profiling while using SQL Tuning Advisor?

    • It is a set of recommendations by the optimizer to create new indexes.

    • It is auxiliary information collected by the optimizer for a SQL statement to eliminate estimation error.

    • It is a set of recommendations by the optimizer to refresh stale statistics to avoid bad execution plan.

    • It is a set of recommendations by the optimizer to restructure a SQL statement to avoid bad execution plan

    Correct Answer
    A. It is auxiliary information collected by the optimizer for a SQL statement to eliminate estimation error.
  • 4. 

    You used SQL Tuning Advisor for a long-running SQL statement that suggested a SQL profile which can be used by the query subsequently for a better execution plan. After implementing the profile, you altered the profile to include it in a category as follows:   SQL> EXEC DBMS_SQLTUNE.ALTER_SQL_PROFILE (name=> 'SYS_SQLPROF_0146ced728214000', attribute_name => 'CATEGORY', value => 'DEV2').   But the performance has not improved for the user session. The profile is enabled and on investigating the query plan, you find that the query from the user session does not use the SQL profile. View the Exhibit and examine the parameters for the user session. What could be the reason for this?   Exhibit:

    • The CONTROL_MANAGEMENT_PACK_ACCESS parameter is not set to DEV2.

    • The OPTIMIZER_MODE parameter is set to ALL_ROWS for the user session.

    • The SQLTUNE_CATEGORY parameter is set to DEFAULT for the user session.

    • The OPTIMIZER_USE_PLAN_BASELINES parameter is set to TRUE for the user session.

    Correct Answer
    A. The SQLTUNE_CATEGORY parameter is set to DEFAULT for the user session.
  • 5. 

    View the Exhibit exhibit1 to examine the series of SQL commands and parameter settings. View the Exhibit exhibit2 to examine the plans available in the SQL plan baseline. The first plan (in red) is created when OPTIMIZER_MODE is set to ALL_ROWS and the second plan (in blue) is created when OPTIMIZER_MODE is set to FIRST_ROWS. Which SQL plan baseline would be used if the SQL query in exhibit1 is executed again when the value of OPTIMIZER_MODE is set to FIRST_ROWS? Exhibit 1: Exhibit 2:  

    • The second plan, because it is a fixed plan

    • The first plan, because it is an accepted plan

    • The second plan, because it is the latest generated plan in FIRST_ROW mode

    • A new plan, because the second plan in FIRST_ROW mode is not an accepted plan

    Correct Answer
    A. The first plan, because it is an accepted plan
  • 6. 

    You are working on a development database that was upgraded to Oracle Database 11g from Oracle Database 9i. An ADDM finding in this database says that the shared pool is inadequately sized, as shown in the Exhibit. You diagnosed that this is due to different kinds of workloads and this occurs only during peak hours. You tried to resize this by shrinking the database buffer cache but that caused inadequate buffer cache problems. The following are the related parameter settings:   SQL> show parameter sga NAME                            TYPE            VALUE ------------------------------ --------------- ----------------- lock_sga                        boolean         FALSE pre_page_sga                    boolean         FALSE sga_max_size                    big integer     300M sga_target                      big integer     0   SQL> show parameter target   NAME                            TYPE            VALUE ------------------------------ --------------- ----------------- ..... fast_start_mttr_target          integer         0 memory_max_target big           integer         0 memory_target big               integer         0 pga_aggregate_target            big integer     100M sga_target big                  integer         0   You want to balance the memory between the System Global Area (SGA) components within SGA without affecting the size of the Program Global Area (PGA). Which action would solve this problem? Exhibit 1:

    • Set the SGA_TARGET parameter to 300M

    • Set the SGA_MAX_SIZE parameter to 400M

    • Set the MEMORY_TARGET parameter to 100M

    • Set the MEMORY_MAX_TARGET parameter to 300M

    Correct Answer
    A. Set the SGA_TARGET parameter to 300M
  • 7. 

    You are working on a decision support system (DSS). The index is available on the COUNTRY_ID column of the CUSTOMERS table. View the Exhibit and examine the parameter settings and the query execution plan. Why is the query using a full table scan instead of an index scan? Exhibit:

    • Because the histogram statistics for the COUNTRY_ID column are not updated

    • Because the index statistics for the index on the COUNTRY_ID column are not current

    • Because the DB_FILE_MULTIBLOCK_READ_COUNT initialization parameter is set to a higher value

    • Because the optimizer predicts that most of the blocks in the table are accessed, therefore, it uses a full table scan, even though indexes are available.

    Correct Answer
    A. Because the optimizer predicts that most of the blocks in the table are accessed, therefore, it uses a full table scan, even though indexes are available.
  • 8. 

    You have the automatic optimizer statistics gathering enabled for a 24x7 database as part of the automatic maintenance task. You observed that a few tables are being updated regularly, but not being queried often. However statistics are being gathered for these tables automatically and regularly, thereby affecting the database performance. What would you do to increase the interval of statistics collection for these tables so that the statistics collection jobs spend less time during the automatic maintenance task?

    • Set the OPTIMIZER_USE_PENDING parameter statistics to TRUE.

    • Increase the value of the STALE_PERCENT preference for these tables.

    • Mark those associated indexes that are less frequently used as invisible.

    • Increase the value of the ESTIMATE_PERCENT preference for these tables

    Correct Answer
    A. Increase the value of the STALE_PERCENT preference for these tables.
  • 9. 

    You observe that suboptimal execution plans for the queries are being generated on a table that previously used less resources. You have collected statistics on these tables two days ago. The optimizer statistics retention period is set to 31 days. You are able to find the timestamp information about statistics update from the DBA_TAB_STATS_HISTORY view. Because it is a frequently queried table, you would like the optimizer to generate better plans. Which action would enable you to use the previous set of statistics on the objects that may lead to better execution plans?

    • Restoring statistics from statistics history up to the desired time

    • Deleting all AWR snapshots collected after the time of desired statistics collection

    • Applying the flashback table technique until the time of desired statistics collection

    • Setting the OPTIMIZER_PENDING_STATISTICS parameter to TRUE to use the previous version of statistics

    Correct Answer
    A. Restoring statistics from statistics history up to the desired time
  • 10. 

    Your company wants to migrate a single instance Oracle 11g Release 1 database to a RAC environment. The database supports middle-tier applications using connection pooling for connecting to database. Being a part of the performance management team, you want to test the performance of the SQL statements and the peak workload of the applications in the new environment before upgrading the production system. Given below are some of the steps in random order to accomplish the task:   1) Capture the real workload on the existing system. 2) Create a SQL Tuning Set (STS) for the statements executed by the application. 3) Transport STS on the test environment and use SQL Tuning Advisor to compare the before and after performance. 4) Replay the workload on the test environment. 5) Analyze the divergence after replay. 6) Use Automatic Workload Repository (AWR) to capture the information for top SQL on the existing system. 7) Transport STS on the test environment and use SQL Performance Analyzer to compare the before and after performance. Identify the correct steps required to perform the test.

    • 2 and 3 only

    • 6 and 7 only

    • 1, 4, and 5 only

    • 2, 3, and 5 only

    • 2, 3, 4, and 5 only

    Correct Answer
    A. 1, 4, and 5 only
  • 11. 

    You used SQL Tuning Advisor for a long-running SQL statement that suggested a SQL profile which can be used by the query subsequently for better execution plan. View the Exhibit. But you want certain user sessions not to use this SQL profile for their queries. How would you implement this?   Exhibit:

    • Alter the SQL profile to change the category of the SQL profile.

    • Set the OPTIMIZER_USE_PENDING_STATISTICS to TRUE the desired sessions.

    • Use database resource manager to prevent the use of the SQL profile by these user sessions.

    • Use database resource manager to preUse the resource management feature in profiles of these users to prevent the use of the SQL profile.

    Correct Answer
    A. Alter the SQL profile to change the category of the SQL profile.
  • 12. 

    You work as a DBA for a company and you have the responsibility of managing one of its online transaction processing (OLTP) systems. The database encountered performance-related problems and you generated an Automatic Workload Repository (AWR) report to investigate it further. View the Exhibits and examine the AWR report. What could be the problem in this database? Exhibit 1: Exhibit 2: Exhibit 3: Exhibit 4:  

    • Java pool is not configured

    • The CPU in the system is slow

    • The shared pool size is inadequate

    • The database buffer cache is inadequate

    • The OPEN_CURSORS parameter is set to a small value

    Correct Answer
    A. The shared pool size is inadequate
  • 13. 

    Examine the initialization parameter values for the instance given below:   NAME                                  TYPE         VALUE ------------------------------------ ----------- ------------------ optimizer_capture_sql_plan_baselines boolean      FALSE optimizer_dynamic_sampling            integer      2 optimizer_features_enable             string       11.1.0.6 optimizer_index_caching               integer      0 optimizer_index_cost_adj              integer      100 optimizer_mode                        string       ALL_ROWS db_file_multiblock_read_count         integer      64   The index created on the column used in the WHERE clause of the query. You notice that the query is not using the index. Instead of an index scan, a full table scan is used. View the Exhibit and examine the autotrace output for a query. What could be the reason for it? (Choose all that apply.) Exhibit:

    • The OPTIMIZER_INDEX_COST_ADJ initialization parameter has a low value.

    • The DB_FILE_MULTIBLOCK_READ_COUNT initialization parameter has a low value.

    • The statistics for the table and all the indexes associated with the table are not current.

    • The table has less than DB_FILE_MULTIBLOCK_READ_COUNT blocks under the high-water mark.

    Correct Answer(s)
    A. The statistics for the table and all the indexes associated with the table are not current.
    A. The table has less than DB_FILE_MULTIBLOCK_READ_COUNT blocks under the high-water mark.
  • 14. 

    The columns CUST_CITY, CUST_STATE_PROVINCE, and COUNTRY_ID are frequently used together in the WHERE clause of the queries. The CUSTOMERS table is a big table with 20 GB of data. You notice that the selectivity for these three columns varies from the selectivity that the optimizer calculates. What would you recommend to influence the selectivity calculated by the optimizer?

    • Creating function-based indexes by concatenating all the columns

    • Updating histogram statistics for these columns by using the DBMS_STATS.GATHER_TABLE_STATS procedure

    • Using the DBMS_STATS.CREATE_EXTENDED_STATS function to create a virtual column and create index on the virtual column

    • Using the DBMS_STATS.CREATE_EXTENDED_STATS function to create a virtual column and the DBMS_STATS.GATHER_TABLE_STATS procedure to collect statistics on the virtual column

    Correct Answer
    A. Using the DBMS_STATS.CREATE_EXTENDED_STATS function to create a virtual column and the DBMS_STATS.GATHER_TABLE_STATS procedure to collect statistics on the virtual column
  • 15. 

    The database application developers are planning to make some major schema changes such as creating new indexes and materialized views. They want to check the net impact of these changes on the workload performance. This activity has to be performed in the production database, so they want only the query part of the data manipulation language (DML) statements to be executed so that the side effects to the database or user data can be prevented. What should they use to achieve this? 

    • Database Replay

    • SQL Tuning Advisor

    • SQL Access Advisor

    • SQL Performance Analyzer

    Correct Answer
    A. SQL Performance Analyzer
  • 16. 

    You have the automatic optimizer statistics gathering enabled for a 24x7 database as part of the automatic maintenance task. Because the automatic optimizer statistics collection runs during maintenance window (in the night), the statistics on tables that are significantly modified throughout the day becomes stale. This leads to poor query performance on these tables and you want to minimize the overhead in statistics collection. Identify a solution to this problem.

    • Change the STALE_PERCENT preference to zero for the tables.

    • Set the OPTIMIZER_USE_PENDING parameter statistics to TRUE.

    • Set the OPTIMIZER_DYNAMIC_SAMPLING parameter to zero during day time.

    • Gather statistics on the table when the tables have a representative number of rows, and then lock the statistics.

    Correct Answer
    A. Gather statistics on the table when the tables have a representative number of rows, and then lock the statistics.
  • 17. 

    The SALES table in your database undergoes frequent changes. While observing the statistics for the table in the middle of the day, you find a change since the last observation. But the information about the statistics collection is not recorded in the DBA_TAB_STATS_HISTORY. Identify the reason for this.

    • The AWR retention time was set to zero.

    • The STATISTICS_LEVEL parameter was set to BASIC.

    • Some of the statistics were collected using the ANALYZE command.

    • There were user-defined statistics that were set by using the DBMS_STATS.SET_TABLE_STATS procedure.

    Correct Answer
    A. Some of the statistics were collected using the ANALYZE command.
  • 18. 

    Identify the two direct sources from where SQL plans can be loaded into the SQL plan baselines. (Choose two.)

    • Cursor cache

    • Stored outline

    • SQL Tuning Set

    • Automatic Workload Repository (AWR) snapshots

    Correct Answer(s)
    A. Cursor cache
    A. SQL Tuning Set
  • 19. 

    Your system is upgraded from Oracle Database 10g to Oracle Database 11g. You imported SQL Tuning Sets (STS) from the previous version. After running the SQL Performance Analyzer for optimizer version change, you observe performance regression for a few SQL statements. What would you suggest to avoid performance regression for these SQL statements? 

    • Include the old plans in the SQL plan baseline.

    • Use DBMS_SPM.EVOLVE_SQL_PLAN_BASELINE to evolve plans.

    • Set the OPTIMIZER_USE_PENDING_STATISTICS parameter to TRUE.

    • Increase the value for the OPTIMIZER_DYNAMIC_SAMPLING parameter.

    Correct Answer
    A. Include the old plans in the SQL plan baseline.
  • 20. 

    You are a DBA in ABC Corp. You are working on an online transaction processing (OLTP) system. The applications running on the database use connection pooling to connect to the database to perform transactions. The company wants to upgrade the CPU and the memory for the machine on which the production database is running. To test the realistic workload on the new machine with increased CPU and memory, you identified the peak workload time for the database and captured the workload on the production system. You set up the test machine with the upgraded CPU and memory, and performed the following operations for replay: 1) You preprocessed the captured workload. 2) You restored the replay database to match the capture database at the start of the workload capture. 3) You resolved all external references. 4) You set up replay clients.   You have the following replay considerations: 1) load testing to be performed 2) all the sessions to connect immediately 3) user waits between issuing calls to be kept to a minimum   What replay options would you choose to accomplish the replay?

    • SYNCHRONIZATION = FALSE, THINK_TIME_SCALE = 0, CONNECT_TIME_SCALE = 0 and THINK_TIME_AUTO_CORRECT = FALSE

    • SYNCHRONIZATION = TRUE, THINK_TIME_SCALE = 100, CONNECT_TIME_SCALE = 0 and THINK_TIME_AUTO_CORRECT = FALSE

    • SYNCHRONIZATION = FALSE, THINK_TIME_SCALE = 100, CONNECT_TIME_SCALE = 100 and THINK_TIME_AUTO_CORRECT = TRUE

    • SYNCHRONIZATION = TRUE, THINK_TIME_SCALE = 100, CONNECT_TIME_SCALE = 100 and THINK_TIME_AUTO_CORRECT = FALSE

    Correct Answer
    A. SYNCHRONIZATION = FALSE, THINK_TIME_SCALE = 0, CONNECT_TIME_SCALE = 0 and THINK_TIME_AUTO_CORRECT = FALSE
  • 21. 

    Examine the query output shown below:   SQL> SELECT sum(pins), sum(reloads), sum(reloads)/sum(pins) FROM v$librarycache;   SUM(PINS) SUM(RELOADS) SUM(RELOADS)/SUM(PINS) ---------- ------------ ---------------------- 16479 16000 0.9709327   Which statement describes the correct interpretation of the reloads-to-pin ratio and the action to be taken?

    • This ratio is reasonable. However, decrease the shared pool size for better performance.

    • This ratio is very high and the shared pool size should be increased immediately to reduce this ratio.

    • This ratio is reasonable. However, this needs monitoring. Increase the shared pool size only if the ratio crosses 1.

    • This ratio is reasonable. However, this needs monitoring. Increase the shared pool size only if the ratio falls below 0.1.

    Correct Answer
    A. This ratio is very high and the shared pool size should be increased immediately to reduce this ratio.
  • 22. 

    You work as a DBA for a company and manage an online transaction processing (OLTP) system. You received complaints about the performance degradation of SQL statements executed by the application that uses this database. View the Exhibit and examine the output of the queries executed to investigate the performance issues. Which two actions can improve performance? (Choose two.)   Exhibit:

    • Increasing the size of the shared pool

    • Setting the CURSOR_SHARING parameter to EXACT

    • Decreasing the value set for the OPEN_CURSORS parameter

    • Replacing literals with bind variables in SQL statements with the PLAN_HASH_VALUE 1337874392

    • Replacing literals with bind variables in SQL statements with the PLAN_HASH_VALUE 1445457117

    Correct Answer(s)
    A. Increasing the size of the shared pool
    A. Replacing literals with bind variables in SQL statements with the PLAN_HASH_VALUE 1445457117
  • 23. 

    You work as a DBA for a company and you have the responsibility of managing one of its online transaction processing (OLTP) systems. The database encountered performance-related problems and you generated an Automatic Workload Repository (AWR) report to investigate it further. View the Exhibits and examine the AWR report. Which is the appropriate solution to the problem in this database? Exhibit 1: Exhibit 2: Exhibit 3: Exhibit 4:

    • Increasing the size of the shared pool

    • Adding one more CPU to the system

    • Setting the CURSOR_SHARING parameter to EXACT

    • Configuring Java pool because it is not configured

    Correct Answer
    A. Increasing the size of the shared pool
  • 24. 

    You work on an online transaction processing (OLTP) database in which the SALES table has 10,000 rows but only four distinct products are sold. View the Exhibit named HIST to check the distribution of values in the table and the histograms on the table. View the Exhibits named QUERY-1 and QUERY-2 that show details in the V$SQL view for the queries executed on the SALES table. You check the plan table and notice that both the queries that executed on the SALES table used index range scan. The second query retrieved most of the rows in the table but used index range scan. Why would the second query use the same plan?   Exhibit 1: Exhibit 2: Exhibit 3:

    • Because the plan was bind aware

    • Because the bind peeking never happened

    • Because the OPEN_CURSORS parameter is set to a very low value

    • Because the optimizer did not consider selectivity due to the use of bind variables

    Correct Answer
    A. Because the optimizer did not consider selectivity due to the use of bind variables
  • 25. 

    You are working for a company that uses huge applications to manage its customer details. During your regular performance checks, you executed the following query:   SQL> show parameter shared_pool_reserved_size NAME                         TYPE              VALUE ---------------------------------------------------- shared_pool_reserved_size    big integer     6920601   SQL> SELECT free_space, used_space, request_misses, request_failures from V$SHARED_POOL_RESERVED;   FREE_SPACE USED_SPACE REQUEST_MISSES REQUEST_FAILURES ---------- ---------- -------------- ---------------- 6469776       555528              0              113   You observed that REQUEST_FAILURES is 113 but not increasing, and also that REQUEST_MISSES is not increasing. What would you interpret from this?

    • The reserved pool is very large. Consider reducing the size of the shared pool.

    • The reserved pool is large and has free space to satisfy requests. Consider reducing the size of the reserved pool

    • The reserved pool is very small and is not finding enough memory to satisfy requests. Increase the size of the shared pool.

    • The reserved pool is very small and is not finding enough memory to satisfy requests. Increase the size of the reserved pool.

    Correct Answer
    A. The reserved pool is large and has free space to satisfy requests. Consider reducing the size of the reserved pool
  • 26. 

    You work for a company as a DBA. The company has an application to manage the details of its business and customer base. However, application users complain that updating the SALES record takes more time than it used to earlier. On investigation, you notice that the application performance degrades when a call is made to the UPDATE_INV procedure. Further, you execute the following query to investigate:   SQL> SELECT name, type, sharable_mem, kept 2 FROM v$db_object_cache 3 WHERE sharable_mem > 4000 4 AND EXECUTIONS > 5 5 AND (type='FUNCTION' OR type='PROCEDURE') 6 /   NAME                TYPE           SHARABLE_MEM    KEPT ------------------- -------------- --------------- ----------- GETEMKEY            FUNCTION             13695     YES UPDATE_INV          PROCEDURE            14766     NO SETEMUSERCONTEXT    PROCEDURE            13703     YES DECRYPT             FUNCTION             17790     YES UPDATE_DEPT         PROCEDURE            18765     NO   What would you do to improve the performance? 

    • Enable the result cache if not already enabled.

    • Flush the shared pool to make space for this procedure.

    • Keep the UPDATE_INV procedure by using the DBMS_SHARED_POOL.KEEP procedure.

    • Increase the size of the keep buffer pool to accommodate the UPDATE_INV procedure.

    • Ask the developers to modify and use literals instead of bind variables in the UPDATE_INV procedure.

    Correct Answer
    A. Keep the UPDATE_INV procedure by using the DBMS_SHARED_POOL.KEEP procedure.
  • 27. 

    View Exhibit1 and examine the indexes on the CUSTOMERS table. The statistics for the CUSTOMERS table have been updated recently by using the following command:   SQL> EXEC DBMS_STATS.GATHER_TABLE_STATS('SH','CUSTOMERS',method_opt=>'FOR ALL INDEXED COLUMNS SIZE AUTO');   View Exhibit2 to examine a query plan. Even though the index is present on the COUNTRY_ID and CUST_GENDER columns, the query uses a full table scan.   What could be the reason? Exhibit 1: Exhibit 2:

    • Because the histogram statistics for the COUNTRY_ID column are not updated

    • Because the DB_FILE_MULTIBLOCK_READ_COUNT initialization parameter is set to a high value

    • Because the optimizer calculates the cost of accessing blocks by using a full table scan to be less as compared to index scans, even though indexes are available

    • Because indexes on CUST_GENDER and COUNTRY_ID columns are of different types, the index on the CUST_GENDER column is bitmap index, and on COUNTRY_ID columns is btree index.

    Correct Answer
    A. Because the optimizer calculates the cost of accessing blocks by using a full table scan to be less as compared to index scans, even though indexes are available
  • 28. 

    Examine the following block that executes a SQL Performance Analyzer task:   begin dbms_sqlpa.execute_analysis_task(task_name => 'SPA_SKD4', execution_type => 'TEST EXECUTE', execution_name => 'before'); end;   Which two statements are true about the execution? (Choose two.)

    • It generates execution plans and execution statistics.

    • It executes only the query part of the DML statements.

    • The test plans are generated and added to plan baseline.

    • The test plans are executed, but not generated if they are available in the plan baseline.

    Correct Answer(s)
    A. It generates execution plans and execution statistics.
    A. It executes only the query part of the DML statements.
  • 29. 

    Identify two correct statements about the Active Session History (ASH) data. (Choose two.)

    • A part of SGA memory is used to store ASH data as rolling buffer.

    • The ASH data can be analyzed between any two small time intervals.

    • All ASH data in memory are flushed to disk by MMON in every 3 seconds.

    • All ASH data in memory are flushed to disk by MMNL process whenever the buffer is full.

    Correct Answer(s)
    A. A part of SGA memory is used to store ASH data as rolling buffer.
    A. The ASH data can be analyzed between any two small time intervals.
  • 30. 

    You are working on an online transaction processing (OLTP) system. By day most of the application users perform queries accessing the most recently added or modified rows. The applications have most of the queries based on multiple tables. But at night, some batch processing is also done. Which two actions would you recommend to choose a goal for the optimizer based on the needs of your application? (Choose two.)

    • Setting the OPTIMIZER_MODE parameter to ALL_ROWS at the instance level

    • Setting the OPTIMIZER_MODE parameter to FIRST_ROWS_n at the instance level

    • Asking the developer to add a hint /*ALL_ROWS*/ in the long-running batch processing queries

    • Asking the developer to add a hint /*FIRST_ROWS_n*/ in the long-running batch processing queries

    Correct Answer(s)
    A. Setting the OPTIMIZER_MODE parameter to FIRST_ROWS_n at the instance level
    A. Asking the developer to add a hint /*ALL_ROWS*/ in the long-running batch processing queries
  • 31. 

    Which three factors influence the optimizer's behavior while choosing an optimization approach and goal for a SQL statement? (Choose three.)

    • Parsing of a SQL statement

    • Operating system (OS) statistics

    • Object statistics in the data dictionary

    • The OPTIMIZER_MODE initialization parameter

    • Optimizer SQL hints for changing the query optimizer goal

    Correct Answer(s)
    A. Object statistics in the data dictionary
    A. The OPTIMIZER_MODE initialization parameter
    A. Optimizer SQL hints for changing the query optimizer goal
  • 32. 

    A user session executes a query and the plan for the query is shown in the Exhibit as Plan-1. After verifying with the SQL Access advisor, an index is created on the table in the JOB_ID column and the query is executed again. A new plan is generated against the second query shown in the Exhibit as Plan-2. When explaining the plan for the second query, you observe that the optimizer uses the first plan instead of the second. The following parameters are set for the user session:   OPTIMIZER_CAPTURE_SQL_PLAN_BASELINES=TRUE OPTIMIZER_USE_SQL_PLAN_BASELINES=TRUE SQLTUNE_CATEGORY=DEFAULT   Why does the optimizer not use the second plan?   Exhibit:

    • Because the second plan is not verified

    • Because the second plan is not part of the SQL plan baseline

    • Because the SQLTUNE_CATEGORY parameter is set to DEFAULT

    • Because the explain plan option in the user session does not allow the new plan because SQLTUNE_CATEGORY parameter is set to DEFAULT

    Correct Answer
    A. Because the second plan is not verified
  • 33. 

    The OPTIMIZER_CAPTURE_SQL_PLAN_BASELINES parameter is set to TRUE for a 24x7 database instance. The space consumption has significantly increased by the automatically captured plan baselines. You are suggested to run the following block:   BEGIN dbms_spm.configure('SPACE_BUDGET_PERCENT', 30); END;   After a few weeks of work, you observe warnings on exceeding space usage by SQL Management Base (SMB) in alert log file. Which two actions can be solutions for this? (Choose two.)

    • Increasing the AWR retention period

    • Purging the older SQL management objects

    • Increasing the size of the SYSTEM tablespace

    • Increasing the size of the SYSAUX tablespace

    Correct Answer(s)
    A. Purging the older SQL management objects
    A. Increasing the size of the SYSAUX tablespace
  • 34. 

    You are a DBA in ABC Corp. You are working on a DSS system. The applications directly connect to the database to perform transactions. The application users also perform direct loads. The company wants to upgrade from Oracle Database 10g version 10.2.0.1 to Oracle Database 11g. You want to test the performance of the SQL statements in the new environment before upgrading the production database. To accomplish this, you set up the test database with Oracle Database 11g, with the same data and schemas as in production. What would you recommend to accomplish the task?

    • Gathering all the SQL statements and using SQL Tuning Advisor on the test database for performance analysis

    • Capturing the workload on the production database, replaying it on the test machine, and comparing the performance

    • Creating a SQL Tuning Set by capturing the SQL workload on the production database and using SQL Performance Analyzer for performance analysis

    • Configuring AWR to capture the maximum number of SQL statements, transporting it to the test system, and using SQL Access Advisor for performance analysis

    Correct Answer
    A. Creating a SQL Tuning Set by capturing the SQL workload on the production database and using SQL Performance Analyzer for performance analysis
  • 35. 

    Examine the output of the following query:   SQL> SELECT c.name,a.addr,a.gets,a.misses,a.sleeps, 2 a.immediate_gets,a.immediate_misses,b.pid 3 FROM v$latch a, v$latchholder b, v$latchname c 4 WHERE a.addr = b.laddr(+) and a.latch# = c.latch# 5 AND c.name LIKE '%latch_name%' ORDER BY a.latch#;   LATCH NAME    ADDR     GETS     MISSES  SLEEPS  IMMEDIATE_GETSIMMEDIATE_MISSES ------------ -------- -------- ------- ------ -------------- ---------------- shared pool   200165448520540  14112   3137    0              0   You calculated the Gets-to-Misses ratio, which is 99834, and this ratio is dropping over a period of time. Which two actions can improve this? (Choose two.)

    • Reducing hard parses

    • Increasing the size of the shared pool

    • Using only dedicated server connections

    • Setting the CURSOR_SHARING parameter to EXACT

    • Encouraging the use of more literal SQL statements

    Correct Answer(s)
    A. Reducing hard parses
    A. Increasing the size of the shared pool
  • 36. 

    You observed that some of the queries are performing poorly on the SALES_RECORDS table in your database. On further investigation, you find that at the end of each day the contents of the SALES_RECORDS table are transferred to the SALES table and deleted from the SALES_RECORDS table. The deleted operations cause the table to be sparsely populated. You decided to use the ALTER TABLE...SHRINK SPACE COMPACT command to shrink the table. Why would you choose this method? (Choose all that apply.) 

    • Because it can be used during peak hours

    • Because it avoids unnecessary cursor invalidation

    • Because it adjusts the high-water mark (HWM) immediately

    • Because you have long-running queries that might span the shrink operation

    • Because it does not allow any data manipulation language (DML) operations, thereby making the shrink operation faster

    Correct Answer(s)
    A. Because it can be used during peak hours
    A. Because it avoids unnecessary cursor invalidation
    A. Because you have long-running queries that might span the shrink operation
  • 37. 

    You work as a consultant DBA for various clients. A performance issue in one of the online transaction processing (OLTP) systems is reported to you and you received the Automatic Workload Repository (AWR) report generated in the database. The main sections of the AWR report are shown in the Exhibits. View the Exhibit named DBTIME and note % DB Time. View the Exhibit named TIMEMODEL and note what has contributed to % DB Time. View the Exhibit named EFFICIENCY and examine the various percentages shown. Identify the option that has the correct answers for the questions given below:   1) Which factor indicates the main problem? 2) What is the main problem? 3) What solution would you recommend?   Exhibit 1 (exhibit): Exhibit 2: Exhibit 3:

    • 1) The Exhibit DBTIME shows that the DB CPU event consumed very high % DB Time. 2) The CPU is very slow. 3) Increase the number of processors

    • 1) hard parse elapsed time has the majority time in parse time elapsed, which is shown in the TIMEMODEL Exhibit. 2) This is due to inadequate Database Buffer Cache. 3) Increase the size of database buffer cache.

    • 1) sql execute elapsed time and parse time elapsed are consuming very high % DB Time in the TIMEMODEL Exhibit. 2) There are too many soft parses. 3) Investigate the HOLD_CURSOR parameter setting in the application and set it appropriately.

    • 1) % Non-Parse CPU is low and Soft Parse % is also low in the EFFICIENCY Exhibit. This shows that very few statements are found in the cache. 2) There are too many hard parses. 3) Investigate the CURSOR_SHARING parameter setting and set it appropriately.

    Correct Answer
    A. 1) % Non-Parse CPU is low and Soft Parse % is also low in the EFFICIENCY Exhibit. This shows that very few statements are found in the cache. 2) There are too many hard parses. 3) Investigate the CURSOR_SHARING parameter setting and set it appropriately.
  • 38. 

    View the Exhibit and examine a portion of the output obtained from the following query:   SQL> SELECT * FROM v$sys_time_model;   Select three correct interpretations of the time model statistics. (Choose three.) Exhibit:

    • DB time includes the wait time of all the nonidle and idle user sessions.

    • SQL execute elapsed time includes the time spent in performing fetches of query results.

    • DB CPU includes the CPU time spent on database user-level calls and background CPU time.

    • SQL execute elapsed time includes components of the hard parse elapsed time like bind elapsed time.

    • DB time includes the connection management call elapsed time excluding the background process time.

    Correct Answer(s)
    A. SQL execute elapsed time includes the time spent in performing fetches of query results.
    A. SQL execute elapsed time includes components of the hard parse elapsed time like bind elapsed time.
    A. DB time includes the connection management call elapsed time excluding the background process time.
  • 39. 

    A batch workload that historically completed in the maintenance window between 10:00 PM and midnight is currently showing poor performance and completing at 2 AM. To help in the diagnosis of the performance degradation, the senior DBA in your organization asks you to execute the awrddrpt.sql script to produce a Compare Periods report. Which two statements are true about the report produced by this script? (Choose two.) 

    • It is refreshed automatically based on the moving window baseline

    • It compares details between any two selected time periods of the same duration.

    • It normalizes the statistics by the amount of time spent on the database for each time period.

    • It compares details between two consecutive time periods of the same or different durations and is refreshed every 60 minutes.

    Correct Answer(s)
    A. It compares details between any two selected time periods of the same duration.
    A. It normalizes the statistics by the amount of time spent on the database for each time period.
  • 40. 

    View Exhibit1 to examine the description of the CUSTOMERS table. You observed that optimizer selectivity is not accurate when the CUST_STATE_PROVINCE and COUNTRY_ID columns are used together in the WHERE clause of a query. View Exhibit2 to examine the query execution plan and the commands executed to gather the statistics. The optimizer predicts that 20 rows will be processed rather than the 3,341 rows, which is the actual number of rows returned from the table. What can you do to make the optimizer detect the actual number of rows? Exhibit 1: Exhibit: 2

    • Set the STATISTICS_LEVEL parameter to ALL.

    • Set the OPTIMIZER_USE_PENDING_STATISTICS parameter to FALSE.

    • Create extended statistics for the CUST_STATE_PROVINCE and COUNTRY_ID columns.

    • Increase the STALE_PERCENT value for the CUSTOMERS table by using the DBMS_STATS. SET_TABLE_PREFS procedure.

    Correct Answer
    A. Create extended statistics for the CUST_STATE_PROVINCE and COUNTRY_ID columns.
  • 41. 

    View Exhibit1 to examine the description of the CUSTOMERS table. The CUSTOMERS table has been updated heavily today. In a frequently used SQL statement, you notice that estimated rows and the actual number of rows fetched differ greatly. The COUNTRY_ID column has an index. View Exhibit2 and examine the query execution plan. What would you recommend to improve the optimizer's estimation? Exhibit 1: Exhibit 2:

    • Setting the STATISTICS_LEVEL parameter to ALL

    • Setting the OPTIMIZER_USE_PENDING_STATISTICS parameter to FALSE

    • Creating extended statistics for the CUST_LAST_NAME, CUST_ID, and CUST_TOTAL columns

    • Updating the statistics for the CUSTOMERS table by using the DBMS_STATS.GATHER_TABLE_STATS procedure

    Correct Answer
    A. Updating the statistics for the CUSTOMERS table by using the DBMS_STATS.GATHER_TABLE_STATS procedure
  • 42. 

    Which three statements are true about performance analysis by SQL Performance Analyzer? (Choose three.)

    • It detects changes in SQL execution plans.

    • It shows only the overall impact on workload.

    • It produces results that can be used to create the SQL plan baseline.

    • It generates recommendations to run SQL Tuning Advisor to tune regressed SQL statements.

    • The importance of SQL statements to be analyzed is based on the size of the objects accessed.

    Correct Answer(s)
    A. It detects changes in SQL execution plans.
    A. It produces results that can be used to create the SQL plan baseline.
    A. It generates recommendations to run SQL Tuning Advisor to tune regressed SQL statements.
  • 43. 

    You have a range-partitioned table in your database. Each partition in the table contains the sales data for a quarter. The partition related to the current quarter is modified frequently, whereas other partitions undergo fewer data manipulations. The preferences for the table are set to their default values. You collect statistics for the table using the following command at regular intervals:   SQL> EXECUTE DBMS_STATS.GATHER_TABLE_STATS('SH','SALES',GRANULARITY=>'AUTO');   You need statistics to be collected more quickly. How do you achieve this?

    • Set the PUBLISH preference to TRUE for the partition table.

    • Set the NO_VALIDATE preference to TRUE for the partition table.

    • Set the INCREMENTAL preference to TRUE for the partition table.

    • Increase the value of the STALE_PERCENT preference for the partition table.

    Correct Answer
    A. Set the INCREMENTAL preference to TRUE for the partition table.
  • 44. 

    View the Exhibit and examine the result of Automatic SQL Tuning for a period. None of the recommended SQL profiles are implemented. What would you do to allow the Automatic SQL Tuning implement the SQL profiles automatically?   Exhibit:

    • Set the OPTIMIZER_MODE parameter to ALL_ROWS for the database instance.

    • Set the SQLTUNE_CATEGORY parameter to DEFAULT for the database instance.

    • Set the OPTIMIZER_CAPTURE_SQL_PLAN_BASELINES parameter to TRUE for the database instance.

    • Use the DBMS_SQLTUNE.SET_TUNING_TASK_PARAMETERS procedure to set ACCEPT_SQL_PROFILES to TRUE.

    Correct Answer
    A. Use the DBMS_SQLTUNE.SET_TUNING_TASK_PARAMETERS procedure to set ACCEPT_SQL_PROFILES to TRUE.
  • 45. 

    Identify the type of recommendation that can automatically be implemented by the Automatic Tuning Advisor as part of automatic SQL tuning task?

    • Recommendation for SQL profiles

    • Recommendation about effective indexing

    • Recommendation about stale or no statistics

    • Recommendation about the structure of SQL statements

    Correct Answer
    A. Recommendation for SQL profiles
  • 46. 

    Examine the output of the query given below:   SQL> SELECT mutex_type, location, sum(gets), sum(sleeps) FROM v$mutex_sleep_history GROUP BY mutex_type, location;   MUTEX_TYPE      LOCATION                SUM(GETS)            SUM(SLEEPS) -------------- -------------------- ----------------- ---------- ----------- Library Cache kglhdgn1                            62    8669586       4538 Library Cache kglget2                              2    2016618         24 Cursor Stat    kkocsStoreBindAwareStats  [KKSSTALOC8]       2975          1 Cursor Pin     kkslce                    [KKSCHLPIN2]     666831        678 Library Cache kgllkdl1                            85    3369224        110 Library Cache kglpnal1                            90     224199         13 Library Cache kglic1                              49      42068         10 Library Cache kglpin1                              4    9620087        374 Library Cache kglpndl1                            95    2065089         79   9 rows selected.   Which statement is true?

    • Each row in the output represents a SQL statement that had to wait for mutexes.

    • The Cursor Stat and Cursor Pin SLEEPS indicate that the CURSOR_SHARING parameter is set to EXACT

    • The GETS column shows the number of times a mutex/location was requested by the requesting session while being held by the blocking session

    • The sum of numbers in the GETS and SLEEPS columns indicates the number of times a mutex/location was requested by the requesting session while being held by the blocking session

    Correct Answer
    A. The GETS column shows the number of times a mutex/location was requested by the requesting session while being held by the blocking session
  • 47. 

    After running SQL Performance Analyzer (SPA), you observe a few regressed SQL statements in the SPA output. Identify the two actions that you would suggest for these regressed SQL statements. (Choose two.) 

    • Running SQL Access Advisor

    • Adding them to SQL Plan Baseline

    • Submitting them to SQL Tuning Advisor

    • Running Automatic Database Diagnostic Monitor (ADDM)

    Correct Answer(s)
    A. Adding them to SQL Plan Baseline
    A. Submitting them to SQL Tuning Advisor
  • 48. 

    View the Exhibit and examine the plans in the SQL plan baseline. You observe that the last two SELECT statements (outlined in red and blue) are identical, but have two different plans. Also, the second plan (in blue) is not being used by the optimizer. Which two steps do you perform to ensure that the optimizer uses the second plan (in blue) if the plan is more efficient? (Choose two.)   Exhibit:

    • Mark the second plan (in blue) as fixed.

    • Use SQL Tuning Advisor to tune the plan.

    • Use SQL Access Advisor to tune the plan.

    • Use the DBMS_SPM.EVOLVE_SQL_PLAN_BASELINE function to evolve the plan.

    Correct Answer(s)
    A. Use SQL Tuning Advisor to tune the plan.
    A. Use the DBMS_SPM.EVOLVE_SQL_PLAN_BASELINE function to evolve the plan.
  • 49. 

    A user in a session executed the following SQL statement to set the optimizer mode:   ALTER SESSION SET OPTIMIZER_MODE = ALL_ROWS   What impact would it have on the goal of the optimizer for that session? (Choose all that apply.)

    • Statement level OPTIMIZER_MODE hints take precedence over the session-level setting.

    • The OPTIMIZER_MODE parameter set at instance level takes precedence over the session-level value.

    • The optimizer uses a cost-based approach, regardless of the presence of statistics; it optimizes with a goal of best response time.

    • The optimizer uses a cost-based approach for all SQL statements in the session, regardless of the presence of statistics; it optimizes with a goal of best throughput.

    Correct Answer(s)
    A. Statement level OPTIMIZER_MODE hints take precedence over the session-level setting.
    A. The optimizer uses a cost-based approach for all SQL statements in the session, regardless of the presence of statistics; it optimizes with a goal of best throughput.

Quiz Review Timeline (Updated): Mar 20, 2022 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 20, 2022
    Quiz Edited by
    ProProfs Editorial Team
  • Sep 13, 2011
    Quiz Created by
    Jswhitworth
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.