Transcript

Database Consult GmbH 1

Oracle 11g.. wie wichtig für Ihre Planung?

TOAD User Konferenz 2007Dr. Günter Unbescheid

Database Consult GmbH

©Database Consult GmbH - Jachenau

Oracle Version 11g

10/2007 Folie 2 von 59

Agenda

• Allgemeine Betrachtung zum Thema „Neue Version“und „Aufrüstung“ (upgrade)

• Feature-Übersicht der neuen Version

• Ausgewählte Details

• Zusammenfassung

Database Consult GmbH 2

©Database Consult GmbH - Jachenau

Oracle Version 11g

10/2007 Folie 3 von 59

Teil 1:Betrachtung zum Thema „Upgrade“

©Database Consult GmbH - Jachenau

Oracle Version 11g

10/2007 Folie 4 von 59

11g10g9i8i...7

...natürliche Evolution...?

Bild: H.Speer, Bad Tölz

...oder Versions-Kannibalismusin der Endlosschleife...??

Database Consult GmbH 3

©Database Consult GmbH - Jachenau

Oracle Version 11g

10/2007 Folie 5 von 59

Versions-Evolution...

Phase 1Version 1.0

Phase 2Essentielles

Phase 3Wichtiges

Phase 4Extremes ??

„Ideologisches“ Marketing

©Database Consult GmbH - Jachenau

Oracle Version 11g

10/2007 Folie 6 von 59

Ideologischer Hintergrund• Enlose Aufwärtspirale technischen

Fortschritts (innovation)• Ethik des globalen „Marketplace“:

innovate or die• Innovation als Resultat feinmaschiger,

kreativer Informationsvernetzungen• Informationsexplosion• Information in „realtime“: Kettenreaktion

innovativer Prozesse ausgelöst• Datenbanken ordnen das „Chaos“

– Wertschöpfung durch „Entlastung“ des Gehirns

– Ständig wechselnde Anforderungen treiben die (Versions)-Innovationen

– „meet global competion“

Database Consult GmbH 4

©Database Consult GmbH - Jachenau

Oracle Version 11g

10/2007 Folie 7 von 59

Selbsteinschätzung Oracle

• Kunden treiben Entwicklung an –„customer release“– „listen carefully to customers“

• Quality Release– intensive, regelmässige Tests– Entwickler treffen Kunden– > 400 User Groups

• „customer advisory boards“– security and compliance– manageabílity and diagnostics– Performance and Scalability– High Availability

©Database Consult GmbH - Jachenau

Oracle Version 11g

10/2007 Folie 8 von 59

Selbsteinschätzung Upgrade Cycle

• Experten: keine Notwendigkeit für neues Release

• Führungskräfte: abheften und abwarten• DBAs und Techniker: download• User Groups: Auseinandersetzung mit den

Features (devour)• Software Vendor nutzen Features• Consultants implementieren neue Version in

Projekten

Database Consult GmbH 5

©Database Consult GmbH - Jachenau

Oracle Version 11g

10/2007 Folie 9 von 59

Feature-Relevanz

Unternehmensziele

Stabilität

ProduktvergleichMarketing

AnforderungenFunktionsprofile

Die Relevanz neuer Features entscheidet jeder Kunde für sich

©Database Consult GmbH - Jachenau

Oracle Version 11g

10/2007 Folie 10 von 59

Beurteilungs-Perspektiven

Programmierer-Perspektive

Betreiber-Perspektive

Experiment versus Konstanz

Database Consult GmbH 6

©Database Consult GmbH - Jachenau

Oracle Version 11g

10/2007 Folie 11 von 59

Kriterien

Kosten-minimie-

rung

Kosten

InstabilitätFehler

Laufzeit-verände-rungen

Support-ende�

NeueFeatures

Perfor-mance

Fehler-behe-bung

Applik.anforde-

rung

Upgrade

©Database Consult GmbH - Jachenau

Oracle Version 11g

10/2007 Folie 12 von 59

Verfügbarkeit 11g

Database Consult GmbH 7

©Database Consult GmbH - Jachenau

Oracle Version 11g

