Você está na página 1de 40

A Oracle10g New Features

Dan Hotka
Author/Instructor/Oracle Expert

www.DanHotka.com

www.DanHotka.com

www.DanHotka.com

Dan is a Training
Consultant

2-day Hands-on Workshops


SQL Statement Tuning Tips and Techniques
Advanced SQL Tuning Tips and Techniques
Oracle/Unix Scripting Techniques
Business Intelligence Courses:
Discoverer for End Users/Discoverer Admin
Intro to Oracle for Business Intelligence Users
Advanced Oracle for Business Intelligence Users
Oracle Courses
Check my website for a current list of offerings
1-day Seminars:
Oracle/Unix Scripting Tips and Techniques
Oracle Performance Tuning

Register for my quarterly Newsletter

www.DanHotka.com

Agenda

Database Enhancements
ASMM
ASM
ASSM
Automatic Everything

Tuning
RBO to CBO
New hints
Tuning Advisor

www.DanHotka.com

Agenda

Object Enhancement

SQL Enhancements

Tablespace Enhancements

New Analytical Functions

IOT and list partitioning, lob


support

New SQL
New syntax

Table Redefinition
Clob, nclob, unicode
Materialized view
enhancement

PL/SQL Enhancements
OP article
Triggers/lobs

www.DanHotka.com

Agenda

Flashback Enhancements

Flashback features

Sqlplus

Drop/recycle bin

login.sql

Rman Enhancements

Auto file create


Simplifyed backups
Proxy Copy
Incrementally Updated Backup

Utilities enhancements

Spool
Define variables

Log miner

Topics NOT Covered


www.DanHotka.com

Database Enhancements

Adjustments made from:

ASMM

Automatic Shared
Memory Management

Buffer Cache (Default Pool)


Shared Pool
Large Pool
Java Pool

Init param:
SGA_TARGET
Set to 0, disables automatic sizing
Set to MAX SGA Size
Cannot be larger than
MAX_SGA_SIZE

V$DB_Cache_Advice
V$Shared_Pool_Advice

Uses new background process


MMAN (Memory Manager)
Keep/Recycle/other block sizes/Log
Buffer are still manually defined
New command:
Alter system flush buffer cache;

Useful for:
Smaller/self-managed databases
Overworked DBA shops

www.DanHotka.com

Database Enhancements

ASM
Automatic Storage Management
Automatic file management
Disk Groups
Normal Redundancy (Raid 0+1)
High Redundancy (Raid 5)
External redundancy (Separate RAID device)

Init param: INSTANCE_TYPE = ASM


Failover groups
Provides mirror copies

www.DanHotka.com

Database Enhancements

ASM (continued)

CREATE DISKGROUP < asm disk group name> EXTERNAL |


NORMAL REDUNDANCY DISK /devdisk/d1, /devdisk/d2
CREATE TABLESPACE <tablespace name> DATAFILE +< asm
disk group name> SIZE <size spec>;.

www.DanHotka.com

Database Enhancements

V$OSM_Diskgroup
V$OSM_Disk
V$OSM_File
V$OSM_Template
V$OSM_Alias
V$OSM_Operation

ASM Summary:
Eliminates the need to
manage/create files
Replaces volume managers
High availability

Enhances performance via


file distribution

www.DanHotka.com

Automatic Space Storage


Management

What it is good for:


Apps with lots of concurrent
inserts
RAC (intended use)
Other 10g features

What it is NOT good for:


Space not well used
Space can be come lost
Needs DBA Attention/monitoring
FIX_SEGMENT_STATUS

Redo generation is high


Gives all indexes a high
clustering factor!

www.DanHotka.com

Tuning

Default Optimizer Mode


First_Rows

RBO still works/no


enhancements/little
documentation
Dynamic Sampling if no
stats
Init param:
optimizer_dynamic_sampling
Default = 2

Dynamic Sampling Levels:


0: no dynamic sampling
(assumptions)
1: tables in SQL
Without stats
> 32 blocks (default sampling)
No indexes

2 (default):
All unanalyzed tables in SQL
2x default sampling

www.DanHotka.com

Tuning

Dynamic Sampling Levels:


3: Level 2 + selectivity
estimation
4: Level 3 + 2 or more singlecolumn predicates
5 thru 9:
Level 4 but 4x, 8x, 32x, 128x
number of default block
sampling

10: Level 4 but sampling all the


blocks in the table

New Hints

Leading
Cardinality
Selectivity
No_use_nl merge hash
No_index_ffs ss
Index_ss ss_asc ss_desc
Cpu_costing no_cpu_costing

www.DanHotka.com

Tuning

Obsolete Hints

And_equal
Nl_adj merge hash
Nl_sj merge hash
Ordered predicates
Rowid
star

