+ All Categories
Home > Documents > OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC)...

OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC)...

Date post: 15-Jan-2016
Category:
View: 214 times
Download: 0 times
Share this document with a friend
84
OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175
Transcript
Page 1: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

OracleWorld 2002

Oracle9i PL/SQL New FeaturesJoe Trezzo

The Ultimate Software Consultants (TUSC)Abstract Number 32175

Page 2: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 2

The Essence of a New Day

This is the beginning of a new day. You have been given this day to do as you will. You can waste it or use it for good. What you do today is important because you are exchanging a day of your life for it. When tomorrow comes, this day will be gone forever; in its place is something that you have left behind…let it be something good.

Page 3: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 3

Audience Knowledge

• Oracle Experience• Developer Experience• DBA Experience• PL/SQL Knowledge• Oracle8i Experience• Oracle9i Experience

Page 4: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 4

Presentation Goals/Non-Goals

• Goals– Highlight New Oracle9i PL/SQL Features– Highlight Oracle9i Features– Add to your Arsenal of PL/SQL

Knowledge

• Non-Goals– Detail Every New PL/SQL Feature

Page 5: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 5

Presentation Outline

Oracle PL/SQL Version History Oracle 9i PL/SQL Compiler Limits & Internal

Improvements New Data Types New Built-In Functions New SQL Commands New Native PL/SQL Compilation Expanded Oracle Supplied Packages Additional Oracle9i Features

Page 6: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 6

Oracle PL/SQL Version History

Page 7: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 7

Oracle PL/SQL Version History

• Oracle and PL/SQL HistoryOracle Database Version PL/SQL Version

6.x 1.07.0 2.07.1 2.17.2 2.27.3 2.38.0 8.08.1.5 (Oracle8i) 8.1.58.1.6 (Oracle8i R2) 8.1.68.1.7 (Oracle8i R3) 8.1.79.0 (Oracle9i) 9.09.2 (Oracle9i R2) 9.2

Page 8: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 8

Oracle PL/SQL Version History

• Oracle8i (Release 3)

• Oracle9i R2

SELECT bannerFROM v$version;

BANNER--------------------------------------------------------------Oracle8i Enterprise Edition Release 8.1.7.0.0 - ProductionPL/SQL Release 8.1.7.0.0 - Production

BANNER--------------------------------------------------------------Oracle9i Enterprise Edition Release 9.2.0.1.0 - ProductionPL/SQL Release 9.2.0.1.0 – Production

Page 9: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 9

Oracle 9i PL/SQL Compiler Limits & Internal Improvements

Page 10: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 10

Oracle PL/SQL Compiler Limits

Item Limit bind variables passed to a program unit 32K exception handlers in a program unit 64K fields in a record 64K levels of block nesting 255 levels of record nesting 32 levels of subquery nesting 254 levels of label nesting 98 magnitude of a BINARY_INTEGER value 2G magnitude of a PLS_INTEGER value 2G objects referenced by a program unit 64K parameters passed to an explicit cursor 64K parameters passed to a function or procedure 64K precision of a FLOAT value (binary digits) 126 precision of a NUMBER value (decimal digits) 38

Page 11: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 11

Oracle PL/SQL Compiler Limits

Item Limit precision of a REAL value (binary digits) 63 size of an identifier (characters) 30 size of a string literal (bytes) 32K size of a CHAR value (bytes) 32K size of a LONG value (bytes) 32K-7 size of a LONG RAW value (bytes) 32K-7 size of a RAW value (bytes) 32K size of a VARCHAR2 value (bytes) 32K size of an NCHAR value (bytes) 32K size of an NVARCHAR2 value (bytes) 32K size of a BIFLE value (bytes) 4G size of a BLOB value (bytes) 4G size of a CLOB value (bytes) 4G size of an NCLOB value (bytes) 4G

Page 12: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 12

Oracle System Options

• Oracle9i R2 Options Detail on Your System

– 48 Options Listed and Only 2 Set to False By Default

SELECT *FROM v$option;

PARAMETER VALUE ------------------------- --------------- Partitioning TRUE Objects TRUE Real Application Clusters FALSE Advanced replication TRUE Bit-mapped indexes TRUE Connection pooling TRUE Oracle Label Security FALSE

Page 13: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 13

Internal PL/SQL Enhancements

• Integration of SQL and PL/SQL Parsers– Prior to Oracle9i

• Separate SQL Parser for SQL Engine and PL/SQL Engine

– Oracle9i• SQL Parser the Same for SQL Engine and PL/SQL Engine

• Internal PL/SQL Performance Improvements– SQL and PL/SQL Runtime Engines Integration– Reduction of Calling PL/SQL from SQL (60%+)– Cross Package References Handled More Efficiently

Page 14: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 14

New Data Types

Page 15: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 15

New Data Types

• New Date/Time Data Types– TIMESTAMP (fractional_seconds_precision)

• Year, month, and day values of date, as well as hour, minute, and second values of time, where fractional_seconds_precision is the number of digits in the fractional part of the SECOND datetime field. Accepted values of fractional_seconds_precision are 0 to 9. The default is 6.

– TIMESTAMP (fractional_seconds_precision) WITH TIME ZONE • All values of TIMESTAMP as well as time zone displacement value, where fractional_seconds_precision is the number of digits in the fractional part of the SECOND datetime field. Accepted values are 0 to 9. The default is 6.