10/2007 Folie 13 von 59

Teil 2:Feature Übersicht (Auswahl)

©Database Consult GmbH - Jachenau

Oracle Version 11g

10/2007 Folie 14 von 59

Design-Ziele

Perfor-mance

redzierte Betriebs-kosten

ease of use

ChangeManage-

ment

Database Consult GmbH 8

©Database Consult GmbH - Jachenau

Oracle Version 11g

10/2007 Folie 15 von 59

Change Management

• SQL Performance Analyzer• SQL capture/replay (real application testing) �• RAC rolling upgrade – Hot patching

©Database Consult GmbH - Jachenau

Oracle Version 11g

10/2007 Folie 16 von 59

Ease of Use

• ADR – automatic diagnostic repository �– Incident Packaging Services (IPS)

• Partitioning – neue Typen, automatische Erzeugung �• OEM – gleicher „look and feel“• Data Recovery Advisor �• SQL Repair Advisor

Database Consult GmbH 9

©Database Consult GmbH - Jachenau

Oracle Version 11g

10/2007 Folie 17 von 59

Performance

• Automatic Memory Tuning – PGA und SGA �• Automatic SQL Tuning – SQL Plan management �• Adaptive Cursors �• Erweiterter Resource Manager – IO / Kalibrierung• Optimizer Statistiken – „pending“ und „extended“�• Securefiles• RMAN UNDO bypass

©Database Consult GmbH - Jachenau

Oracle Version 11g

10/2007 Folie 18 von 59

Performance

• Invisible Indexes �• Erweiterter SQL Access Advisor• Fine Grain dependency tracking• Result Caches – server, client, function �• Erweiterte Baselines �• Adaptive Threshholds �

Database Consult GmbH 10

©Database Consult GmbH - Jachenau

Oracle Version 11g

10/2007 Folie 19 von 59

Kostenreduzierung

• Information Life Cyle Mangement (ILM)– Strategien und Features für kostenreduzuierende Speicherung

• verbesserte Tabellen-/Index-Komprimierung �• Data Guard – erweiterte Nutzung, standby snapshot

©Database Consult GmbH - Jachenau

Oracle Version 11g

10/2007 Folie 20 von 59

Kleines und Feines

• Datatypes: simple_integer• virtual columns �• Binary XML-Storage• Compound trigger �• Flashback Data Archive �• DDL Wait Option• Add Column Default

Database Consult GmbH 11

©Database Consult GmbH - Jachenau

Oracle Version 11g

10/2007 Folie 21 von 59

Kleines und Feines

• read only Tables• Sequence Management ohne DML• Verbesserte Passwörter �• Audit Vault und Database Vault (offline release)• PL/SQL

– loop continue– native compile ohne C-Compiler, automatisiert

©Database Consult GmbH - Jachenau

Oracle Version 11g

10/2007 Folie 22 von 59

Teil 3:Ausgewählte Details

Database Consult GmbH 12

©Database Consult GmbH - Jachenau

Oracle Version 11g

10/2007 Folie 23 von 59

Oracle 11g in Zahlen

• über 400 neue Features

Quelle: Julian Dyke

©Database Consult GmbH - Jachenau

Oracle Version 11g

10/2007 Folie 24 von 59

Management Packs EE

• Diagnostic Pack– ADDM for RAC– AWR Baselines– Transportable AWR

• Tuning Pack– Automatic SQL Tuning Advisor– Partition Advisor– SQL Monitoring– SPM Automatic Plan Evolution

Database Consult GmbH 13

©Database Consult GmbH - Jachenau

Oracle Version 11g

10/2007 Folie 25 von 59

Automatic Workload Repository Baselines

• Oracle Database 11g Erweiterungen für AutomaticWorkload Repository baselines.– Out-of-the-box Moving Window Baseline über komplette AWR

Retention (8 Tage)• hierfür können adaptive thresholds definiert werde

– Baseline Templates für die Erzeugung von Baselines• einmalig oder wiederholt mit Verfallsdatum

– Rename baselines

©Database Consult GmbH - Jachenau

