oracle10g new features - university system of … new features presented by: ... chapter 1 of the...

50
Evaluation Code 432 Monday, 3:00 PM – 4:30 PM March 29, 2004 Oracle10g New Features Presented by: John Morgan, Sungard SCT

Upload: phamxuyen

Post on 20-Mar-2018

216 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Oracle10g New Features - University System of … New Features Presented by: ... Chapter 1 of the New Features Guide is 67 pages of just that ... Support for new 10g features

Evaluation Code 432 Monday, 3:00 PM – 4:30 PM

March 29, 2004

Oracle10g New Features Presented by: John Morgan, Sungard SCT

Page 2: Oracle10g New Features - University System of … New Features Presented by: ... Chapter 1 of the New Features Guide is 67 pages of just that ... Support for new 10g features

Evaluation code 432

Session Rules of Etiquette

  Please turn off your cell phone/pager

  If you must leave the session early, please do so as discreetly as possible

  Please avoid side conversation during the session

Thank you for your cooperation!

Page 3: Oracle10g New Features - University System of … New Features Presented by: ... Chapter 1 of the New Features Guide is 67 pages of just that ... Support for new 10g features

Evaluation code 432

What This Session Is About

  What does Oracle10g have to offer the SCT Banner DBA?

  Language enhancements   SQL*Plus

  SQL

  PL/SQL

  Manageability improvements

  Tuning

  Monitoring

  Changes to installations and upgrades

  Miscellaneous other features

Page 4: Oracle10g New Features - University System of … New Features Presented by: ... Chapter 1 of the New Features Guide is 67 pages of just that ... Support for new 10g features

Evaluation code 432

And What It Isn’t

  Grid computing

  The ‘g’ in Oracle10g

  RAC: The Next Generation

  How to install or upgrade to Oracle10g

  An exhaustive list of features   Chapter 1 of the New Features Guide is 67 pages of just that

  Been there, done that, had a boring presentation

Page 5: Oracle10g New Features - University System of … New Features Presented by: ... Chapter 1 of the New Features Guide is 67 pages of just that ... Support for new 10g features

Evaluation code 432

Agenda

  What does Oracle10g have to offer the SCT Banner DBA?

  Language enhancements   SQL*Plus

  SQL

  PL/SQL

  Manageability improvements

  Tuning

  Monitoring

  Changes to installations and upgrades

  Miscellaneous other features

Page 6: Oracle10g New Features - University System of … New Features Presented by: ... Chapter 1 of the New Features Guide is 67 pages of just that ... Support for new 10g features

Evaluation code 432

SQL*Plus Changes

  Improved capability for debugging/scripting

  Support for new 10g features

  SHOW RECYCLEBIN

  View objects available for FLASHBACK BEFORE DROP

  glogin.sql and login.sql executed after each CONNECT

  Avoids need to exit SQL*Plus to reset to known state

  DBMS_OUTPUT

  Display trigger/procedure output on SELECTs

Page 7: Oracle10g New Features - University System of … New Features Presented by: ... Chapter 1 of the New Features Guide is 67 pages of just that ... Support for new 10g features

Evaluation code 432

SQL*Plus Changes (cont.)

  Command-line compatibility switch

  -C to set SQLPLUSCOMPATIBILITY

  SET SQLPROMPT runtime variable substitution

  Predefined variables for username, connection privilege, date

  New SPOOL options   CREATE, REPLACE, and APPEND

Page 8: Oracle10g New Features - University System of … New Features Presented by: ... Chapter 1 of the New Features Guide is 67 pages of just that ... Support for new 10g features

Evaluation code 432

SQL Improvements

  Case/accent insensitive sorting

  Access to row SCNs

  Regular expressions

  Native floating-point numbers

Page 9: Oracle10g New Features - University System of … New Features Presented by: ... Chapter 1 of the New Features Guide is 67 pages of just that ... Support for new 10g features

Evaluation code 432

Case and Accent Insensitive Sorts

  Extension of case-insensitive query capability in 9i

  Primarily useful for globalization   E.g.: the table LETTERS that contains 'a', 'Z','A', and 'ä'