– TIMESTAMP (fractional_seconds_precision) WITH LOCAL TIME ZONE • All values of TIMESTAMP WITH TIME ZONE, with the following

exceptions: Data is normalized to the database time zone when it is stored in

the database. When the data is retrieved, users see the data in the session time

zone.

Page 16: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 16

New Data Types

• New Date/Time Data Types– INTERVAL YEAR (year_precision) TO MONTH

• Stores a period of time in years and months, where year_precision is the number of digits in the YEAR datetime field. Accepted values are 0 to 9. The default is 2.

– INTERVAL DAY (day_precision) TO SECOND (fractional_seconds_precision) • Stores a period of time in days, hours, minutes, and seconds, where

day_precision is the maximum number of digits in the DAY datetime field. Accepted values are 0 to 9. The default is 2.

fractional_seconds_precision is the number of digits in the fractional part of the SECOND field. Accepted values are 0 to 9. The default is 6.

– Tables for Reference• Oracle9i SQL Reference

– fractional_seconds_precision depends on your database server platform• Oracle Enterprise Edition Release 9.2.0.1.0 on a Compaq Tru64 UNIX the number of digits

was 6 maximum• Oracle Enterprise Edition Release 9.2.0.1.0 on Windows 2000 Professional the number of

digits was 3 maximum

Page 17: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 17

New Data Types

• TIMESTAMP Data Type Example– Create transaction table TIMESTAMP data type

– Two records inserted with SYSDATE value

– Two records inserted with SYSTIMESTAMP value

CREATE TABLE transactions(trans_id VARCHAR2(5), trans_date TIMESTAMP(9));

INSERT INTO transactions VALUES ('1', SYSDATE);INSERT INTO transactions VALUES ('2', SYSDATE);

INSERT INTO transactions VALUES ('3', SYSTIMESTAMP);INSERT INTO transactions VALUES ('4', SYSTIMESTAMP);

Page 18: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 18

New Data Types

• TIMESTAMP Data Type Example– Four Records selected from transaction Table

– Use SYSTIMESTAMP versus SYSDATE to set timestamp datatypes

SELECT * FROM transactions;

TRANS_ID TRANS_DATE -------- ---------------------------------------------- 1 11-OCT-02 08.05.09.000000000 AM 2 11-OCT-02 08.05.12.000000000 AM 3 11-OCT-02 08.05.26.534392000 AM

4 11-OCT-02 08.05.29.921128000 AM

Page 19: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 19

New Data Types

• TIMESTAMP Data Type Example– Attempting to change the precision to a

lower value is only allowed if the column is empty as shown belowALTER TABLE transactions MODIFY trans_date TIMESTAMP(6);

ERROR at line 1:ORA-30082: datetime/interval column to be modified must be empty to decrease fractional second or leading field precision

Page 20: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 20

New Built-in Functions

Page 21: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 21

New Built-In Functions

• Several New Built-In Functions• Covered in SQL Reference Manual• List of New Functionsasciistr bin_to_num coalesce composecurrent_date current_timestamp dbtimezone decomposeexistsnode extract (datetime) extract (xml) firstfrom_tz group_id grouping_id lastlocaltimestamp nullif percentile_cont percentile_discrawtonhex rowidtonchar sessiontimezone sys_connect_by_pathsys_dburigen sys_extract_utc sys_xmlagg sys_xmlgen systimestamp to_char (character) to_clob to_dsinterval to_nchar (character) to_nchar (datetime) to_nchar (number) to_nclob to_timestamp to_timestamp_tzto to_yminterval treattz_offset unistr width_bucket

Page 22: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 22

New Built-In Functions

• New NULL Type Functions– NULLIF

• Returns NULL if values match, otherwise returns first value

– COALESCE• Returns first non-NULL value in list

– SQL and PL/SQL Functions

Page 23: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 23

New Built-In Functions

• New NULL Type FunctionsSELECT NULLIF('XXX','XXX') col1, NULLIF('XXX','AAA') col2, COALESCE(NULL, NULL, 123, 456) col3, COALESCE(NULL, NULL, NULL, 789) col4FROM DUAL;

COL1 COL2 COL3 COL4---- ---- ---------- ---------- XXX 123 789

Page 24: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 24

New Built-In Functions

• New NULL Type FunctionsSET SERVEROUTPUT ON SIZE 1000000DECLARE x1 PLS_INTEGER := 1234; x2 PLS_INTEGER := 1234; x3 PLS_INTEGER := 5678; x4 PLS_INTEGER; x5 PLS_INTEGER; x6 PLS_INTEGER; x7 PLS_INTEGER; x8 PLS_INTEGER;BEGIN x5 := NULLIF(x1, x2); X6 := NULLIF(x4, x1); X7 := COALESCE(x3, x4, 4321); X8 := COALESCE(x4, x5, x1); DBMS_OUTPUT.PUT_LINE('x5: ' || x5); DBMS_OUTPUT.PUT_LINE('x6: ' || x6); DBMS_OUTPUT.PUT_LINE('x7: ' || x7); DBMS_OUTPUT.PUT_LINE('x8: ' || x8);END;/

Page 25: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 25

New Built-In Functions

