Poder 10g New Features

32
1/32 Tanel Põder NYOUG 2004 Oracle 10 g Database Engine New Features For Techies Tanel Põder independent consultant http://integrid.info 24-Mar-04 NYOUG General Meeting March 2004

Transcript of Poder 10g New Features

Page 1: Poder 10g New Features

8/8/2019 Poder 10g New Features

http://slidepdf.com/reader/full/poder-10g-new-features 1/32

1/32Tanel Põder NYOUG 2004

Oracle 10g Database Engine

New Features For Techies

Tanel Põder

independent consultant

http://integrid.info

24-Mar-04

NYOUG General Meeting

March 2004

Page 2: Poder 10g New Features

8/8/2019 Poder 10g New Features

http://slidepdf.com/reader/full/poder-10g-new-features 2/32

2/32Tanel Põder NYOUG 2004

Introduction & About

What¶s behind the 10g buzzwords

Manageability enhancements

Performance tuning enhancements Exp/imp with Data Pump

Parameters, views

SQL and PL /SQL

Recovery and Flashback Wrap-up

Questions

Agenda

Page 3: Poder 10g New Features

8/8/2019 Poder 10g New Features

http://slidepdf.com/reader/full/poder-10g-new-features 3/32

3/32Tanel Põder NYOUG 2004

Introduction & About

Name: Tanel Põder

Experience: 7 years as Oracle DBA

Occupation: independent consultant

Company: integrid.info Other: Europe, Middle-East & Africa Oracle

User Group BoD member

Oracle Certified Master DBA More information and presentations:

http://integrid.info

Page 4: Poder 10g New Features

8/8/2019 Poder 10g New Features

http://slidepdf.com/reader/full/poder-10g-new-features 4/32

4/32Tanel Põder NYOUG 2004

Simplicity vs Flexibility

Automatic statistics gathering

Advisories

Automatic tuning

Less than 30 basic (init.ora) parameters± Basic, advanced, hidden parameters

Easier operations

± alter tablespace rename

± flashback queries

± ³undrop´ table

± etc..

Page 5: Poder 10g New Features

8/8/2019 Poder 10g New Features

http://slidepdf.com/reader/full/poder-10g-new-features 5/32

5/32Tanel Põder NYOUG 2004

Manageability

SGA_TARGET

± Sets total size for all SGA components

± Buffer Cache, Shared Pool, Large Pool, Java Pool

± Dynamically and automatically adjustable± Automatic changes persist in SPFILE

PGA_AGGREGATE _TARGET

± Available since 9i

± Sets total size target for all server processes± sort_area_size, sort_area_retained_size,

hash_area_size, bitmap_merge_area_size

± Contents automatically managed

Page 6: Poder 10g New Features

8/8/2019 Poder 10g New Features

http://slidepdf.com/reader/full/poder-10g-new-features 6/32

6/32Tanel Põder NYOUG 2004

Basic ParametersCOMPATIBLE

CONTROL _FILES

DB_BLOCK _SIZE

DB_CREATE _FILE _DEST

DB_CREATE _ONLINE _LOG_DEST

DB_DOMAIN

DB_NAME

DB_RECOVERY_FILE _DEST

DB_RECOVERY_FILE _DEST_SIZE

INSTANCE _NUMBER

JOB_QUEUE _PROCESSES

LOG_ARCHIVE _DEST_n

LOG_ARCHIVE _DEST_STATE _n

NLS _LANGUAGE

NLS _TERRITORY

OPEN_CURSORS

PROCESSES

REMOTE _LISTENER

REMOTE _LOGIN_PASSWORDFILE

ROLLBACK _SEGMENTS

SESSIONS

SHARED_SERVERS

STAR _TRANSFORMATION_ENABLED

UNDO_MANAGEMENT

UNDO_TABLESPACE

Page 7: Poder 10g New Features

8/8/2019 Poder 10g New Features

http://slidepdf.com/reader/full/poder-10g-new-features 7/32

7/32Tanel Põder NYOUG 2004

Manageability

SYSAUX tablespace for system utilitiesModule Tablespace

SYS objects SYSTEM (includes AUD$and FGA_LOG$ tables)

Oracle Data Mining ODMOEM Repository OEM_REPOSITORY

Oracle OLAP CWMLITE

Oracle interMedia SYSTEM

Oracle Spatial SYSTEM

Oracle UltraSearch D

RSY

S

RMAN Recovery Catalog TOOLS

Sample Schemas Example

Workspace Manager SYSTEM

Oracle XML DB XDB_RESINFO

Auto. Workload Repository New in 10g

SYSAUX

Page 8: Poder 10g New Features

8/8/2019 Poder 10g New Features

http://slidepdf.com/reader/full/poder-10g-new-features 8/32

8/32Tanel Põder NYOUG 2004

