Oracle11g New Features

30-Jun-2011 Rakesh Kumar Verma

Agenda
 Active Data Guard  RMAN Enhancements  ASM Enhancements  Automatic Memory Management(AMM)  Security Enhancements  Schema Management  Flashback Data Archive  Partitioning & Storage Related Enhancements  Query Result Cache  Q&A

1) Active Data Guard Before 11g Active Data Guard
• Prior to Oracle 11g, read access to standby database required Redo Apply to be stopped. • Queries on read only standby databases could potentially return stale results as changes occurring on the primary database are not applied. • This backlog of unapplied redo data could potentially increase failover times

What is Active Data Guard? • Available in the database server Enterprise Edition as an additional license option • Real time replica of a production database which is open in read only mode while changes transmitted from the primary database are being simultaneously applied to it. human error. . database and site failures. • Applies to physical and not logical standby database • Can offload reporting. queries and fast incremental backups from the primary site to the standby • Performs its primary Data Guard objective of preventing data loss and downtime due to data corruptions. or natural disaster.

Active Data Guard – Operations What can we do? • • Issue SELECT statements Issue complex queries such as grouping SET queries and WITH clause queries • • • Call stored procedures Use database links to write to remote databases Use stored procedures to call remote procedures via dblinks What we cannot do …. Any DML excluding SELECT Any DDL So no additional indexes allowed AWR tool not supported for Active DG standby .

2) RMAN Enhancements .

Duplicating a Database  With network (no backups required)  Including customized SPFILE  Via Enterprise Manager or RMAN command line Destination or AUXILIARY database TCP/IP Active source database .

'/u02' DB_FILE_NAME_CONVERT = '/u01'.'/u02'. '/u02' SET SGA_MAX_SIZE = '200M' SET SGA_TARGET = '125M' SET LOG_FILE_NAME_CONVERT = '/u01'. .The RMAN DUPLICATE Command DUPLICATE TARGET DATABASE TO dbtest FROM ACTIVE DATABASE SPFILE PARAMETER_VALUE_CONVERT '/u01'.

'/u02' DB_FILE_NAME_CONVERT = '/u01'.Creating a Standby Database with the DUPLICATE Command DUPLICATE TARGET DATABASE FOR STANDBY FROM ACTIVE DATABASE SPFILE PARAMETER_VALUE_CONVERT '/u01'. '/u02' SET "DB_UNIQUE_NAME"="FOO" SET SGA_MAX_SIZE = "200M" SET SGA_TARGET = "125M" SET LOG_FILE_NAME_CONVERT = '/u01'.'/u02'. .

Creating and Using RMAN Virtual Private Catalogs Databases registered in RMAN catalog RMAN base catalog Enhancing security by restricting access to metadata Virtual private catalogs (VPC) .

RMAN> CREATE CATALOG. Grant RECOVERY_CATALOG_OWNER to VPC owner: SQL> CONNECT SYS/oracle@catdb AS SYSDBA SQL> GRANT RECOVERY_CATALOG_OWNER to vpcowner 3a. Grant REGISTER to the VPC owner. Grant CATALOG FOR DATABASE to the VPC owner: RMAN>GRANT CATALOG FOR DATABASE db10g TO vpcowner .Using RMAN Virtual Private Catalogs 1. RMAN> GRANT REGISTER DATABASE TO vpcowner. Create an RMAN base catalog: RMAN> CONNECT CATALOG catowner/oracle@catdb. 2. or: RMAN> CONNECT CATALOG catowner/oracle@catdb. 3b.

4b.dbms_rcvcat. 5. Register a new database in the catalog: RMAN> CONNECT TARGET / CATALOG vpcowner/oracle@catdb. Create a virtual catalog for pre-11g clients: SQL> CONNECT vpcowner/oracle@catdb SQL> exec catowner. RMAN> BACKUP DATABASE.Using RMAN Virtual Private Catalogs 4a. or: RMAN> CONNECT CATALOG vpcowner/oracle@catdb. 6. RMAN> REGISTER DATABASE. . RMAN> CREATE VIRTUAL CATALOG.create_virtual_catalog. Use the virtual catalog: RMAN> CONNECT TARGET / CATALOG vpcowner/oracle@catdb. Create a virtual catalog for 11g clients.