• New NULL Type Functionsx5:x6:x7: 5678x8: 1234

PL/SQL procedure successfully completed.

Page 26: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 26

New Built-In Functions

• New CASE Expression– Similar to IF Statement– Multiple Methods of Writing Statements

• Selector Option• Search Option

– Boolean Evaluation: If TRUE, CASE Terminated– Recommendation: Order CASE Conditions

Based on Most Highly Evaluated to TRUE First– Sets a Variable: Treated as Function– If No Match, Returns a NULL

Page 27: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 27

New Built-In Functions

• New CASE Expression– Selector Option

DECLARE customer_rating VARCHAR2(10); customer_credit VARCHAR2(1);BEGIN customer_credit := 'B'; customer_rating := CASE customer_credit WHEN 'A' THEN 'Rank 1' WHEN 'B' THEN 'Rank 2' WHEN 'C' THEN 'Rank 3' ELSE 'Rank 5' END; DBMS_OUTPUT.PUT_LINE('Customer Ranking: ' || customer_rating);END;/Customer Ranking: Rank 2

PL/SQL procedure successfully completed.

Page 28: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 28

New Built-In Functions

• New CASE Expression– Search Option

DECLARE customer_rating VARCHAR2(10); customer_credit VARCHAR2(1);BEGIN customer_credit := 'B'; customer_rating := CASE WHEN customer_credit = 'A' THEN 'Rank 1' WHEN customer_credit = 'B' THEN 'Rank 2' WHEN customer_credit = 'C' THEN 'Rank 3' ELSE 'Rank 5' END; DBMS_OUTPUT.PUT_LINE('Customer Ranking: ' || customer_rating);END;/Customer Ranking: Rank 2

PL/SQL procedure successfully completed.

Page 29: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 29

New Built-In Functions

• New CASE Statement– Similar to CASE Expression, but Each

Condition Contains a PL/SQL Command– Not Treated as a Function– If No Match, Raises a

CASE_NOT_FOUND Exception

Page 30: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 30

New Built-In Functions

• New CASE Statement– Selector Option

DECLARE customer_rating VARCHAR2(10); customer_credit VARCHAR2(1);BEGIN customer_credit := 'B'; CASE customer_credit WHEN 'A' THEN customer_rating := 'Rank 1'; WHEN 'B' THEN customer_rating := 'Rank 2'; WHEN 'C' THEN customer_rating := 'Rank 3'; ELSE customer_rating := 'Rank 5'; END CASE; DBMS_OUTPUT.PUT_LINE('Customer Ranking: ' || customer_rating);END;/Customer Ranking: Rank 2

PL/SQL procedure successfully completed.

Page 31: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 31

New Built-In Functions

• New CASE Statement– Search Option

DECLARE customer_rating VARCHAR2(10); customer_credit VARCHAR2(1);BEGIN customer_credit := 'B'; CASE WHEN customer_credit='A' THEN customer_rating:='Rank 1'; WHEN customer_credit='B' THEN customer_rating:='Rank 2'; WHEN customer_credit='C' THEN customer_rating:='Rank 3'; ELSE customer_rating:='Rank 5'; END CASE; DBMS_OUTPUT.PUT_LINE('Customer Ranking: ' || customer_rating);END;/Customer Ranking: Rank 2

PL/SQL procedure successfully completed.

Page 32: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 32

New SQL Commands

Page 33: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 33

New SQL Commands

• 3 New SQL Commands• Covered in SQL Reference Manual• List of New Commands

– CREATE PFILE– CREATE SPFILE– MERGE

Page 34: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 34

New SQL Commands

• Merge Statement– Insert or Update Operation in One Statement

• If record exists, update the record• If record does not exist, insert the record

– Example Scenario• System 1:

– Internal ADP Payroll Processing– ADP is the Single Point of New/Updates of Employees– Cannot Update Database Structures

• System 2:– Time and Expense (T&E) Entry System– Replicate the Master Employee Table

Page 35: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 35

New SQL Commands

• Merge Statement– Example Scenario

• Prior to Oracle9i– Execute a Scheduled Routine to Update System 2

Master Emps– ADP Employee Information Updates T&E

Employee Information– Select Each ADP Employee– If Exists in T&E, then Update– If Not Exists in T&E, then Insert

• Oracle9i– Superceded with the Merge Statement

Page 36: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 36

New SQL Commands

• Example ScenarioSELECT employee_id, title, salary FROM adp_employees;

EMPLOYEE_ID TITLE SALARY----------- ------------------------- ---------- 1 PRESIDENT and COO 5000 2 VP, OPERATIONS 1450 3 VP, SALES 1400 4 VP, FINANCE 1450 5 VP, ADMINISTRATION 1550

SELECT employee_id, title, salary FROM employees;

EMPLOYEE_ID TITLE SALARY----------- ------------------------- ---------- 1 PRESIDENT 2500 2 VP, OPERATIONS 1450 3 VP, SALES 1400

Page 37: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 37

New SQL Commands

• Prior to Oracle9iSET SERVEROUTPUT 1000000DECLARE lv_adp_employee adp_employees.employee_id%TYPE; CURSOR cur_adp_employee IS SELECT employee_id, title, salary FROM adp_employees; CURSOR cur_employee IS SELECT employee_id, title, salary FROM employees where employee_id = lv_adp_employee;

