Previous | Table of Contents | Next |
Aside from the basic features for applications programmers, the Oracle database administrator can benefit immensely benefit from an understanding of the Oracle performance features. These features can be especially useful for routine database administration tasks, such as exports/imports, index creation, and table replication. Topics will include:
At specific times, Oracle allows its internal transaction logging mechanism to be turned off. With Oracle, the software maintains a read-consistent image of the data for long-running queries, while at the same time providing rollback capability for each update transaction. Of course, this level of recoverability carries a price tag, and significant performance improvements can be achieved with the prudent use of the unrecoverable option. In practice, use of the unrecoverable clause will improve response time from 40 to 60 percent. Care needs to be taken, of course, to synchronize the use of the unrecoverable clause with the traditional procedures used when taking backups of the archived redo logs.
Unrecoverable can be used for any of the following operations:
In a busy environment where many different applications require access to a tablespace, it is sometimes desirable to use the read-only tablespace feature of Oracle 7.3. With read-only tablespaces, separate instances can be mapped to the same tablespaces, each accessing the tablespace in read-only mode. Of course, sharing a tablespace across Oracle instances increases the risk that I/O against the shared tablespaces may become excessive. As we can see in Figure 6.1, a read-only tablespace does not have the same overhead as an updatable tablespace.
Figure 6.1 Oracle read-only tablespaces.
This approach has several advantages:
One of the primary responsibilities of the Oracle DBA is ensuring that Oracle indexes are present when they are needed to avoid full-table scans. In order to achieve this goal, the Oracle DBA needs to understand the types of indexes that Oracle provides as well as the proper time to create a table index.
Unfortunately, the Oracle dictionary does not gather statistics about how many times an index is used, so the DBA must rely upon the application developers to provide guidance regarding index placement. As Oracle moves toward Oracle8, this reliance may change, since most of the SQL will be stored within the Oracle dictionary, where the DBA can analyze the explain plan output. However, until that time, the best that an Oracle DBA can hope for is to keep the existing indexes clean and functioning optimally.
Listing 6.1 is a script that can be run to view SQL that has been loaded into the SGA shared pool.
Listing 6.1 The sqltext.sql shows all SQL in the SGA shared pool.
REM Written by Don Burleson SET PAGESIZE 9999; SET LINESIZE 79; SET NEWPAGE 0; SET VERIFY OFF; BREAK ON ADDRESS SKIP 2; COLUMN ADDRESS FORMAT 9; SELECT ADDRESS, sql_text FROM v$sqltext ORDER BY ADDRESS, PIECE;
Listing 6.2 shows the output from sqltext.sql.
Listing 6.2 The output for sqltext.sql.
D09AFC4C SELECT DECODE(object_type, 'TABLE', 2, 'VIEW', 2, 'PACKAGE', 3, 'PACKAGE BODY', 3, 'PROCEDURE', 4, 'FUNCTION', 5, 0) from all_objects where object_name = upper('V_$SQLTEXT') and object_type in ('TABLE', 'VIEW', 'PACKAGE', 'PACKAGE BODY', 'PROCEDURE', 'FUNCTION') AND owner = upper('SYS') D09B653C SELECT OWNER, table_name, table_owner, db_link FROM all_synonyms where synonym_name = upper('V_$SQLTEXT') AND owner = upper('SYS') D09BC5AC SELECT OWNER, table_name, table_owner, db_link from all_synonyms where synonym_name = upper('v$sqltext') AND (owner = 'PUBLIC' or owner = USER) D09C2D58 SELECT DECODE(object_type, 'TABLE', 2, 'VIEW', 2, 'PACKAGE', 3,'PACKAGE BODY', 3, 'PROCEDURE', 4, 'FUNCTION', 5, 0) from user_objects where object_name = upper('v$sqltext') AND object_type in ('TABLE', 'VIEW', 'PACKAGE', 'PACKAGE BODY', 'PROCEDURE', 'FUNCTION') D09CFF4C UPDATE SHPMT SET amt_sum_ili=:b1,pmt_wght_sum_ili=:b2,cust_pmt_wght_sum_ili= :b3 WHERE shpmt_id = :b4 AND shpmt_sys_src_cd = :b5
Previous | Table of Contents | Next |