SELECT * FROM letters ORDER BY letter;

Value of NLS_SORT

None BINARY_C1 BINARY_A1

Row 1 A a ä

Row 2 Z A a

Row 3 a Z A

Row 4 ä ä Z

Page 10: Oracle10g New Features - University System of … New Features Presented by: ... Chapter 1 of the New Features Guide is 67 pages of just that ... Support for new 10g features

Evaluation code 432

Row SCN Visibility

  Row timestamp via pseudo-column ORA_ROWSCN

  Gives applications ability to check for changes since last query

SELECT ORA_ROWSCN, last_name

FROM employees

WHERE employee_id = 188;

SELECT SCN_TO_TIMESTAMP(ORA_ROWSCN),last_name

FROM employees

WHERE employee_id = 188;

Page 11: Oracle10g New Features - University System of … New Features Presented by: ... Chapter 1 of the New Features Guide is 67 pages of just that ... Support for new 10g features

Evaluation code 432

Regular Expressions

  Origins in mathematical/linguistic grammars

  UNIX users should be familiar with regexp from tools   ed, sed, grep, awk, vi

  Estimated that 80% of app logic is string processing   Regexp provides powerful string/text handling capabilities

  Oracle10g provides native regexp support

  SQL and PL/SQL interfaces

  Based on POSIX extended regexps

Page 12: Oracle10g New Features - University System of … New Features Presented by: ... Chapter 1 of the New Features Guide is 67 pages of just that ... Support for new 10g features

Evaluation code 432

Regular Expression Syntax

  Operator

  REGEXP_LIKE

  Built-in Functions

  REGEXP_SUBSTR

  REGEXP_INSTR

  REGEXP_REPLACE

  Syntax should be familiar to users of UNIX-derived tools

  '^.*[0-9][0-9]$' - match a string ending in two digits

Page 13: Oracle10g New Features - University System of … New Features Presented by: ... Chapter 1 of the New Features Guide is 67 pages of just that ... Support for new 10g features

Evaluation code 432

Regular Expression Metacharacters

. Any character | Or

+ One or more ( ... ) Subexpression

? Zero or one \n Backreference

* Zero or more \ Escape

{m} Interval (exact) ^ Start of line

{m,} Interval (at least) $ End of line

{m,n} Interval (between) [:class:] Char class

[ ... ] Matching char list [.element.] Collating seq

[^ ... ] Non-matching char list [=character=] Equiv class

Page 14: Oracle10g New Features - University System of … New Features Presented by: ... Chapter 1 of the New Features Guide is 67 pages of just that ... Support for new 10g features

Evaluation code 432

Regular Expression Examples

SELECT first_name, last_name

FROM employees

WHERE REGEXP_LIKE (first_name, '^Ste(v|ph)en$');

SELECT

REGEXP_REPLACE(phone_number,

'([[:digit:]]{3})\.([[:digit:]]{3})\.([[:digit:]]{4})',

'(\1) \2-\3') "REGEXP_REPLACE"

FROM employees;

Page 15: Oracle10g New Features - University System of … New Features Presented by: ... Chapter 1 of the New Features Guide is 67 pages of just that ... Support for new 10g features

Evaluation code 432

Performance of Regular Expressions

  Pattern matching can be resource intensive

  May be faster than LIKE in many situations

  Almost definitely faster than equivalent PL/SQL   Many lines of PL/SQL code can be reduced to a single

pattern-matching statement

  Test thoroughly for performance before putting into production

Page 16: Oracle10g New Features - University System of … New Features Presented by: ... Chapter 1 of the New Features Guide is 67 pages of just that ... Support for new 10g features

Evaluation code 432

Native Floating-Point Numbers

  Two types

  BINARY_FLOAT

  Single precision 32-bit

  BINARY_DOUBLE

  Double precision 64-bit

  IEEE standard   Maps to native Java and XML schema datatypes

  Better performance than NUMBER   Oracle NUMBER datatype implemented in software

  Native numbers take advantage of machine instruction set