Oracle Version 11g

10/2007 Folie 27 von 59

Baseline Templates

– Allows you to schedule the creation of Baselines for future time period(s) of interest

• Single Time Period in the future• Repeating Schedule

– For example:• A known holiday weekend• Every Monday morning from 10am-2pm

– Once the Baseline Template has been specified for a future time period, MMON will detect when the end time has passed and will create the Baseline.

Database Consult GmbH 14

©Database Consult GmbH - Jachenau

Oracle Version 11g

10/2007 Folie 29 von 59

Adaptive Cursor Sharing• 10g

– bind variable peeking bei hard parse– bad luck bei soft parse

• 11g– auch: extended cursor sharing– Beobachtung der Werte von Bind Variablen („bind sensitive cursor“ ) –

erstellt bind profiles– Bei unterschiedlicher Selektivität Makierung - „bind aware cursor

matching“– ggf. mehrere Ausführunhgspläne pro Statement

Views:

v$sql (is_bind_sensitive, is_bind_aware)V$SQL_CS_HISTOGRAMV$SQL_CS_SELECTIVITYV$SQL_CS_STATISTICS

©Database Consult GmbH - Jachenau

Oracle Version 11g

10/2007 Folie 30 von 59

SQL Plan Management• Veränderte SQL-Zugriffspläne kommen nur zum Einsatz

wenn sie besser sind.• SQL Plan Baselines

– für „wiederholt“ ausgeführte Statements – keine ad-hoc St.– gespeichert in SMB (SQL management Base - SYSAUX) in

Form von „plan baselines“• SQL text, outline, bind variables, und compilation

environment– automatisch über optimizer_capture_sql_plan_baselines (default FALSE) – View DBA_SQL_PLAN_BASELINES

– oder explizit geladen (SQL Sets/AWR, Cursor Cache)– nutzbar über optimizer_use_sql_plan_baselines– Schnittstellen EM und DBMS_SPM

Database Consult GmbH 15

©Database Consult GmbH - Jachenau

Oracle Version 11g

10/2007 Folie 31 von 59

SQL Plan Management

• Neue Pläne werden als „non-accepted“ der Baseline hinzugefügt und als accepted eingestuft, wenn sie erfolgreich verifiziert werden können

• Konfiguration: %-Anteil von SYSAUX, Purge-Periode nicht genutzter Pläne (plan retention)

SET SERVEROUTPUT ONSET LONG 10000DECLAREreport clob;

BEGINreport := DBMS_SPM.EVOLVE_SQL_PLAN_BASELINE(

sql_handle => 'SYS_SQL_593bc74fca8e6738');DBMS_OUTPUT.PUT_LINE(report);

END;

©Database Consult GmbH - Jachenau

Oracle Version 11g

10/2007 Folie 32 von 59

Automatic Memory Management 10g

DB_KEEP_CACHE_SIZEDB_RECYCLE_CACHE_SIZE

DB_nK_CACHE_SIZE

LOG_BUFFER_SIZESHARED_POOL_SIZEDB_CACHE_SIZELARGE_POOL_SIZEJAVA_POOL_SIZESTREAMS_POOL_SIZE

Auto-tuned Manuell dynamisch Manuell statisch

SGA_TARGET SGA_MAX_SIZE

PGA_AGGREGATE_TARGETWORKAREA_SIZE_POLICY

Database Consult GmbH 16

©Database Consult GmbH - Jachenau

Oracle Version 11g

10/2007 Folie 34 von 59

Automatic Memory Management 11g

DB_KEEP_CACHE_SIZEDB_RECYCLE_CACHE_SIZEDB_nK_CACHE_SIZE

LOG_BUFFER_SIZERESULT_CACHE_SIZE

SHARED_POOL_SIZEDB_CACHE_SIZELARGE_POOL_SIZEJAVA_POOL_SIZESTREAMS_POOL_SIZE

SGA_TARGET

SGA_MAX_SIZE

MEMORY_MAX_TARGET

MEMORY_TARGET

Diverse

PGA_AGGREGATE_TARGET

©Database Consult GmbH - Jachenau

