You are on page 1of 62

LAOUG, November 2007 Conference

<Insert Picture Here>

Oracle Database 11g


New and Notable Features

Presented
by

David Austin

Intended Agenda

Manageability
Availability
Error Management
Security
Tools and Utilities

Introductory Preamble
I do not intend to cover every new feature of Oracle
Database 11g
Nor am I presenting an overriding concept of an
Oracle Database 11g focus
But I will try to highlight new capabilities that I think
could be useful or mildly interesting to a working DBA

Intended Agenda
Manageability

ASM
Real Application Testing
Jobs
SQL
I/O

Availability
Error Management
Security
Tools and Utilities

ASM
Fast Mirror Resync

Transient failure fast resync


Transient failures: interruptions to disk access, not disk
content failure (e.g. controller failure, disk power failure)
Fast Mirror Resync
I/Os stored offline during outage
You can set a time limit before disk goes completely offline
(no longer transient failure)
I/O continue after interruption is fixed without waiting for
synchronization

ASM
Fast Mirror Resync

Set period after which diskgroup goes offline if you


dont fix transient problem in time (default is 3.6 hours)
SQL> ALTER DISKGROUP laoug SET ATTRIBUTE
'disk_repair_time' = '2.5h';

When problem is resolved, bring diskgroup back


online
SQL> ALTER DISKGROUP laoug ONLINE ALL;

ASM
ASM / Database Compatibility
Set attributes to allow different ASM and database versions to
work together
CREATE DISKGROUP laoug DISK '/dev/raw/*'
ATTRIBUTE 'compatible.asm' = '11.1';
Attribute compatibility matrix
compatible.
asm
10.1
11.1
11.1
11.1

compatible.
rdbms
10.1
10.1
10.2
11.1

ASM
Instance
>=10.1
>=11.1
>=11.1
>=11.1

RDBMS
Instance
>=10.1
>=10.1
>=10.2
>=11.0

ASM
Other (non-RAC) Features

Increased file size limits


Redundancy Type

Max ASM File Size

External

140 PB

Normal

42 PB

High

15 PB

SYSASM system privilege and OSASM group provide


non-DBA privileges for managing ASM instance

Real Application Testing


SQL Performance Analyzer

Use SQL Performance Analyzer (SPA) to evaluate the


impact on key SQL statements prior to making a
production change (new release, new hardware, &c)
Run and capture a workload, executing the SQL
statements to be evaluated, on the current system
Copy the captured workload to a test/development
system and make the anticipated changes
Run the workload and use reports to identify any
performance regressions
Use SQL Tuning Advisor to help tune regressed SQL
statements

Real Application Testing


DB Replay

Use DB Replay to investigate all aspects of a


proposed production change (login overhead, disk
I/O, transaction concurrency, &c)
As with SPA, a workload is captured in the current
environment, then copied to and run on a system with
the proposed setup (new patch, new release, new
storage, &c)
Monitor the workload playback using graphical tools
and resulting reports
Lets see if we can show a demo of this

Jobs
Lightweight Jobs

Run faster and more efficiently than


regular jobs
Definitions based on templates
Do not create/drop their own schema
objects
Use when
Creating, running, dropping hundreds or
thousands of jobs per second
You already have a job library that can be
used for lightweight job templates

Jobs
Lightweight Jobs