Page 17: Oracle10g New Features - University System of … New Features Presented by: ... Chapter 1 of the New Features Guide is 67 pages of just that ... Support for new 10g features

Evaluation code 432

Native Number Examples

CREATE TABLE foo

(col1 BINARY_FLOAT, col2 BINARY_DOUBLE);

INSERT INTO foo VALUES(3.1415926f,1.414214d);

DECLARE

my_var BINARY_FLOAT := 2.0f;

BEGIN

my_var := my_var / 3.0f;

END;

/

Page 18: Oracle10g New Features - University System of … New Features Presented by: ... Chapter 1 of the New Features Guide is 67 pages of just that ... Support for new 10g features

Evaluation code 432

Native Number Functions and Constraints

  Conversion functions   TO_BINARY_FLOAT

  TO_BINARY_DOUBLE

  Existing SQL function support   Trig functions

  Aggregate functions

  Statistical functions

  Two new constraint options   IS (NOT) INFINITE

  IS (NOT) NAN

Page 19: Oracle10g New Features - University System of … New Features Presented by: ... Chapter 1 of the New Features Guide is 67 pages of just that ... Support for new 10g features

Evaluation code 432

PL/SQL Enhancements

  Database storage of native compilation units   Stored in BLOBs

  Reduces complexity of using/maintaining

  User-specified quoting character   my_var := q'#select 'x' from dual#';

  UTL_COMPRESS

  Lempel-Ziv compression algorithm

  gzip compatible for single files

  Optimizing compiler   Best improvements for computationally intensive code

Page 20: Oracle10g New Features - University System of … New Features Presented by: ... Chapter 1 of the New Features Guide is 67 pages of just that ... Support for new 10g features

Evaluation code 432

PL/SQL Compile-Time Warnings   Turn on/off warning messages during compiles

  Code that is syntactically correct but may have problems

  Three classes

  SEVERE

  PERFORMANCE

  INFORMATIONAL

  ALTER SYSTEM SET PLSQL_WARNINGS

  Also visible with SHOW ERRORS

  Can force specific warnings to be treated as error

Page 21: Oracle10g New Features - University System of … New Features Presented by: ... Chapter 1 of the New Features Guide is 67 pages of just that ... Support for new 10g features

Evaluation code 432

Current PLW Messages

5000: mismatch in NOCOPY qualification between specification and body

5001: previous use of 's1' (at line s2) conflicts with this use

5003: same actual parameter(s1 and s2) at IN and NOCOPY may have side effects

5004: identifier s1 is also declared in STANDARD or is a SQL builtin

5005: function s1 returns without value at line s2

6002: Unreachable code

7202: bind type would result in conversion away from column type

7203: parameter 's1' may benefit from use of the NOCOPY compiler hint

7204: conversion away from column type may result in sub-optimal query plan

Page 22: Oracle10g New Features - University System of … New Features Presented by: ... Chapter 1 of the New Features Guide is 67 pages of just that ... Support for new 10g features

Evaluation code 432

Agenda

  What does Oracle10g have to offer the SCT Banner DBA?

  Language enhancements   SQL*Plus

  SQL

  PL/SQL

  Manageability improvements

  Tuning

  Monitoring

  Changes to installations and upgrades

  Miscellaneous other features

Page 23: Oracle10g New Features - University System of … New Features Presented by: ... Chapter 1 of the New Features Guide is 67 pages of just that ... Support for new 10g features

Evaluation code 432

What Do DBAs Do?

  According to 2001 survey by IOUG, DBA spend 85% of their time on the following tasks

  6% software installation

  12% database creation/configuration

  6% loading data

  55% system management

  6% software maintenance

Page 24: Oracle10g New Features - University System of … New Features Presented by: ... Chapter 1 of the New Features Guide is 67 pages of just that ... Support for new 10g features

Evaluation code 432

Improving Database Management

  Oracle committed to making database easier to manage

  Improvements made in all areas

  Largest single effort in 10g

  50% of Oracle architects

  Over 200 engineers

  Extensive customer input

  Effort spanned entire technology stack