Online Operations

Some functionality there already in 8i, 9i

± Online index build, rebuild

± Online index organized table rebuild

± Analyze/validate structure online Online table redefinition

± dbms_redefinition package starting from 9i

± change table physical structure online

± allows adding, changing, removing columnsonline

Rolling database upgrade

± Requires Logical Standby database

Page 9: Poder 10g New Features

8/8/2019 Poder 10g New Features

http://slidepdf.com/reader/full/poder-10g-new-features 9/32

9/32Tanel Põder NYOUG 2004

Online Segment Shrink

Can be recommended by Segment Advisor

alter table enable row movement;

alter table t1 shrink space cascade;

TABLE HEADER  01010101

110110101100110100001101 10111101

1100110110101111111011010000110110111101

High Water Mark

TABLE HEADER  11001101

00001101

11001101101011111110110100001101

11001101101011111110110100001101

High Water Mark Free Space

Free Space

Page 10: Poder 10g New Features

8/8/2019 Poder 10g New Features

http://slidepdf.com/reader/full/poder-10g-new-features 10/32

10/32Tanel Põder NYOUG 2004

Rename Tablespace

Useful in Transportable Tablespacescenarios

ALTER TABLESPACE prod RENAME to arc1;

± Can¶t rename SYSTEM or SYSAUX± Tablespace and all datafiles must be online

± Can also rename READ ONLY tablespaces

PR OD ARC1

Page 11: Poder 10g New Features

8/8/2019 Poder 10g New Features

http://slidepdf.com/reader/full/poder-10g-new-features 11/32

11/32Tanel Põder NYOUG 2004

Temporary Tablespace Groups

Can create several temporary tablespacesand assign them to a tablespace group

Can assign the tablespace group as users

temporary tablespace Parallel Query and Parallel execution slaves

can spread temporary segments ondifferent tablespaces

± alter tablespace temp1 tabl espac e group t ;± create temporary tablespace temp2 tempfile

'temp2_01.dbf' size 100m tabl espac e group t ;

± alter tablespace temp1 tablespace group '';

Page 12: Poder 10g New Features

8/8/2019 Poder 10g New Features

http://slidepdf.com/reader/full/poder-10g-new-features 12/32

12/32Tanel Põder NYOUG 2004

Bigfile Tablespaces

Support for sizes up to 8 Exabytes!

± 8 000 000 Terabytes

± Max 65535 files in database

± SYSTEM & SYSAUX can¶t be bigfile tablespaces

CREATE BIGFILE TABLESPACE bigtbs

DATAFILE '/u02/oracle/data/bigtbs01.dbfµSIZE 50G  EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;

8 000 000 000 000 000 000 bytes

Page 13: Poder 10g New Features

8/8/2019 Poder 10g New Features

http://slidepdf.com/reader/full/poder-10g-new-features 13/32

13/32Tanel Põder NYOUG 2004

Who Needs This?!

Who could possibly outgrow previousdatabase size limits?

9i limits 65534 files per database

222

-1=4,194,303 blocks per datafile 32kB max blocksize (not on all platforms)

Total max size of 9i database:

± 65534*4194303*32 kB§8055 TB§8 P etabyt es!

± 38000*4194303*16 kB§2.5 P etabyt es!

± Practical size limit in reality is even smaller

CERN in Switzerland: 5-8 PB data per year

Page 14: Poder 10g New Features

8/8/2019 Poder 10g New Features

http://slidepdf.com/reader/full/poder-10g-new-features 14/32

14/32Tanel Põder NYOUG 2004

Crossplatform Transportable TSRMAN> CONVERT TABLESPACE sales_1,sales_2

2> TO PLATFORM ¶Microsoft Windows NT¶

3> FORMAT ¶/temp/%U¶;

...

Transporting Tablespaces Between Databasesinput datafile fno=00004name=/u01/oracle/oradata/salesdb/sales_101.dbf

converted datafile=/temp/data_D-10_I-3295731590_TS-EXAMPLE_FNO-4_06ek24vl

channel ORA_DISK_1: datafile conversioncomplete, elapsed time: 00:00:45

Page 15: Poder 10g New Features

8/8/2019 Poder 10g New Features

http://slidepdf.com/reader/full/poder-10g-new-features 15/32

15/32Tanel Põder NYOUG 2004

Data Pump

A server-managed data transportation tool

Direct load/extract capabilities

Very high performance/efficient with large

data sets Replacement for exp/imp

± old exp/imp remain supported

PR ODData

Warehouse

Data Pump

DataPumpClient

Data Pump

DataPumpClient

Page 16: Poder 10g New Features

8/8/2019 Poder 10g New Features

http://slidepdf.com/reader/full/poder-10g-new-features 16/32

16/32Tanel Põder NYOUG 2004

Data Pump

Commands expdp/impdp