Oracle Version 11g

10/2007 Folie 35 von 59

Flashback• Undo_management + undo_retention

– Version 9i – FB Query– Version 10g – FB table, FB drop, FB version query

• FB recovery area – 10g FB Database• Version 11g – FB data archive

– genutzt durchFB query, unabhängig von retention– geschrieben durch separaten BG-Prozess FBDA

create flashback archive near_termtablespace far_near_term retention 1 month/alter table TRANS flashback archive near_term/alter flashback archive near_term purge before scn 1234567/

Database Consult GmbH 17

©Database Consult GmbH - Jachenau

Oracle Version 11g

10/2007 Folie 36 von 59

Result Cache• Chaching von Result Sets, nicht von Blöcken -> Speichereffizienz• „just-in-time materialized view“ - Teil des Shared Pool• Gültig bis abhängige Objekte modifiziert werden• 3 Ebenen implementiert

– Server Side + Client Side – OCI-Calls + PL/SQL function results-- Parameterresult_cache_max_sizeresult_cache_max_result (Prozentsatz eines Results)result_cache_mode = { MANUAL | FORCE }select /*+ result_cache */ ....-- Function CacheCREATE FUNCTION x (p_x IN NUMBER) RETURN NUMBERRESULT_CACHE RELIES_ON(table_t) AS ...--SELECT dbms_result_cache.status() FROM dual;-- DiversesV$RESULT_CACHE_STATISTICS - DBMS_RESULT_CACHE.MEMORY_REPORTDBMS_RESULT_CACHE.FLUSH

©Database Consult GmbH - Jachenau

Oracle Version 11g

10/2007 Folie 37 von 59

Table Compression

• 10g: nur wirksam bei direct path load -> OLAP

• 11g: Support für DML und add/drop column -> OLTP– gesamte Tabelle oder– einzelne Partitionen

Compression

kompaktereBlockspeicherung

geringeCache-Belastung

reduziertes IObessere Cache Hits

CPU