BEGIN
DBMS_SCHEDULER.CREATE_JOB (
job_name => my_first_lightweight_job',
program_name => DAILY_GRUNT_JOB',
repeat_interval => 'FREQ=DAILY;BY_HOUR=8',
end_time => '30-Oct-07 04.00.00 AM
Australia/Sydney',
job_style => 'LIGHTWEIGHT',
comments => 'New lightweight job based on a
program');
END;
/

Jobs
External Jobs

External jobs (e.g. shell scripts) can run on


local or on (multiple) remote nodes even
nodes without an Oracle database
For host access, external jobs use
A database credential object (user/password pair)
for host created with
DBMS_SCHEDULER.CREATE_CREDENTIAL
A scheduler agent
Optional arguments set with
DBMS_SCHEDULER.SET_JOB_ARGUMENT_VALUE

Jobs
External Jobs
declare
job_prefix varchar2(30) := 'remote_';
job_name varchar2(30);
destinations dbms_utility.lname_array;
begin
destinations(1) := 'host1:1234';
destinations(2) := 'host2:1234';
destinations(3) := 'host3:1234';
for i in 1..destinations.LAST loop
job_name := dbms_scheduler.generate_job_name(job_prefix);
dbms_scheduler.create_job(job_name, job_type=>'executable',
job_action=>'/u01/app/ext_backup',
number_of_arguments=>0,
enabled=>false);
dbms_scheduler.set_attribute(job_name,'destination',
destinations(i));
dbms_scheduler.set_attribute(job_name,
'credential_name','remote_cred');
dbms_scheduler.enable(job_name);
end loop;
end;
/

SQL
A Handful of Changes

Updated statistics or execution plans can be sidelined


until you have a chance to evaluate them
The database automatically detects high-load SQL
statements and
Tunes them automatically in the maintenance window by
creating appropriate SQL Profiles
Issues proactive advice to create new indexes, &c. to improve
the performance

You can now collect statistics for any arbitrary set of


columns in a single table
SQL Access Advisor has been enhanced to include
advice on how to partition tables, materialized views,
and indexes

I/O
Calibration

Procedure to help evaluate storage


subsystem
Executes typical Oracle read-only workload to
investigate behavior (random plus sequential
access)
Use during low-activity periods to avoid
disrupting production performance
Note: Only works on files with ASYNCH_IO
enabled

I/O
Calibration
DECLARE
v_iops PLS_INTEGER;
v_mbps PLS_INTEGER;
v_latency PLS_INTEGER;
BEGIN
DBMS_RESOURCE_MANAGER.CALIBRATE_IO (
num_physical_disks => 4,
max_latency => 20,
max_iops => v_iops,
max_mbps => v_mbps,
actual_latency => v_latency);
END;
/
SELECT *
FROM DBA_RSRC_IO_CALIBRATE;

I/O
Calibration
START_TIME

Start time of the most recent I/O calibration

END_TIME

End time of the most recent I/O calibration

MAX_IOPS

Maximum number of data block read


requests that can be sustained per second

MAX_MBPS

MAX_PMBPS
LATENCY
NUM_PHYSICAL_
DISKS

Maximum megabytes per second of


maximum-sized read requests that can
be sustained
Maximum megabytes per second of large
I/O requests that can be sustained by a
single process
Latency for data block read requests
Number of physical disks in the
storage subsystem

I/O
You May Find These Features Attractive

Automatic Workload Repository (AWR)


Maintains I/O statistics for

I/O type (single and multi block, read and write)


Component
Data file
Consumer group

Resource Plan Consumer Groups now can


limit the maximum megabytes of I/O that a
session may issue

Intended Agenda
Manageability
Availability

General
Runtime, Maintenance, and Upgrades
Data Guard
Other

Error Management
Security
Tools and Utilities

High Availability Improvements


General

Flashback now available at the transaction


level
Single transaction
Transaction plus all dependent transactions

Redo Apply performance significantly


improved
Faster media recovery
Faster application of redo to Data Guard physical
standby

Tablespace transport now supported between


Linux and Windows

High Availability Improvements


Runtime, Maintenance, and Upgrades

Invisible indexes
Are maintained during DML operations
Are only used in query optimization if specified in a Hint
Enables testing the impact of dropping indexes or performing
application upgrades

Manage invisible indexes


CREATE INDEX <name> ON
<table>(<column>)INVISIBLE
ALTER INDEX <name> { VISIBLE | INVISBLE }
SELECT INDEX_NAME, VISIBILITY FROM
ALL_INDEXES . . .

Use invisible index


See example on next page

High Availability Improvements


Runtime, Maintenance, and Upgrades
SQL> explain plan for select * from laoug where col1=10;
. . .
SQL> select operation, object_name from plan_table;
OPERATION
OBJECT_NAME
------------------------------ -----------------------------SELECT STATEMENT
INDEX
MISSING_LAOUG
SQL> alter index missing_laoug invisible;
. . .
SQL> explain plan for select * from laoug where col1=10;
. . .
SQL> select operation, object_name from plan_table;
OPERATION
OBJECT_NAME
------------------------------ -----------------------------SELECT STATEMENT
TABLE ACCESS
LAOUG

High Availability Improvements


Runtime, Maintenance, and Upgrades

You can disable materialized view logging at


the session level to facilitate testing or certain
application upgrades
DML-blocking locks are no longer used when
creating or rebuilding an index online
The restriction that prevented redefinition of
tables with materialized view logs is no more
Tables can be modified to be read-only,
preventing everyone, including the owner,
from executing DML statements

High Availability Improvements


Runtime, Maintenance, and Upgrades

DDL_LOCK_TIMEOUT sets threshold period


for DDL statements to wait rather than failing
immediately if a required lock is not available
When adding new columns with DEFAULT and
NOT NULL options, the default value is not
stored in the table during execution of the
ALTER statement
Finer grained dependencies between PL/SQL
units, views, tables, and so on reduces the
number of invalidations due to changes that
do not directly impact the related objects

Data Guard
Snapshot Database

Pre 11g

Standby
Database

Incoming redo
Users?

11g
Incoming redo

Standby
Database

SELECT
SELECT

Users

Data Guard
Snapshot Database

11g
Incoming redo

Standby
Database

Convert to Snapshot DB

ALTER DATABASE CONVERT


TO SNAPSHOT STANDBY
or use EM or DGMGRL

Data Guard
Snapshot Database

Restore point record

11g
Incoming redo

Snapshot
Database
INSERT
UPDATE
DELETE
SELECT
Users

Data Guard
Snapshot Database

11g
Incoming redo

Standby
Database

Convert back to Standby DB

ALTER DATABASE CONVERT


TO PHYSICAL STANDBY
or use EM or DGMGRL

Data Guard
Snapshot Database

Flashback to
Restore point record

11g
Incoming redo

Snapshot
Database
INSERT
UPDATE
DELETE
SELECT
Users

Data Guard
Snapshot Database

Restore point record

11g
Incoming redo

Snapshot
Database
SELECT
SELECT
SELECT
SELECT
Users

Data Guard
Broker

Improved logging and tracing


Oracle Managed Files support for
configuration files
Integration with DB startup
Support for advanced redo transport
settings
Prepared switchovers for Logical
Standby supported

Data Guard
Logical Apply Completeness

Logical standby databases now protect data


from primary databases that
Have executed the DBMS_SCHEDULER
package
Use Oracle Fine-Grained Auditing
Contain tables with
Transparent Data Encryption
The CLOB representation of the XMLType data
type
Oracle Virtual Private Database

Data Guard
Other Improvements

Maximum performance mode fast-start failover occurs


if data loss will not exceed x seconds, where you get
to set x
Archived redo logs can be compressed if they are
sent across a network to a standby DB
Lights-out failover from primary to standby based on
your pre-established conditions
Not all SQL Apply parameter changes require you to
restart SQL Apply to implement them
Advisory histogram available to help you pick suitable
NET_TIMEOUT values

Data Guard
You May Find These Features Attractive

You can now authenticate redo transport network sessions with


SSL, making remote login password files optional
Your DDL statements that were executed with a parallel hint at
the primary DB are executed in parallel by SQL Apply (if parallel
servers are available)
Switching over to logical standby DB in a RAC environment no
longer requires you to shut down one or more instances
You should benefit from miscellaneous internal changes to
improve performance, such as faster role transitioning
During media recovery on a primary database, lost write
conditions can be detected and reported using a physical
standby database

Intended Agenda
Manageability
Availability
Error Management

Automatic Diagnostic Repository


Tools, including Health Monitor
Problem containment
Data Protection & Repair
LogMiner
RMAN

Security
Tools and Utilities

Error Management
Automatic Diagnostic Repository

Automatic Diagnostic Repository (ADR) is a new


system-managed repository that stores and organizes
trace files and other error diagnostic data
ADR provides a uniform and consistent mechanism to
store, format, and locate all database diagnostic
information
Allows correlation of errors across various
components such as Oracle RAC, Oracle
Clusterware, OCI, Net, processes, and so on
ADR automatically generates incidents for serious
errors

Error Management
Diagnostic Tools

Automatic inter-component deadlock detection


Hang Manager automatically detects, analyzes, and dumps
diagnostic information for hangs in Oracle db environments,
including Oracle RAC and ASM instances
Incident Packaging Service (IPS) and SQL Test Case Builder:
Extract incident-related data from the ADR and packages it for
transport to Oracle Support
Provide mechanisms for Support to automatically generate test
cases on their own systems to reproduce your problems

Network diagnostics information (for clients, application servers,


and so on) is stored in the ADR, allowing Oracle Net to use the
same diagnostic infrastructure as Oracle Database
OCI now logs state information for network and client/server
correlation to provide better information for debugging problems

Error Management
Health Monitor

Health Monitor checks (aka checkers, health checks,


or checks) search for problems such as

File corruptions
Physical and logical block corruptions
Undo and redo corruptions
Data dictionary corruptions
Transaction integrity

Health checks can be run in two ways:


ReactiveThe fault diagnosability infrastructure runs health
checks automatically in response to a critical error
ManualUse the DBMS_HM PL/SQL package or Enterprise
Manager

Error Management
Health Monitor

Health checks can run in two modes:


DB-online moderun while the database is in
OPEN or MOUNT mode
DB-offline moderun when the instance is in
NOMOUNT mode: restricted to DB structure and
redo integrity checks

Findings, recommendations, and so on saved


in the Automatic Diagnostic Repository (ADR)
Generate reports of findings with EM,
DBMS_HM package, or ADRCI utility

Error Management
Problem Containment

Automatic quarantine of corrupt undo segments


prevents future transactions from using them
Your tests using ANALYZE TABLE ... VALIDATE
STRUCTURE CASCADE will complete much faster
because of improved algorithms
Support Workbench

Provides an easy-to-use EM interface


Presents database health-related incidents in a timely manner
Provides information on how to manage incidents
Assists in viewing diagnostic information from multiple Oracle
products (such as Net, clients, ASM, RAC, &c.)
Packages incident data for Oracle Support

Error Management
Problem Containment

SQL Repair Advisor reloads problematic SQL


statements, recompiles them in a more detailed
diagnostic mode, gathers more information on the
incident, and provides a workaround or
recommendations
Improved block corruption detection:
Live block corruptions are recorded in
V$DATABASE_BLOCK_CORRUPTION (along with RMANdetected block corruptions)
This view is automatically updated when corruptions are
repaired; for example, using block media recovery or data file
recovery

Data Protection & Repair

Corrupt blocks automatically recorded in


DBA_CORRUPTION_LIST during instance recovery
Flashback logs may provide uncorrupted block images during
block media recovery: faster than recovering from tape or disk
Backups made with KEEP option now include only necessary
(for data consistency), not all, archived logs
Redo checksum created at generation time for faster and more
complete redo validation
Data Recovery Advisor detects data errors, prepares and
optionally runs scripts to repair them
New initialization parameter, DB_ULTRA_SAFE, lets you set data
checking at the table or table plus index level (or turn it off
completely)

LogMiner

LogMiner is now supported by EM, including


work flows that integrate log mining with
Flashback Transactions
LogMiner supports Automatic Data Repair by
providing metadata when a database
unavailable

RMAN
Data Guard Integration

You can enable block change tracking on physical


standby databases for faster incremental backups
Catalog changes can be made for primary or standby
DBs with DB connections
Standby and backup control files can be converted
into one another
Restores to or from different mount points in storage
area networks enable backups to be shared by
primary and standby databases
Use network topology to define which backups can be
used by which databases for restore operations

RMAN
You May Find These Features Attractive
You can now merge one recovery catalog schema into another
(to consolidate different versions or from from one DB to
another)
Archive log deletion policies now integrated with other tools
(Data Guard, Flashback, et al) and, optionally, non-mandatory
destinations
Optional archive log destinations may be used in place of
inaccessible flash back areas during backups
You can clone databases using backups stored somewhere on
the network no longer have to copy the backup to the new
database server
Use the CONFIGURE BACKUP UNDO OPTIMIZATION option so
backup operations skip unneeded undo records
You no longer have to make transported tablespaces read-write
before you can back them up with RMAN

Intended Agenda

Manageability
Availability
Error Management
Security
Secure by Default
Advanced Security
Data Masking

Tools and Utilities

Secure by Default

In the Security Settings window in Database Configuration


Assistant (DBCA) enable or disable the default security settings
When enabled, security-related SQL statements are
automatically audited
These are statements that use specific privileges such as
ALTER ANY TABLE, GRANT ANY OBJECT PRIVILEGE, CREATE
PUBLIC DATABASE LINK

Password Complexity Checker


Uses same techniques (UTLPWDMG.SQL script and User Profile)
as other password management functions
Provides default checks (e.g. password length, simple word
checks) and ability to customize by adding your own checks

Ability to limit which internet hosts can be reached with network


call-out packages (e.g. UTL_HTTP and UTL_SMTP)

Advanced Security

Strong authentication added for database


connections made as SYSDBA and SYSOPER
Entire tablespace encryption added to
encryption by individual column
Support for HSM-based Hardware Security
Module based) encryption allows you to store
a master encryption key inside the HSM
rather than on the host operating system

