Oracle Database 11g - New Features
Transcription
Oracle Database 11g - New Features
<Insert Picture Here> Neue Features der Oracle 11g Datenbank Nik Eichler Leitender Systemberater STCC Düsseldorf Manage Performance & Resource M an ag e Ch an ge Self-Managing Database: Die 3 M s ManageFault Fault Manage Manage Change MEMORY_TARGET, Real Application Testing (RAT), Database Replay, Automatic Maintenance Tasks Management, Incident packaging service (IPS) and incident packages, SQL Test Case Builder, DIAGNOSTIC_DEST, dbms_hm.run_check, DDL_LOCK_TIMEOUT, Standardized trace formats, Automatic Diagnostic Repository Command Interpreter (ADRCI), Grants und Audit Statements für Datamining, automatic capture of diagnostic data upon first failure, READ ONLY table, default resource manager plan enabled, database control enhancements, CONTROL_MANAGEMENT_PACK_ACCESS, flashback data archive, real time monitoring of longtime SQL u.v.m. Database Replay Why DB Replay? 150 Days From: To: Artificial workloads Production workloads Partial workflows Complete workflows Months of development Days of development Manual intensive Automated High risk Low risk 10 Days Trace und Log- Dateien, Health Monitor... Automatic Diagnostic Repository • Ein (!) Repository (sogenanntes ADR) für Diagnostic Daten aus Datenbank, ASM, CRS und anderen Oracle Produkten/Komponenten • ADRCI ist ein neues Command-line Tool: • Um Diagnostic Daten im ADR zu monitoren • Um "incident" und "problem" Informationen in einer ZIP Datei zur Verfügung zu stellen • Ohne Login nutzbar • Bietet Interface für Health Monitor Checks ADR Interface Manage Performance & Resource M an ag e Ch an ge Self-Managing Database: Die 3 M s ManageFault Fault Manage Manage Availability RAC optimized cache Fusion, Total Recall, Flashback Data Archive, Data Recovery Advisor, Oracle Flashback Transaction Backout, ASM fast mirror (DISK) resync, SYSASM role and OSASM OS group, ASM variable size extents, ASM preferred read, multisection RMAN backup, lost write detection, Snapshot standby, Real-time query capability of physical standby, LOGMiner in EM, Use of physical standby database for rolling upgrades,Faster role transitions, Support for additional object datatypes and PL/SQL package support, READ_ONLY_OPEN_DELAYED, Heterogeneous Data Guard Configuration (Linux und Windows), Support Transparent Data Encryption, Compression of redo traffic over the network in a Data Guard configuration, Improved Integration with RMAN u.v.m Flashback-Techniken Problem Lösung Konfiguration DROP USER, TRUNCATE... Flashback Database Flash Recovery Area, FLASH- und ARCHIVELOG Mode DROP TABLE Recycle Bin Default DML Flashback Table Flashback Transaction Query Undo Management BatchJobs Flashback Version Flashback Transaction Query Undo Management Und nun ....... Flashback Data Archive • Speicherung von Veränderungen durch Transaktionen über langen Zeitraum • Einfache Nutzung mit AS OF select * from employees AS OF TIMESTAMP (systimestamp - interval '3' month) where last_name='Fox' Flashback Data Archive: Einfaches Setup und Verwendung • Erzeugen des Data Archive mit Retention Policy: create FLASHBACK ARCHIVE ts1 tablespace QUOTA 100M RETENTION 2 year; • Einschalten für die Tabellen: alter table employees FLASHBACK ARCHIVE ts1; Im Hintergrund: • Anwenden: select * from employees AS OF TIMESTAMP (systimestamp - interval '3' month) where last_name='Fox' Transaction Backout: Was ist das? • Rollback einer Transaktion und der abhängigen Transaktionen • Verwendet dazu Undo, Archivierte Redo Logs und Supplemental Logging • Analysiert die Abhängigkeiten der Transaktionen, führt DML durch und generiert Berichte • Führt kein COMMIT durch • Verwendbar im EM und mit Package DBMS_FLASHBACK.TRANSACTION_BACKOUT Gesteuert über Database Control Dataguard News 3 - Real Time Query • • • • Physical Standby für Abfragen öffnen Log Apply läuft im Hintergrund weiter Volles Disaster Recovery Voll-aktive Nutzung der Standby-Datenbank Redo Shipping PROD und Redo Apply phySTBY Dataguard - Snapshot Standby • Physical Standby Read/Write öffnen, Testen, Daten ändern - und danach einfach auf Knopfdruck wieder zurückstellen • Dabei Zero Data Loss erhalten Updates Primary Database Queries Updates Physical Standby Snapshot Database Database Dataguard - Transient Logical Standby • Für Rolling Upgrades die Physical Standby in eine Logical Standby transferieren, das Upgrade durchführen und danach wieder Rücktransformation in eine Physical Standby Physical Logical Upgrade Physical ASM Fast Mirror Resync • Fraction of time to establish redundancy • Only changed blocks are resync’ed 1 Failure time < DISK_REPAIR_TIME • Benefits: 2 Disk again accessible: Only need to resync modified extents • Fast recovery from transient failures • Enables pro-active maintenance ASM Preferred Mirror Read • Allow local mirror read operations • Eliminate network latencies in extended clusters Site A Site B Extended Cluster S P ASM_PREFERRED_READ_ FAILURE_GROUPS=DATA .SITEA ASM_PREFERRED_READ_ FAILURE_GROUPS=DATA .SITEB SELECT preferred_read FROM v$asm_disk; SELECT * FROM v$asm_disk_iostat; RMAN 11g • Demo RMAN Advisor Manage Performance & Resource M an ag e Ch an ge Self-Managing Database: Die 3 M s ManageFault Fault Manage Manage ALL your data SECUREFILE, LOB Deduplicate, LOB compression, invisible index, XMLDIFF, XMLPATCH, compound DML trigger, Reihenfolge für Trigger Firing, LOCK TABLE WAIT, REGEXP_COUNT, PL/SQL hierarchical profiler, CUBE_TABLE Funktion, XML Index, READ ONLY table, SIMPLE_INTEGER, function result cache, CONTINUE statement, PL/SQL Native Compiler, PL/Scope, Inlining, SQL Developer Erweiterungen, Result Cache Memory Pool, database resident connection pool, XML storage: binary XML, repository events, native xml db web services, in place schema evolution, Xlink, Xinclude, JSR-170 support, Composite Domain Index für Text, Oracle Text Manager, user defined scoring, incremental text indexing, OWL inferencing, 3-D geometry support, DICOM-Format Unterstützung, ORDDicom Objekttyp, PHP Connection Pool, Online Domain Index Rebuild, APEX by default u.v.m. Result Cache • Memorybereich für Resultate für sich wiederholende Ergebnisse aus Queries und PL/SQL-Funktionen • Poolbereich wird im Shared Pool reserviert • Bei Veränderungen: Cache Refresh/Invalidierung • Einstellung auf Session/System-, Tabellen-Ebene und mit Hint • Parameter: RESULT_CACHE_MODE (MANUAL/FORCE/AUTO) • Größeneinstellung: RESULT_CACHE_MAX_SIZE query 1 executes cached Group resultby join Table 1 join join Table 4 query 2 uses cached result transparently Group by join Table 2 join Table 3 Table 5 Table 5 PL/SQL Function Cache create or replace function plcache return number result_cache relies_on(scott.emp) is … OCI Consistent Client Cache Application Server Consistent Caching Database • Caches query results on client • Improves performance for read-mostly tables • • Faster response time - eliminates network round trips Saves server CPU • Consistent with server • • • Cache proactively refreshed when result set changes Same consistency semantics as RAC max_commit_propagation Like Cache Fusion between server and client Manage large data Manage performance SQL Performance Analyzer (SPA), OLTP compression, Automatischer SQL Tuning Advisor, ASH enhancements, Interval Partitioning, system partitioning, ref partitioning, pivot und unpivot operator, partition advisor, list-list, listrange, list-hash range-rangepartitioning, virtual column based partitioning, query rewrite enhancements, refresh enhancements, ILM, securefile, LOB compression, LOB deduplication, automatic performance diagnostic, enhanced optimizer statistics (multi column statistics), resource manager (I/O statistics), query result cache, SQL plan baselines, SQL plan management, AWR baslines, ADDM for clusters, pending statistics, publication of statistics, data pump compression, compression for external tables, SQL Test Case Builder, RESULT_CACHE_MODE u.v.m SQL Tuning in Oracle Datenbank 10g Implementieren Workload Empfehlungen bewerten DBA DBA Empfehlungen generieren one hour DBA ADDM AWR Advisor aufrufen SQL Tuning Kandidaten SQL Tuning Advisor Bedeutende Automatisierung, aber DBA noch erforderlich Automatisches SQL Tuning in Oracle 11g Implement SQL Profiles Test SQL Profiles Workload Generate Recommendations Choose Candidate SQL SQL Tuning Candidates one week AWR DBA It’s Automatic! View Reports / Control Process Automatisches Memory Tuning O/S Memory O/S Memory SGA SGA PGA PGA • Automatiche Anpassung an Lastveränderungen • Vereint Shared-(SGA) und Prozess- (PGA) Memory Management • Ein dynamischer Parameter • Maximiert MemoryAusnutzung • Verhindert out- of-memory Fehler • Verwaltet OS Memory: Linux, Windows and Solaris, HPUX, AIX Partitioning,Partitioning,Partitioning Version Funktionen Manageabibility Oracle8 Range Global range indexes Maintenance Operationen wie add, drop, exchange… Oracle8i Hash composite range-hash Merge Operation Oracle9i List Global Index Maintenance Oracle9iR2 Composite range-list Oracle10g Global hash indexes Local Index Maintenance Oracle10gR2 Partitionen pro Tabelle (1024 K) Fast drop table Oracle 11g List-List List-Range List-Hash Range-Range REF Partitioning Virtual Column Partitioning System Partitioning Interval Partitioning Partition Advisor Interval Partitioning CREATE TABLE sales (order_date DATE, ...) PARTITON BY RANGE (order_date) INTERVAL(NUMTOYMINTERVAL(1,'month') (PARTITION p_first VALUES LESS THAN ('01-FEB-2006'); Table SALES ... Jan 2006 Feb 2006 Mar 2006 1te Partition wird angelegt ... Jan 2007 ... Oct 2009 Später hinzugefügt Nov 2009 Virtual Columns & Partitioning Create table t1 ( first_name varchar2(15), last_name varchar2(20), full_name as (first_name||' '||last_name) virtual ); • ANSI syntax • Look just like regular columns from SQL perspective • Support for indexes, constraints, statistics, histograms • Used by expression evaluation when applicable • Can partition on virtual columns REF PARTITIONING • Equi-partitions a foreign key table with a primary key table • Foreign key table need not contain the partitioning key Partition Order_lines by Order_Date in Orders table • Foreign keys will be placed in same relative partition as parent primary keys • Joins between primary key and foreign key will be partition-wise SQL Access Advisor: Recommendations SQL Access Advisor SQL cache Workload Hypothetical STS Filter Options Indexes Materialized views Materialized Partitioned views log objects Compression for OLTP • Oracle Database 9i table compression works for DW • Compression for bulk load operations • Direct Path Load • Create Table Select As … • Compression is now viable for OLTP • Regular (non-bulk) INSERT, UPDATE, DELETE • Add, Drop Column • Compression benefits • • • • Reduced disk space consumption – typically 2x to 3x Reduced IO Enhanced cache efficiency Better read performance <Insert Picture Here> Transparent performance: Fine Grained Dependency Tracking The challenge create table t(a number) / create view v as select a from t / alter table t add(Unheard_Of number) / select status from User_Objects where Object_Name = 'V' / • View v ends up invalid in 10.2 because we know only that its dependency parent has changed – at the granularity of the whole object Fine Grained Dependency Tracking • In 11.1 we track dependencies at the level of element within unit • so we know that these changes have no consequence • It’s transparent! • Unnecessary recompilation certainly consumes CPU Oracle 11g: Java in the Database • Java auf aktuellem Stand: J2SE 5.0 (Java 1.5) • Java "just got faster": Just-In-Time-Compiler • Testcase: Arithmetik und Tabellenzugriff • Java ohne JIT: 21 Sekunden • Java mit JIT: 5 Sekunden Java und PL/SQL sind gleichberechtigte Alternativen! ODP.NET 11g • Endlich: Instant Client Support • Unterstützung für Objekttypen • Erweiterungen beim Connection Pool • Als öffentliche Beta bereits jetzt verfügbar! http://www.oracle.com/technology/software/tech/windows/odpnet/index_11gbeta.html Database-Resident Connection Pool • Starten des Connection Pools dbms_connection_pool.start_pool( pool_name => 'SYS_DEFAULT_CONNECTION_POOL' ); • Datenbank-Connect am Beispiel PHP $conn = oci_connect( 'scott', 'tiger', 'localhost:1521/ORCL.de.oracle.com:POOLED' ); Ohne Pool: Mit Pool: ~ 10 Sekunden ~ 5-6 Sekunden Optimizer Statistics • Faster • Order of magnitude faster optimizer stats computations • Efficient incremental maintenance of partitioned table stats • Better • Correlated stats (NDV, histograms) on multiple columns • Safer • Stats gathered can remain private in "statistics workspace" until they are ready to publish for general use Oracle Confidential Bilder, Dokumente und mehr ... Oracle SecureFiles • Securefile = Neue LOB-Storage-Technologie • Bessere Performance • Zusätzliche Features: Deduplication, Encryption • Aktivierung durch Storage-Clause CREATE TABLE LOBTEST( LOBCOL BLOB ) LOB (LOBCOL) STORE AS [SECUREFILE | BASICFILE] [deduplication-params, encrypt-params] • Zusätzlich: Init.ora-Parameter DB_SECUREFILE = [NEVER | PERMITTED | ALWAYS | IGNORE] SecureFiles Für den Entwickler ändert sich ... eigentlich Nichts! • Securefiles sind für den Entwickler transparent • Datentypen weiterhin BLOB/CLOB • Definition in der Storage-Clause oder durch DB-Parameter • Keine funktionalen Unterschiede • Selbst "deduplication" ist transparent für den Entwickler • API-Zugriffe PL/SQL (DBMS_LOB), JDBC, .NET, PHP, ... "These features are implemented in the database and are transparently available to [...] programs through the existing APIs." High Performance File Read Performance 120 100 80 Speed 60 (MB/sec) 40 20 0 SecureFiles Linux Files LOBs 0.1 1 10 File Size (MB) 100 File Write Performance 120 100 80 60 40 20 0 SecureFiles Linux Files LOBs 0.1 1 10 100 File Size (MB) • Preliminary performance compared to Linux filesystem • No network, no logging, single stream of file reads or writes • Filesystem-like performance Database and File System Interfaces • SecureFiles can be accessed by both database clients and file system clients • Database clients use extended LOB interfaces • JDBC, ODBC, OCI, .NET, PL/SQL • 11g has a highly optimized streaming protocol for SecureFiles • File system clients use the file system protocols implemented in the XML DB repository • FTP access • WebDav Access Designed from Scratch • SecureFiles is a major rearchitecture of how the database handles file data • Not an incremental improvement to LOBs • Entirely new: • • • • • • • Disk format Network protocol Versioning and sharing mechanisms Caching and locking Redo and undo algorithms Space and memory management Cluster consistency algorithms Storage Optimized • Deduplication • Multiple copies of identical SecureFiles are stored only once • Great for document management, testing, product “homes” • Significantly better performance for copy operations • Compression • Intelligent – Automatically determines if data is compressible • 2x to 3x compression for typical files • Improves performance by reducing IO, buffer cache requirements, redo generation and encryption overhead • Transparent to applications Oracle TEXT 11g Mehr Performance: Composite Domain Indizes • Optimierung für Mixed Queries und Sortierungen CREATE INDEX myindex on docs(text) INDEXTYPE is CTXSYS.CONTEXT FILTER BY category, publisher, pub_date ORDER BY pub_date desc; • Sortierung und Filtern werden direkt im TEXT-Index durchgeführt Oracle TEXT 11g Mehr Performance: Composite Domain Indexes • Beispiel für eine Mixed Query select rowid from docs where contains(dok, 'Tag') > 0 and pub_date between '2006-01-01' and '2006-12-31' Plan mit Composite Domain Index Plan ohne Composite Domain Index Oracle InterMedia • Neuer Name in den Handbüchern: MultiMedia • Performance / Skalierbarkeit • Objekte bis zu 128TB = LOB Maximum • Performance-Verbesserungen (auch durch JVM) • Stark erweitert: DICOM Unterstützung • Eigener Datentyp ORDDicom Metadatenextraktion, -Manipulation, Anonymisierung, DICOM-Spezifische API • XML basierte Metadaten Nutzung der XML DB Oracle XML DB: Neu: Binary XML und XML Index • Neue Speicherungsform • Compact Binary XML create table xml_tab (doc xmltype) xmltype column store as binary_xml allow nonschema • Neuer Index für XML: XML Index • Für Speicherung als CLOB oder Binary XML create index idx_xml on xml_tab(dokument) indextype is xdb.xml_index PARAMETERS ('PATHS (INCLUDE (/path/to/xml/node)(//anothernode))') Binary XML Challenge • 10.2 schema-less XML not well optimized Solution • 11.1 binary XML optimized for schema-less and flexible schema-based XML • Post Parse compact representation of XML • Flexible XML Schema Support • High performance fragment access and extraction with new XML Index XML DB Native Web Services • Datenbankkomponenten als Web Service bereitstellen • SQL-Abfragen, XQuery-Abfragen • PL/SQL-Prozeduren, -Funktionen und –Packages • Ohne zusätzliche Entwicklung SOAP / HTTP JDBC Middleware • BEA, IBM WS •Oracle 9i •Oracle10g XML DB Native Web Services • Datenbankkomponenten als Web Service bereitstellen • SQL-Abfragen, XQuery-Abfragen • PL/SQL-Prozeduren, -Funktionen und –Packages • Ohne zusätzliche Entwicklung SOAP / HTTP Listener als HTTP Endpoint XML DB Protokollserver WSDL-Generierung on demand Oracle11g XML DB Weitere Neuigkeiten • "Functional Completeness" • XMLTYPE und Data Pump • XMLTYPE und Data Guard Logical Standby (Textbasierte (CLOB)-Speicherung) • Große Textknoten (> 64k) werden unterstützt • Weitere neue Features • "In Place" Schema Evolution • XMLDiff und XMLPatch • PL/SQL ACL basieren auf XML DB (DBMS_NETWORK_ACL_ADMIN, DBMS_NETWORK_ACL_UTILITY) • Allgemein bessere Performance Oracle Spatial 11g ... Die 3. Dimension • Vollständige Unterstützung für 3D-Geometrien • Modellierung Oberflächen, geschlossene Körper, TIN, Punktwolken • Indizierung P(10,10,20) und P(10,10,30) sind verschiedene Punkte • Anwendungsgebiete • 3D-Stadtmodelle • "Noise Maps" (EU) • Google Earth-Integration (KML) SQL: Allgemeine Erweiterungen • Tabellen-Erweiterungen READ ONLY-Tabellen, Virtuelle Columns, Flashback Archive Klausel, Neue Partitioning Klauseln u.v.m. • Index-Erweiterungen INVISIBLE Index, Text Index, XML Index u.v.m. • Funktionen REGEXP-Funktionen, XML-Funktionen wie XMLDIFF,XMLEXISTS, CUBE_TABLE u.v.m. • Statements MERGE für Tabellen mit Domain Indizes, SELECT mit PIVOT und UNPIVOT,CREATE TRIGGER, LOCK TABLE u.v.m. Enhanced SQL – PIVOT und UNPIVOT PROD QUARTER AMOUNT Shoes Q1 2000 Shoes Q2 1000 Jeans Q1 1000 Jeans Q3 500 Jeans Q3 100 Jeans Q4 1000 Beispiel SELECT * FROM sales PIVOT (sum(amount) FOR quarter in ‘Q1’,’Q2’,’Q3’,’Q4’); PROD Q1 Q2 Q3 Q4 Shoes 2000 1000 Null Null Jeans 1000 Null 600 1000 PL/SQL Profiling PL/SQL Hierarchical Profiler • Nicht-hierarchische (flat) Profiler listen die Zeit, die ein Programm in seinen Unterprogrammen verbringt • Wichtige Fragen: • Wieviele Calls überhaupt? • Wieviel Zeit insgesamt auch für die Unterprogramme? • Neu: Dynamisches Execution Profiling von PL/SQL • • • • • Keine spezielle Source nötig Resultat in speziellen "hierarchical profiler" Tabellen Liefert Unterprogramm-Level Execution Informationen Detaillierte parent-children Informationen SQL und PL/SQL werden separat behandelt PL/SQL native Compiler • • • • PL/SQL native Compilation funktioniert out-of-the-box Kein C-Compiler mehr nötig Native Code ist gespeichert im SYSTEM-Tablespace Einzige Einstellung über Session/System/ALTER PROCEDURE Kommandos: PLSQL_CODE_TYPE = NATIVE/INTERPRETED • Besonders sinnvoll bei Berechnungen (BINARY_INTEGER!) mit geringem Anteil an SQL • Tests mit Fibonacci-Zahlen (FIB35) :) • interpreted: 29:01/native: 12:08 Manage Security Tablespace level encryption, Master Key protection in hardware using PKCS #11, Enforced case Sensitivity (SEC_CASE_SENSITIVE_LOGON), SYSDBA and SYSOPER Strong Authentication, SYSASM Privilege for Automatic Storage Management, Intelligent LOB Compression and Encryption with SecureFiles, Compressed and Encrypted Dump File Sets, Automatic Secure Configuration, DBCA, Default Auditing for Security Relevant SQL Statements and Privileges, Configuring Password Settings in the Default Profile, Fine-Grained Access Control on Network Services on the Database, XDB_WEBSERVICES, XDB_WEBSERVICES_OVER_HTTP,XDB_WEBSERVICES_WITH_PUBLIC predefined roles, Enterprise User Security in EM, DB_ULTRA_SAFE u.v.m. Automatic Secure Configuration Audit By Default und Default Profile ALTER ANY PROCEDURE ALTER ANY TABLE ALTER DATABASE ALTER PROFILE AUDIT ROLE ALTER SYSTEM ALTER USER AUDIT SYSTEM BY ACCESS CREATE ANY JOB CREATE ANY LIBRARY CREATE ANY PROCEDURE CREATE ANY TABLE CREATE EXTERNAL JOB CREATE SESSION CREATE USER CREATE PUBLIC DATABASE LINK DROP ANY PROCEDURE DROP ANY TABLE DROP PROFILE DROP USER EXEMPT ACCESS POLICY GRANT ANY OBJECT PRIVILEGE GRANT ANY ROLE GRANT ANY PRIVILEGE Das Default Profile FAILED_LOGIN_ATTEMPTS= 10 PASSWORD_GRACE_TIME = 7 PASSWORD_LIFE_TIME= 180 PASSWORD_LOCK_TIME = 1 PASSWORD_REUSE_MAX = UNLIMITED PASSWORD_REUSE_TIME = UNLIMITED Oracle Scheduler enhancements in Oracle Database 11g Schedule Jobs 11g • Local OS jobs • run as any OS user • Remote OS jobs Execute local OS job A as OS user X & job B as OS user Y • no Oracle database required on node • run as any OS user Agent Agent Execute remote Execute remote OS job as OS user X OS Job as OS user Z Oracle 11g – Neue Optionen • Oracle Real Application Testing • Oracle Advanced Compression • Oracle Total Recall • Oracle Active Data Guard. 11g Veranstaltungen • Oracle Education ab 23.07. • 11g Launch Events • • • • 25.09. Hamburg 16.10. Köln 23.10. Stuttgart 07.11. München • DOAG Special Interest Group • 27.09. Düsseldorf – Umgang mit großen Datenmengen • 28.09. Aktiv Workshop • Internet Seminare in Vorbereitung • 2 x pro Monat, nach der Sommerpause • DOAG Konferenz • 20.-22.11. in Nürnberg • ODD: Hochverfügbarer und sicherer IT-Betrieb mit 11g • in allen NLs ab 29.11. insgesamt 10 Veranstaltungen • Inklusive der Schweiz Fragen Antworten