lv_cur_employee cur_employee%ROWTYPE; lv_emp_insert PLS_INTEGER := 0; lv_emp_update PLS_INTEGER := 0;BEGIN FOR lv_cur_adp_employee_rec IN cur_adp_employee LOOP lv_adp_employee := lv_cur_adp_employee_rec.employee_id; OPEN cur_employee; FETCH cur_employee INTO lv_cur_employee;

Page 38: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 38

New SQL Commands

• Prior to Oracle9iIF cur_employee%FOUND THEN UPDATE employees SET title = lv_cur_adp_employee_rec.title, salary = lv_cur_adp_employee_rec.salary WHERE employee_id = lv_cur_adp_employee_rec.employee_id; lv_emp_update := lv_emp_update + 1; ELSE INSERT INTO employees (employee_id, title, salary) VALUES (lv_cur_adp_employee_rec.employee_id, lv_cur_adp_employee_rec.title, lv_cur_adp_employee_rec.salary); lv_emp_insert := lv_emp_insert + 1; END IF; CLOSE cur_employee; END LOOP; DBMS_OUTPUT.PUT_LINE('Records Inserted: ' || lv_emp_insert); DBMS_OUTPUT.PUT_LINE('Records Updated: ' || lv_emp_update);END;/

Page 39: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 39

New SQL Commands

• Prior to Oracle9iRecords Inserted: 2Records Updated: 3

PL/SQL procedure successfully completed.

Page 40: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 40

New SQL Commands

• Merge StatementMERGE INTO employees destUSING(SELECT employee_id, title, salaryFROM adp_employees) origON (dest.employee_id = orig.employee_id)WHEN MATCHED THEN UPDATE SET dest.title = orig.title, dest.salary = orig.salaryWHEN NOT MATCHED THEN INSERT (dest.employee_id, dest.title, dest.salary) VALUES (orig.employee_id, orig.title, orig.salary);

5 rows merged.

Page 41: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 41

New SQL Commands

• Merge StatementSELECT employee_id, title, salary FROM employees;

EMPLOYEE_ID TITLE SALARY----------- ------------------------- ---------- 1 PRESIDENT and COO 5000 2 VP, OPERATIONS 1450 3 VP, SALES 1400 4 VP, FINANCE 1450 5 VP, ADMINISTRATION 1550

Page 42: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 42

New Native PL/SQL Compilation

Page 43: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 43

New PL/SQL Compilation

• Native Compilation of PL/SQL Code– Prior to Oracle9i

• PL/SQL Code Stored in the Database• Upon Creation, Compiled into Byte Code (p-code)• Upon Execution, Loaded into Memory and Interpreted

– Oracle9i Option• Convert PL/SQL Code into C Code• Becomes a Shared Library and Linked into Executable• Advantage: For Compute Intensive PL/SQL with

Limited SQL Code, Faster Execution

Page 44: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 44

New PL/SQL Compilation

• Native Compilation of PL/SQL Code– Oracle9i Option

• Steps to Use:– Update $ORACLE_HOME/plsql/spnc_makefile.mk– Set the Following Init.ora Values:

• PLSQL_NATIVE_LIBRARY_DIR• PLSQL_NATIVE_LIBRARY_SUBDIR_COUNT • PLSQL_NATIVE_MAKE_UTILITY • PLSQL_NATIVE_MAKE_FILE_NAME

– Set the PLSQL_COMPILER_FLAGS Init.ora Value• INTERPRETED (default)• NATIVE (C compilation)• Can Modify with an ALTER SESSION

Page 45: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 45

New PL/SQL Compilation

• Native Compilation of PL/SQL CodeDESCRIBE user_stored_settings Name Null? Type ----------------------- -------- ---------------------------- OBJECT_NAME NOT NULL VARCHAR2(30) OBJECT_ID NOT NULL NUMBER OBJECT_TYPE VARCHAR2(12) PARAM_NAME NOT NULL VARCHAR2(30) PARAM_VALUE VARCHAR2(4000)

SELECT * FROM user_stored_settings;

no rows selected

Page 46: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 46

New PL/SQL Compilation

• Native Compilation of PL/SQL CodeCREATE PROCEDURE xyz ASBEGIN DBMS_OUTPUT.PUT_LINE('Hello');END;/

Procedure created.

SET SERVEROUTPUT ONEXECUTE xyzHello

PL/SQL procedure successfully completed.

Page 47: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 47

New PL/SQL Compilation

• Native Compilation of PL/SQL CodeSELECT * FROM user_stored_settings;

OBJECT OBJ_ID OBJ_TYPE PARAM_NAME PARAM_VALUE------ ------ --------- -------------------- ------------ XYZ 32506 PROCEDURE plsql_compiler_flags INTERPRETED, NON_DEBUG XYZ 32506 PROCEDURE nls_length_semantics BYTE

ALTER SESSION SET plsql_compiler_flags = native;

Session altered.

CREATE PROCEDURE abc ASBEGIN DBMS_OUTPUT.PUT_LINE('Good Bye');END;/

Page 48: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 48

New PL/SQL Compilation

• Native Compilation of PL/SQL CodeSET SERVEROUTPUT ONEXECUTE abcGood Bye

PL/SQL procedure successfully completed.

SELECT * FROM user_stored_settingsWHERE object_name = 'ABC';