Can use files or direct network transfer

Dynamic configuration, resumable

operations Client can detach and reconnect

Can be parallelized using PARALLEL± Even loads to/from external text files

± Parallelization level can be changed on the flyfor long running jobs

Monitored through DBA_DATAPUMP_JOBS

Page 17: Poder 10g New Features

8/8/2019 Poder 10g New Features

http://slidepdf.com/reader/full/poder-10g-new-features 17/32

17/32Tanel Põder NYOUG 2004

Data Pump Options

Fine-Grained Object Selection

± exclude=function

± exclude=procedure

± exclude=package:´like µPAYROLL%¶ ´ ± include=table

± content=metadata_only | data_only | both

± query=³modify_date > sysdate-1´ 

DDL Transformations, DDL extract table_exists_action

± skip, append, truncate, replace

Page 18: Poder 10g New Features

8/8/2019 Poder 10g New Features

http://slidepdf.com/reader/full/poder-10g-new-features 18/32

18/32Tanel Põder NYOUG 2004

FlashBack Database

Flash Recovery Area must be configured

± Flashback logs are stored there

± Consisting of old database block images

± Fast ³rollback´ of database, no redologsrequired

DB FlashbackLog

ServerProcess

ServerProcessServer

Process

Page 19: Poder 10g New Features

8/8/2019 Poder 10g New Features

http://slidepdf.com/reader/full/poder-10g-new-features 19/32

Page 20: Poder 10g New Features

8/8/2019 Poder 10g New Features

http://slidepdf.com/reader/full/poder-10g-new-features 20/32

20/32Tanel Põder NYOUG 2004

FlashBack Options

Flashback Query:

exec dbms_flashback.enable_at_time(«);

select * from table;

exec dbms_flashback.disable; select * from table AS OF timestamp µ«¶;

Flashback Table:

FLASHBACK TABLE t1 TO SCN 12345; FLASHBACK TABLE t1 TO TIMESTAMP

'2003-03-03 12:05:00';

Page 21: Poder 10g New Features

8/8/2019 Poder 10g New Features

http://slidepdf.com/reader/full/poder-10g-new-features 21/32

21/32Tanel Põder NYOUG 2004

Flashback Row HistorySELECT versions_xid XID, versions_startscn START_SCN,

versions_endscn END_SCN, versions_operation OPERATION,

empname, salary FROM hr.employees_demo

 VERSIONS BETWEEN SCN MINVALUE AND MAXVALUE

where empno = 111;XID START_SCN END_SCN OPERATION EMPNAME SALARY

--- --------- ------- --------- ------- ------

0004000700000058 113855 I Tom 927

000200030000002D 113564 D Mike 555

000200030000002E 112670 113564 I Mike 555

3 rows selected

Useful for auditing

Page 22: Poder 10g New Features

8/8/2019 Poder 10g New Features

http://slidepdf.com/reader/full/poder-10g-new-features 22/32

22/32Tanel Põder NYOUG 2004

Flashback Transaction Historyselect xid, start_scn, commit_scn, operation,

undo_sql, table_name

from dba_transaction_q uery where xid = ¶000200030000002D¶;

XID START_SCN COMMIT_SCN OPERATION UNDO_SQL

--- --------- ---------- --------- -------------------------

000200030000002D 112670 113565 D insert into "SCOTT"."EMP"

("EMPNO","EMPNAME","SALARY") values ('111','Mike','655')

000200030000002D 112670 113565 I delete from "SCOTT"."DEPT"

where "DEPTNO" = '20' and "DEPTNAME" = 'Finance'

000200030000002D 112670 113565 D update ³SCOTT´.´EMP´set ³SALARY´ = µ555¶ where ³EMPNO´ = µ111¶ and ´EMPNAME´ =

µMike¶ and ³SALARY´

= µ655¶

3 rows selected

Page 23: Poder 10g New Features

8/8/2019 Poder 10g New Features

http://slidepdf.com/reader/full/poder-10g-new-features 23/32

23/32Tanel Põder NYOUG 2004

Table Recovery using Flashback

DROP TABLE X;

± Table is renamed internally, not dropped

± Indexes & other structures remain

± Table is purged when out of free space or quota SELECT * FROM RECYCLEBIN;

± Systemwide recyclebin DBA_RECYCLEBIN

± Or show recyclebin command in sqlplus

FLASHBACK TABLE RB$$3560$TABLE$1TO BEFORE DROP RENAME TO scott.emp;

PURGE RECYCLEBIN;

DROP TABLE X PURGE;

Page 24: Poder 10g New Features

8/8/2019 Poder 10g New Features

http://slidepdf.com/reader/full/poder-10g-new-features 24/32

24/32Tanel Põder NYOUG 2004

Performance Tuning

RBO is dead, long live the CBO!± Even data dictionary, SYS tables using CBO