Page 25: Oracle10g New Features - University System of … New Features Presented by: ... Chapter 1 of the New Features Guide is 67 pages of just that ... Support for new 10g features

Evaluation code 432

Software Installation   Major redesign of installation process

  Database Configuration Assistant (DBCA)

  Single CD, ~20 minutes

  Resource consumption decreased

  Memory, CPU, and disk

  Lightweight client install available (3 files!)

  OEM installed/configured "out of box"

  Automation of pre/post installation tasks   Validate OS config, patches, resource availability

  Configure listeners, database, etc. for startup/shutdown

Page 26: Oracle10g New Features - University System of … New Features Presented by: ... Chapter 1 of the New Features Guide is 67 pages of just that ... Support for new 10g features

Evaluation code 432

Software Upgrades   Upgrade process streamlined

  Database Upgrade Assistant (DBUA)

  Automation of pre/post upgrade tasks

  Validate OS config, patches, resource availability

  Upgrade time estimator

  Re-startable process

  Can take advantage of parallel processing, if available

Page 27: Oracle10g New Features - University System of … New Features Presented by: ... Chapter 1 of the New Features Guide is 67 pages of just that ... Support for new 10g features

Evaluation code 432

Basic Initialization Parameters

compatible processes sessions db_name nls_language nls_territory db_domain shared_servers instance_number cluster_database db_block_size sga_target

control_files pga_aggregate_target db_recovery_file_dest remote_listener db_recovery_file_dest_size db_create_online_log_dest_n db_create_file_dest log_archive_dest_n log_archive_dest_state_n remote_login_passwordfile db_unique_name

Page 28: Oracle10g New Features - University System of … New Features Presented by: ... Chapter 1 of the New Features Guide is 67 pages of just that ... Support for new 10g features

Evaluation code 432

Data Pump

  Efficient data load/unload with expdp/impdp

  For single stream   60% faster than export

  15-20 times faster than import

  Automatic parallelism, if available

  Re-startable

  But…   Old export/import scripts won't work

  New syntax

Page 29: Oracle10g New Features - University System of … New Features Presented by: ... Chapter 1 of the New Features Guide is 67 pages of just that ... Support for new 10g features

Evaluation code 432

Comparing Exp and Data Pump Export

  These parameters are obsolete or functionality is built-in

BUFFER COMPRESS DIRECT OBJECT_CONSISTENT RECORDLENGTH RESUMABLE RESUMABLE_NAME RESUMABLE_TIMEOUT STATISTICS USERID VOLSIZE

Old exp parameter

New expdp parameter

CONSTRAINTS EXCLUDE/INCLUDE=CONSTRAINT

FEEDBACK STATUS

FILE DUMPFILE

GRANTS EXCLUDE/INCLUDE=GRANT

INDEXES EXCLUDE/INCLUDE=INDEX

LOG LOGFILE

OWNER SCHEMAS

ROWS CONTENT=ALL/METADATA_ONLY

TRIGGERS EXCLUDE/INCLUDE=TRIGGER

Page 30: Oracle10g New Features - University System of … New Features Presented by: ... Chapter 1 of the New Features Guide is 67 pages of just that ... Support for new 10g features

Evaluation code 432

Improving System Management

  Four major components

  Automatic workload repository   Warehouse of metadata about database performance

  Automatic maintenance tasks

  Server generated alerts

  Advisory infrastructure

Page 31: Oracle10g New Features - University System of … New Features Presented by: ... Chapter 1 of the New Features Guide is 67 pages of just that ... Support for new 10g features

Evaluation code 432

Automatic Workload Repository

  Top SQL criteria for collection   CPU time, elapsed time, parse calls, shared memory, version

count

  Top 30 collected for each criteria (100 if statistics_level=ALL)

  Top Segments criteria for collection   Logical reads, wait count, RAC stats, largest space used delta

  Top 30 collected for each criteria

  Repository used by Automatic Database Diagnostic Monitor (ADDM)   Identify database performance problems and recommends

solutions