Data Masking
Not really within scope
of this talk
An Oracle 10gR2,
10.2.0.4, feature not
yet available in 11g
tools
But it is a very nifty
feature

Data Masking

An easy way to keep data secret when you


have to provide real data for internal testing,
training, &c, or for external debugging, tuning,
&c.
Masks any or all columns in tables
Keeps values required for referential integrity
consistent across the data set
Lets see if we can show a demo of this . . .

Intended Agenda

Manageability
Availability
Error Management
Security
Tools and Utilities

ASMCMD
DBCA / DBUA
Data Pump
SQL & PL/SQL

ASM Command-line Utility


ASMCMD

Use to view and manipulate files and directories


within ASM disk groups at the OS level
Provides commands similar to OS directory and file
management commands, for example
cd dir_name navigate through directories
ls [name] list file or directory attributes
du [dir_name] list space used
find dir_name name_pattern search for file

Also has ASM-specific commands such as


lsdg [group] list disk group data from V$ views
mkalias file alias create alias for system-generated
file name

ASMCMD help lists all commands and syntax

DBCA & DBUA


New Parameter-based Changes

Both use DIAGNOSTIC_DEST in place of


BACKGROUND_DUMP_DEST,
USER_DUMP_DEST, &c, derived from
ORACLE_BASE value
DBCA uses MEMORY_TARGET in place of
SGA_TARGET and PGA_AGGREGATE_TARGET

