g Oracle Database 10

:

Managing the SelfManaging Database
‫הדר פייס‬ ‫יונתן טולדנו‬ Certified Oracle 10g Technician

How DBAs Spend Their Time?
Install 6% Maintain Software 6% Load Data 6% System Management 55% Create & Configure 12%

How DBAs Spend Their Time?
Install 6% Create & Configure 12%

Maintain Software 6%

Load Data 6%

System Management 55%

OID etc. memory. disk space consumption greatly reduced Extremely lightweight client install (3 files) using Oracle Instant Client • Automation of All Pre and Post Install Steps – Validate OS Configuration. 20 Minutes CPU. – Configure all components (listeners.) for automatic startup and shutdown • Enhanced silent install . agent. patches. database. OMS.Software Installation • Fast lightweight install – – – – Major redesign of installation process Single CD. resource availability etc.

g.Simplified Creation & Configuration • Greatly reduced database creation time using pre-configured. e. backups • Automatically configures LDAP server • Automatic Shared Server Set-up • Easy Connect Naming . ready-to-use database • 90% reduction of initialization parameters: < 30 Basic parameters • Automatically setup common tasks.

Basic Parameters y y y y y y y y y compatible processes sessions y y y y y y y cluster_database db_block_size sga_target control_files db_name db_recovery_file_dest remote_listener db_recovery_file_dest_size y y y y y y 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 pga_aggregate_target y nls_language nls_territory db_domain shared_servers instance_number .

Simplified Upgrade • • • • • Pre upgrade checks (e. parameter settings) Post upgrade status checks Time estimator Re-startable Guide administrators in using best practices .g.

Out-of-the-Box Database Control • No separate install • Fully functional administration and monitoring after database creation • Listener discovery. configuration & monitoring .

How DBAs Spend Their Time? Install 6% Maintain Software 6% Create & Configure 12% System Management 55% Load Data 6% .

.Data Pump: What is it? • Server-based facility for high performance loading and unloading of data and metadata • Callable: DBMS_DATAPUMP. • Foundation for Streams. Transportable Tablespaces and Data Mining initial instantiation. Metadata written as XML • New clients expdp and impdp: Supersets of original exp / imp. Internally uses DBMS_METADATA • Data written in Direct Path stream format. Logical Standby. Grid.

5-2X exp Single thread of data load: 15X-40X imp With index builds: 4-10X imp . two-level parallelism – – – – Direct Path for inter-partition parallelism External Tables for intra-partition parallelism Simple: parallel=<number of active threads> Dynamic: Workers can be added and removed from a running job in Enterprise Edition – Index builds automatically “parallelized” up to degree of job • • • • Simultaneous data and metadata unload Single thread of data unload: 1.Features: Performance!! • Automatic.

Features: Checkpoint / Restart • Job progress recorded in a “Master Table” • May be explicitly stopped and restarted later: – Stop after current item finishes or stop immediate • Abnormally terminated job is also restartable • Current objects can be skipped on restart if problematic .

Features: Monitoring • Flexible GET_STATUS call • Per-worker status showing current object and percent done • Initial job space estimate and overall percent done • Job state and description • Work-in-progress and errors .

Metadata API runs remotely.Features: Network Mode • Network import: Load one database directly from another • Network export: Unload a remote database to a local dumpfile set – Allows export of read-only databases • Data Pump runs locally. Data is moved as ‘insert into <local table> select from <remote table>@service_name’ • Direct path engine is used on both ends • It’s easy to swamp network bandwidth: Be careful! . not pipes. • Uses DB links / listener service names.

but use of both is prohibited by new clients • Both take an optional name filter for even finer granularity: – INCLUDE PACKAGE: “LIKE ‘PAYROLL%’ “ – EXCLUDE TABLE: “IN (‘FOO’.Features: Fine-Grained Object Selection • All object types are supported for both operations: export and import • Exclude: Specified object types are excluded from the operation • Include: Only the specified object types are included. functions and procedures • More than one of each can be specified. just retrieve packages.g.’BAR’. … )’ “ . E.