OBJECT OBJ_ID OBJ_TYPE PARAM_NAME PARAM_VALUE------ ------ --------- -------------------- ------------- ABC 32508 PROCEDURE plsql_compiler_flags NATIVE,NON_DE BUG ABC 32508 PROCEDURE nls_length_semantics BYTE

Page 49: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 49

Expanded Oracle Supplied Packages

Page 50: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 50

Expanded Oracle Supplied Packages

• Identify Packages Installed By Default (catproc.sql)– Groups Packages Installed– Provides Short Description of Grouping

• New Reference Manual in Oracle 8.1 (Oracle8i Supplied Package Reference)– Covers 70 Packages– Includes Many of the Packages Prior to Oracle8i

• Oracle9i Supplied PL/SQL Packages and Type Reference– Covers over 100 Packages

• Several Packages Upgraded and Enhanced

Page 51: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 51

Expanded Oracle Supplied Packages

• List of New Oracle9i Oracle Supplied Packages

DBMS_AQELM DBMS_ENCODEDBMS_FGA DBMS_FLASHBACKDBMS_LDAP DBMS_LIBCACHE DBMS_LOGMNR_CDC_PUBLISH DBMS_LOGMNR_CDC_SUBSCRIBE DBMS_METADATA DBMS_ODCI DBMS_OUTLN_EDIT DBMS_REDEFINITION DBMS_TRANSFORM DBMS_WMDBMS_XMLGEN DBMS_XMLQUERYDMBS_XMLSAVE UTL_ENCODEUTL_URL

Page 52: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 52

Expanded Oracle Supplied Packages

• List of New Oracle9i R2 Oracle Supplied Packages

DBMS_APPLY_ADM DBMS_CAPTURE_ADM DBMS_LOGSTDBY DBMS_MGWADM DBMS_MGWMSG DBMS_PROPAGATION_ADM DBMS_RULE DBMS_RULE_ADM DBMS_STORAGE_MAP DBMS_STREAMS DBMS_STREAMS_ADM DBMS_XDB DBMS_XDBT DBMS_XDB_VERSION DBMS_XMLDOM DBMS_XMLPARSER

DBMS_XPLAN DBMS_XSLPROCESSOR

Page 53: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 53

Expanded Oracle Supplied Packages

• View List of Supplied Packages on Your SystemSELECT object_nameFROM all_objectsWHERE owner = 'SYS'AND object_type = 'PACKAGE'ORDER BY object_name;

OBJECT_NAME------------------------------DBMS_APPLICATION_INFODBMS_OUTPUTDBMS_PIPEDBMS_SESSIONDBMS_SHARED_POOL

Page 54: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 54

Expanded Oracle Supplied Packages

• DBMS_REDEFINITION Package– Perform Redefinition Online While Table Being

Accessed

– Change Table Structure, Storage, etc.

– Creation Script: dbmshord.sql• Called By catproc.sql script

• Located in $ORACLE_HOME/rdbms/admin Directory

– Grant Privilege on Package to Schema• EXECUTE Privilege or EXECUTE_CATALOG_ROLE

Page 55: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 55

Expanded Oracle Supplied Packages

• DBMS_REDEFINITION Package(DESCRIBE)PROCEDURE CAN_REDEF_TABLE

Argument Name Type In/Out Default? --------------------------- ----------------------- ------ -------- UNAME VARCHAR2 IN TNAME VARCHAR2 INPROCEDURE START_REDEF_TABLE Argument Name Type In/Out Default? --------------------------- ----------------------- ------ -------- UNAME VARCHAR2 IN ORIG_TABLE VARCHAR2 IN INT_TABLE VARCHAR2 IN COL_MAPPING VARCHAR2 IN DEFAULTPROCEDURE FINISH_REDEF_TABLE Argument Name Type In/Out Default? --------------------------- ----------------------- ------ -------- UNAME VARCHAR2 IN ORIG_TABLE VARCHAR2 IN INT_TABLE VARCHAR2 IN

Page 56: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 56

Expanded Oracle Supplied Packages

• DBMS_REDEFINITION Package(DESCRIBE)PROCEDURE SYNC_INTERIM_TABLE

Argument Name Type In/Out Default? --------------------------- ----------------------- ------ -------- UNAME VARCHAR2 IN ORIG_TABLE VARCHAR2 IN INT_TABLE VARCHAR2 INPROCEDURE ABORT_REDEF_TABLE Argument Name Type In/Out Default? --------------------------- ----------------------- ------ -------- UNAME VARCHAR2 IN ORIG_TABLE VARCHAR2 IN INT_TABLE VARCHAR2 IN

Page 57: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 57

Expanded Oracle Supplied Packages

• DBMS_REDEFINITION Package Example– Create Employee TableCREATE TABLE s_employee

(employee_id NUMBER(7) CONSTRAINT s_employee_id_nn NOT NULL, employee_last_name VARCHAR2(25) CONSTRAINT s_employee_last_name_nn

NOT NULL, employee_first_name VARCHAR2(25), userid VARCHAR2(8), start_date DATE, comments VARCHAR2(255), manager_id NUMBER(7), title VARCHAR2(25), department_id NUMBER(7), salary NUMBER(11, 2), commission_pct NUMBER(4, 2), CONSTRAINT s_employee_id_pk PRIMARY KEY (employee_id), CONSTRAINT s_employee_userid_uk UNIQUE (userid), CONSTRAINT s_employee_commission_pct_ck CHECK (commission_pct IN (10, 12.5, 15, 17.5, 20)));

