30. What are the types of triggers?

Expected Answer: There are 12 types of triggers in PL/SQL that consist of combinations of the BEFORE, AFTER, ROW, TABLE, INSERT, UPDATE, DELETE and ALL key words:

BEFORE ALL ROW INSERT

AFTER ALL ROW INSERT

BEFORE INSERT

AFTER INSERT etc.

 

31. A tablespace has a table with 30 extents in it. Is this bad? Why or why not.

 

Multiple extents in and of themselves aren?t bad. However if you also have chained rows this can hurt performance.

 

 

32. How do you set up tablespaces during an Oracle installation?

 

You should always attempt to use the Oracle Flexible Architecture standard or another partitioning scheme to ensure proper separation of SYSTEM, ROLLBACK, REDO LOG, DATA, TEMPORARY and INDEX segments.

 

 

33. You see multiple fragments in the SYSTEM tablespace, what should you check first?

 

Ensure that users don?t have the SYSTEM tablespace as their TEMPORARY or DEFAULT tablespace assignment by checking the DBA_USERS view.

 

 

34. What are some indications that you need to increase the SHARED_POOL_SIZE parameter?

 

Poor data dictionary or library cache hit ratios, getting error ORA-04031. Another indication is steadily decreasing performance with all other tuning parameters the same.

35. What is the general guideline for sizing db_block_size and db_multi_block_read for an application that does many full table scans?

 

Oracle almost always reads in 64k chunks. The two should have a product equal to 64 or a multiple of 64.

 

 

36. What is the fastest query method for a table

 

Fetch by rowid

 

 

37. Explain the use of TKPROF? What initialization parameter should be turned on to get full TKPROF output?

 

The tkprof tool is a tuning tool used to determine cpu and execution times for SQL statements. You use it by first setting timed_statistics to true in the initialization file and then turning on tracing for either the entire database via the sql_trace parameter or for the session using the ALTER SESSION command. Once the trace file is generated you run the tkprof tool against the trace file and then look at the output from the tkprof tool. This can also be used to generate explain plan output.

 

 

38. When looking at v$sysstat you see that sorts (disk) is high. Is this bad or good? If bad -How do you correct it?

 

If you get excessive disk sorts this is bad. This indicates you need to tune the sort area parameters in the initialization files. The major sort are parameter is the SORT_AREA_SIZe parameter.

 

 

39. When should you increase copy latches? What parameters control copy latches

 

When you get excessive contention for the copy latches as shown by the “redo copy” latch hit ratio. You can increase copy latches via the initialization parameter LOG_SIMULTANEOUS_COPIES to twice the number of CPUs on your system.

Advertisements