± However, RBO is gone nowhere, it¶s available

Optimizer able to use run-time statistics± exec dbms_stats.gather_system_statistics(«)

± OPTIMIZER _DYNAMIC _SAMPLING (default: 2)

Multiple Advisors± SQL Access & Tuning Advisor

± Memory Advisors (SGA, Shared Pool, etc..)

± Segment Advisor (Fragmentation, etc..)

± Undo Advisor

Page 25: Poder 10g New Features

8/8/2019 Poder 10g New Features

http://slidepdf.com/reader/full/poder-10g-new-features 25/32

25/32Tanel Põder NYOUG 2004

Advisor Information

DBA_ADVISOR _FINDINGS

DBA_ADVISOR _RECOMMENDATIONS

DBA_ADVISOR _RATIONALE

And many more« All the information is accessible through

DBA_ and V$ data dictionary views

The reasons and rationale behindrecommendations can be seen

Page 26: Poder 10g New Features

8/8/2019 Poder 10g New Features

http://slidepdf.com/reader/full/poder-10g-new-features 26/32

26/32Tanel Põder NYOUG 2004

Performance Troubleshooting

Automatic Workload Repository

± Runtime execution statistics are gathered inmemory

± MMON background process flushes stats to disk

V$SQL _BIND_CAPTURE

± Samples bind variables for all sessions

± Faster than sql_trace (10046 trace on level 4)

± But doesn¶t capture all variable types± And doesn¶t capture occurences of bindings

 _cursor_bind_capture_interval defaults to 900 seconds

± Good for getting samples of database operations

Page 27: Poder 10g New Features

8/8/2019 Poder 10g New Features

http://slidepdf.com/reader/full/poder-10g-new-features 27/32

27/32Tanel Põder NYOUG 2004

Performance Troubleshooting (2)

Event, P1, P2, P3 columns in V$SESSIONfor quick diagnosis± the same information that in V$SESSION_WAIT

dbms_monitor package± set tracing and statistics gathering in sessions

based on sessionid, client_id, module and actionattributes

± RAC aware, monitoring remains active until

explicitly disabled t r c sess tool for gathering sessions SQL from

in shared server environment± Sql trace (10046) reports module, action,

client_id information to trace file

Page 28: Poder 10g New Features

8/8/2019 Poder 10g New Features

http://slidepdf.com/reader/full/poder-10g-new-features 28/32

28/32Tanel Põder NYOUG 2004

Improved Timing and Statistics

Old methods

± V$SESSION_EVENT, V$SYSTEM_EVENT

± V$SYSSTAT, V$SESSTAT, V$FILESTAT,

± Contained cumulative information since startup New opportunities

± V$EVENTMETRIC, V$SESSMETRIC,V$SYSMETRIC, V$FILEMETRIC

± V$SYSMETRIC _HISTORY,V$SESSION_WAIT_HISTORY

± Contain same statistics, but sampled overinterval, also history views

Page 29: Poder 10g New Features

8/8/2019 Poder 10g New Features

http://slidepdf.com/reader/full/poder-10g-new-features 29/32

29/32Tanel Põder NYOUG 2004

SQLPLUS Changes

Improvements

SPOOL CREATE | REPLACE | APPEND± also works for SAVE command

SHOW RECYCLE BIN

SQLPROMPT runtime variable substitution± SET SQLPROMPT "_USER'@'_CONNECT_IDENTIFIER >"

glogin.sql and login.sql scripts are executedalso on CONNECT

Deimprovements

No graphical sqlplusw.exe in Windows

COPY command deprecated

Page 30: Poder 10g New Features

8/8/2019 Poder 10g New Features

http://slidepdf.com/reader/full/poder-10g-new-features 30/32

30/32Tanel Põder NYOUG 2004

Other 

dbms_scheduler

± calendar Expressions: Yearly, Monthly, Weekly,Daily, Hourly, Minutely, Secondely

alter system flush buffer_cache; drop database;

± database must be closed

± mounted exclusively

± restricted default user tablespace

± specifies default tablespace for new users,similar to default temporary tablespace in 9i

Page 31: Poder 10g New Features

8/8/2019 Poder 10g New Features

http://slidepdf.com/reader/full/poder-10g-new-features 31/32

31/32Tanel Põder NYOUG 2004

Conclusion

This was probably < 1% of all new features

Lot¶s of new features = lot¶s of new bugs

Automatic for small to medium systems

Big & heavily loaded systems still need care

Page 32: Poder 10g New Features

8/8/2019 Poder 10g New Features

http://slidepdf.com/reader/full/poder-10g-new-features 32/32

32/32Tanel Põder NYOUG 2004

Oracle 10g Database Engine

New Features For TechiesTanel Põder 

Thank you!

http://integrid.info

[email protected]

integrid.info