Page 58: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 58

Expanded Oracle Supplied Packages

• DBMS_REDEFINITION Package Example– 25 Records Inserted into Employee Table– Assume the Following Desired:

• Remove COMMENTS Column• Add FULL_NAME Column• Change DEPARTMENT_ID Column Name to DEPT_ID• Increase Salary of All Employees by 50%

– Step 1: Ensure Table Can be Redefined• Execute CAN_REDEF_TABLE Procedure• If Execution Succeeds without Error, Then can

Redefine

Page 59: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 59

Expanded Oracle Supplied Packages

• DBMS_REDEFINITION Package Example– Step 1: Ensure Table Can be Redefined

– Success: s_employee Table Can be Redefined– Illustration of a Table that Cannot Be

Redefined• Create TEMP Table• Execute CAN_REDEF_TABLE• Error Due to No Primary Key in Table

EXECUTE dbms_redefinition.can_redef_table('plsql_user','s_employee')

PL/SQL procedure successfully completed.

Page 60: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 60

Expanded Oracle Supplied Packages

• DBMS_REDEFINITION Package Example– Illustration of a Table that Cannot Be Redefined

– Set of Criteria Checked to Ensure Redefinition Allowed

CREATE TABLE temp(temp VARCHAR2(10));

EXECUTE dbms_redefinition.can_redef_table('plsql_user','temp')begin dbms_redefinition.can_redef_table('plsql_user','temp'); end;

*ERROR at line 1:ORA-12089: cannot online redefine table "PLSQL_USER"."TEMP" with no primary keyORA-06512: at "SYS.DBMS_REDEFINITION", line 8ORA-06512: at "SYS.DBMS_REDEFINITION", line 236ORA-06512: at line 1

Page 61: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 61

Expanded Oracle Supplied Packages

• DBMS_REDEFINITION Package Example– Criteria Detailed:

• Oracle9i Database Administration Guide (Chp. 15)

• Oracle9i Supplied PL/SQL Packages Reference (Chp. 45)

– Step 2: Create Temporary Table with New Structure

CREATE TABLE temp_s_employee(employee_id NUMBER(7) CONSTRAINT s_employee_id_nn2 NOT NULL, employee_last_name VARCHAR2(25) CONSTRAINT s_employee_last_name_nn2 NOT NULL, employee_first_name VARCHAR2(25), employee_full_name VARCHAR2(51), userid VARCHAR2(8), start_date DATE, manager_id NUMBER(7), title VARCHAR2(25), dept_id NUMBER(7), salary NUMBER(11, 2), commission_pct NUMBER(4, 2), CONSTRAINT s_employee_id_pk2 PRIMARY KEY (employee_id), CONSTRAINT s_employee_userid_uk2 UNIQUE (userid), CONSTRAINT s_employee_commission_pct_ck2 CHECK (commission_pct IN (10, 12.5, 15, 17.5, 20)));

Page 62: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 62

Expanded Oracle Supplied Packages

• DBMS_REDEFINITION Package Example– Step 3: Start the Redefinition Process

• Execute START_REDEF_TABLE Procedure• Map Existing Columns to Temporary Table

ColumnsBEGIN dbms_redefinition.start_redef_table('plsql_user', 's_employee','temp_s_employee', 'employee_id employee_id, employee_last_name employee_last_name, employee_first_name employee_first_name, employee_first_name||'' ''||employee_last_name employee_full_name, userid userid, start_date start_date, manager_id manager_id, title title, department_id dept_id, salary * 1.5 salary, commission_pct commission_pct');END;/

Page 63: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 63

Expanded Oracle Supplied Packages

• DBMS_REDEFINITION Package Example– Step 3: Start the Redefinition Process

• If Singe Quote Desired, Use 2 Single Quotes (Line 7)• Standard SELECT Capabilities Valid in Column Mapping• Once Step 3 Complete, 25 Records Inserted into

Temporary Table– Step 4: Complete the Redefinition Process

• Execute FINISH_REDEF_TABLE Procedure• Synchronizes the Redefinition and Applies the Temporary

Architecture and Contents to the Existing Table• Prior to Executing the FINISH_REDEF_TABLE Procedure,

Option to Execute SYNC_INTERIM_TABLE Procedure to Synchronize Table Contents and Reduce the Completion Process Time

Page 64: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 64

Expanded Oracle Supplied Packages

• DBMS_REDEFINITION Package Example– Step 4: Complete the Redefinition

ProcessBEGIN dbms_redefinition.sync_interim_table('plsql_user', 's_employee','temp_s_employee');END;/

BEGIN dbms_redefinition.finish_redef_table('plsql_user', 's_employee','temp_s_employee'); END; /

Page 65: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 65

Expanded Oracle Supplied Packages

• DBMS_REDEFINITION Package Example– Step 4: Complete the Redefinition