Page 32: Oracle10g New Features - University System of … New Features Presented by: ... Chapter 1 of the New Features Guide is 67 pages of just that ... Support for new 10g features

Evaluation code 432

Automatic SQL Tuning Advisor

  Identifies poorly performing SQL

  Works off workload repository

  Built-in intelligence learns from past executions

  Iterative improvement of execution profiles

  Provides advice through SQL Access Advisor   DBA accepts/rejects profile

  When schema changes recommended (indexes, materialized views, etc.) takes entire workload into account

Page 33: Oracle10g New Features - University System of … New Features Presented by: ... Chapter 1 of the New Features Guide is 67 pages of just that ... Support for new 10g features

Evaluation code 432

Automatic Shared Memory Tuning

  Adapts to workload changes   OLTP v. batch v. OLAP v. web

  SGA areas managed include   Buffer cache

  Large pool

  SQL cache

  Java pool

  DBA sets two parms   SGA_TARGET

  PGA_AGGREGATE_TARGET

Page 34: Oracle10g New Features - University System of … New Features Presented by: ... Chapter 1 of the New Features Guide is 67 pages of just that ... Support for new 10g features

Evaluation code 432

Segment Advisor

  Analyzes storage objects for "dead" space

  Reclaims space from deletions

  Can shrink segments on-line

  No more export/import!

  Data captured for growth, fragmentation trends

  Alerts for impending problems

Page 35: Oracle10g New Features - University System of … New Features Presented by: ... Chapter 1 of the New Features Guide is 67 pages of just that ... Support for new 10g features

Evaluation code 432

Automatic Backup and Recovery

  Fully automatic disk based

  Recovery area holds full backup of database and logs

  Nightly incremental backup   Changed blocks tracked in database, so full scan not needed

  Backup and restore much faster

  But….   Need sufficient disk to house recovery area

  For maximum safety, recovery area should be on mirror or other redundant disk storage

Page 36: Oracle10g New Features - University System of … New Features Presented by: ... Chapter 1 of the New Features Guide is 67 pages of just that ... Support for new 10g features

Evaluation code 432

Single-Command Recovery

  Database level   Flashback Database

  Restores to point-in-time using Flashback Logs

  Table level   Flashback Table

  Restores table(s) to point-in-time using UNDO

  Flashback Drop   Restores dropped table/index using recycle bin

  E.g., FLASHBACK TABLE spriden TO BEFORE DROP;

  Row level   Flashback Query

Page 37: Oracle10g New Features - University System of … New Features Presented by: ... Chapter 1 of the New Features Guide is 67 pages of just that ... Support for new 10g features

Evaluation code 432

Automatic Storage Management

  Benefits

  Automatic I/O tuning

  Eliminate disk fragmentation

  Appropriate allocation policy for Oracle file type

  Online migration to new storage   New hardware

  Add/drop disks

Page 38: Oracle10g New Features - University System of … New Features Presented by: ... Chapter 1 of the New Features Guide is 67 pages of just that ... Support for new 10g features

Evaluation code 432

Manageability Summary

  Managing an Oracle10g environment requires

  44% less time than Oracle9i

  47% fewer steps than Oracle9i

Page 39: Oracle10g New Features - University System of … New Features Presented by: ... Chapter 1 of the New Features Guide is 67 pages of just that ... Support for new 10g features

Evaluation code 432

Agenda

  What does Oracle10g have to offer the SCT Banner DBA?

  Language enhancements   SQL*Plus

  SQL

  PL/SQL

  Manageability improvements

  Tuning

  Monitoring

  Changes to installations and upgrades

  Miscellaneous other features

Page 40: Oracle10g New Features - University System of … New Features Presented by: ... Chapter 1 of the New Features Guide is 67 pages of just that ... Support for new 10g features

Evaluation code 432

LOB Enhancements

  Inline (less than 4KB) LOBs performance improved 5x

  Temporary LOBs MUCH more efficient   Potentially orders of magnitude improvement

  Support for Ultra-Sized LOBs   8 to 128 TByte, depending on DB_BLOCK_SIZE

  Implicit conversion between CLOB and NCLOB