CREATE TABLE ... ( ... )COMPRESS FOR ALL OPERATIONS;CREATE TABLE ... ( ... ) COMPRESS { FOR DIRECT_LOAD OPERATIONS };CREATE TABLE ... ( ... ,region varchar2(10)) COMPRESSPARTITION BY LIST (region)(PARTITION nw VALUES (NW'),PARTITION sw VALUES ('SW'),PARTITION ne VALUES ('NE') NOCOMPRESS,...);

Database Consult GmbH 18

©Database Consult GmbH - Jachenau

Oracle Version 11g

10/2007 Folie 38 von 59

Database Replay

DR Restrtiktionen: keine MTS-calls u.a.

Real Application Testing = DR + SQL Performance Analyzer

capture directoriescapture files („binär)Filter sind möglich (inklusiv / exklusiv)

create directory dbcapture as '/home/oracle/dbcapture';# Capture activity using EM or DBMS_WORKLOAD_CAPTURE# z.B. ADD_FILTER, START_CAPTURE, FINISH_CAPTURE, PROCESS_CAPTURE# monitoring DBA_WORKLOAD_CAPTURES, DBA_WORKLOAD_FILTERS

©Database Consult GmbH - Jachenau

Oracle Version 11g

10/2007 Folie 40 von 59

RMAN

rman target=/...RMAN> list failure;using target database control file instead of recovery catalogList of Database Failures=========================Failure ID Priority Status Time Detected Summary---------- -------- --------- ------------- -------142 HIGH OPEN 15-JUL-07 One or more non-

system datafiles are missingRMAN> list failure 142 detail;RMAN> advise failure;List of Database Failures=========================Failure ID ...analyzing automatic repair options; this may take some timeusing channel ORA_DISK_1analyzing automatic repair options complete

Database Consult GmbH 19

©Database Consult GmbH - Jachenau

Oracle Version 11g

10/2007 Folie 41 von 59

RMANMandatory Manual Actions========================no manual actions available

Optional Manual Actions=======================1. If file /home/oracle/oradata/PRODB3/users01.dbf was unintentionally renamed or moved, restore it

Automated Repair Options========================Option Repair Description------ ------------------1 Restore and recover datafile 4Strategy: The repair includes complete media recovery with no data lossRepair script:/home/oracle/app/diag/rdbms/prodb3/PRODB3/hm/reco_3162589478.hm

©Database Consult GmbH - Jachenau

Oracle Version 11g

10/2007 Folie 42 von 59

RMAN

RMAN> repair failure preview;Strategy: The repair includes complete media recovery with no data lossRepair script:/home/oracle/app/diag/rdbms/prodb3/PRODB3/hm/reco_741461097.hmcontents of repair script:# restore and recover datafilesql 'alter database datafile 4 offline';restore datafile 4;recover datafile 4;sql 'alter database datafile 4 online';RMAN> repair failure;...<Anzeige des Scripts>Do you really want to execute the above repair (enter YES or NO)?...<Logging der Atkionen>repair failure complete

Database Consult GmbH 20

©Database Consult GmbH - Jachenau

Oracle Version 11g

10/2007 Folie 43 von 59

RMAN Health ChecksRMAN> validate database;Starting validate at 09-SEP-07using target database control file instead of recovery catalogallocated channel: ORA_DISK_1...channel ORA_DISK_1: validation complete, elapsed time: 00:02:18List of Datafiles=================File Status Marked Corrupt Empty Blocks Blocks Examined High SCN---- ------ -------------- ------------ --------------- ----------7 FAILED 0 0 128 5556154File Name: /home/oracle/oradata/ODEL11/test01.dbfBlock Type Blocks Failing Blocks Processed---------- -------------- ----------------Data 0 108Index 0 0Other 10 20# Auch noch:validate tablespace / datafile / controlfilecopy / spfile etc.

©Database Consult GmbH - Jachenau

Oracle Version 11g

10/2007 Folie 44 von 59

Partitioning

• Extended Composite P.– list-list– range-range– list-range– list-hash

• Partition Extentsions– interval (range mit

automatischerErweiterung) – für NUMBER und DATE

– reference– virtual column – p.key ist

ein Ausdruck

Database Consult GmbH 21

©Database Consult GmbH - Jachenau

Oracle Version 11g

10/2007 Folie 45 von 59

Interval-Partitioningcreate table T( sales_id number,sales_dt date)partition by range (sales_dt)interval (numtoyminterval(1,'MONTH'))(

partition p0701 values less than (to_date('2007-02-01','yyyy-mm-dd'))

);insert into T values (1,'01-jun-07');insert into sales6 values (1,'01-may-07');-- aus USER_TAB_PARTITIONS PARTITION_NAME-------------------P0701SYS_P41 SYS_P42#>> interval (numtoyminterval(1,'MONTH'))#>> store in (TS1,TS2,TS3)#>> ..* from T partition for (to_date('15-may-2007‘,...));

©Database Consult GmbH - Jachenau

Oracle Version 11g

10/2007 Folie 48 von 59

Invisible Indexes

• Index ist physisch vorhanden, jedoch „unsichtbar“ für Optimizer– Ausnahme: Index-Hint

• DML-Operation aktualisieren Index• Sinnvoll für Performance-Tests:

– vor dem Löschen eines Index– Nach dem Anlegen und vor dem Sichtbarmachen

create index in_res_guest on res (guest_id);-- Index ist für alle nutzbaralter index in_res_guest invisible;-- Index wird per Default nicht genutzt, umschalten über:alter session set optimizer_use_invisible_indexes = true;-- Index neu als invisible anlegencreate index ... invisible;

Database Consult GmbH 22

©Database Consult GmbH - Jachenau

Oracle Version 11g

10/2007 Folie 49 von 59

Virtual Columnscreate table SALES(sales_id number, cust_id number, sales_amt number,sale_category varchar2(6)generated always as( case when sales_amt <= 10000 then 'LOW'

when sales_amt > 10000 and sales_amt <= 100000then case

when cust_id < 101 then 'LOW'when cust_id between 101 and 200 then 'MEDIUM'else 'MEDIUM'end

....end

) virtual )partition by list (sale_category)(partition p_low values ('LOW'),partition p_medium values ('MEDIUM'),..

©Database Consult GmbH - Jachenau

Oracle Version 11g

10/2007 Folie 51 von 59

Trigger-- > compound triggercreate or replace trigger tr_bookings_trackfor update of booking_dt on bookingscompound trigger...before statement isbegindbms_output.put_line('In before statement');

end before statement;before each row isbegin ...-- > execution order auf einer Ebene: Design ?!create or replace trigger xxxbefore update on Tfor each rowfollows <triggername>begin ....--Create trigger ... disable begin ...

Database Consult GmbH 23

©Database Consult GmbH - Jachenau

Oracle Version 11g

10/2007 Folie 53 von 59

Security

• User mit Standard-Passwörtern anzeigen– View DBA_USERS_WITH_DEFPWD

• case-sensitive passwords– aufwendigere brute-force-attacks– alter system set sec_case_sensitive_logon = false;

• View DBA_USERS– Password Spalte ohne Hash-Wert– Neue Spalte PASSWORD_VERSIONS

• orapwd file=orapwPRODB3 password=abc123 entries=10 ignorecase=n

©Database Consult GmbH - Jachenau

Oracle Version 11g

10/2007 Folie 54 von 59

Security

• Password verify function Bestandteil des Standard-Profiles für Benutzer

• Auditing– Voreinstellung audit_trail=DB– insgesamt 24 Einstellungen audit by default (Vorsicht bei der Migration)

• Transparent Tablespace Encryption– Index Range Scans möglich

alter system set encryption key identified by "abcd1234!";alter system set wallet open identified by "abcd1234!“/create tablespace secure1 datafile '...‚ size 1Mencryption using 'AES128' default storage (encrypt)/

Database Consult GmbH 24

©Database Consult GmbH - Jachenau

Oracle Version 11g

10/2007 Folie 55 von 59

SQL Tuning unter Oracle 10g

Workload

SQL Tuning CandidatesSQL Tuning

Advisor

ADDM

AWR

one hour

GenerateRecommendations

DBA

Invoke Advisor

Implement

DBA

EvaluateRecommendations

DBA

Quelle: Oracle

©Database Consult GmbH - Jachenau

Oracle Version 11g

10/2007 Folie 56 von 59

SQL Tuning automatisiert

one week

It’s Automatic!

Choose Candidate

SQL

Workload

SQL Tuning Candidates

Test SQL ProfilesImplementSQL Profiles

GenerateRecommendations

AWRDBA

View Reports / Control Process

Database Consult GmbH 25

©Database Consult GmbH - Jachenau

Oracle Version 11g

10/2007 Folie 57 von 59

Automatic Diagnostic Repository

diag

rdbms

DBName

SID

ADRBase

$ORACLE_HOME/log

DIAGNOSTIC_DEST

ADRHome

$ORACLE_BASE

ADRCIlog.xml alert_SID.log

V$DIAG_INFO

BACKGROUND_DUMP_DEST

USER_DUMP_DEST

CORE_DUMP_DEST

alert cdump (others)hmincpkg incident

metadata

incdir_1 incdir_n…

trace

Support Workbench

©Database Consult GmbH - Jachenau

Oracle Version 11g

10/2007 Folie 59 von 59

Teil 4:Zusammenfassung

Database Consult GmbH 26

©Database Consult GmbH - Jachenau

Oracle Version 11g

10/2007 Folie 60 von 59

Oracle 11g

• Die Wichtigkeit der Features entscheided das jeweilige Projekt

• Keine „Knüller-Features“• Interessante Weiterführung von 10g-Trends:

– Automatisierung – Ease of Use– Performance-/Tuning-Features– Verfügbarkeit-/Kosten-Features

• Viel „Kleines & Feines“• Stabilität / Performance von 11.1.0.6 – in Ordnung• Bisher geringe Portierungs-Dichte: nur x86-Linux

©Database Consult GmbH - Jachenau

Oracle Version 11g

10/2007 Folie 61 von 59

Danke für‘s Zuhören


Recommended