DBUA
You May Find These Features Attractive

Upgrade can include conversion from Oracle


Database XE (Express Edition) to Oracle
Database 11g
Upgrade can include storage transfer to SAN,
NAS, or ASM
AUTOEXTEND command line option turns on
automatic file extension for the duration of the
upgrade only

Application Development Features


SQL & PL/SQL

New syntax allows extraction of nth occurrence or count of


occurrences of a substring in a regular expression
Native dynamic SQL now supports statements bigger than 32K
characters by allowing a CLOB argument
Type hierarchies now supported with the ANSI SQL generalizedinvocation syntax to allow the following method invocation
scoping operator:
(<type-instance> AS <type-name>).<method-name>

SQL can now invoke a PL/SQL function with named or mixed


notation:
SELECT my_func(p3=>42,p1=>6,p2=>8) FROM dual;
SELECT my_func(6,p3=>42) FROM dual;

Application Development Features


PL/SQL

CONTINUE statement initiates a new loop iteration


SQL> begin
for i in 1..3 loop
l
if i = 2 then continue; end if;
2
dbms_output.put_line
3
('Iteration: ' || to_char(i));
4
end loop;
5
6 end;
7 /
Iteration: 1
Iteration: 3
PL/SQL procedure successfully completed.

Application Development Features


