Download presentation
Presentation is loading. Please wait.
Published byAnnabel Stephens Modified over 8 years ago
1
1 11g NEW FEATURES ByVIJAY
2
2 AGENDA RESULT CACHE INVISIBLE INDEXES READ ONLY TABLES DDL WAIT OPTION ADDING COLUMN TO A TABLE WITH DEFAULT VALUE. VIRTUAL COLUMNS
3
3 RESULT CACHE SQL Query Results Query result cache is used to store the results of SQL queries for re-use in subsequent executions PL/SQL Function Results provides a simple way to boost the performance of PL/SQL functions by saving the results of function calls for specific combinations of input parameters in the SGA. These results can be reused by any session calling the same function with the same parameters
4
4 ADVANTAGES Access Large Amount of Data Return Few Rows Execute Somewhat Frequently Based on Slowly Changing Data DISADVANTAGES Will Not Work With Temporary tables, SYS or SYSTEM tables Sequences (NEXTVAL or CURRVAL) Date/Time Functions – SYSDATE, CURRENT_DATE, SYS_TIMESTAMP, CURRENT_TIMESTAMP, etc Query must retrieve the most current committed state of the data No Active Transaction Against Objects in Current Session ADVANTAGES Access Large Amount of Data Return Few Rows Execute Somewhat Frequently Based on Slowly Changing Data DISADVANTAGES Will Not Work With Temporary tables, SYS or SYSTEM tables Sequences (NEXTVAL or CURRVAL) Date/Time Functions – SYSDATE, CURRENT_DATE, SYS_TIMESTAMP, CURRENT_TIMESTAMP, etc Query must retrieve the most current committed state of the data No Active Transaction Against Objects in Current Session
5
5 System Views V$RESULT_CACHE_STATISTICS –How well is the cache doing? –Monitor CREATES vs. FINDS V$RESULT_CACHE_MEMORY –Memory components and statistics V$RESULT_CACHE_OBJECTS –Objects that are in the cache along with attributes V$RESULT_CACHE_DEPENDENCY –Dependencies of the results in cache
6
6 VISIBLE AND INVISIBLE INDEXES TEST THE REMOVAL OF INDEX BEFORE DROPPING IT. PARAMETER OPTIMIZER_USE_INVISIBLE_INDEXES=TRUE
7
7 READ ONLY TABLES USED TO RESTRICT DML OPERATIONS WE CAN MAKE TABLE READ ONLY IN DIFFERENT WAYS PRIOR TO ORACLE 11G THEY ARE: CREATE A TRIGGER WHICH RAISES AN EXCEPTION CREATE A MATERIALIZED VIEW Create a check constraint with disable validate RELATED VIEW: 1.USER_TABLES
8
8 DDL WAIT OPTION DDL WAIT OPTION DDL commands require exclusive locks on internal structures. If these locks are not available the commands return with an "ORA-00054: resource busy" error message. This can be especially frustrating when trying to modify objects that are accessed frequently. To get round this Oracle 11g includes the DDL_LOCK_TIMEOUT parameter, which can be set at instance or session level using the ALTER SYSTEM and ALTER SESSION commands respectively. The DDL_LOCK_TIMEOUT parameter indicates the number of seconds a DDL command should wait for the locks to become available before throwing the resource busy error message. The default value is zero.
9
9 ADDING COLUMN WITH DEFAULT VALUE if there are some millions of records in the table and updating millions of rows will not only take a very long time, it will also fill up the undo segments, generate a large amount of redo, and create massive performance overhead. SQL> alter table product add Item_code varchar2(20) default ‘AAAAA’ not null; The above statement will not issue an update to all the existing records of the table. When a user selects the column for an existing record, Oracle gets the fact about the default value from the data dictionary and returns it to the user.So there is not storage involved, no redo and undo generation and no performance overhead.
10
10 VIRTUAL COLUMN virtual columns, allow you to create table columns which are purely expression-based and aren't stored on disk Limitations Virtual columns are not supported under external, object, cluster, temporary, or index organized tables. You can’t create virtual column as a user-defined type,large object or RAW. All columns in column expression must be of same table. The columsn expression the AS clause cannot refer to another virtual column. You can’t update a virtual column by using it in SET clause of an UPDATE statement
11
11 Thank You
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.