3) ASM Enhancements ASM Fast Mirror Resync .

Without ASM Fast Mirror Resync 1 ASM redundancy used 2 Disk access failure Oracle Database 10g and 11g 4 Disk added back: Extents rebalanced 3 Disk automatically dropped: All dropped extents re-created .

ASM Fast Mirror Resync: Overview 1 ASM redundancy used 2 Disk access failure Oracle Database 11g 4 Disk again accessible. need only to resync modified extents 3 Failure time < DISK_REPAIR_TIME .

ALTER DISKGROUP dgroupA ONLINE DISKS IN FAILGROUP contrler2 POWER 2 WAIT. ALTER DISKGROUP dgroupA OFFLINE DISKS IN FAILGROUP contrl2 DROP AFTER 5H. .Setting Up ASM Fast Mirror Resync ALTER DISKGROUP dgroupA SET ATTRIBUTE 'DISK_REPAIR_TIME'='3H'. ALTER DISKGROUP dgroupA DROP DISKS IN FAILGROUP contrl2 FORCE.

ASM Preferred Mirror Read Site A Site B P S Site A Site B P P: Primary AU S: Secondary AU S .

SITEB On first instance On second instance Monitor SELECT preferred_read FROM v$asm_disk.SITEA ASM_PREFERRED_READ_FAILURE_GROUPS=DATA. .ASM Preferred Mirror Read: Setup Setup ASM_PREFERRED_READ_FAILURE_GROUPS=DATA. SELECT * FROM v$asm_disk_iostat.

SQL> CONNECT username/passwd AS SYSASM. .  SYSDBA will be deprecated:  Oracle Database 11g. Release 1 behaves as in 10g.  In future releases. SQL> GRANT SYSASM TO username. SQL> DROP USER username. SYSDBA privileges will be restricted in ASM instances.  Using the SYSASM role to manage ASM instances avoids overlap between DBAs and storage administrators.SYSASM Role SQL> CONNECT / AS SYSASM SQL> CREATE USER username IDENTIFIED by passwd.

PGA_AGGREGATE_TARGET oracle offers MEMORY_TARGET.4) Automatic memory management(AMM)  In 10g.      Oracle also provides four new dynamic performance views : V$MEMORY_CURRENT_RESIZE_OPS V$MEMORY_DYNAMIC_COMPONENTS V$MEMORY_RESIZE_OPS V$MEMORY_TARGET_ADVICE . This parameter is a static initialization parameter. If MEMORY_TAGET is set oracle takes care of SGA and PGA automatically. In 11g oracle takes this tradition a little forward to completely automate the available memory.the total available memory is divided into two components.  Along with SGA_TARGET. One is SGA and the other is PGA. Oracle offered SGA_TARGET to automate the individual components inside the SGA.

you can migrate your passwords to the new standard. especially the new column PASSWORD_VERSIONS. You can check the status of the password by querying the DBA_USERS view.One can set the parameter to false to disable this.5) Security Enhancements Case sensitive passwords  Oracle offers case sensitive passwords and also allows you to revert back if you do not like it using the parameter SEC_CASE_SENSITIVE_LOGON.  When you upgrade an existing Oracle 10g database to 11g. .

.6) Schema Management Enhancements  DDL Wait Option The ORA-00054 : resource busy and acquire with NOWAIT specified or timeout expired The ORA is generally observed during busy system time.oracle 11g does not throw a error instead tries it for 10sec’s until it is successful. can also be used to make this default to all sessions  Fine Grained Dependency Tracking Consider a table is altered by adding a new column and in 10g a view derived from this object will be invalid causing the objects like packages using this view to be invalid. ALTER SYSTEM SET DDL_LOCK_TIMEOUT. In 11g Oracle takes care of changes like these and will not mark the view as invalid thereby improving the availability of the application.