Page 41: Oracle10g New Features - University System of … New Features Presented by: ... Chapter 1 of the New Features Guide is 67 pages of just that ... Support for new 10g features

Evaluation code 432

Better Timezone Support

  New initialization parameter

  ORA_TZFILE

  Defaults to ?/oracore/timeinfo/timezone.dat

  Loaded into SGA at startup

  Valid timezones accessible in v$timezone_names

Page 42: Oracle10g New Features - University System of … New Features Presented by: ... Chapter 1 of the New Features Guide is 67 pages of just that ... Support for new 10g features

Evaluation code 432

SYSAUX Tablespace

  Oracle8i and Oracle9i created a number of auxiliary tablespaces

  TOOLS, DRSYS, XDB, etc.

  Most utilities now use SYSAUX tablespace

  SYS objects continue to reside in SYSTEM

Page 43: Oracle10g New Features - University System of … New Features Presented by: ... Chapter 1 of the New Features Guide is 67 pages of just that ... Support for new 10g features

Evaluation code 432

Clearing Buffers

  When testing/benchmarking, a clean "base state" needed

  Pre-10g, this required a database bounce

  New ALTER SYSTEM option   ALTER SYSTEM FLUSH BUFFER_CACHE;

  Probably inadvisable to use on your production database, though

Page 44: Oracle10g New Features - University System of … New Features Presented by: ... Chapter 1 of the New Features Guide is 67 pages of just that ... Support for new 10g features

Evaluation code 432

You Probably Won't Need This…

  Oracle10g supports bigfile tablespaces

  Oracle9i had maximum theoretical database size of 8 Petabytes (~8,000 Terabytes)

  Oracle10g has maximum of 8 Exabytes (~8,000,000 Terabytes)

Page 45: Oracle10g New Features - University System of … New Features Presented by: ... Chapter 1 of the New Features Guide is 67 pages of just that ... Support for new 10g features

Evaluation code 432

Renaming Tablespaces

  Syntax

  ALTER TABLESPACE old_name RENAME TO new_name;

  Can't do it to SYSTEM or SYSAUX

  Particularly good for transportable tablespaces

Page 46: Oracle10g New Features - University System of … New Features Presented by: ... Chapter 1 of the New Features Guide is 67 pages of just that ... Support for new 10g features

Evaluation code 432

What's Next?

  Oracle10g has many features to make the DBA's life easier

  Build a test database and get your feet wet

  Try out the many automatic management features

  Replace your export processes with expdp (and test it!)

  Consider new features for local development

Page 47: Oracle10g New Features - University System of … New Features Presented by: ... Chapter 1 of the New Features Guide is 67 pages of just that ... Support for new 10g features

Evaluation code 432

Ready to Learn More?

  Full Oracle documentation available at OTN

  http://otn.oracle.com

  Free membership

  Many other technical resources available at the site

  OracleWorld 2003 presentations available online   http://www.oracleworld2003.com/scps/controller/catalog

Page 48: Oracle10g New Features - University System of … New Features Presented by: ... Chapter 1 of the New Features Guide is 67 pages of just that ... Support for new 10g features

Evaluation code 432

Questions and Answers

Page 49: Oracle10g New Features - University System of … New Features Presented by: ... Chapter 1 of the New Features Guide is 67 pages of just that ... Support for new 10g features

Evaluation code 432

Thank You!

John Morgan

[email protected]

Please fill out the Evaluation Form

Evaluation Code 432

Page 50: Oracle10g New Features - University System of … New Features Presented by: ... Chapter 1 of the New Features Guide is 67 pages of just that ... Support for new 10g features

Evaluation code 432

SCT, the SCT logo, Banner, PowerCAMPUS, Campus Pipeline, SCT Plus, SCT Matrix, SCT PocketRecruiter, and Luminis are trademarks or registered trademarks of Systems & Computer Technology Corp. Any other trademarks, service marks, or trade names referenced herein are the property of their respective owners.

Copyright © 2003 Systems & Computer Technology Corp. All rights reserved.