ADDM
Automatic Database Diagnostic
Monitor
Uses MMON process
Tracks bottlenecks and analyzes
workloads
OEM Interface, character-mode
interface via
DBA_ADVISOR_FINDINGS

www.DanHotka.com

Tuning

SQL Tuning Advisor

Provides tuning recommendations


OEM Interface
DBMS_SQLTUNE.Report_Tuning_Task
DBMS_ADVISOR.Quick_Tune
DBMS_ADVISOR.Tune_MView

www.DanHotka.com

Object Enhancements

New Tablespace Features


SYSAUX
Moving Oracle Utilities out of
SYSTEM
V$Sysaux_Occupants

ALTER <ts> RENAME <new ts>;


Useful for transportable TS
Cannot rename SYSTEM &
SYSAUX
All affected objects must be
online

Temporary TS Groups
Oracle assigns users in a round-robin
fashion
ALTER <temporary tablespace
name> TABLESPACE GROUP
<group name>
Temporary TS must exist

ALTER USER <user name>


DEFAULT TABLESPACE <TS name
or group name>
ALTER DATABASE DEFAULT
TABLESPACE <TS name or
group name>
DBA_TABLESPACE_GROUPS

www.DanHotka.com

Object Enhancements

New TS Features
(continued)
Bigfile Tablespace
Oracle10g allows for
65,536 total number of
files
Small TSs (regular TS)
up to 1022 files
32K block: 131,000GB

CREATE BIGFILE TABLESPACE


<tablespace name> DATAFILE <file
spec> SIZE <size in K M G or T>
Note: BIGFILE uses a different ROWID
Might have implications on apps that utilize
ROWID

Bigfile has same limit but


uses only 1 file

www.DanHotka.com

Object Enhancements

Transportable Tablespace
Enhanced to allow for cross-platform TS movements
V$Transportable_Platform to view supported
platforms and file types
Endian_Format
Big & Small
No conversion necessary if both source and target are of the
same format
Use RMAN to convert from one format type to another

www.DanHotka.com

Object Enhancements

IOTs
Support for List Partitioning
Support for LOBs

CLOB/NCLOB Support
New to_clob and to_nclob functions for
these long fields

Support for Unicode 3.2


Oracle supported Unicode since v7

BFILE to LOB

Loadfromfile2() function

Online Table Redefinition


Useful for real-time
adding/dropping of columns
24/7 databases

Introduced in Oracle9i
LOBS, CLOBS, BLOBS now
supported
Bfile not supported

Replaces LOADFROMFILE
Allows BFILE to load into LOB
Allows for character set definition

www.DanHotka.com

Object Enhancements

Materialized Views
Fast refresh now supports
Self-joins
Views
Remote tables

Query rewrite now supports


More than one MV table

Rewrite_or_Error Hint
Fails the SQL if it did not
do a rewrite

www.DanHotka.com

SQL Enhancements

Returning Clause
DML syntax
Useful to extract totals of
calculation
Can only be used on single
tables, MV, or views with
single tables
Contains a single-set
aggregate function
Can use rowid, etc, if DML
is only affecting 1 row

Insert into new_emp


select ename, deptno,
sal from emp
RETURNING sum(sal)
into :Sal_Total
Applies RETURNING function to
affected rows

Trigger BEFORE Row


Insert
Allows LOB column
maintenance
www.DanHotka.com

SQL Enhancements

Analytical New Features

Model function
Creates mutidimensional array
Spreadsheet Columns

Symbolic cell addressing


Array computations
Insert/update cell values

Spreadsheet columns
Reference_spreadsheet
Main_spreadsheet
Spreadsheet_column_values

Grouped Table Outer Joins

64K SQL statement size limit


removed
No limits on number of
aggregates in GROUP BY
clause
New connect-by functionality
Connect_by_iscycle
Connect_by_isleaf
Connect_by_root

Used on time-based calculations

www.DanHotka.com

SQL Enhancements

Regular expressions in String Commands

REGEXP_INSTR
REGEXP_LIKE
REGEXP_REPLACE
Any POSIX operators

^ - beginning of line
$ - end of line
. match any char
\n match string

www.DanHotka.com

PL/SQL Enhancements
Optimizing compiler
Runtime improvements
Optimizer levels:

0 no optimization
1 moderate optimization
2 aggressive optimization
USER_PLSQL_Object_Settings

Compile-time warnings

Nested Table Functions


Collect, powermultiset

Programmer-defined
quoting for strings
Floating Point data type
enhancements
Now uses native arithmetic
functions saving memory/time

www.DanHotka.com

Flashback Enhancements

Flashback Database

Flashback database to < scn >