7) Flashback Data Archive: “Oracle Total Recall” Transparently tracks historical changes to all Oracle data in a highly secure and efficient manner  “Secure”  No possibility to modify historical data  Retained according to your specifications  Automatically purged based on your retention policy  “Efficient”  Special kernel optimizations to minimize performance overhead of capturing historical data  Stored in compressed form in tablespaces to minimize storage requirements  Completely transparent to applications  Easy to set up .

requires preconfiguration and resources Database One per database Operation Granularity Access point-intime .Flashback Data Archive Comparison Flashback Data Archive Main benefit Access to data at any point in time without changing the current data Online operation. tracking enabled. minimal resource usage Table Any number per table Flashback Database Physically moves entire database back in time Offline operation.

Flashback Data Archive: Overview For long-retention requirements exceeding undo Original data in buffer cache Undo data DML operations FBDA Example: Three flashback data archives with retention of: 1 year Flashback data archives stored in tablespaces 2 years 5 years .

Using Flashback Data Archive Basic workflow to access historical data: 1. Enable history tracking for a table in the FLA1 archive: ALTER TABLE inventory FLASHBACK ARCHIVE fla1. product_name. count FROM inventory AS OF TIMESTAMP TO_TIMESTAMP ('2007-01-01 00:00:00'. 2. View the historical data: SELECT product_number. Create the flashback data archive: CREATE FLASHBACK ARCHIVE fla1 TABLESPACE tbs1 QUOTA 10G RETENTION 5 YEAR. . 'YYYY-MM-DD HH24:MI:SS'). 3.

Changing retention time: ALTER FLASHBACK ARCHIVE fla1 MODIFY RETENTION 2 YEAR. 2. 3.Maintaining Flashback Data Archives 1. 4. Dropping a flashback data archive: DROP FLASHBACK ARCHIVE fla1. . Purging data: ALTER FLASHBACK ARCHIVE fla1 PURGE BEFORE TIMESTAMP(SYSTIMESTAMP . Adding space: ALTER FLASHBACK ARCHIVE fla1 ADD TABLESPACE tbs3 QUOTA 5G.INTERVAL '1' day).

 Interval partitioning automates the creation of range partitions.  At least one range partition must be created.8) Interval Partitioning  Interval partitioning is an extension of range partitioning.  Partitions of a specified interval are created when inserted data exceeds all of the range partitions. .