PL/SQL

Sequence operators, nextval and currval,


can be used directly in expressions
SQL>
2
3
4
5

declare pk_id NUMBER := abc.NEXTVAL;


begin INSERT INTO laoug VALUES
(pk_id,SYSDATE);
end;
/

PL/SQL procedure successfully completed.


SQL> SELECT * FROM laoug;
ID DELIVERY
---------- --------1 05-OCT-07

General Database Enhancements


Data Pump

Data Pump improvements include


Option to compress the entire dump set or row data
as well as just the metadata
Ability to restart failed parallel worker processes
Ability to apply data transformations to sensitive data
during export or import
Ability to encrypt entire dump sets, including the
metadata
XML data import and export support
Partition mode allows partitions or subpartitions to be
handled by Data Pump import/export

General Database Enhancements


Clustering and RAC

Improved GUI formats for simultaneous viewing RAC


instances
Improved formats in GUI tools, DBCA, DBUA, and
NetCA
rconfig can now convert single instance ASM to
clustered ASM
Default load balancing across instances in OCI and
OCCI applications
Parallel operations now work within a defined service,
removing the need to set
PARALLEL_INSTANCE_GROUPS
XA transactions can now span Oracle RAC instances

General Database Enhancements


You May Find These Features Attractive

Flashback Data Archive lets you store every state of a


record across all transactional changes for chosen
number of days/years
SQL*Plus queries can now access tables with BLOB
columns
Improved upgrade/downgrade feedback (pre- and
post-install)
Direct path loads can now include data for subtypes in
object columns or object tables
All object types currently supported by the original
Export utility are now included in the Metadata API for
heterogeneous object types

You might also like