Uses new RVWR background
process
Useful to:

Flashback Row History


Row data/meta data

Flashback Transaction
History

rollback corruption
Syncronize DB with Standby

Flashback Standby DB

Undoes corruption

Flashback Drop
Flashback Table
www.DanHotka.com

Flashback Enhancements

Enabling Flashback Database


Set parameters:
db_recovery_file_dest
db_recovery_file_dest_size
Db_flashback_retention_target

Startup mount exclusive


Alter database flashback on
Monitor with:
V$Database V$Flashback_Database_Stat
V$Flashback_Database_Log

www.DanHotka.com

Recycle Bin

DROP places objects in Recycle bin


User_Recyclebin DBA_Recyclebin
Flashback table <object name from recyclebin> to before drop

PURGE permanently removes objects


Drop table purge <table name>
Drop tablespace PURGES the objects NOT placed in recyclebin!

Purge recyclebin
Purge recyclebin purges user_recyclebin
Purge dba_recyclebin
Purge tablespace <ts name> - purges all objects from this TS that were in the
recyclebin

www.DanHotka.com

Rman Enhancements

Automated File Creation

Useful for files never backed up

No need to backup after point-intime recovery


No need to recreate standby DB
Scripts dont need to be changed

Single Command to backup


Backup as copy tag <tag name>
database

Proxy Copy supports archive


log files & control files
Incremental Updates
Lowers recovery time
Avoids full image copy after backup

Recovery thru Resetlogs

Begin backup command


Alter database begin backup puts all files in online backup
mode

www.DanHotka.com

Rman Enhancements

Change-Aware Incremental
Backups

Creates block change tracking file

Dont need to manually


create auxiliary instance
anymore

Unified Disk Storage Location


Easier to cleanup old archive and rman
files
Alter System Set

Tablespace point-intime restriction lifted

Cataloging
Much simpler to modify the
catalog

DB_Recovery_File_Dest_Size
DB_Recovery_File_Dest

Catalog
Uncatalog

V$Recovery_File_Dest

New OEM interfaces!


www.DanHotka.com

SQL*Plus Enhancements

New Spool Functionality

Spool White Space.txt


Also applies to RUN @ @@

Spool sometext.out APPEND

New Variables
_date
_user
_privilege

Compatibility
Sqlplus c 9.0 .

Show recyclebin
DID you know
Set html markup on

www.DanHotka.com

SQL*Plus Enhancements
Tip on reading login.sql on each connectadd my little script again grant select on v$_instance to public
Login.sql
column INSTANCE_ID new_value INST_ID noprint
select HOST_NAME || ':' || INSTANCE_NAME || ':' || USER || '> ' INSTANCE_ID
from sys.v_$instance
/
set SQLPROMPT &&INST_ID

www.DanHotka.com

Log Miner Enhancements

Automatic Redo Log


Assignments
Just give the SCNs for
recovery and LM finds the
right files

ROWID can be
eliminated from output
UNDO-REDO SQL

New Stuff:
Remove_logfile command
Support for:

CLOB
NCLOB
LONG
LONG Raq
Binary_Float
Binary_Double
IOTs

www.DanHotka.com

Topics NOT Covered


Streams
Security
Data Mining
Globalization
Data Guard/Standby DB
Enterprise Manager

www.DanHotka.com

Additional Reading

Oracle Database 10g


New Features
By Robert Freeman;
Oracle Press
ISBN: 0-5996-00268-8

www.DanHotka.com

Additional Reading

Oracle Database 10g


New Features
By Ault/Liu/Tumma;
Oracle Press
ISBN: 0-9740716-0-9

www.DanHotka.com

More Information
www. Ixora .com.au
Evdbt.com www. Sagelogix .com
www.jlcomp.demon.co.uk
Presentation downloads

www. DanHotka.com click on Downloads

www.DanHotka.com

Reading Explain Plans

www.DanHotka.com

What have we learned?

Oracle10g New Features


Database Enhancements
Tuning
Object Enhancements
SQL Enhancements
PL/SQL Enhancements
Recovery Enhancements
Utilities Enhancements

www.DanHotka.com

Dan is a Training
Consultant

2-day Hands-on Workshops


SQL Statement Tuning Tips and Techniques
Advanced SQL Tuning Tips and Techniques
Oracle/Unix Scripting Techniques
Business Intelligence Courses:
Discoverer for End Users/Discoverer Admin
Intro to Oracle for Business Intelligence Users
Advanced Oracle for Business Intelligence Users
Oracle Courses
Check my website for a current list of offerings
1-day Seminars:
Oracle/Unix Scripting Tips and Techniques
Oracle Performance Tuning

Register for my quarterly Newsletter

www.DanHotka.com

Você também pode gostar