ProcessDESCRIBE s_employee Name Null? Type ------------------------------- -------- ---- EMPLOYEE_ID NOT NULL NUMBER(7) EMPLOYEE_LAST_NAME NOT NULL VARCHAR2(25) EMPLOYEE_FIRST_NAME VARCHAR2(25) EMPLOYEE_FULL_NAME VARCHAR2(51) USERID VARCHAR2(8) START_DATE DATE MANAGER_ID NUMBER(7) TITLE VARCHAR2(25) DEPT_ID NUMBER(7) SALARY NUMBER(11,2) COMMISSION_PCT NUMBER(4,2)

Page 66: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 66

Expanded Oracle Supplied Packages

• DBMS_REDEFINITION Package Example– Step 4: Complete the Redefinition Process

– Step 5: Drop the Temporary Table

SELECT * FROM s_employee WHERE employee_id = 1;

EMP_ID EMP_L_NAME EMP_F_NAME EMP_FULL_NAME USERID ------ ---------- ---------- ---------------- --------1 VELASQUEZ CARMEN CARMEN VELASQUEZ cvelasqu

START_DATE MANAGER_ID TITLE DEPT_ID SALARY COMMISSION_PCT---------- ---------- --------- ------- ------ --------------03-MAR-90 PRESIDENT 50 3750

Page 67: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 67

Expanded Oracle Supplied Packages

• DBMS_METADATA Package– Provides an API to the Object Creation

Layer

– 19 Total Procedures and Functions

– Concentration on GET_DDL FunctionFUNCTION GET_DDL RETURNS CLOB Argument Name Type In/Out Default? ------------------------- ------------------ ------ -------- OBJECT_TYPE VARCHAR2 IN NAME VARCHAR2 IN SCHEMA VARCHAR2 IN DEFAULT VERSION VARCHAR2 IN DEFAULT MODEL VARCHAR2 IN DEFAULT TRANSFORM VARCHAR2 IN DEFAULT

Page 68: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 68

Expanded Oracle Supplied Packages

• DBMS_METADATA Package– Table Example (Create and GET_DDL)

CREATE TABLE temp(temp VARCHAR2(10) NOT NULL);

SET LONG 350SELECT dbms_metadata.get_ddl('TABLE', table_name)FROM user_tablesWHERE table_name = 'TEMP';