'dd-mm-yyyy')). Automatically created when you insert data P1 P2 Range section P3 Pi1 … Interval section Pin Transition point .'dd-mm-yyyy'). PARTITION P2 values less than (TO_DATE('1-1-2003'. PARTITION P3 values less than (TO_DATE('1-1-2004'.'month')) STORE IN (tbs1.Interval Partitioning: Example CREATE TABLE SH.'dd-mm-yyyy')).SALES_INTERVAL PARTITION BY RANGE (time_id) INTERVAL (NUMTOYMINTERVAL(1.'dd-mm-yyyy'))) AS SELECT * FROM SH.tbs3.tbs2.tbs4) ( PARTITION P1 values less than (TO_DATE('1-1-2002'.SALES WHERE TIME_ID < TO_DATE('1-1-2004'.

Table Compression: Overview  Oracle Database 11g extends compression for OLTP data. . DELETE)  New algorithm significantly reduces write overhead.  Batched compression ensures no impact for most OLTP transactions. UPDATE.  No impact on reads  Reads may actually see improved performance due to fewer I/Os and enhanced memory efficiency.  Support for conventional DML operations (INSERT.

Free space Inserts are uncompressed. . Compressed data Uncompressed data PCTFREE reached triggers compression.Table Compression Concepts Inserts are again uncompressed. Data block Header PCTFREE limit PCTFREE reached triggers compression.

1 or greater New syntax extends the COMPRESS keyword:  COMPRESS [FOR {ALL | DIRECT_LOAD} OPERATIONS]  FOR DIRECT_LOAD is the default: Refers to bulk load operations from prior releases  FOR ALL OPERATIONS: OLTP + direct loads  Enable compression for new tables: CREATE TABLE t1 COMPRESS FOR ALL OPERATIONS.  Does not trigger compression on existing rows .Using Table Compression   Requires database compatibility level at 11.  Enable compression on existing table: ALTER TABLE t2 COMPRESS FOR ALL OPERATIONS.

9) SQL Query Result Cache  Cache the result of a query or query block for future reuse.  Cache is used across statements and sessions unless it is stale.  Benefits:  Scalability  Reduction of memory usage  Good candidate statements:  Access many rows  Return few rows SELECT … SQL Query Result Cache 2 1 3 SELECT … Session 2 Session 1 .

Q&A .

9/- #&!%$ ...0.47.

 $3. 9969%:50 .3.:.020398 & .

:9/.51  :2.02 .5.:9.33196771 33196771.  & 9151.501  :2.94:9$.897747#083.: .64.39 "9..5..3../..0.03.50:1  :2.00::.111/.

.1 .09.

0  & 9151.:  :2.00::.5.69:504611.897747#083.39 "9. .50:1  :2.03.4$*#!#*% ./.5.:  .39..$.00::/3 51653.07...

4397 # .439707! #% %#$# &!/74:5# !$$# &!.897747#083. %#$# &!/74:5$%%%#&% $*#!#*%    %#$# &!/74:5 $$# &!.4397# !%# %#$# &!/74:5 $$# &!.$0993&5$.

 # ##94.9 &&0651.9 & . # & &./ &. &. &.$!7010770/7747#0.

5:.82*/8*489.69 $%57010770/*70.9 .$!7010770/7747#0..50 $*!###*#*&#*# &!$% $% $*!###*#*&#*# &!$% $% "5:06515:.82*/8 $% # ./$09:5 &../# .50 65.7 "59:...

$$$ #40 $" %.

20 $" %:8073.20 %-5.$$$$ $"#%&$#:8073.20.88/ $"#%$$$% :8073.

50:.:5  5.64.: %3.:.88/ $$$$ $"# !&$#:8073.993.& 5:.03.69..69: $$ 33/1790.90.7/..:: $$ 793:33/ 9:..$$$ 963.51:.:/.5:.1 "9..1 5& 5:.145:.61: 693./.9..5..20 :5.50: ..5.

9./34469 365.02039  5 ...'%'   "%.202472..3.'%'.69... :942.2:.:5:1.3.369.6 06473.511.9..: "5:&.4079694.4.9.:.0."#&   "%.:..6.64.91.64.%%!'.03.2:0.6.03.3.96&." #"!!'&   "%..%&.64..'%'.51 .3.657..05.3:67961:69515...03691&...9 "9. .3 0647655.%&."#&   "%.3.&.& 569./34469:1115.6...! .'%'69.3.03.3..51# .1.0369:  "%.''::.9.%'.50:   "%..'%' #.65..9:.9:# "9..4.33 ':7.60647655.6.

&.51...7./.549.336:6.61:.02 61656.33.9././3..6 60.: 5679.""! "5 0.9.::691:.5002.7.51.0369:0.91 60.1.7.6.32.9.031.9&. 7.5:.7.%&"!& .:5.:.::5:..4.:6.::691/895.506345 #&&"%.3:.5"9....5:.:793.6..020398 .699.&%& :70.:.&!&'.4.::691:.5:. 697.::691: "9.3.3:6.::5:. $0.

3."7.02.65 '"%. $..020398 ..3.020393.

6/0.33:::65: 59.9:690/:.9/ 47965.:./3:..:6/0.3:6/:1.2.3.:327.4 69.115."...5:32..69:0:5.6.191964.6/5.64.:.3.92...31 5"9.:1.::5../3.02.96.51.!"':70169.6.::00::3 '%&&' &'.791 '"%:59..9:.513356.7730.506345.025 65:19.65 .960.:5.3..336/:91195/:::.5175150'9.3.310.4..4.1.:5.31.515.91/. 33/5.46.03..9969 5:.' "'0.0316:56.5.2:0.089.

0 7.5:7.031.95:.51 05.51..33"9.669:700.0: .3..691506479::16945.9.64.7730.65: . %.. .645479694..3..3295367.4.4..690...6:.7.690.690. '9.¾ &70.0%49.31..5:7.: 6473.5.#0./3:7.. 98945.9.7.5:.3:09.16 0.6461:.559 &09¾ !676::/3.:.7 ..0.95..95.65:.65: .8-.33791/.02::.... &.:165699.6.006915.69.657630 05.30.6454:.9..6..31..5..5069.

9..9.9.80 .8-..3/ 7084:7.7.431:7.9.0 %..7084:7.0803970 392094:9...943 706:708 570.-...80 507.3-03019 .80-..79 ..-0 11304507.3 03.35439 !8.-0/ 232.943 97.0885439 3 920 .80 30507/..9.3920 90.0 :8.943 7.9.. 3304507.0 .-.9..-.24.:77039/...7843 .3:..33 /..08 .0425.9.-0 33:2-075079.9.-.7.8-.943.8-.08894/.

.7.9..07.8-.0 .0 69365...

5 /90./3:7.0 5161...6915.90:.9: .:/. ....0: .9..9: .9 3..6598945..  679.473'93..021.021.:/.90: :..656 ..:015516 "95.5.5.65:  .9.3 1.

.00:::.31.90 #%$#'1..:069236.&83.90 %#%3.0 ....4:39 # 3..02569.690. ..690.  ..  9.31.03947$  %$%!% *%$%!          $$  ...:/.20 .3...7.8-../35./3:.69.9*3:2-07 574/:.9. $%574/:.9.021..:.03947$#'1.9*3. %$!9-8"& % #%% #  5.6.

. #%% #  #951.65....7.39.0 %#$#'1.8-.!&# # %$%! $$%$%! %#'  /.4 %#$#'1. .   96775.08  115:7.5.9.021.... %$!9-8"& %  .90 # !$#'1.:/.33..559. %#$#'1.3..

9.6569.09....3.9.9.336.9.5. 3907.65: .799433 5.659..:.654:...9.57.155:9.65: .9.3.57.64..37....11.9..:7015.9.37.5:6569.9./09. 01:.655...:..65:6.!.655 #.1 5.9.655:.57.9..57.909.

1 565:9.9.3 % *%     !#%% !.3 % *%     $ $%  # $ $$ #%*% *%     // 22   . .:080889.!..65765.799433.. # # %.3309.64.65 # #  #3 5.5:.250 #%%$ $$*%#' !#%% # 920*/  %#' &% %#'  2439 $% # 9-8 9-8 9-8 9-8 // 22  // 22  // 22  !#%% !.65 '9...1....3907..5:0.0.:080889.3:0.3 % *%     !#%% !.:080889.

0..659.9..6 9":.65: !647.1 .1: %. &7769.5014469050 .690655.65: $#% &!% % !....0106479::655:9:5647.369.: .33:4796179694.65.0..501.0.03.6946:.-0425708843 .4:50.5.%..1:4.515./.0 "9.3 679.3910:9.51:06479::6569"'#1."'# .69.07.0..5:.

01 . 9 :7. 506479::1 1. !%# 9.19 #'% 34...9 506479::1 .5 506479::1 6479::1 1..:.99:06479::65 .0 5:9.99:06479::65 .-042570884343.9./3602 !%# 9..%.0598 5:9.:...01 ..

/306479::65695.9 !:5..33..6/3236.9906479::6565:..36../3 %#%9 !#$$ # !#% $ 6:56..::  # !#% $"'# 190.. 699..596: .1./3: #%%9 !#$$ # !#% $ 5.%9:.51:./3./306479::6565:..:0647.65: 964796993...1679. !#$$ 2691  !#$$ #  #%* < !#% $(  ##%*  :.&83%.-0425708843 %89:1..3./.5.1: 5.

-9 #0/:.9089.....748889.3/8088438:30889889..0 ...3748 #09:7310748 &' Ã $" ":07#08:9 .1471:9:7070:80 .0 030198 $.9434120247:8.0  $08843  &'Ã $08843  .9020398 . $"":07#08:9.6:07476:07-4..08:80/.0 44/.9020398.0882..090708:941.3//.

"  .