table. but a single client can attach to only one job at a time • If privileged. tablespace. Superset of exp / imp • Flashback is supported • Query supported by both expdp and impdp… and on a per-table basis! • Detach from and attach to running jobs • Multiple clients per job allowed.New Clients – expdp / impdp • Similar (but not identical) look and feel to exp / imp • All modes supported: full. schema. transportable. attach to and control other users’ jobs .

leaving it restartable.New Clients – expdp / impdp • Interactive mode entered via Ctl-C: – ADD_FILE: Add dump files and wildcard specs. to job – PARALLEL: Dynamically add or remove workers – STATUS: Get detailed per-worker status and change reporting interval – STOP_JOB{=IMMEDIATE}: Stop job. leave job running . dump files) leaving it unrestartable – CONTINUE: Leave interactive mode. continue logging – EXIT: Exit client. Immediate doesn’t wait for workers to finish current work items… they’ll be re-done at restart – START_JOB: Restart a previously stopped job – KILL_JOB: Stop job and delete all its resources (master table.

Features: Other Cool Stuff… • Can extract and load just data. truncate then load or append to it. just metadata or both • SQLFILE operation generates executable DDL script • If a table pre-exists at load time. replace it. you can: skip it (default). • Space estimates based on allocated blocks (default) or statistics if available • Enterprise Manager interface integrates 9i and 10g • Callable! .

2 Gb Program exp out of the box: direct=y exp tuned: direct=y buffer=2M recordlength=64K expdp out of the box: Parallel=1 imp out of the box imp tuned: buffer=2M recordlength=64K impdp out of the box: Parallel=1 Elapsed 0 hr 10 min 40 sec 0 hr 04 min 08 sec 0 hr 03 min 12 sec 2 hr 26 min 10 sec 2 hr 18 min 37 sec 0 hr 03 min 05 sec .2M rows.Large Internet Company 2 Fact Tables: 16.

Keep in Mind: • Designed for *big* jobs with lots of data. – Metadata performance is about the same – More complex infrastructure. but much more flexible • Data format in dump files is ~15% more compact than exp • Import subsetting is accomplished by pruning the Master Table . longer startup • XML is bigger than DDL.

but may not support all new functionality. • 9i exp may be used for downgrades from 10g • Original and Data Pump dump file formats are not compatible .Original exp and imp • Original imp will be supported forever to allow loading of V5 – V9i dump files • Original exp will ship at least in 10g.

How DBAs Spend Their Time? Install 6% Maintain Software 6% Create & Configure 12% Load Data 6% System Management 55% .

Database Management Challenges ? ? Storage Management Application and SQL Management System Resource Management ? ? Backup and Recovery Management Space Management ? .

Solution: Self-Managing Database Enterprise Manager Database Console Application and SQL Management Storage Management System Resource Management Advise Space Management Monitor Fix Alert Automatic Management Backup and Recovery Management Common Manageability Infrastructure .

Common Manageability Infrastructure: Automatic Workload Repository Automatic Automated Tasks Proactive Server Alerts Advisory Framework Automatic Workload Repository Efficient Data Warehouse of the Database Automatic collection of important statistics Direct memory access .

m.m. 7:30 a. Snapshot 1 Snapshot 2 Snapshot 3 Snapshot 4 Seven days .Automatic Workload Repository ADDM finds top problems MMON SYSAUX WR Schema BG … BG FG … FG In-memory statistics AWR ASH Statistics SGA 8:30am DBA 7:00 a.m.m. 8:00 a. 8:30 a.

Statistics Level STATISTICS_LEVEL BASIC TYPICAL ALL Turn off all self-tuning capabilities Recommended default value Additional statistics for manual SQL diagnostics .

Configuring The Workload Repository .

Manually Creating Snapshots .

maximum number of sessions.Database Feature Usage Metric Collection Oracle Database 10g Once a week DB Feature Usage Statistics Advanced Replication. Audit options. … MMON DB High-Water Mark Statistics size of largest segment. Virtual Private Database. maximum size of the database. maximum number of data files. maximum number of tables. AQ. Oracle Streams. … AWR DBA_FEATURE_USAGE_STATISTICS DBA_HIGH_WATER_MARK_STATISTICS HOST CONFIGURATION INFO EM Repository: ECM EM Console .

Common Manageability Infrastructure: Server Alerts Automatic Automated Tasks Proactive Server Alerts Advisory Framework Automatic Workload Repository Efficient Enabled by default Timely generation Push model .

Server Alerts Enterprise Manager Guided Resolution Server Alerts Queue Automatic Notification Server monitors itself Oracle Server (SGA) MMON AWR .

Server Alerts Delivery Process Subscribing Console Clients Update Queue BG Advanced Queue FG EM (EMD) Push Third Party Page or e-mail DBAs .

Server-Generated Alert Types Metric-Based Alert Threshold Alerts Alert 97% Critical Cleared 85% Warning Cleared MMON Resumable Session Suspended Recovery Area Low On Free Space NonThreshold Alerts Snapshot Too Old Alert Alert Event-Based Alert .

Out-of-the-box Alerts Locally Managed Tablespace Space Usage 97% Critical 85% Warning Tablespace Resumable Session Suspended Recovery Area Low On Free Space Snapshot Too Old .

EM Interface to Alerts .

Setting Alert Thresholds .

Common Manageability Infrastructure: Automated Tasks Automatic Automated Tasks Proactive Server Alerts Advisory Framework Automatic Workload Repository Efficient Pre-packaged routine maintenance tasks Resource usage controlled Statistics collection task scheduled out-of-the-box .

Automatic Optimizer Statistics Collection DBA tracks and gathers statistics Targets right objects Resolves two issues Automatic statistics collection Determines right samples .

Gather Statistics Job MAINTENANCE_WINDOW_GROUP WEEKNIGHT_WINDOW 10pm–6am Mon to Fri WEEKEND_WINDOW 12am Sat to 12am Mon gather_stats_job AUTO_TASKS_JOB_CLASS AUTO_TASKS_CONSUMER_GROUP .

Adding New Tasks Using EM .

Common Manageability Infrastructure: Advisory Framework Automatic Automated Tasks Proactive Server Alerts Advisory Framework Automatic Workload Repository Efficient Uniform interface Fully integrated .

Advisory Framework SQL Tuning Memory ADDM Access Space Segment Advisor Undo SGA Shared Pool PGA Buffer Cache Common data source AWR Seamless integration .

Guided Tuning Session Create an advisor task Adjust task parameters Enterprise Manager Database Console Perform analysis No Accept results? Yes Implement recommendations .

Advisory Central .

Solution: Self-Managing Database

Enterprise Manager Database Console

Application and SQL Management Storage Management System Resource Management Advise Space Management Common Infrastructure

Monitor Fix

Alert

Automatic Management

Backup and Recovery Management

Performance Monitoring Solutions
SGA In-memory statistics MMON Snapshots

Alerts

ADDM

DBA Reactive Monitoring

Proactive Monitoring within Oracle Server

ADDM Results AWR

ADDM Performance Monitoring
SGA In-memory statistics MMON Snapshots 30 minutes

ADDM

ADDM Results AWR

EM ADDM Results

ADDM Problem Classification System … … … … RAC Waits System Wait Concurrency Buffer Busy Parse Latches … … Buf Cache latches IO Waits Non-problem areas … … Symptoms Root Causes .

Accessing ADDM Advice .

ADDM Recommendations .

Performance Monitoring Solutions SGA In-memory statistics MMON Snapshots Alerts ADDM DBA Reactive Monitoring Proactive Monitoring within Oracle Server ADDM Results AWR .

Performance Management Approach Host CPU Bottlenecks Oracle CPU/Waits Uses ASH and AWR SQL Sessions Memory Bottlenecks .

Database Performance Page .

Concurrency Wait Class: Drill Down .

Solution: Self-Managing Database Enterprise Manager Database Console Application and SQL Management Storage Management System Resource Management Advise Space Management Common Infrastructure Monitor Fix Alert Automatic Management Backup and Recovery Management .

Automate the SQL Tuning Process I can do it for you! SQL Workload DBA ADDM High-load SQL SQL Tuning Advisor .

SQL Tuning Advisor Overview Automatic Tuning Optimizer Statistics Check Optimization Mode Plan Tuning Optimization Mode Access Analysis Optimization Mode SQL Analysis Optimization Mode SQL Tuning Advisor Comprehensive SQL Tuning Detect Stale or Missing Statistics Plan Tuning (SQL Profile) Add Missing Index Run Access Advisor Restructure SQL .

Plan Tuning Flow submit Optimizer (Tuning Mode) create SQL Tuning Advisor use No application code change Optimizer (Normal Mode) Database Users SQL Profile output Well-Tuned Plan .

SQL Tuning Advisor Usage Model Automatic Selection AWR ADDM Sources AWR Manual Selection High-load SQL SQL Tuning Advisor STS Cursor Cache Filter/Rank DBA Custom .

Solution: Self-Managing Database Enterprise Manager Database Console Application and SQL Management Storage Management System Resource Management Advise Space Management Common Infrastructure Monitor Fix Alert Automatic Management Backup and Recovery Management .

Overview of Automatic Shared Memory Management Database Buffer Cache Redo Log Buffer Shared Pool Java Pool Fixed SGA SGA Large Pool MMAN Automatically set the optimal size .

Benefits of Automatic Shared Memory Management DB_CACHE_SIZE SHARED_POOL_SIZE LARGE_POOL_SIZE JAVA_POOL_SIZE Total SGA size SGA_TARGET .

Using EM to Configure Automatic Shared Memory Management .

Solution: Self-Managing Database Enterprise Manager Database Console Application and SQL Management Storage Management System Resource Management Advise Space Management Common Infrastructure Monitor Fix Alert Automatic Management Backup and Recovery Management .

Segment Shrink Overview Data Data Unused Space Unused Space HWM Online and in-place Shrink Operation Reclaimed Space Data HWM .

1 2 .How Can I Shrink Segments? ALTER … SHRINK SPACE [CASCADE] TABLE INDEX MATERIALIZED VIEW MATERIALIZED VIEW LOG MODIFY PARTITION MODIFY SUBPARTITION MODIFY LOB ALTER TABLE employees ENABLE ROW MOVEMENT. ALTER TABLE employees SHRINK SPACE CASCADE.

Segment Advisor .

Growth Trend Report .

Segment Resource Estimation .

Automatic Undo Retention Tuning – Proactive tuning • Undo retention is tuned for longest-running query. – Enabled by default . • Oldest unexpired extents are used first. • Query duration information is collected every 30 seconds. – Reactive tuning • Undo retention is gradually lowered under space pressure.

Undo Advisor .

Redo Logfile Size Advisor .

Solution: Self-Managing Database Enterprise Manager Database Console Application and SQL Management Storage Management System Resource Management Advise Space Management Common Infrastructure Monitor Fix Alert Automatic Management Backup and Recovery Management .

Automatic Backup (DBCA Setup) .

– Database backup automatically uses changed block list.Optimized Incremental Backup • Optimizes incremental backups – Tracks which blocks have changed since last backup • Oracle Database 10g has integrated change tracking. – New Change Tracking File is introduced. List of Changed Blocks Redo Generation 1011001010110 0001110100101 1010101110011 Change Tracking File Redo Log SGA . – Changed blocks are tracked as redo is generated.

Defining Flash Recovery Area .

Flash Recovery Area Space Management Disk limit is reached and a new file needs to be written into the Recovery Area. RMAN updates 1 list of files that 2 may be deleted. . Warning is issued to user. Backup files to be deleted Database file backup 1 2 3 4 Recovery Area Oracle deletes files that are no longer required on disk. Space pressure occurs.

Suggested Strategy .

Flashback Error Correction Database Customer – Flashback Database • Restore database to time • Uses flashback logs – Flashback Drop Order • Restore dropped table • Uses recycle bin – Flashback Table • Restore all rows in table to time • Uses UNDO in database Order Line – Flashback Transaction Query • Query a committed Txn – Flashback Versions Query • Query changes to rows over time .

Solution: Self-Managing Database Enterprise Manager Database Console Application and SQL Management Storage Management System Resource Management Advise Space Management Common Infrastructure Monitor Fix Alert Automatic Management Backup and Recovery Management .

ASM does not replace existing concepts.What Is Automatic Storage Management Database Tablespace ASM solves management problems of Oracle databases. Segment Extent ASM manages Oracle files. .

Hierarchy Database ASM disk group ASM file Tablespace Data file Segment Or ASM disk Extent File system file or raw device Allocation unit Oracle block Physical block .

ASM Benefits Reduces the cost of managing storage Reduces administration complexity Supports RAC Improves performance. scalability. and reliability .

Database file 1 2 3 4 Automatic ASM file creation 1 2 3 4 ASM file automatically spread inside disk group dgroupA .ASM Files CREATE TABLESPACE sample DATAFILE '+dgroupA'.

SQL Statements Issued to ASM Instances ALTER SYSTEM RESTRICTED SESSION CREATE DISKGROUP ASM Instance ALTER DISKGROUP DROP DISKGROUP .

Enterprise Manager and ASM .

– Oracle Database 10 g is a self-managing database which reduces administration overhead and enables DBAs to become proactive strategists. .Summary – Oracle Database 10 g’s self-management capabilities work out-of-the-box. – Customization of Oracle Database 10 g’s selfmanagement capabilities can be done through Enterprise Manager.

How DBAs Spend Their Time? Maintain Software 6% Install 6% Create & Configure 12% Load Data 6% System Management 55% .

com Policy Manager Liv e Lin k Product Updates Patches Product Configuration .Enterprise Configuration Management Oracle Inventory Software Configurations Hardware Configurations View/Search Dis co ve r Grid Control a An e lyz Compare/Diff Change Tracking Reference Configurations Install/Clone Configure Patch Secure ov r P on i s i Oracle.

How Oracle Database 10 g DBAs Spend Their Time Proactive & Stratigic Planing 60% Install 3% Create & Configure 6% Load Data 3% Maintain Software 3% System Management 25% .

Oracle Database 10g Simplified Creation & Configuration Fast Lightweight Install ½ COST Efficient Data Load Enterprise Configuration Management Self-Managing Database .

Oracle 10g : Twice as Manageable as Oracle9i 16 13 10 10 Number of Steps 12 6 8 6 4 4 1 2 SQL Tuning 4 2 Resource Management (Memory) Space Management 2 Backup & Recovery 2 Storage Management Oracle9i Oracle 1 0g 0 Performance Diagnostic Result Summary Oracle 10g required 44% less time and 47% fewer steps than Oracle9i. .

What Does It Mean to You?

DBA of the Future Does MORE
• • • • • • • • MORE sleep at nights! MORE weekends off! MORE databases MORE applications: OLTP, DW, OCS, iAS MORE users, larger databases MORE mission-critical applications MORE proactive and strategic MORE important and valuable!

LESS Cost for Businesses
For customers
• Less Administration Cost • Less Capital Expenditure • Less Failures

For Application ISV Partners
• Less Deployment Cost • Less Development Cost • Less Support Cost

– Customization of Oracle Database 10 g’s selfmanagement capabilities can be done through Enterprise Manager.Summary – Oracle Database 10 g’s self-management capabilities work out-of-the-box. . – Oracle Database 10 g is a self-managing database which reduces administration overhead and enables DBAs to become proactive strategists.

co.il .FIN Thank You hpaiss@hpcc.co.il toledano@hi-tech.

Master your semester with Scribd & The New York Times

Special offer for students: Only $4.99/month.

Master your semester with Scribd & The New York Times

Cancel anytime.