DBMS_METADATA.GET_DDL('TABLE',TABLE_NAME)-------------------------------------------------------------------------- CREATE TABLE "PLSQL_USER"."TEMP" ( "TEMP" VARCHAR2(10) NOT NULL ENABLE ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "SYSTEM"

Page 69: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 69

Expanded Oracle Supplied Packages

• DBMS_METADATA Package– Procedure Example (Create and GET_DDL)

CREATE OR REPLACE PROCEDURE abc ASBEGIN NULL;END abc;

SET LONG 350SELECT dbms_metadata.get_ddl('PROCEDURE', object_name)FROM user_objectsWHERE object_name = 'ABC';

DBMS_METADATA.GET_DDL('PROCEDURE',OBJECT_NAME)-------------------------------------------------------------- CREATE OR REPLACE PROCEDURE "PLSQL_USER"."ABC" ASBEGIN NULL;END abc;

Page 70: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 70

Expanded Oracle Supplied Packages

• UTL_FILE Package Enhancements in R2– Around Many Versions for Reading and

Writing to Operating System Files

– Several New Procedures to Provide More Control and Flexibility with Operating System Files

– Directory Additions for Easier MaintenanceCREATE OR REPLACE DIRECTORY 'TEMP_DIR' AS '/usr/users/oracle';GRANT READ, WRITE ON DIRECTORY TEMP_DIR TO plsql_user;

Page 71: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 71

Expanded Oracle Supplied Packages

• UTL_FILE Package Enhancements in R2– 4 New Procedures Added

• Delete an Operating System File

• Rename/Move an Operating System FilePROCEDURE FRENAME Argument Name Type In/Out Default? --------------------------- ----------------------- ------ -------- SRC_LOCATION VARCHAR2 IN SRC_FILENAME VARCHAR2 IN DEST_LOCATION VARCHAR2 IN DEST_FILENAME VARCHAR2 IN OVERWRITE BOOLEAN IN DEFAULT

PROCEDURE FREMOVE Argument Name Type In/Out Default? --------------------------- ----------------------- ------ -------- LOCATION VARCHAR2 IN FILENAME VARCHAR2 IN

Page 72: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 72

Expanded Oracle Supplied Packages

• UTL_FILE Package Enhancements in R2– 4 New Procedures Added

• Copy a Complete or Partial Operating System File

• Retrieve Attribute Information About an Operating System File

PROCEDURE FGETATTR Argument Name Type In/Out Default? --------------------------- ----------------------- ------ -------- LOCATION VARCHAR2 IN FILENAME VARCHAR2 IN FEXISTS BOOLEAN OUT FILE_LENGTH NUMBER OUT BLOCK_SIZE BINARY_INTEGER OUT

PROCEDURE FCOPY Argument Name Type In/Out Default? --------------------------- ----------------------- ------ -------- SRC_LOCATION VARCHAR2 IN SRC_FILENAME VARCHAR2 IN DEST_LOCATION VARCHAR2 IN DEST_FILENAME VARCHAR2 IN START_LINE BINARY_INTEGER IN DEFAULT END_LINE BINARY_INTEGER IN DEFAULT

Page 73: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 73

Additional Oracle9i New Features

Page 74: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 74

Additional Oracle9i Features

Resumable Space Allocation (suspend long running processes)

Segment Space Management (auto versus manual)

Multiple Block Sizes (tablespace dependent and separate cache for each)

Dynamic SGA Sizing (ability to modify the SGA with init.ora parameters)

Managing UNDO Space (rollback segment management by Oracle)

Page 75: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 75

Additional Oracle9i Features

Drop the OS Data Files Automatically (when dropping a tablespace)

EXTERNAL TABLES (reference flat file data within Oracle)

SERVER PARAMETER FILES (modify system parameters via ALTER SYSTEM and kept on shutdown/startup)

MONITORING INDEX USAGE (determine index usage)

iSQL*Plus (browser based SQL*Plus interface) New Hints

Page 76: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 76

Additional Oracle9i Features

Java Enhancements Oracle Enterprise Manager (OEM)

Enhancements Plan Stability Automate Statistic Gathering

(DBMS_STATS.GATHER*) Automate SQL Execution Memory Management Standby Databases Improvement Version 1.2 of IFS with Oracle9i V$SQL_PLAN Enhanced (actual plan versus

theoretical plan executed)

Page 77: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 77

Additional Oracle9i Features

New Join Syntax True Real Application Clusters (RACs -

replaces Oracle Parallel Server for real scalability by adding nodes and making it transparent to the environment (add nodes and disk when desired to improve performance/failover))

Security Improvements LogMiner Improvements (graphical user

interface and more automated) Skip Scan Index (ability to skip the first

portion of an index if not referenced)

Page 78: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 78

Additional Oracle9i Features

Flashback Queries Better Integration and More Flexibility

on LOBs Increased Support for XML Enhanced Bulk Operation Support List Partitioning Modifications in Storing Execution Plans cursor_sharing Enhancements (similar)

Page 79: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 79

Presentation Coverage

Oracle PL/SQL Version History Oracle 9i PL/SQL Compiler Limits & Internal

Improvements New Data Types New Built-In Functions New SQL Commands New Native PL/SQL Compilation Expanded Oracle Supplied Packages Additional Oracle9i Features

Page 80: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 80

For More Information

• The V$ Views for Oracle 9i PosterThis poster displays the V$ views of Oracle9i categorized by major function. The V$ (fixed) views are a supplement of views to the data dictionary and contain valuable real-time information that is stored in the SGA.

• Oracle PL/SQL Tips & TechniquesExpand your PL/SQL knowledge to the next level by using hundreds of PL/SQL tips and techniques provided in this one-of-a-kind reference, designed for every Oracle developer and database administrator. This book highlights many solutions that are either hidden, undocumented, or can only be discovered through many years of experience or through laborious trial and error. (Released: September, 1999; 942 pages)

Page 81: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 81

The Power of Attitude

Our lives are not determined by what happens to us, but by how we respond to what happens; not by what life brings us, but by attitude we bring to life. A positive attitude causes a chain reaction of positive thoughts, events, and outcomes. It is a catalyst…a spark that creates extraordinary results.

Page 82: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 82

Summary

• PL/SQL Has Grown Tremendously with Oracle9i and Oracle9i R2

• This Growth Includes a Wide Range of Both DBA and Developer Enhancements

• Learn These New Features and Make Sure You Thoroughly Understand the New Features Prior to Deploying in Your Environment

• Expand Your Arsenal and Utilize These New Features that Oracle Has Provided

Page 83: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

Joe Trezzo Contact Information

Phone: 630-960-2909Email: [email protected]

This presentation will be available on the TUSC Web

Site

www.tusc.com

Thank You for Coming

Page 84: OracleWorld 2002 Oracle9i PL/SQL New Features Joe Trezzo The Ultimate Software Consultants (TUSC) Abstract Number 32175.

A TUSC Presentation 84

References

• Oracle PL/SQL Tips & Techniques (Oracle Press), Joseph C. Trezzo• Oracle9I Instant PL/SQL Scripts (Oracle Press), Kevin Loney• Oracle9I DBA Handbook (Oracle Press), Kevin Loney• Oracle9i The Complete Reference (Oracle Press), Kevin Loney• Oracle9i New Features (Oracle Press), Robert Freeman• PL/SQL User's Guide and Reference(Release 9.0.1 & 9.2.0), Oracle Corporation• Supplied PL/SQL Packages and Types Reference (Release 9.0.1 & 9.2.0), Oracle

Corp.• Application Developer’s Guide - Fundamentals (Release 9.0.1 & 9.2.0), Oracle

Corp.• Oracle9i Database New Features (Release 9.0.1 & 9.2.0), Oracle Corporation• Oracle9i Database Administrators Guide (Release 9.0.1 & 9.2.0), Oracle

Corporation• Oracle9I SQL Reference (Release 9.0.1 & 9.2.0), Oracle Corporation• Concepts (Release 9.0.1 & 9.2.0), Oracle Corporation• $ORACLE_HOME/rdbms/doc/README_rdbms.htm• www.tusc.com• All companies and product names are trademarks or registered trademarks of the

respective owners.• Please report errors in this article to TUSC. Neither TUSC nor the author warrant

that this document is error-free. Please provide comments/questions to [email protected]. TUSC copyright 2002.

• This document cannot be reproduced without expressed written consent from an officer of TUSC


Recommended