Вы находитесь на странице: 1из 248

<Insert Picture Here>

Move to Oracle Database 11g – The whole Story


Mike Dietrich
Database Upgrade & Utilities
ORACLE Corporation
Welcome!!!

© 2009 Oracle Corporation 2


Agenda

Preparation

Upgrade

News and Task List

Diagnostics & Tuning

Performance Testing

Best Practices

© 2009 Oracle Corporation 3


Agenda

Preparation
Support Policy
Patches
Upgrade Certification
Documentation
Upgrade paths
News and Task List Installation
Editions

Diagnostics & Tuning

Performance Testing

Best Practices

© 2009 Oracle Corporation 4


Lifetime Support Policy
today

R2

August 2012 August 2015

July 2010 July 2011 July 2013


R2

January 2009 January 2012

Sustaining Support
Premier Support Extended Support
July 2007 July 2008 July 2010
R2
t
2005

2010

2015
2002

2003

2004

2006

2007

2008

2009

2011

2012

2013

2014

2016

2017

2018
© 2009 Oracle Corporation 5
http://www.oracle.com/support/library/brochure/lifetime-support-technology.pdf
Lifetime Support Policy
Feature Premier Extended Sustaining
Support Support Support
Major Product and Technology Releases   
Technical Support   
Access to Knowledge Base   
(MetaLink/Customer Connection/SupportWeb)

Updates, Fixes, Security Alerts and Critical Patch   Pre-


Pre-existing Only
Updates

Tax, Legal and Regulatory Updates   No

Upgrade Scripts   No

Certification with existing Third Party   No


Products/Versions

Certification with New Third Party  No No


Products/Versions

Certification with new Oracle Products   No

© 2009 Oracle Corporation 6


Lifetime Support Policy
• See:
http://www.oracle.com/support/library/brochure/lifetime-
support-technology.pdf

© 2009 Oracle Corporation 7


Releases – Support-SRs

12%

© 2009 Oracle Corporation 8


Upgrade to Oracle Database 11g

≥≥ 7.3.4
7.3.4 9.2.0.8
9.2.0.8
R2
R2
≥≥ 9.2.0.4
9.2.0.4

≥≥ 8.0.6
8.0.6

R2
R2
≥≥ 8.1.7.4
8.1.7.4

10.1.0.5
10.1.0.5

≥≥ 9.0.1.4
9.0.1.4 ≥≥ 10.2.0.2
10.2.0.2

R2
R2
"Empty" arrows mean: no specific patch release required

© 2009 Oracle Corporation 9


Recommended Patches

© 2009 Oracle Corporation 10


Recommended Patches

© 2009 Oracle Corporation 11


Recommended Patches

© 2009 Oracle Corporation 12


Important Alerts?
• Note 161818.1

© 2009 Oracle Corporation 13


Upgrade Information / Alerts
• Note:454507.1
Support Status and Alerts for Oracle 11g Release 1 (11.1.0.X)

© 2009 Oracle Corporation 14


Upgrade Information / Alerts
• Note 738538.1 Known Issues specific to the 11.1.0.7 Patch Set

© 2009 Oracle Corporation 15


Upgrade Information / Alerts
• Note 738538.1 Known Issues specific to the 11.1.0.7 Patch Set

© 2009 Oracle Corporation 16


Timezone Patches
• Why DST timezone patches? (DST: Daylight Savings Time)
• The date for moving to DST has been changed for 7 different
timezones since 2007
• HST - EST - MST - EST5EDT - MST7MDT - CST6CDT - PST8PDT
• Current DST definitions are included from within the following
patch set
• 10.2.0.4
• Oracle Database 11g requires timezone version V.4
• Oracle 9i: Timezone V1
• Oracle 10g: Timezone V2

• Without timezone V4 no upgrade to Oracle Database


11g will be possible!!!

© 2009 Oracle Corporation 17


Timezone Patches
• Summary – 4 important ML notes:
• Note 414590.1: FAQ and Issues
• Note 413671.1: Timezone V4 - Checks and Links to the Patches

• Note 359145.1: Links to download utltzuv2.sql

• Note 396387.1: Explanations


• Run script utltzuv2.sql to recognize TIMESTAMP WITH TIMEZONE
• Files timezone.dat and timezlrg.dat will be applied

© 2009 Oracle Corporation 18


Timezone Patches
• Timezone How To:
• Download the right patch according to the table in Note 413671.1

• Download the script utltzuv2.sql according to Note 359145.1

• Run the script utltzuv2.sql in your current source database


• Apply files timezone.dat and timezlrg.dat to the source
$ORACLE_HOME/oracore/zoneinfo directory with either Opatch
or manually and restart the database

© 2009 Oracle Corporation 19


Verify Database Creation Wordsize - 10.2.0.3
• Has the database been created originally in a 32-bit
environment and is now on a 64-bit platform?

select
select decode(instr(metadata,'B023'),0,
decode(instr(metadata,'B023'),0,
'64bit
'64bit Database','32bit
Database','32bit Database')
Database') "DB
"DB Creation"
Creation"
from
from kopm$;
kopm$;

• Happens in 10.2.0.3 - see Note:412271.1


• Apply patch:5871314 and patch:5892355 if:
• KOPM$.METADATA contains 'B023'
 created in 32-bit env
• Don't apply patch if:
• KOPM$.METADATA contains 'B047'
 created in 64-bit env
• Database version is 10.2.0.4

© 2009 Oracle Corporation 20


Related to Database Creation Wordsize - 11gR1
• Database upgrade to 11.1.0.6:
• Delete orphan rows from KOTTD$
• Apply patch 6770913
• Database upgrade to 11.1.0.7:
• Delete orphan rows from KOTTD$
• No patches necessary
select
select sys_nc_oid$
sys_nc_oid$ from
from kottd$
kottd$ where
where sys_nc_oid$
sys_nc_oid$
not
not in
in (select
(select oid$
oid$ from
from obj$
obj$ where
where type#=13);
type#=13);
• If result is not null:
delete
delete from
from kottd$
kottd$ where
where sys_nc_oid$
sys_nc_oid$ not
not in
in
(select
(select oid$
oid$ from
from obj$
obj$ where
where type#=13);
type#=13);
commit;
commit;

• See Note:579523.1 - bug:6770913

© 2009 Oracle Corporation 21


Oracle Certification

© 2009 Oracle Corporation 22


Recommended OS patches and settings
• Note: 169706.1

• Note: 401705.1 Linux x86, x86-64, and s390x Requirements Reference List

© 2009 Oracle Corporation 23


Upgrade is easier!
• The upgrade to Oracle Database 11g is much easier
than any upgrades to earlier Oracle releases

• Size of Upgrade guides:


• 8.1.7 - 512 pages
• 9.0.1 - 484 pages – 111 steps for an RDBMS with 9 components
• 9.2.0 - 344 pages
• 10.1.0 - 170 pages - only 6 stepsl!!!
• 10.2.0 - 140 pages
• 11.1.0 - 186 pages - now detailed explanations and
information about new options included

© 2009 Oracle Corporation 24


Upgrade Length
• How long will the upgrade take
to complete?
• Independent of:
• Size of the database
• Used datatypes
• Dependent on:
• The number of objects needing upgrading
• Thus: the number of installed options/components
• Valid and non-stale data dictionary statistics
• Number of synonyms – they‘ll get recompiled (upgrade from 9i)
• Number of objects in XDB
• Number of rows in SYS.AUD$
• At a very low rate if COMPATIBLE will be increased:
• Number of datafiles
• Size of redo logs
© 2009 Oracle Corporation 25
Documentation
• Note: 466181.1 Upgrade Companion 10gR2

• Note: 601807.1 Upgrade Companion 11g

© 2009 Oracle Corporation 26


Documentation
• Note: 601807.1 Upgrade Companion 11g

© 2009 Oracle Corporation 27


Documentation
• Note: 601807.1 Upgrade Companion 11g

© 2009 Oracle Corporation 28


Documentation
• Upgrade Guide

http://download.oracle.com/docs/cd/B28359_01/server.111/b28300/toc.htm

• Note:429825.1
Complete Checklist for Manual Upgrades to 11gR1

• Note: 421191.1
Complete checklist for manual upgrades from X to Y

© 2009 Oracle Corporation 29


Database.us.oracle.com: Upgrade Page
• http://database.us.oracle.com

© 2009 Oracle Corporation 30


OTN Upgrade Page
• http://www.oracle.com/technology/products/database/oracle11g/upgrade/index.html

© 2009 Oracle Corporation 31


OTN Upgrade Forum
• http://forums.oracle.com/forums/forum.jspa?forumID=583&start=0

© 2009 Oracle Corporation 32


42 External 11g References 1/2

© 2009 Oracle Corporation 33


01-JUL-2009
42 External 11g References 2/2

© 2009 Oracle Corporation 34


01-JUL-2009
Upgrade Paths

UPGRADE
UPGRADE
Export/Import
Export/Import

N
N Stay
Stay on
on same
same OS?
OS? Y
Y

CTAS,
CTAS, COPY
COPY
N
N Downtime
Downtime >45min?
>45min?

SQL
SQL Apply
Apply
Y
Y
Oracle
Oracle Streams
Streams
DBUA
DBUA
Transportable
Transportable Tablespaces
Tablespaces
O
OR
CLI
CLI
RAAC
CLLEE
rreecco SQL> @catupgrd
Transportable
Transportable Database
Database ommm
meenn
ddeed
d

© 2009 Oracle Corporation 35


Preparation
• Get INVALID Objects:
SQL>
SQL> SELECT
SELECT UNIQUE
UNIQUE object_name,
object_name, object_type,
object_type, owner
owner
FROM
FROM dba_objects
dba_objects WHERE
WHERE status='INVALID';
status='INVALID';

Recompile invalid objects in SYS and SYSTEM with utlrp.sql


• Compare invalid objects from before and after the upgrade
• Beginning with 11.1.0.7 the comparison has been automated
• registry$sys_inv_objs, registry$nonsys_inv_objs => utluiobj.sql

• Get accurate performance statistics


• Comparison: before ↔ after
• Time specific queries and batches

• Test upgrade of the database


• Functional tests
• Performance tests with real life loads!!!

© 2009 Oracle Corporation 36


Preparation
• Possibilities for performance analysis:
• STATSPACK – export Perfstat user!!!
• Note:394937.1 STATSPACK guide
• Note:466350.1 STATSPACK before/after upgrade
• AWR - extract the AWR
• Do AWR diff reports comparing before/after upgrade
• Real Application Testing
• SQL Performance Analyzer
• Database Replay

© 2009 Oracle Corporation 37


Preparation
• If upgrading from 10g or 11g, purge the recyclebin
SQL>
SQL> purge
purge DBA_RECYCLEBIN;
DBA_RECYCLEBIN;

© 2009 Oracle Corporation 38


Preparation
• Remove from your init.ora/spfile:
• Underscore parameter
• e.g. _always_anti_join=off, _bloom_filter_enabled = FALSE etc.
• Events
• e.g. event="10235 trace name context forever, level 512"
• To the previous release related parameter
• e.g. optimizer_features_enabled=9.2.0

© 2009 Oracle Corporation 39


Preparation
• Create dictionary statistics prior to the upgrade - otherwise
it will take significantly longer
BEGIN
BEGIN
dbms_stats.gather_schema_stats
dbms_stats.gather_schema_stats
('SYS',
('SYS',
options
options =>
=> 'GATHER',
'GATHER',
estimate_percent
estimate_percent =>
=> DBMS_STATS.AUTO_SAMPLE_SIZE,
DBMS_STATS.AUTO_SAMPLE_SIZE,
method_opt
method_opt =>
=> 'FOR
'FOR ALL
ALL COLUMNS
COLUMNS SIZE
SIZE AUTO',
AUTO',
cascade
cascade =>
=> TRUE);
TRUE);
END;
END;
//

• Or in / :
SQL>
SQL> EXECUTE
EXECUTE dbms_stats.gather_dictionary_stats;
dbms_stats.gather_dictionary_stats;

© 2009 Oracle Corporation 40


Preparation
• Switch off DATABASE VAULT (if used/installed)
• Oracle® Database Vault Administrator's Guide: Appendix B
• Unix: (simplified)
• Relinking without Database Vault
[$ make -f ins_rdbms.mk dv_off ]
• $$ dvca
dvca -action
-action disable
disable ...
...

• Windows:
• Rename oradv10.dll in ORACLE_HOME\bin
• Upon restart: $$ dvca
dvca -action
-action disable
disable ...
...

• After upgrading relink with dv_on or rename the DLL and enable
Database Vault again:
$$ dvca
dvca -action
-action enable
enable ...
...

© 2009 Oracle Corporation 41


Preparation
• Drop table SYS.PLAN_TABLE$ and the public synonym
PUBLIC.PLAN_TABLE
• See Alert-Note:782735.1 and Notes: 605317.1 and 736353.1
• Otherwise the component "Oracle Server" can be INVALID after
the upgrade
• Applies to 10.2.0.4 and further releases
• Introduced with DBMS_SQLPA
• Steps to solve this issue if it has happened:
• @catplan.sql -- recreate the plan table
@dbmsxpln.sql -- reload dbms_xplan spec
@prvtxpln.plb -- reload dbms_xplan implementation
@prvtspao.plb -- reload dbms_sqlpa
alter package SYS.DBMS_SUMADVISOR compile ;
alter package SYS.DBMS_SUMADVISOR compile body;

© 2009 Oracle Corporation 42


Installation
• Space / resource requirements
• Software installation:
• 150-200 MB in /tmp or \TEMP necessary
• Between 2.7 GB (Windows), 3.5 GB (Linux) and 6.9 GB (HP-UX)

• Seed database: ≥ 1,6 GB


• Seed databases (ORCL) are always prebuilt EE databases with all
options!!!

• RAM: ≥ 1GB

• Swapspace
• RAM up to 2048Mb → 1.5x RAM
• RAM between 2049Mb and 8192Mb → 1x RAM
• RAM more than 8192Mb → 0.75x RAM

© 2009 Oracle Corporation 43


Installation
• How to access the software?
• Download from OTN:
http://otn.oracle.com/software/index.html
• Metalink:

• http://edelivery.oracle.com/

© 2009 Oracle Corporation 44


Installation
• Download from OTN:

© 2009 Oracle Corporation 45


Installation
• DVD contents?
• Database
• Enterprise Edition
• Standard Edition
• Personal Edition (Windows)
• Client
• Clusterware
• Extra: Examples (formerly known as companion)
• Required Products
• Oracle Globalization Support Demos
• Oracle Multimedia Demos
• Oracle Precompiler Demos
• Oracle Spatial Demos
• Oracle SQLJ Demos
• Oracle XML Demos
• Oracle JDBC Development Drivers
• Oracle Text Knowledge Base

© 2009 Oracle Corporation 46


Installation
• Pre-installation checks:

• Warning: 500MB swap space needed – also on Windows!!!

• Ask support before installing with:


./runInstaller -ignoreSysPrereqs

© 2009 Oracle Corporation 47


Installation - Loopback Adapter for DBcontrol
• Microsoft Loopback Adapter is recommended if IP address
is distributed via DHCP
• Install the MS Loopback Adapter
• Launch the Add Hardware wizard and install a new network
adapter - manufacturer is Microsoft
• Adjust this adapter to be the primary network adapter
• My Network Places => Properties => TCP/IP
• IP address: 10.10.10.10
• Subnet mask: 255.255.255.0
• Edit:
• \windows\system32\drivers\etc\hosts
• 10.10.10.10 mycomputer.mydomain.com mycomputer

• http://download.oracle.com/docs/cd/B28359_01/install.111/b32006/reqs.htm#sthref291

© 2009 Oracle Corporation 48


Installation - Loopback Adapter for DBcontrol
• Launch the Windows Add Hardware Wizard

• Choose Yes, I've already connected the hardware ...

• Scoll down to Add a new hardware device

• Choose Install the hardware that I manually select ...

• Select Network Adapters:


• Click on Manufacturer Microsoft
• Install the Loopback Adapter
• Make the Loopback Adapter
the FIRST network card in
TCP/IP properties!!

© 2009 Oracle Corporation 49


Installation

© 2009 Oracle Corporation 50


Installation

© 2009 Oracle Corporation 51


Installation

Important:
Important:
„CUSTOM“
„CUSTOM“ ALWAYS
ALWAYS installs
installs
Enterprise
Enterprise Edition
Edition

© 2009 Oracle Corporation 52


Installation
• Custom installation:
• 10gR2 doc installation guide

• 11gR1 doc installation guide


http://download.oracle.com/docs/cd/B28359_01/install.111/b32002/install_overview.htm#BABEGJFD

© 2009 Oracle Corporation 53


Patch Set Installation
• Install patch sets and patches before you start the upgrade

© 2009 Oracle Corporation 54


Patch Set Update (PSU) Installation
• Install PSUs as well
• See Note:854428.1: Introduction to Database Patch Set Updates

• PSU patches are intended to be low-risk.


Included in the criteria for the bug fixes in the Database PSU are:
• Critical technical issues with fixes that may affect a large number of customers and
that are already proven in the field
• Critical Patch Update fixes
• PSU patches do not include:
• Changes that require re-certification
• Fixes that require configuration changes
• Typically 50-100 new bug fixes - cummulative
• Guaranteed to be RAC rolling installable
• Change the fifth digit of the release number, e.g. 10.2.0.4.3
• Will be released 4x per year such as CPUs on the same schedule
• Platforms: HP-UX Itanium and PA-RISC64, AIX, Linux x86 and x86-64, Solaris SPARC64

© 2009 Oracle Corporation 55


Unattended Installation/Configuration
• Two options:
• Oracle Universal Installer OUI
• ./runInstaller -record -destinationFile ...
• ./runInstaller -silent -noconsole -responseFile ...
• But this has to be done for a patch set, too
• Home Cloning (script or Provisioning Pack)
• Prepare a fully patched Oracle Home
• Create an archive consisting of all files
• Exclude *log, *dbf, tnsnames/listener/sqlnet.ora
• ./runInstaller -silent -clone -...
• Listener Configuration
• ./netca /silent /responseFile $OH/inventory/response/netca.rsp

© 2009 Oracle Corporation 56


Installation
• Overview on differences of database editions and available
options by edition
• Feature differences:
Note.465465.1
Differences Between Enterprise, Standard and Personal Editions on Oracle 10.2

• Oracle® Database Licensing Information


11g Release 1 (11.1)
Part Number B28287-01
http://download.oracle.com/docs/cd/B28359_01/license.111/b28287/editions.htm

© 2009 Oracle Corporation 57


Installation
• Windows OS - Home Selector :

© 2009 Oracle Corporation 58


Listener Configuration
• Best Practices- strongly recommended:
Create a new listener environment with NETCA:

© 2009 Oracle Corporation 59


Agenda

Preparation

Upgrade
Database Upgrade Assistant
Command Line Upgrade
News and Task List Post Upgrade
Alternatives
CRS Upgrade
Diagnostics & Tuning ASM Upgrade
Migration
Performance Testing

Best Practice

© 2009 Oracle Corporation 60


Database Upgrade Assistant (GUI)
• Features:
• Graphically led upgrade
• Lots of important checks
• RAC aware - inclusion of all nodes
• for RAC (almost) a must !!!
• Offline Backup and Restore possible
• ASM upgrade
• Oracle XE upgrade
• Patch upgrades

• Logs:
• $ORACLE_HOME/cfgtoollogs/dbua

• Documentation:
• Oracle® Database Upgrade Guide
http://download.oracle.com/docs/cd/B28359_01/server.111/b28300/toc.htm

© 2009 Oracle Corporation 61


Database Upgrade Assistant (GUI)
• Silent mode:
• $ dbua –help shows all valid options
• See doc:
http://download.oracle.com/docs/cd/B28359_01/server.111/b28300/upgrade.htm

© 2009 Oracle Corporation 62


Database Upgrade Assistant (GUI)
• dbua [ -silent ] [ -sid SID ] [-oracleHome home_name]
[-oracleBase base_name] [-diagnosticDest diagnostic_destination]
[-sysDBAUserName SYSDBA_user] [-sysDBAPassword SYSDBA_pwd]
[-upgradeASM] [-autoextendFiles] [-newGlobalDbName db_name]
[-newSid new_SID] [-generateMapFile] [-useASM]
[-commonFileLocation common_files] [-omfLocation omf_area]
[-databaseMapFile map_file_name] [-newRecoveryArea recover_area]
[-newRecoveryAreaSize recover_size] [-apexAdminPassword apex_pwd]
[-disableUpgradeScriptLogging ] [-backupLocation directory]
[-sysauxTablespace -datafileName name -datafileSize size
-datafileSizeNext size -datafileSizeMax size]
[-postUpgradeScripts script [, script ] ... ]
[-initParam parameter=value [, parameter=value ] ... ]
[-disableArchiveLogMode] [-recompile_invalid_objects true | false]
[-degree_of_parallelism cpu_number]
[-emConfiguration {CENTRAL|LOCAL|ALL|NOBACKUP|NOEMAIL|NONE}
-dbsnmpPassword password -sysmanPassword password
-asmPassword password -hostUserName hostname
-hostUserPassword password -backupSchedule hh:mm
[-smtpServer server_name -emailAddress address]
[-centralAgent location] [-localRacSid SID]]
[-recoveryAreaDestination directory]
[-h|-help]

© 2009 Oracle Corporation 63


Database Upgrade Assistant (GUI)

• Example:

dbua -silent -sid dwh


-oracleHome /opt/oracle/product/RDBMS10g
-diagnosticDest /opt/oracle/diag
-sysDBAUserName sys
-sysDBAPassword manager
-recompile_invalid_objects true
-degree_of_parallelism 4
-emConfiguration LOCAL
-dbsnmpPassword manager
-sysmanPassword manager

© 2009 Oracle Corporation 64


Database Upgrade Assistant (GUI)
• Before you start DBUA:
• Run $OH_11g/rdbms/admin/utlu111i.sql in your current
environment
• Check especially the components status in DBA_REGISTRY
• To remove (or reinstall) components manually:
Note:472937.1 Information On Installed Database Components
Note:753041.1 How to diagnose Components with NON VALID status

© 2009 Oracle Corporation 65


Database Upgrade Assistant (GUI)

© 2009 Oracle Corporation 66


Database Upgrade Assistant (GUI)

© 2009 Oracle Corporation 67


Database Upgrade Assistant (GUI)

© 2009 Oracle Corporation 68


Database Upgrade Assistant (GUI)

© 2009 Oracle Corporation 69


Database Upgrade Assistant (GUI)

© 2009 Oracle Corporation 70


Database Upgrade Assistant (GUI)

© 2009 Oracle Corporation 71


Database Upgrade Assistant (GUI)

© 2009 Oracle Corporation 72


Database Upgrade Assistant (GUI)

© 2009 Oracle Corporation 73


Database Upgrade Assistant (GUI)

© 2009 Oracle Corporation 74


Database Upgrade Assistant (GUI)

© 2009 Oracle Corporation 75


Database Upgrade Assistant (GUI)

From
From 11g
11g
on
on always
always
SECURE
SECURE

© 2009 Oracle Corporation 76


Database Upgrade Assistant (GUI)

© 2009 Oracle Corporation 77


Database Upgrade Assistant (GUI)

© 2009 Oracle Corporation 78


Database Upgrade Assistant (GUI)

© 2009 Oracle Corporation 79


Database Upgrade Assistant (GUI)

© 2009 Oracle Corporation 80


Database Upgrade Assistant (GUI)

© 2009 Oracle Corporation 81


Database Upgrade Assistant (GUI)

© 2009 Oracle Corporation 82


Database Upgrade Assistant (GUI)

© 2009 Oracle Corporation 83


Database Upgrade Assistant (GUI)

© 2009 Oracle Corporation 84


Database Upgrade Assistant (GUI)

© 2009 Oracle Corporation 85


Agenda

Preparation

Upgrade
Database Upgrade Assistant
Command Line Upgrade
News and Task List Post Upgrade
Alternatives
CRS Upgrade
Diagnostics & Tuning ASM Upgrade
Migration
Performance Testing

Best Practice

© 2009 Oracle Corporation 86


Command Line Upgrade
• Typical scenario: e.g. changing to a new server

Server(OLD)
Server(NEW)

1) Install Oracle11g software


2) Copy utlu111i.sql
3) Run utlu111i.sql
4) Shutdown database
5) Copy all relevant files
(dbf, ctl, log, spfile, orapw) 6) Apply suggested changes
7) Start the upgrade process

© 2009 Oracle Corporation 87


Command Line Upgrade
• Step-by-step:
1. Complete online backup of the database
2. Install 11g Oracle software and apply patch set 11.1.0.7
3. Analyze the DB using utlu111i.sql and follow all
requirements given by the script
4. Create a new 11g listener with NETCA
5. Switch to the new environment, startup the DB (startup
upgrade) and create the SYSAUX tablespace (if source db is
an Oracle 9i db)
6. Run upgrade script catupgrd.sql
7. Recompile with utlrp.sql - compare with utluiobj.sql
8. Run catuppst.sql if you are upgrading from ≥10g
9. Check the post upgrade status: utlu111s.sql

© 2009 Oracle Corporation 88


Command Line Upgrade
Info

• Upgrade information script: utlu111i.sql


• Run in the environment of the source database
• Checks all init parameters and displays warnings for obsolete and
deprecated parameters
• Checks
• Components
• Tablespace SYSAUX
• National Characterset
• Timezone file version check
• Cluster check

© 2009 Oracle Corporation 89


Command Line Upgrade
• utlu111i.sql: DB info and time zone check? (see also PREPARATION)


• DST (Daylight Savings Time) patches for Version V4 have to be
applied as a requirement for the upgrade to Oracle Database 11g
• REGISTRY$DATABASE ==> TZ_VERSION=4


© 2009 Oracle Corporation 90
Command Line Upgrade
• utlu111i.sql: Tablespaces adequate size?

© 2009 Oracle Corporation 91


Command Line Upgrade
• utlu111i.sql: Init parameter changes?

© 2009 Oracle Corporation 92


Command Line Upgrade
• utlu111i.sql: Components and options?

• Annotation:
You'll have to install all options installed for the release you are
upgrading from – otherwise some components can’t be upgraded

• To remove (or reinstall) components manually:


Note:472937.1 Information On Installed Database Components
Note:753041.1 How to diagnose Components with NON VALID status

© 2009 Oracle Corporation 93


Command Line Upgrade - 10gR2
• utlu102i.sql: Typical pitfalls

• Ideally include
the Companion-CD's
"Oracle Database Products"
in all installations:

© 2009 Oracle Corporation 94


Command Line Upgrade
• Create Dictionary statistics
• Shutdown the database (IMMEDIATE/NORMAL)
• Adjust init parameters:
• COMPATIBLE ≥ 10.1.0
• SGA_TARGET ≥ 340MB (32-bit) ... ≥ 640MB (64-bit)
• PGA_AGGREGATE_TARGET ≥ 25MB
• LOG_ARCHIVE_FORMAT must contain %s, %t and %r

• Move init.ora/SPFILE and PWDsid.ora to their new location


• Create a new 11g-Listener (use the NETCA)
• Change environment to point to the new $ORACLE_HOME

© 2009 Oracle Corporation 95


Command Line Upgrade
• Windows only:
• Delete the old Service:
> oradim -DELETE -SID ORCL
• Create a new Service:
> oradim -NEW
-SID ORCL
-SYSPWD passwrd
-STARTMODE a
-PFILE initfile

ORADIM creates a logfile in %ORACLE_HOME%\database

© 2009 Oracle Corporation 96


Command Line Upgrade

SQL>
SQL> STARTUP
STARTUP UPGRADE;
UPGRADE;

ALTER SYSTEM SET _system_trig_enabled=FALSE SCOPE=MEMORY;


Autotune of undo retention is turned off.
ALTER SYSTEM SET _undo_autotune=FALSE SCOPE=MEMORY;
ALTER SYSTEM SET undo_retention=900 SCOPE=MEMORY;
ALTER SYSTEM SET aq_tm_processes=0 SCOPE=MEMORY;
ALTER SYSTEM SET enable_ddl_logging=FALSE SCOPE=MEMORY;
Resource Manager disabled during database migration: plan '' not set
ALTER SYSTEM SET resource_manager_plan='' SCOPE=MEMORY;
Resource Manager disabled during database migration
Taken from an example alert.log

• Supresses unnecessary error messages like


ORA-00942: table or view does not exist -
thus logfiles will be easier to read and check

© 2009 Oracle Corporation 97


Command Line Upgrade
• Create tablespace SYSAUX (only if source is a 9i db) :
SQL>
SQL> CREATE
CREATE TABLESPACE
TABLESPACE sysaux
sysaux
DATAFILE 'file' SIZE
DATAFILE 'file' SIZE 500M
500M
EXTENT
EXTENT MANAGEMENT
MANAGEMENT LOCAL
LOCAL
SEGMENT
SEGMENT SPACE
SPACE MANAGEMENT
MANAGEMENT AUTO
AUTO
ONLINE;
ONLINE;

© 2009 Oracle Corporation 98


Command Line Upgrade
• One upgrade scripts for all releases and all components:
SQL>
SQL> @catupgrd.sql
@catupgrd.sql

• Useful:
SQL>
SQL> SPOOL
SPOOL c:\temp\upgrade.log
c:\temp\upgrade.log

• Database will be shutdown when script has been completed

• Generate fixed object stats:


SQL>
SQL> execute
execute
dbms_stats.gather_fixed_objects_stats;
dbms_stats.gather_fixed_objects_stats;

© 2009 Oracle Corporation 99


Command Line Upgrade
• Recompilation:
• utlrp.sql
• Calls utlprp.sql with CPU_COUNT-1
• Determines automatically if serial or parallel recompilation
with multiple threads can be done
• Recompiles all INVALID objects
• Utilizes package utl_recomp
• Re-enables functional indexes automatically
• utlprp.sql can be called directly like:
• SQL> @utlprp 7
• This can be useful to minimize CPU usage

© 2009 Oracle Corporation 100


Command Line Upgrade
• Progress during recompilation :
1.
1. Query
Query returning
returning the
the number
number of
of invalid
invalid objects
objects remaining.
remaining.
This
This number
number should
should decrease
decrease with
with time.
time.
SELECT
SELECT COUNT(*)
COUNT(*) FROM
FROM obj$
obj$ WHERE
WHERE status
status IN
IN (4,
(4, 5,
5, 6);
6);

2.
2. Query
Query returning
returning the
the number
number ofof objects
objects compiled
compiled so
so far.
far.
This
This number
number should
should increase
increase with
with time.
time.
SELECT
SELECT COUNT(*)
COUNT(*) FROM
FROM UTL_RECOMP_COMPILED;
UTL_RECOMP_COMPILED;

3.
3. Query
Query showing
showing jobs
jobs created
created by
by UTL_RECOMP.
UTL_RECOMP.
SELECT
SELECT job_name
job_name FROM
FROM dba_scheduler_jobs
dba_scheduler_jobs
WHERE
WHERE job_name
job_name like
like 'UTL_RECOMP_SLAVE_%';
'UTL_RECOMP_SLAVE_%';

4.
4. Query
Query showing
showing UTL_RECOMP
UTL_RECOMP jobs
jobs that
that are
are running.
running.
SELECT
SELECT job_name
job_name FROM
FROM dba_scheduler_running_jobs
dba_scheduler_running_jobs
WHERE
WHERE job_name
job_name like
like 'UTL_RECOMP_SLAVE_%';
'UTL_RECOMP_SLAVE_%';

© 2009 Oracle Corporation 101


Command Line Upgrade
• Post upgrade script: catuppst.sql
• Only necessary when upgrading from ≥10.1
• Located in ?/rdbms/admin
• Database is not in upgrade mode anymore
• Can be run concurrently with utlrp.sql
• Upgrade Automatic Workload repository (AWR) baseline information
• Upgrade ADDM task metadata
• Update Oracle Label security (OLS) policies

© 2009 Oracle Corporation 102


Command Line Upgrade
Status

• Post upgrade script: utlu111s.sql


• Run against new database in 11g environment
• Checks the upgrade results according to DBA_REGISTRY
• Displays duration of the upgrade per component and in total

© 2009 Oracle Corporation 103


Command Line Upgrade
• Post upgrade script: utlu111s.sql
SQL>
SQL> @?/rdbms/admin/utlu111s.sql
@?/rdbms/admin/utlu111s.sql

Oracle
Oracle Database
Database 11.1
11.1 Post-Upgrade
Post-Upgrade Status
Status Tool
Tool 05-06-2009
05-06-2009 11:23:33
11:23:33

Component
Component Status
Status Version
Version HH:MM:SS
HH:MM:SS
Oracle
Oracle Server
Server VALID
VALID 11.1.0.7.0
11.1.0.7.0 00:16:17
00:16:17
JServer
JServer JAVA
JAVA Virtual
Virtual Machine
Machine VALID
VALID 11.1.0.7.0
11.1.0.7.0 00:05:19
00:05:19
Oracle
Oracle Workspace
Workspace Manager
Manager VALID
VALID 11.1.0.7.0
11.1.0.7.0 00:01:01
00:01:01
Oracle
Oracle Enterprise
Enterprise Manager
Manager VALID
VALID 11.1.0.7.0
11.1.0.7.0 00:10:13
00:10:13
Oracle
Oracle XDK
XDK VALID
VALID 11.1.0.7.0
11.1.0.7.0 00:00:48
00:00:48
Oracle
Oracle Text
Text VALID
VALID 11.1.0.7.0
11.1.0.7.0 00:00:58
00:00:58
Oracle
Oracle XML
XML Database
Database VALID
VALID 11.1.0.7.0
11.1.0.7.0 00:04:09
00:04:09
Oracle
Oracle Database
Database Java
Java Packages
Packages VALID
VALID 11.1.0.7.0
11.1.0.7.0 00:00:33
00:00:33
Oracle
Oracle Multimedia
Multimedia VALID
VALID 11.1.0.7.0
11.1.0.7.0 00:07:43
00:07:43
Oracle
Oracle Expression
Expression Filter
Filter VALID
VALID 11.1.0.7.0
11.1.0.7.0 00:00:18
00:00:18
Oracle
Oracle Rule
Rule Manager
Manager VALID
VALID 11.1.0.7.0
11.1.0.7.0 00:00:12
00:00:12
Gathering
Gathering Statistics
Statistics 00:04:53
00:04:53

Total
Total Upgrade
Upgrade Time:
Time: 00:52:31
00:52:31

© 2009 Oracle Corporation 104


Agenda

Preparation

Upgrade
Database Upgrade Assistant
Command Line Upgrade
News and Task List Post Upgrade
Alternatives
CRS Upgrade
Diagnostics & Tuning ASM Upgrade
Migration
Performance Testing

Best Practice

© 2009 Oracle Corporation 105


Post Upgrade - SPFILE
• Always create an editable init.ora from the current SPFILE
after the upgrade has been finished
• SPFILE is:
• It’s a binary file!!!
• Default since Oracle 9.0
• It simply exists after using DBUA or DBCA
• Parameter can be changed by:
SQL>
SQL> alter
alter system
system set
set PARAMETER=VALUE
PARAMETER=VALUE scope=both;
scope=both;

or:
SQL>
SQL> create
create pfile pfile from
from spfile;
spfile;
Now
Now edit
edit init.ora
init.ora with
with an
an editor:
editor:
SQL>
SQL> startup
startup force force pfile=initDB.ora
pfile=initDB.ora
SQL>
SQL> create
create spfilespfile from
from pfile;
pfile;

© 2009 Oracle Corporation 106


Post Upgrade
• Create system statistics during a regular workload period -
otherwise non-appropriate values for the CBO will be used:
SQL>
SQL> EXECUTE
EXECUTE dbms_stats.gather_system_stats('start');
dbms_stats.gather_system_stats('start');
...
...
SQL>
SQL> EXECUTE
EXECUTE dbms_stats.gather_system_stats('stop');
dbms_stats.gather_system_stats('stop');

SQL>
SQL> select
select pname
pname NAME,
NAME, pval1
pval1 VALUE,
VALUE, pval2
pval2 INFO
INFO
from
from aux_stats$;
aux_stats$;

NAME
NAME VALUE
VALUE INFO
INFO
-------------------- ---------- ------------------------------
-------------------- ---------- ------------------------------
STATUS
STATUS COMPLETED
COMPLETED
DSTART
DSTART 04-03-2008
04-03-2008 12:30
12:30
DSTOP
DSTOP 05-03-2008
05-03-2008 12:30
12:30
FLAGS
FLAGS 11
CPUSPEEDNW
CPUSPEEDNW 1392,39
1392,39
IOSEEKTIM
IOSEEKTIM 11,405
11,405
IOTFRSPEED
IOTFRSPEED 25595,605
25595,605
...
...

© 2009 Oracle Corporation 107


Post Upgrade
• Create fixed table statistics directly after catupgrd.sql has
been completed:
SQL>
SQL> execute
execute
dbms_stats.gather_fixed_objects_stats;
dbms_stats.gather_fixed_objects_stats;

• Otherwise it can happen that MMON will cause too much CPU load

© 2009 Oracle Corporation 108


Agenda

Preparation

Upgrade
Database Upgrade Assistant
Command Line Upgrade
News and Task List Post Upgrade
Alternatives
CRS Upgrade
Diagnostics & Tuning ASM Upgrade
Migration
Performance Testing

Best Practice

© 2009 Oracle Corporation 109


Upgrade Alternatives
• Export/Import
• DataPump
• Transportable Tablespaces
• Streams
• Logical Standby

© 2009 Oracle Corporation 110


Upgrade Alternatives
• Export/Import
• All-purpose
• Import possible for ≥ Oracle V5
• Export is not supported anymore in Oracle 11g
• Time and resource consuming
• Necessary or useful for:
• Changing the character set
• Changing the OS platform before Oracle 10gR2
• Consolidating schemas
• All non-supported upgrade releases (like 8.1.6)

© 2009 Oracle Corporation 111


Upgrade Alternatives
• Export/Import
• Changing the character set
• Changing the Database Character Set
Note: 225912.1
• Use Scanner Utility CSscan before altering the DB Character set
Note: 123670.1
• Unicode
• Problem can be:
Umlaut Ä in WE8ISO... = 1 Byte
Umlaut Ä in UTF8 = 2 Byte
• Important Unicode Notes on Metalink:
Note: 260893.1 and Note: 788156.1
• WE8ISO8859P1 ==> P15: Note 257722.1
• Character Set Migration - White Paper:
• http://www.oracle.com/technology/tech/globalization/pdf/mwp.pdf

© 2009 Oracle Corporation 112


Upgrade Alternatives
• Hints and tricks
• Transfer dump files always in BINARY mode
• Do full database export always as user SYSTEM
• GRANTs on SYS's objects have to be exported seperately
• Import takes approximately 3x times as long as Export
• Export always with the lowest involved database version
• Import always with imp of target database
• See also: Note:286775.1

• Export performance
• DIRECT=Y ... bypasses SQL-Layer, but no conversions!
• Parallelize export by dividing into logical independent chunks of data
• Import performance
• Increase BUFFER
• INDEXES=N ... build indexes later in parallel ... INDEXFILE=...
• Parameter COMMIT_WRITE=NOWAIT (10g) or
COMMIT_WAIT=NOWAIT (11g) during import

© 2009 Oracle Corporation 113


Upgrade Alternatives
• Data Pump
• Goal:
• Much faster and more flexible than exp/imp
• Concept:
• Use impdp through a database link to transport the data into a new
database without dumping the data to disk
IMPDP
IMPDP usr1/password
usr1/password NETWORK_LINK=db_link1
NETWORK_LINK=db_link1 FULL=Y
FULL=Y
• Pros & Cons:
+ All advantages of the datapump concept
+ No dumpfile will be created (so no additional IO)
+ Very simple to realize
- Works only with 10.1.0.2 and above

• For documentation see:


Oracle® Database Utilities
• Further information and examples: Note:553337.1

© 2009 Oracle Corporation 114


Upgrade Alternatives
• Transportable Tablespaces
• Goal:
• Minimal downtime
• Concept:
• Tablespaces and metadata will be just transported from one
database to another and plugged in

• Pros&Cons:
+ "Can be" extremely fast
- SYSTEM+SYSAUX tablespaces won't get transported - so additional
tasks are required to get views, synonyms etc. moved into the new
database
- Full backup necessary afterwards
• Cases and White Papers on OTN:
• Amadeus Customer Case
http://www.oracle.com/technology/deploy/availability/pdf/AmadeusProfile_TTS.pdf
• For TTS White Papers see the MAA webpage:
http://www.oracle.com/technology/deploy/availability/htdocs/maa.htm

© 2009 Oracle Corporation 115


Upgrade Alternatives
• General Transportable Tablespaces feature
• Available since Oracle 8i
Source DB Target DB

Read Only

Copy datafiles
exp meta data
imp meta data

Read Write

© 2009 Oracle Corporation 116


Upgrade Alternatives
• TTS x-platform (v$transportable_platform):

Little Endian RMAN Big Endian


c
HP Open VMS
HP Tru64 UNIX o
FILE FILE Apple Mac OS
n
Linux IA (32-bit) v HP-UX (64-bit)
COPY COPY
Linux IA (64-bit) e HP-UX IA (64-bit)
Linux 64-bit for AMD r
t AIX-Based Systems (64-bit)
Microsoft Windows IA (64-bit) IBM zSeries Based Linux
Microsoft Windows 64-bit for AMD IBM Power Based Linux
Microsoft Windows IA (32-bit)
Solaris[tm] OE (32-bit)
Solaris Operating System (x86) Solaris[tm] OE (64-bit)

© 2009 Oracle Corporation 117


Upgrade Alternatives

10.2.0.4 11.1.0.7

Source DB Target DB

Create new

Import non-segment
user data (views etc.)

Transport

© 2009 Oracle Corporation 118


Upgrade Alternatives
• Transportable Tablespaces - 3 ways
• The "brutal" way
• Full exp/imp with ROWS=N
• The "smart" way
• Generate scripts
• String concatenation with || ...
• DBMS_METADATA
• The "very smart" way
• RMAN clone with SKIP TABLESPACES option

© 2009 Oracle Corporation 119


Upgrade Alternatives
• Transportable Tablespaces - Information
• For TTS White Papers see the MAA webpage:
http://www.oracle.com/technology/deploy/availability/htdocs/maa.htm
• Database Upgrades using TTS:
http://www.oracle.com/technology/deploy/availability/pdf/maa_wp_11g_upgradetts.pdf

• Database Upgrades using Transportable Database (RMAN):


http://www.oracle.com/technology/deploy/availability/pdf/MAA_WP_10gR2_PlatformMigration
TDB.pdf

• Transportable Database - Information


• Note: 413586.1
How To Use RMAN CONVERT DATABASE for Cross Platform Migration

© 2009 Oracle Corporation 120


Upgrade Alternatives
• Oracle Streams
• Goal:
• Least downtime
• Concept:
• Build up a second database, run it synchronized with Streams and
switch over to the new db at any time

• Pros&Cons:
+ Operation in parallel
+ Possibility of changing the platform environment
- Logminer has some datatype restrictions
- Effort is relatively high and source db must be at least 9.2

• For a detailed documentation see:


Oracle® Streams Concepts and Administration: Appendix D
http://download.oracle.com/docs/cd/B28359_01/server.111/b28321/ap_strup.htm#i642623

© 2009 Oracle Corporation 121


Upgrade Alternatives
• Logical Standby (Data Guard)
• Goal:
• Minimal downtime
• Concept:
• Upgrade will be done on the standby first
• Afterwards: Switchover - standby will be now prod system
• Now upgrade on ex-prod - switchover back to start layout

• Pros&Cons:
+ Downtime ~2min for both switchovers
- No changes of the OS platform possible
- Logminer has some datatype restrictions
- Some effort to setup and prod must be at least 10.1.0.3
+ But beginning with 11g:
Transient Logical Standby utilizes an existing Physical
Standby database for the rolling upgrade process

© 2009 Oracle Corporation 122


Upgrade Alternatives
Upgrade

Clients Redo
P L Log P L
ARCH

10.1.0.3 10.1.0.3 10.1.0.3 11.1.0.7


1 Logical Standby configuration 2 Upgrade node L to 11.1

Redo Redo
Upgrade L P P L

11.1.0.7 11.1.0.7 10.1.0.3 11.1.0.7


Switchover (role change),
4 3 "Mixed setup" for testing
then upgrade on L (ex-P)

© 2009 Oracle Corporation 123


Upgrade Alternatives
• How to:
• Patches, Links and Restrictions: Note: 300479.1
• Please see the documentation!!!
http://download.oracle.com/docs/cd/B28359_01/server.111/b28294/create_ls.htm#g105412
http://download.oracle.com/docs/cd/B28359_01/server.111/b28294/rollup.htm#BABJIDHI

• Note:748595.1 (how to create a logical standby from a physical)


• White Paper (see OTN.oracle.com => High Availability => MAA):
Database Upgrades using SQL Apply
http://www.oracle.com/technology/deploy/availability/pdf/maa_wp_10gr2_rollingupgradebestpractices.pdf

Database Upgrades using a Transient Logical Standby


http://www.oracle.com/technology/deploy/availability/pdf/maa_wp_11g_transientlogicalrollingupgrade.pdf

© 2009 Oracle Corporation 124


Upgrade Alternatives – Transient Standby
Guaranteed
Guaranteed
Restore
Restore Point
Point PROD PSTBY

Logminer
Logminer KEEP IDENTITY 
Build
Build LSTBY
 synchronize

Upgrade
Upgrade with
with DBUA
DBUA
synchronize 
 FLASHBACK
DATABASE TO: SWITCHOVER 
LSTBY PROD
Guaranteed
Guaranteed
Restore
Restore Point
Point


New
New $OH
$OH
Upgrade via
PSTBY Logshipping:

synchronize

SWITCHOVER 
PROD PSTBY

t t
© 2009 Oracle Corporation 125
Agenda

Preparation

Upgrade
Database Upgrade Assistant
Command Line Upgrade
News and Task List Post Upgrade
Alternatives
CRS Upgrade
Diagnostics & Tuning ASM Upgrade
Migration
Performance Testing

Best Practices

© 2009 Oracle Corporation 126


CRS Upgrade
• Always install into the existing CRS Home

© 2009 Oracle Corporation 127


CRS Upgrade

© 2009 Oracle Corporation 128


CRS Upgrade
• Documentation:
• Oracle Clusterware Administration and Deployment Guide 11g
http://download.oracle.com/docs/cd/B28359_01/rac.111/b28255/toc.htm

• CRS Rolling Upgrade:


• Note: 338706.1: Oracle Clusterware Rolling Upgrades

© 2009 Oracle Corporation 129


Agenda

Preparation

Upgrade
Database Upgrade Assistant
Command Line Upgrade
News and Task List Post Upgrade
Alternatives
CRS Upgrade
Diagnostics & Tuning ASM Upgrade
Migration
Performance Testing

Best Practices

© 2009 Oracle Corporation 130


ASM Upgrade
• Upgrade an ASM instance with DBUA:
http://download.oracle.com/docs/cd/B28359_01/server.111/b28300/upgrade.htm#BABGEDJI

• Upgrade an ASM instance manually:


• http://download.oracle.com/docs/cd/B28359_01/server.111/b28300/upgrade.htm#BABHJIFJ

• ASM Rolling Upgrade (only in clustered environments):


http://download.oracle.com/docs/cd/B28359_01/server.111/b31107/asminst.htm#OSTMG02400

© 2009 Oracle Corporation 131


ASM Upgrade using DBUA

© 2009 Oracle Corporation 132


ASM Upgrade using DBUA

© 2009 Oracle Corporation 133


CRS - ASM - DB Compatibility
Note:
337737.1

© 2009 Oracle Corporation 134


CRS - ASM - DB Upgrade
• Reconfigure Oracle Cluster Synchronization Services
• Upgrading a single-instance ASM requires that Oracle Cluster
Synchronization Services (CSS) first be configured to run from
the new Oracle Database 11g Release 1 (11.1) home. To do this
you need to run the following command before upgrading ASM:
• localconfig reset [destination_Oracle_home]
• Prepare the new ASM Home
• Copy config files ... $OH/dbs/...
• Copy password file
• Adjust init.ora

© 2009 Oracle Corporation 135


Agenda

Preparation

Upgrade
Database Upgrade Assistant
Command Line Upgrade
News and Task List Post Upgrade
Alternatives
CRS Upgrade
Diagnostics & Tuning ASM Upgrade
Migration
Performance Testing

Best Practices

© 2009 Oracle Corporation 136


Platform Migration
• Data Guard Physical Standby
• Goal:
• Platform migration between with a Physical Standby
• Concept:
• Build a physical standby database and do a switchover

• Pros&Cons:
+ Only 1 minute downtime for a complete platform migration
+ Simple to setup
+ For Oracle 9.2.0.7+8 and 10.2.0.2+3+4:
HP-PA 11.23 HP-IA64
+ Since Oracle 11g: Win Linux
• For supported combinations see: Note:413484.1

© 2009 Oracle Corporation 137


OS change on HP: PA RISC  IA64
• Migration from HP PA-RISC (64bit) to HP Itanium ia64
Note:266220.1
1) Complete valid backup
2) Trace the controlfile
• SQL> alter database backup controlfile to trace;
3) Shutdown immediate (or normal)
4) Copy all datafiles
5) Startup nomount
6) Create a new controlfile
7) Possibly rebuild the JVM
• SQL> create or replace java system;

© 2009 Oracle Corporation 138


ASM Migration
• Migration to ASM
• Option 1: RMAN
• Option 2: Physical standby
• Simple switchover will do the migration to ASM
• Just 1 minute downtime
• See:

http://www.oracle.com/technology/deploy/availability/pdf/maa_wp_10gr2_asmmigrationwithdg.pdf

© 2009 Oracle Corporation 139


RAC Migration
• Migration from Single Instance to RAC:
• Option 1: rconfig utility
http://download.oracle.com/docs/cd/B28359_01/install.111/b28264/cvrt2rac.htm#BABGGEGJ
• Modify $ORACLE_HOME/assistants/rconfig/sampleXMLs/ConvertToRAC.xml
• Run $ORACLE_HOME/bin/rconfig myconvert.xml
• Option 2: Enterprise Manager Grid Control
http://download.oracle.com/docs/cd/B28359_01/install.111/b28264/cvrt2rac.htm#sthref466

• Option 3: Manual
• Install Cluster Ready Services (CRS) software
• Install Oracle RAC software (or link with RAC option)
• Reconfigure database to accommodate RAC settings
• @$ORACLE_HOME/rdbms/admin/catclust.sql
• init.ora
• Register instances with srvctl
• See an example:
• http://www.oracle.com/technology/pub/articles/chan_sing2rac_install.html

© 2009 Oracle Corporation 140


Agenda

Preparation

Upgrade

News and Task List


Parameters
Processes
Diagnostics & Tuning Miscellaneous
Tools
Automation
Performance Testing LOB & SecureFiles
Flashback
ADR
Best Practices Compression

© 2009 Oracle Corporation 141


Parameter COMPATIBLE
• COMPATIBLE has to be at least 10.1.0 for an 11g database
• No way back once ≥11.1.0 has been enabled
• Supported release downgrade only down to 10.1.0
• Supported patch downgrade only down to 11.1.0
• No ALTER DATABASE RESET COMPATIBILITY command anymore

COMPATIBLE
COMPATIBLE == 10.0/1/2.0
10.0/1/2.0

COMPATIBLE
COMPATIBLE == 11.0.0
11.0.0

© 2009 Oracle Corporation 142


Parameter COMPATIBLE
• Upgrade 9i 11g precautions:
• Make 100% sure that you've applied DST patches before starting
the 9i database in an 11g environment
• 9i 11g requires COMPATIBLE ≥ 10.1
• No possibility to have COMPATIBLE=9.2.0
• No way back as soon as the database has be opened with a
raised COMPATIBLE setting

COMPATIBLE
COMPATIBLE ≥≥ 10.1/2.0
10.1/2.0

© 2009 Oracle Corporation 143


Parameter COMPATIBLE
• DBUA raises COMPATIBLE only for 9i databases to 10.1.0
• To enable Oracle 11g features:
SQL>
SQL> alter
alter system
system
set
set compatible='11.1.0'
compatible='11.1.0' scope=spfile;
scope=spfile;

• Afterwards restart the database


• New features will be enabled
• Datafile headers will be adjusted
• Redologfiles will be adjusted during first access

© 2009 Oracle Corporation 144


New 11g Parameters
New in 11g OPTIMIZER_USE_INVISIBLE_INDEXES
OPTIMIZER_USE_PENDING_STATISTICS
Oracle® Database Reference
OPTIMIZER_USE_SQL_PLAN_BASELINES
PARALLEL_IO_CAP_ENABLED
ASM_PREFERRED_READ_FAILURE_GROUPS PLSCOPE_SETTINGS
CLIENT_RESULT_CACHE_LAG REDO_TRANSPORT_USER
CLIENT_RESULT_CACHE_SIZE RESOURCE_MANAGER_CPU_ALLOCATION
COMMIT_LOGGING RESULT_CACHE_MAX_RESULT
COMMIT_WAIT RESULT_CACHE_MAX_SIZE
CONTROL_MANAGEMENT_PACK_ACCESS RESULT_CACHE_MODE
DB_LOST_WRITE_PROTECT RESULT_CACHE_REMOTE_EXPIRATION
DB_SECUREFILE SEC_CASE_SENSITIVE_LOGON
DB_ULTRA_SAFE SEC_MAX_FAILED_LOGIN_ATTEMPTS
DDL_LOCK_TIMEOUT SEC_PROTOCOL_ERROR_FURTHER_ACTION
DIAGNOSTIC_DEST SEC_PROTOCOL_ERROR_TRACE_ACTION
GLOBAL_TXN_PROCESSES SEC_RETURN_SERVER_RELEASE_BANNER
JAVA_JIT_ENABLED XML_DB_EVENTS
LDAP_DIRECTORY_SYSAUTH
MEMORY_MAX_TARGET
MEMORY_TARGET
OPTIMIZER_CAPTURE_SQL_PLAN_BASELINES
ES

© 2009 Oracle Corporation 145


New Parameters - Selection
• CONTROL_MANAGEMENT_PACK_ACCESS
• Default: DIAGNOSTIC+TUNING
• Values: DIAGNOSTIC+TUNING
DIAGNOSTIC
NONE
• Purpose:Controls access to several functionalties of
Diagnostic and Tuning Pack
• Example:
CONTROL_MANAGEMENT_PACK_ACCESS=NONE
CONTROL_MANAGEMENT_PACK_ACCESS=NONE

select
select count(*)
count(*) from
from v$active_session_history;
v$active_session_history;
==> 00 rows
==> rows

© 2009 Oracle Corporation 146


New Parameters - Selection
• DIAGNOSTIC_DEST
• Default: $ORACLE_BASE
• Value: OS path/directory
• Layout: <diagnostic_dest>/diag/rdbms/<dbname>/<instname>
• Purpose:Substitutes background_dump_dest,
user_dump_dest, listener trace etc. and specifies the
ADR home (Automatic Diagnostic Repository)

© 2009 Oracle Corporation 147


New Parameters - Selection
• MEMORY_TARGET and MEMORY_MAX_TARGET
• Default: 0
• Value: integer [K | M | G]
• Purpose:Specifies the complete plus the maximum memory
available to the Oracle server

MEMORY_MAX_TARGET
SGA_MAX_SIZE

MEMORY_TARGET

SGA_TARGET PGA_AGGREGATE_TARGET

© 2009 Oracle Corporation 148


New Parameters - Selection
• OPTIMIZER_USE_INVISIBLE_INDEXES
• Default: FALSE
• Values: TRUE
FALSE
• Purpose:"Invisible" indexes will be ignored by the optimizer if set to
FALSE. But DMLs will be still executed to the index.
• Motivation: Isolated testing of performance effects of an
index based on a session level
• Example: CREATE
CREATE INDEX
INDEX emp_ename
emp_ename ONON emp(ename)
emp(ename)
INVISIBLE;
INVISIBLE;
ALTER
ALTER SESSION
SESSION SET
SET
OPTIMIZER_USE_INVISIBLE_INDEXES=TRUE;
OPTIMIZER_USE_INVISIBLE_INDEXES=TRUE;

© 2009 Oracle Corporation 149


New Parameters - Selection
• SEC_CASE_SENSITIVE_LOGON 1/2
• Default: TRUE
• Values: TRUE
FALSE
• Purpose:Switches on/off the case sensitivity of passwords
Attention: also valid for database links!!
• Info: SELECT username, password_versions FROM dba_users;
SELECT username, password_versions FROM dba_users;
USERNAME
USERNAME PASSWORD_VERSIONS
PASSWORD_VERSIONS
----------
---------- -----------------
-----------------
JONES
JONES 10G
10G 11G
11G
PRESTON
PRESTON 11G
11G Changed
Changed in:
in:
BLAKE
BLAKE 10G
10G

Created
Created in:
in:

© 2009 Oracle Corporation 150


New Parameters - Selection
• SEC_CASE_SENSITIVE_LOGON 2/2
• Switching on the case sensitivity password mode can have several
impacts:
• Scripts with user/pw like SCOTT/TIGER won't run anymore if
the user gets created or altered e.g. as SCOTT/tiger in 11g
• Annotation: Upon upgrading the "old" mechanism is still valid
• Check password encrypted database links
• Can be enabled also for the password file checkings
• orapwd
orapwd file=orapwSID
file=orapwSID password=GeHeIm
password=GeHeIm ignorecase=n
ignorecase=n

• Very helpful:
Check view for default passwords: DBA_USERS_WITH_DEFPWD

© 2009 Oracle Corporation 151


New Parameter Defaults - Selection
• AUDIT_TRAIL
• Default: NONE or DB
• Values: NONE
OS
XML
DB
DB_EXTENDED
• Purpose:Will help auditing security relevant statements.
Upon an upgrde AUDIT_TRAIL keeps its default
from 9.2/10.1/10.2 (NONE). If a 11g database is
created from scratch then it'll set to DB and
statements get logged in SYS.AUD$

© 2009 Oracle Corporation 152


Agenda

Preparation

Upgrade

News and Task List


Parameters
Processes
Diagnostics & Tuning Miscellaneous
Tools
Automation
Performance Testing LOB & SecureFiles
Flashback
ADR
Best Practices Compression

© 2009 Oracle Corporation 153


Background Processes
• Example:
select
select name,
name, description
description from
from v$bgprocess,
v$bgprocess, v$process
v$process
where
where paddr=addr;
paddr=addr;
NAME
NAME DESCRIPTION
DESCRIPTION NAME DESCRIPTION
-----
----- -----------------------
----------------------- ----- --------------------------
ARC0
ARC0 Archival
Archival Process
Process 00 MMNL Manageability Monitor Pr 2
ARC1
ARC1 Archival
Archival Process
Process 11 MMON Manageability Monitor Pr
ARC2
ARC2 Archival
Archival Process
Process 22 PMON process cleanup
ARC3
ARC3 Archival
Archival Process
Process 33 PSP0 process spawner 0
CJQ0
CJQ0 Job
Job Queue
Queue Coordinator
Coordinator QMNC AQ Coordinator
CKPT
CKPT checkpoint
checkpoint RECO distributed recovery
DBRM
DBRM Resource
Resource Manager
Manager process
process SMCO Space Manager Process
DBW0
DBW0 db
db writer
writer process
process 00 SMON System Monitor Process
DIA0
DIA0 diagnosibility
diagnosibility process
process 00 VKTM Virtual Keeper of TiMe pr
DIAG
DIAG diagnosibility
diagnosibility process
process
DSKM
DSKM slave
slave DiSKMon
DiSKMon process
process
FBDA
FBDA Flashback
Flashback Data
Data Archiver
Archiver Pr.
Pr.
LGWR
LGWR Redo
Redo etc.
etc.
MMAN
MMAN Memory
Memory Manager
Manager

© 2009 Oracle Corporation 154


New Background Processes
Process
Description Found
Name
In an RAC environment, this per-instance process (Atomic Controlfile to Memory Service) is an agent
which contributes to ensuring a distributed SGA memory update is either globally committed on success
ACMS or globally aborted in the event of a failure. RAC

Responsible for hang detection and deadlock resolution.


DIA0 ALL

Performs diagnostic dumps and executes global oradebug commands.


DIAG ALL

The Resource Manager process is responsible for setting Resource Plans and other Resource Manager
DBRM related tasks.
ALL

ALL with any


EMNC / The Event Monitor Coordinator coordinates the event management and notification activity in the registered event
database which includes Streams Event Notifications, Continuous Query Notifications and Fast activity
e0xx Application Notifications.
(optional non-fatal)

The process archives historical rows for tracked tables into flashback data archives and manages the
FBDA flashback archives.
ALL.

GMON Maintains disk membership in ASM disk groups ASM

Provides transparent support for XA global transactions in a RAC environment. The database
GTX0-j autotunes the number of these processes based on the workload of XA global transactions.
RAC only

© 2009 Oracle Corporation 155


New Background Processes
Process
Description Found
Name
ASM, spawned on
KATE Performs proxy I/O to an ASM metafile when a disk becomes offline.
demand.

ASM, spawned on
MARK Marks ASM Allocation Units as stale following a missed write to an offline disk.
demand.

Spawns Oracle processes.


PSP0 ALL

The RAC Management Processes perform manageability tasks for RAC, e.g. creation of RAC related
RMSn resources when new instances are added to the clusters
RAC only

In a RACenvironment, this process manages background slave process creation and communication on
RMSN remote instances. These background slave processes perform tasks on behalf of a coordinating process RAC only
running in another instance.

SMCO / The space management coordinator process coordinates the execution of various space management
ALL (optional non-
related tasks, such as proactive space allocation and space reclamation. It dynamically spawns slave
fatal)
Wnnn processes (Wnnn) to implement the task.

?
The Virtual Keeper of TiMe is responsible for providing a Wall-Clock time (updated every second) and
VKTM Reference-Time Counter (updated every 20ms and available only when running at elevated priority).
ALL

© 2009 Oracle Corporation 156


Agenda

Preparation

Upgrade

News and Task List


Parameters
Processes
Diagnostics & Tuning Miscellaneous
Tools
Automation
Performance Testing LOB & SecureFiles
Flashback
ADR
Best Practices

© 2009 Oracle Corporation 157


CONNECT Role
• The CONNECT Role has been changed since 10gR2:
GRANTEE
GRANTEE PRIVILEGE
PRIVILEGE
-----------------------
----------------------- -------------------
-------------------
CONNECT
CONNECT CREATE
CREATE VIEW
VIEW
CONNECT
CONNECT CREATE
CREATE TABLE
TABLE
CONNECT
CONNECT ALTER
ALTER SESSION
SESSION
CONNECT
CONNECT CREATE
CREATE CLUSTER
CLUSTER
CONNECT
CONNECT CREATE
CREATE SESSION
SESSION
CONNECT
CONNECT CREATE
CREATE SYNONYM
SYNONYM
CONNECT
CONNECT CREATE
CREATE SEQUENCE
SEQUENCE
CONNECT
CONNECT CREATE
CREATE DATABASE
DATABASE LINK
LINK

R2 GRANTEE
GRANTEE PRIVILEGE
PRIVILEGE
-----------------------
----------------------- -------------------
-------------------
CONNECT
CONNECT CREATE
CREATE SESSION
SESSION

© 2009 Oracle Corporation 158


CONNECT Role
• Find out affected database users:
SELECT
SELECT grantee
grantee
FROM
FROM dba_role_privs
dba_role_privs
WHERE
WHERE granted_role
granted_role == 'CONNECT'
'CONNECT' and
and
grantee
grantee NOT
NOT IN
IN ('SYS',
('SYS', 'OUTLN',
'OUTLN', 'SYSTEM',
'SYSTEM',
'CTXSYS',
'CTXSYS', 'DBSNMP',
'DBSNMP',
'LOGSTDBY_ADMINISTRATOR',
'LOGSTDBY_ADMINISTRATOR',
'ORDSYS',
'ORDSYS', 'ORDPLUGINS',
'ORDPLUGINS',
'OEM_MONITOR',
'OEM_MONITOR', 'WKSYS',
'WKSYS',
'WKPROXY',
'WKPROXY', 'WK_TEST',
'WK_TEST',
'WKUSER',
'WKUSER', 'MDSYS',
'MDSYS',
'LBACSYS',
'LBACSYS', 'DMSYS',
'DMSYS', 'WMSYS',
'WMSYS',
'EXFSYS',
'EXFSYS', 'SYSMAN',
'SYSMAN',
'MDDATA',
'MDDATA', 'XDB',
'XDB', 'ODM',
'ODM',
'SI_INFORMTN_SCHEMA');
'SI_INFORMTN_SCHEMA');

© 2009 Oracle Corporation 159


Shared Pool calculation since 10g
• Parameter shared_pool_size is calculated differently
since 10g
• Real shared pool = shared_pool_size – startup overhead
SQL>
SQL> select
select ** from
from v$sgainfo;
v$sgainfo;

NAME
NAME BYTES
BYTES RES
RES
-------------------------------- ---------- ---
-------------------------------- ---------- ---
Fixed
Fixed SGA
SGA Size
Size 1266372
1266372 No
No
Redo
Redo Buffers
Buffers 2924544
2924544 No
No
Buffer
Buffer Cache
Cache Size
Size 16777216
16777216 Yes
Yes
Shared Pool Size
Shared Pool Size 83886080 Yes
83886080 Yes
Large Pool Size
Large Pool Size 00 Yes
Yes
Java Pool Size
Java Pool Size 50331648 Yes
50331648 Yes
Streams
Streams Pool
Pool Size
Size 00 Yes
Yes
Granule
Granule Size
Size 4194304
4194304 No
No
Maximum SGA Size
Maximum SGA Size 155189248 No
155189248 No
Startup overhead in Shared Pool
Startup overhead in Shared Pool 29360128
29360128 No
No
Free SGA Memory Available
Free SGA Memory Available 00

© 2009 Oracle Corporation 160


GROUP BY results: unsorted
• Hash Group by aggregation which allows a hash
algorithm to process group by statements
• For sorts ORDER BY has to be used
select
select sum(sal),
sum(sal), deptno
deptno from
from scott.emp
scott.emp group
group by
by deptno;
deptno;

SUM(SAL)
SUM(SAL) DEPTNO
DEPTNO SUM(SAL)
SUM(SAL) DEPTNO
DEPTNO
----------
---------- ----------
---------- ----------
---------- ---------
---------
8750
8750 10
10 9400
9400 30
30
10875
10875 20
20 10875
10875 20
20
9400
9400 30
30 8750
8750 10
10

• Description see Note:345048.1


• _gby_hash_aggregation_enabled=false
• See also:
Note:295819.1 Potential Query Tuning Related Issues

© 2009 Oracle Corporation 161


Secure-View-Merging Privilege
• To prevent optimizer issues in since 10gR2 complex
view structures security:
• optimizer_secure_view_merging=false
• Otherwise it is possible for the optimizer to create different
execution plans for identical statements on identical objects
issued from different user schemas
• Alternative:
Grant MERGE ANY VIEW privilege to subordinate users
• See Note:468380.1

© 2009 Oracle Corporation 162


Cascading View Issues - 10.2.0.x
• Optimizer sometimes does wrong rewrites with
cascading views
• Requirement:
• "_push_join_predicate" is set to TRUE
• Solution:
• Patch on top of 10.2.0.4: #7445276
• Or: _optimizer_join_elimination_enabled=false
• Otherwise sometimes:
• This Query: select * from some_view where col1=10;
results in:
• OK: select * from (select * from base_table where col1=10);
• Not OK: select * from (select * from base_table) where col1=10;

© 2009 Oracle Corporation 163


Costed query transformations since 10g
• Observation:
Query timing problems after upgrade to 10/11g
• Since 10g CBO has been added costed subquery unnesting and
view merging functionality.
• Can be disabled by:
• _optimizer_cost_based_transformation=off

© 2009 Oracle Corporation 164


CBO verifies more joins orders since 10g
• The CBO since 10g verifies more join orders to find out
the least expensive one - this can sometimes lead to
higher parse times
• Remedy: _new_initial_join_orders=false
• Example: observation for an explain plan:
• Set OFE=920: Number of join permutations tried: 187
• Set OFE=10203: Number of join permutations tried: 986

© 2009 Oracle Corporation 165


PL/SQL cursors not cached ≥10.2.0.4
• Before 10.2.0.4 PL/SQL cursors will be cached
automatically because of OPEN_CURSORS. Since
10.2.0.4 SESSION_CACHED_CURSORS has to be
defined to ensure cursor caching for PL/SQL
• Remedy: session_cached_cursors=500

© 2009 Oracle Corporation 166


Table caching has changed ≥11.1.0.6
• Large tables most likely won't be cached for sequential
FTS regardless of ALTER TABLE CACHE attribute
• Remedy: set _small_table_treshold
• Example:
• CREATE TABLE big_has_95000_rows(...);
• Force a preload:
ALTER SESSION SET "_small_table_threshold"=100000;
SELECT /*+FULL(a) */ ... FROM big_has_95000_rows;
• Now the table is in cache and will be kept there

© 2009 Oracle Corporation 167


Bug 7596023
• ORA-7445 [kkqtutlGenRowid()+157]
• Bug 7596023
• Apply patch on top of 11.1.0.7

or:

• Workaround:
• Set "_optimizer_join_elimination_enabled"=false
• Disable the fix for bug 6167716 eg:
Set "_FIX_CONTROL"='6167716:OFF'

© 2009 Oracle Corporation 168


SYSAUX
• SYSAUX-Tablespace
• SYSAUX is the new home for most repositories
• SYSAUX can't be deleted or renamed
• SYSAUX can't be changed to read-only
• SYSAUX has to be created
• Recommended size: 500 MB
• ASSM and Locally Managed
• Size estimation: ?/rdbms/admin/utlsyxsz.sql

• View V$SYSAUX_OCCUPANTS shows:


• Repositories and their owner
• Space usage
• Procedures for moving repositories

© 2009 Oracle Corporation 169


SYSAUX
• V$SYSAUX_OCCUPANTS - an excerpt:
REPO
REPO DESCR
DESCR MOVE
MOVE MB
MB
---------------
--------------- -----------------------------------
----------------------------------- --------------- ------
--------------- ------
AO
AO Analytical
Analytical Workspace
Workspace Object
Object Table
Table DBMS_AW.MOVE_AW
DBMS_AW.MOVE_AW 1.4
1.4
AUTO_TASK
AUTO_TASK Automated
Automated Maintenance
Maintenance Tasks
Tasks .3
.3
EM_MONITORING_U
EM_MONITORING_U Enterprise
Enterprise Manager Monitoring User
Manager Monitoring User 2.4
2.4
EM
EM Enterprise Manager Repository
Enterprise Manager Repository emd_maintenance 123.6
emd_maintenance 123.6
LOGMNR
LOGMNR LogMiner
LogMiner SYS.DBMS_LOGMNR
SYS.DBMS_LOGMNR 7.6
7.6
SDO
SDO Oracle
Oracle Spatial
Spatial MDSYS.MOVE_SDO
MDSYS.MOVE_SDO 00
STREAMS
STREAMS Oracle
Oracle Streams
Streams 11
PL/SCOPE
PL/SCOPE PL/SQL
PL/SQL Identifier Collection
Identifier Collection .4
.4
SQL_MANAGEMENT_
SQL_MANAGEMENT_ SQL
SQL Management Base Schema
Management Base Schema 1.6
1.6
SM/ADVISOR
SM/ADVISOR Server
Server Manageability -- Advisor
Manageability Advisor Fram
Fram 7.8
7.8
SM/AWR
SM/AWR Server
Server Manageability
Manageability -- Automatic
Automatic Wo
Wo 27.6
27.6
SM/OPTSTAT
SM/OPTSTAT Server
Server Manageability
Manageability -- Optimizer
Optimizer St
St 3.6
3.6
SM/OTHER
SM/OTHER Server
Server Manageability
Manageability -- Other
Other Compon
Compon 5.6
5.6
STATSPACK
STATSPACK Statspack Repository
Statspack Repository 00
JOB_SCHEDULER
JOB_SCHEDULER Unified
Unified Job
Job Scheduler
Scheduler .4
.4
WM
WM Workspace Manager
Workspace Manager DBMS_WM.move_pr
DBMS_WM.move_pr 7.1
7.1

© 2009 Oracle Corporation 170


SYSAUX
• utlsyxsz.sql:

© 2009 Oracle Corporation 171


Instant Client
• Universal. small footprint Oracle client
• Works with OCI, OCCI, Pro*C, ODBC, JDBC, ODP.NET, ASP.NET,
OLE DB and OO4O applications
• No OUI Oracle Client installation necessary anymore
• Easy and simple deployment
• Download it from OTN
• Copy it to the target/client system(s)
• Add its directory to PATH/LD_LIBRARY_PATH and set TNS_ADMIN
• For ODBC run the provided batch script
• Patching? Just deploy the current version
• More Information on OTN:
http://www.oracle.com/technology/tech/oci/instantclient/instantclient.html

© 2009 Oracle Corporation 172


Instant Client
• Instant Client Download:
http://www.oracle.com/technology/software/tech/oci/instantclient/index.html

© 2009 Oracle Corporation 173


Instant Client
• Instant Client Packaging

• Basic: All files required to run OCI, OCCI, and JDBC-OCI applications (46 MB)
• JDBC Supplement: Additional support for XA, Internationalization, and RowSet operations under JDBC (1.5 MB)
• SQL*Plus: Additional libraries and executable for running SQL*Plus with Instant Client (0.8 MB)
• SDK: Additional header files and an example makefile for developing Oracle applications with Instant Client (1 MB)
• ODBC: Additional libraries for enabling ODBC applications (0.7 MB)
• WRC: Workload Replay Client used to replay workload for RAT's DB Replay Feature (6 KB)
• ´Precompiler: Additional files for "proc" binary and related files to precompile a Pro*C application and demo (0.5 MB)

© 2009 Oracle Corporation 174


Clients & Net
• Client certification - Note: 207303.1

Database Release
11.1.0 10.2.0 10.1.0 9.2.0 9.0.1 8.1.7
11.1.0    
C
l
10.2.0     
i 10.1.0     
e 9.2.0      
n 9.0.1   
t
8.1.7     
 Certified  Supported but ES
 Not supported anymore Never supported

© 2009 Oracle Corporation 175


Clients & Net
• Database links
• Only supported if matrix shows ‚Supported‘ in both directions
• Not supported means: Use it on your own risk
• JDBC certification
• Note:203849.1
• Forms/Reports certification
• Metalink  Certify Tab  Development Tools

© 2009 Oracle Corporation 176


RMAN - Recovery Manager
• RMAN Compatibility Matrix
• Note:73431.1
• Rules:
• The RMAN executable version should be the same as the target database
• The RMAN catalog schema version must be greater than or equal to the RMAN
executable
• The RMAN catalog is backwards compatible with target databases from earlier
releases

© 2009 Oracle Corporation 177


PL/SQL Compilation

• PL/SQL issues while upgrading from 7/8 to 10g/11g?


• PLSQL_V2_COMPATIBILITY = TRUE
PL/SQL checking methods work such as in release 8i

© 2009 Oracle Corporation 178


Upgrading your applications
• Compatibility Issues:
• Check for reserved words
• Appendix A, Upgrade Guide
• Check for behaviour changes
• Appendix A, Upgrade Guide
• Upgrade Companion
• Check for changes in the data dictionary
• Appendix A, Upgrade Guide

© 2009 Oracle Corporation 179


Upgrading your applications
• Precompiler and OCI applications:
• Upgrading the Oracle Database Server software
• If you do not change the client environment than you won't
have to precompile, compile or relink
• Database Server version should be identical or higher than
client version
• Upgrading the Oracle Client software
• It is recommended that Oracle client software has the
same release than the server
• Dynamic Libraries: No relink required
• Static Libraries: Need to be relinked always

© 2009 Oracle Corporation 180


Upgrading your applications
• Precompiler and OCI applications:
• Option 1: Leave the application unchanged
• Don't upgrade the client installation
• Simple and easy
• Option 2: Precompile the application and change client
• Recompile when you change the major release
• You don't have to recompile for a patch release
• Option 3: Change the application code to use 11g features
• Most potential benefits
• Most difficult option
• Precompile, compile and relink

© 2009 Oracle Corporation 181


Wordsize
• Word size change 32/64-bit happens implicitly during
upgrade/downgrade process
• This will apply to patch sets, too

© 2009 Oracle Corporation 182


Conversion between XE, SE and EE
• SE  EE see Note:117048.1
• Take a full backup
• Run catalog.sql and catproc.sql in the EE environment

• EE  SE see Note:139642.1
• Only Export/Import with exp/imp or expdp/imdp will be
supported

• XE  SE/SEone/EE
• http://download.oracle.com/docs/cd/B28359_01/server.111/b28300/intro.htm#BABGDCDD

• Use the DBUA to upgrade your XE database to Seone/SE/EE

© 2009 Oracle Corporation 183


Agenda

Preparation

Upgrade

News and Task List


Parameters
Processes
Diagnostics & Tuning Miscellaneous
Tools
Automation
Performance Testing LOB & SecureFiles
Flashback
ADR
Best Practices Compression

© 2009 Oracle Corporation 184


Enterprise Manager 11g
• Database Control for all database administration tasks

• Grid Control as an IT system administration tool


• Supports Oracle and non-Oracle IT infrastructures
• GC patch set 10.2.0.5 contains 11g functionality
• GridControl 11g is not yet available

© 2009 Oracle Corporation 185


Enterprise Manager 11g
• Components
• Database Control:
Agent and standalone OC4J - thus no additional webserver needed
• Grid Control:
OMS, Management Agent and Repository Database
• Installation:
• Database Control:
Automatically done within the 11g database software installation
• Grid Control:
Separate download/DVD
• License:
• Both products are included in any database license
• Specific packs and plug-ins may be licensed additionally

© 2009 Oracle Corporation 186


Enterprise Manager 11g
• Database Control

© 2009 Oracle Corporation 187


Enterprise Manager 10g
• Grid Control 10.2

© 2009 Oracle Corporation 188


SQL Developer 1.5.5
• Developer tool at no extra cost
(Installation deploys V.1.1.3 - Update available via OTN)

• Key-Features:
• PL/SQL development and debugging
• Extremely fast object browser
• Excellent reporting capabilities
• Supports Oracle 9iR2 and above
• Migration workbench for:
• MS SQL-Server
• MS Access
• MySQL
• No extra license costs!

© 2009 Oracle Corporation 189


SQL Developer 1.5
• Connections and object browser

© 2009 Oracle Corporation 190


APEX 3.0
• APEX = Application Express = ex-HTMLDB
• GUI development enviroment
• Easy to use - wizard driven

• APEX is available by default


• No additional installation or license necessary
• Current release: 3.2

• HTTP via "Embedded Gateway"

• Two configuration steps:


• $ORACLE_HOME/apex/apxconf.sql
• ALTER USER anonymous ACCOUNT UNLOCK;

© 2009 Oracle Corporation 191


APEX
• APEX web page: apex.oracle.com

© 2009 Oracle Corporation 192


Data Pump
• Facts
• The „new“ export/import
• Available and usable only for 10g and 11g
• No backward compatibility to exp/imp
• But syntax very similar to exp/imp
• And much faster than exp/imp - parallelism!!!
• It‘s server based only
• Interface
• Command line: expdp and impdp
• Package DBMS_DATAPUMP
• Controllable through interactive Job Control
• API
• Documentation:
• Database Utilities and Note:553337.1

© 2009 Oracle Corporation 193


Data Pump in Enterprise Manager

© 2009 Oracle Corporation 194


Data Pump
• Step-by-step
1) Directory in which Oracle OS user has write permissions
2) Default DATA_PUMP_DIR already defined – may be
changed in 11g: DBA_DIRECTORIES
3) Grant non-privileged users permissions:
grant
grant READ,WRITE
READ,WRITE on on directory
directory DPDIR
DPDIR to
to SCOTT
SCOTT;;

4) Example of a full database export:

expdp
expdp system/manager
system/manager
DUMPFILE=DATA_PUMP_DIR:full%u.dmp
DUMPFILE=DATA_PUMP_DIR:full%u.dmp
FULL=y
FULL=y NOLOGFILE=y
NOLOGFILE=y

© 2009 Oracle Corporation 195


Data Pump
• Step-by-step
5) Enter the interactive job control by pressing CTRL-C:

© 2009 Oracle Corporation 196


Data Pump
• Step-by-step
6) Commands available in job control mode:

© 2009 Oracle Corporation 197


Data Pump
• Step-by-step
7) Attach to a running job and stop it:
• Hit CTRL-C to enter the interactive job control
• Job name:

• Attach:

• Stop the job:

© 2009 Oracle Corporation 198


Data Pump
• Behind the scenes
• Starting data pump creates a master table in the database user
schema of the user calling expdp
• By default the table name is identical to the job name
• Master table acts as the "commemoration" and is essential for the
job control
• At the end of a run of expdp the master table will be moved into
the dump file
• Metadata will be unloaded as XML and can be extracted easily

© 2009 Oracle Corporation 199


Data Pump Capabilities
• Some important features
• ReMapping of tablespaces, files and schemas
• Extract all DDLs from a dump file
• Include or exclude specific objects/users with EXCLUDE and
INCLUDE - wildcard usage possible
• Import via a network without creating a dump file
• impdp
impdp system/orc
system/orc NETWORK_LINK=db_link1
NETWORK_LINK=db_link1 FULL=Y
FULL=Y

• Compression - dump file size reduction by 50 % or more possible


• expdp
expdp system/orc
system/orc DUMPFILE=DPDIR:full.dmp
DUMPFILE=DPDIR:full.dmp
FULL=y
FULL=y NOLOGFILE=y
NOLOGFILE=y COMPRESSION=all
COMPRESSION=all
• Advanced Compression Option license required
• Encryption - encrypt dump files or data - requires Advanced Security Option
• expdp
expdp system/orc
system/orc DUMPFILE=DPDIR:enc.dmp
DUMPFILE=DPDIR:enc.dmp
ENCRYPTION_PASSWORD=secret
ENCRYPTION_PASSWORD=secret ENCRYPTION_ALGORITHM=AES128
ENCRYPTION_ALGORITHM=AES128

© 2009 Oracle Corporation 200


Agenda

Preparation

Upgrade

News and Task List


Parameters
Processes
Diagnostics & Tuning Miscellaneous
Tools
Automation
Performance Testing LOB & SecureFiles
Flashback
ADR
Best Practices Compression

© 2009 Oracle Corporation 201


Automation in 11g
• Predefined Jobs: DBA_SCHEDULER_JOBS

Disable them in 11.1.0.6:


exec dbms_scheduler.
disable(‚<jobname>');

© 2009 Oracle Corporation 202


Automation in 11g
• Jobs – Default Maintenance Windows

240min = 4h ... 1200min = 20h

© 2009 Oracle Corporation 203


Automation in 11g
• Configure automatically defines maintenance jobs

© 2009 Oracle Corporation 204


Automation in 11g
• Segment Advisor job identifies space to free up

© 2009 Oracle Corporation 205


Mechanism: scale down tables in

High Copy tables


Watermark
• Additional storage needed
• Remove old tables
• Maintenance on indexes

High
Watermark

© 2009 Oracle Corporation 206


Mechanism: scale down tables in:

High Move data


Watermark

High
Watermark
• Online
• Indexes are maintained
• Triggers won't be executed
• But: TS must be ASSM
• Exclusive Table Lock for HWM

ALTER
ALTER TABLE
TABLE <tablename>
<tablename> SHRINK
SHRINK SPACE;
SPACE;

© 2009 Oracle Corporation 207


Agenda

Preparation

Upgrade

News and Task List


Parameters
Processes
Diagnostics & Tuning Miscellaneous
Tools
Automatisms
Performance Testing LOB & SecureFiles
Flashback
ADR
Best Practices Compression

© 2009 Oracle Corporation 208


LONG  LOB Conversion
• LONG data type is still supported, but Oracle
recommends conversion to LOB types

LONG LONG RAW

CLOB NCLOB BLOB

• Disadvantages of LONG:
• Maximum number of LONG columns per table : 1
• No replication possible with LONG und LONG RAW
• Attention:
• LONG  LOB conversion is irreversible

© 2009 Oracle Corporation 209


LONG  LOB Conversion
• Conversion:
ALTER
ALTER TABLE
TABLE long_tab
long_tab MODIFY
MODIFY (( long_col
long_col CLOB
CLOB );
);

• Online Table Redefinition


• Available for LONG/LOB since 10g
• Package: DBMS_REDEFINITION
• Regulation:
• LONG  CLOB
• LONG RAW  BLOB
• Conversion is done implicitly
• More information: Note:251417.1 and 1012454.7 (including examples)
• Advantage:
Source table is available during the whole process

© 2009 Oracle Corporation 210


SecureFiles
• Securefiles = new LOB storage technology
• Better performance
• Additional features: deduplication, encryption
• Examples:
CREATE
CREATE TABLE
TABLE t1
t1 (( aa CLOB)
CLOB)
LOB(a) STORE
LOB(a) STORE AS
AS SECUREFILE
SECUREFILE ((
DEDUPLICATE);
DEDUPLICATE);

CREATE
CREATE TABLE
TABLE t2
t2 (( aa CLOB
CLOB ENCRYPT
ENCRYPT USING
USING 'AES128')
'AES128')
LOB(a)
LOB(a) STORE
STORE AS
AS SECUREFILE
SECUREFILE (CACHE);
(CACHE);
• Tablespace must be ASSM managed

• Additional init.ora parameter


DB_SECUREFILE
DB_SECUREFILE == [NEVER
[NEVER || PERMITTED
PERMITTED || ALWAYS
ALWAYS || IGNORE]
IGNORE]

© 2009 Oracle Corporation 211


SecureFiles
• Securefiles are fully transparent
• Data type still a BLOB/CLOB
• Definition per storage clause or controlled by init Parameter
• No functional differences
• Even "deduplication" is fully transparent for developers

• API access:
PL/SQL (DBMS_LOB), JDBC, .NET, PHP, ...

© 2009 Oracle Corporation 212


Agenda

Preparation

Upgrade

News and Task List


Parameters
Processes
Diagnostics & Tuning Miscellaneous
Tools
Automatisms
Performance Testing LOB & SecureFiles
Flashback
ADR
Best Practices Compression

© 2009 Oracle Corporation 213


Flashback
• Different types of flashback and its sources
• Flashback Query
• Versions Query
• Transaction Query Undo
Undo  Enabled by default

• Flashback Table

• Flashback Drop  Enabled by default

• Flashback Database
 Has to be enabled
Flashback Logs

• Total Recall  Has to be enabled


Flashback Data Archive Undo
Undo

© 2009 Oracle Corporation 214


Flashback in EM
• In Enterprise Manager:

© 2009 Oracle Corporation 215


Restore Points
• Restore point – specifies a jump label
• Named Restore Point
• Similar to a bookmark
• "Can be" - but no guarantee
• Will be recorded to the control file
SQL>
SQL> CREATE
CREATE RESTORE
RESTORE POINT
POINT rpt;
rpt;
SQL>
SQL> FLASHBACK
FLASHBACK DATABASE
DATABASE TO TO RESTORE
RESTORE POINT
POINT rpt;
rpt;

• Guaranteed Restore Point


• Similar to storage snapshots
• Overrides the FLASHBACK_RETENTION_TARGET
• Attention: A guarantee restore point can stop the whole database 
SQL>
SQL> CREATE
CREATE RESTORE
RESTORE POINT
POINT grpt
grpt
GUARANTEE
GUARANTEE FLASHBACK
FLASHBACK DATABASE;
DATABASE;
SQL>
SQL> FLASHBACK
FLASHBACK DATABASE
DATABASE TO TO RESTORE
RESTORE POINT
POINT grpt;
grpt;

© 2009 Oracle Corporation 216


Flashback Query
• Review into the status or to the changes happened to
a table
• Flashback Query
• Query a specific state (date, SCN ...)
• Flashback Versions Query
• Display changes happened in the past
• Flashback Transaction Query
• Detect change transactions from within the past

• Example:
• select * from EMP as of timestamp ...

© 2009 Oracle Corporation 217


Flashback Query
• Example:
 Change data:
> update EMP set SAL=60000 where ENAME='KING';
 Query data BEFORE it has changed:
> select * from EMP as of timestamp
TO_TIMESTAMP('2005-08-01 20:30:00',
'YYYY-MM-DD HH24:MI:SS')
where ENAME='KING';
 Result: 5000
 Change the data back to its original status:
> update EMP set SAL=
(select SAL from EMP as of timestamp
TO_TIMESTAMP('2005-08-01 20:30:00',
'YYYY-MM-DD HH24:MI:SS')
where ENAME='KING') where ENAME='KING';

© 2009 Oracle Corporation 218


Flashback Table
• Requirements:
• Row movement has to be switched on for the table
• alter table EMP enable row movement;
• Purpose:
• Recover a table point-in-time
• Example:
• flashback table EMP to timestamp
to_timestamp(...);

• Annotation:
• Maintains indexes, takes care on constraints
• Triggers are disabled
• Afterwards statistics will be stale

© 2009 Oracle Corporation 219


Flashback Table
• Example:
 Change data:
> delete from EMP;
 Flashback the table:
> flashback table EMP to timestamp
to_timestamp('01.08.2005 21:39:00',
'dd.mm.yyyy hh24:mi:ss');
 Table now has the state of before-delete

© 2009 Oracle Corporation 220


Flashback Drop
• Requirements:
• Init parameter recyclebin is set to ON
• Tablespace is locally managed and <> SYSTEM
• Owner <> SYS, SYSTEM

• Purpose:
• Recover deleted tables with their dependent objects

• Example:
> flashback table EMP to before drop;

© 2009 Oracle Corporation 221


Flashback Drop
• How does it work?
• drop table
• Pointer to the table will be redirected:
This includes:
Dependent objects like indexes, constraints, trigger, nested tables, LOB
segments and LOB index segments
• Objects stay in DBA_Views but have a different name:
BIN$$globalUID$version
• Table can now be undroped with a single command

© 2009 Oracle Corporation 222


Flashback Drop
• Example:
 Delete a table:
> drop table EMP;
 Query the USER_RECYCLEBIN:
> OBJECT_NAME ORIG OPER TYPE CAN
BIN$/U0DO44XUeXgMFaMimgQ==$0 EMP DROP TABLE YES

 Check the table contents:


> select * from "BIN$/U0DO44XUeXgMFaMimgQ==$0"

 Recover the table:


> flashback table EMP to before drop;
> flashback table "BIN$/..." to before drop;
> flashback table EMP to before drop
rename to EMP_version1;

© 2009 Oracle Corporation 223


Flashback Drop
• Sometimes there‘s a misunderstanding ...
• Tablespace won‘t overflow...

Tablespace TEST Tablespace TEST Tablespace TEST Tablespace TEST


Table NEWEMP Table NEWEMP
DROP TABLE EMP

Table EMP Table BIN$. exEMP Table BIN$. exEMP

© 2009 Oracle Corporation 224


Flashback Drop
• Search the recyclebin in SQL Developer:

© 2009 Oracle Corporation 225


Flashback Database
• How does it work?
• Before-Images of changed
data blocks will be written
into flashback logs in intervals
• Not every changed block will be
written into the flashback logs
• Therefore the database has to be in archivelog mode
• Example:
> flashback database to scn 47110815;

• Annotation:
Flashback logs have to be in the flash recovery area

© 2009 Oracle Corporation 226


Flashback Database
• Example:
 User droped accidentially:
> drop user SCOTT cascade;
 Flashback the whole database:
> shutdown immediate;
> flashback database to scn 47110815;
> alter database open resetlogs;

© 2009 Oracle Corporation 227


Flashback Database
• (Almost) as fast as lightning ... ☺
700
627
600

500
Time in minutes

Restore
400
Recovery
300
250 Flashback
200
114
100
51
2 3 4 6
0
10 GB 100 GB 1 TB 10 TB

Database size

© 2009 Oracle Corporation 228


Flashback Database
• Typical questions:
• Q: How much flashback data will be generated?
A: About the same amount of data as for redologs
• Q: Are the logs cleared automatically ?
A: Yes, flashback logs get cleared automatically to reclaim space
• Q: Can Flashback Logs be administered?
A: No !!!
• Q: Is this available in a Standard Edition (one) database, too?
A: No, Flashback Database is a EE feature
• Q: How can do performance tuning?
A: Switch off OS file caching, use lots of disc spindles, use a small stripe-
size (~128 kB)

© 2009 Oracle Corporation 229


Flashback Data Archive - Total Recall
• How does it work?
• Background process FBDA
will track data changes
(only UPDATEs
and DELETEs) on
monitored tables in
the Flashback Data
Archive (asynchronous)
• Data gets extracted
from undo information
• Default capture interval:
5min FBDA
FBDA
• Capture intervall will be
changed automatically
upon system work load
• Licensable option

© 2009 Oracle Corporation 230


Flashback Data Archive - Total Recall
• Requirements:
• Tablespace for FBDA has to be ASSM managed
• Ideally separate tablespaces get created for the flashback data
archives and reside on cheaper storage for cost efficiency
• Create a flashback data archive:
CREATE
CREATE FLASHBACK
FLASHBACK ARCHIVE
ARCHIVE fda1
fda1
TABLESPACE
TABLESPACE fda
fda
RETENTION
RETENTION 11 year;
year;

• Switch on flashback archiving for a specific object:


ALTER
ALTER TABLE
TABLE t1
t1 FLASHBACK
FLASHBACK ARCHIVE
ARCHIVE fda1;
fda1;

© 2009 Oracle Corporation 231


Flashback Data Archive - Total Recall
• Behind the scenes:
• In tablespace fda some structures will be created:
NAME
NAME TYP
TYP
------------------------------
------------------------------ ------------------
------------------
SYS_FBA_DDL_COLMAP_23107
SYS_FBA_DDL_COLMAP_23107 TABLE
TABLE
SYS_FBA_HIST_23107
SYS_FBA_HIST_23107 TABLE
TABLE PARTITION
PARTITION
SYS_FBA_TCRV_23107
SYS_FBA_TCRV_23107 TABLE
TABLE
SYS_FBA_TCRV_IDX_23107
SYS_FBA_TCRV_IDX_23107 INDEX
INDEX
• 23107 is the OBJECT_ID of the table getting monitored/archived
• Tracks the changes
• If the defined retention is reached the required data will be deleted
automatically
• Absolutely transparent - no changes to any application necessary
• Partitioning happens automatically

© 2009 Oracle Corporation 232


Flashback Data Archive - Total Recall
• Is it possible to change data in the FDA?
• Data will be stored such as:
ROWID
ROWID STARTSCN
STARTSCN ENDSCN
ENDSCN OO COL1
COL1
------------------
------------------ ----------
---------- ----------
---------- -- ----------
----------
AAAFplAAGAAAAAVAAA
AAAFplAAGAAAAAVAAA 1114797
1114797 1115141
1115141 II 11
AAAFplAAGAAAAAVAAB
AAAFplAAGAAAAAVAAB 1114797
1114797 1115141
1115141 II 22
AAAFplAAGAAAAAVAAC
AAAFplAAGAAAAAVAAC 1114797
1114797 1115141
1115141 II 23
23
AAAFplAAGAAAAAVAAD
AAAFplAAGAAAAAVAAD 1114797
1114797 1115141
1115141 II 24
24
AAAFplAAGAAAAAVAAE
AAAFplAAGAAAAAVAAE 1114797
1114797 1115141
1115141 II 25
25
AAAFplAAGAAAAAVAAF
AAAFplAAGAAAAAVAAF 1115141
1115141 1116039
1116039 UU 22
...
...

• Data can‘t be manipulated:


SQL>
SQL> update
update SYS_FBA_HIST_23107
SYS_FBA_HIST_23107 set
set col1=col1-1;
col1=col1-1;
update
update SYS_FBA_HIST_23107
SYS_FBA_HIST_23107 set
set col1=col1-1
col1=col1-1
**
ERROR
ERROR at
at line
line 1:
1:
ORA-55622:
ORA-55622: DML,
DML, ALTER
ALTER and
and CREATE
CREATE UNIQUE
UNIQUE INDEX
INDEX operations
operations are
are
not
not allowed
allowed on
on table
table "SYS"."SYS_FBA_HIST_23107"
"SYS"."SYS_FBA_HIST_23107"

© 2009 Oracle Corporation 233


Flashback Data Archive - Total Recall
• How to access the historical data?

SELECT
SELECT ** FROM
FROM t1
t1
AS
AS OF
OF TIMESTAMP
TIMESTAMP '27-AUG-07
'27-AUG-07 2:15:00pm';
2:15:00pm';
COL1
COL1
----------
----------
11
22
23
23
SELECT
SELECT ** FROM
FROM t1
t1
AS
AS OF
OF TIMESTAMP
TIMESTAMP '27-AUG-07
'27-AUG-07 2:30:00pm';
2:30:00pm';
COL1
COL1
----------
----------
22
33
24
24

© 2009 Oracle Corporation 234


Flashback Data Archive - Total Recall
• Switch background process FBDA off?
• SQL> ALTER SYSTEM SET
SQL> ALTER SYSTEM SET
"_disable_flashback_archiver"=1
"_disable_flashback_archiver"=1
scope=spfile;
scope=spfile;

SQL>
SQL> STARTUP
STARTUP FORCE
FORCE

$$ ps
ps -ef
-ef || grep
grep fbda
fbda

© 2009 Oracle Corporation 235


Agenda

Preparation

Upgrade

News and Task List


Parameters
Processes
Diagnostics & Tuning Miscellaneous
Tools
Automatisms
Performance Testing LOB & SecureFiles
Flashback
ADR
Best Practices Compression

© 2009 Oracle Corporation 236


Automatic Diagnostic Repository
• ADR: systemwide logging and tracing directory
• Set via diagnostic_dest parameter
• Default: ORACLE_BASE\diag

© 2009 Oracle Corporation 237


Automatic Diagnostic Repository
• ADR: systemwide logging/tracing directory
• "Oh ... my alert.log is now in XML format ...?"

• No panic:
• Files are still kept also in text mode
• There are two very comfortable interfaces:
• adrci
• EM interface

• Error categories
• Problem (Critical error like ORA-600, ORA-7445, ORA-4031 ...)
• Incident (Singular error - if it gets raised more often it'll become a
PROBLEM!!)

© 2009 Oracle Corporation 238


Automatic Diagnostic Repository
• V$DIAG_INFO:
SQL>
SQL> SELECT
SELECT name,
name, value
value FROM
FROM v$diag_info;
v$diag_info;

NAME
NAME WERT
WERT
-----------------------
----------------------- ----------------------------------------
----------------------------------------
Diag
Diag Enabled
Enabled TRUE
TRUE
ADR
ADR Base
Base c:\oracle
c:\oracle
ADR
ADR Home
Home c:\oracle\diag\rdbms\source\source
c:\oracle\diag\rdbms\source\source
Diag
Diag Trace
Trace c:\oracle\diag\rdbms\source\source\trace
c:\oracle\diag\rdbms\source\source\trace
Diag
Diag Alert
Alert c:\oracle\diag\rdbms\source\source\alert
c:\oracle\diag\rdbms\source\source\alert
Diag
Diag Incident
Incident c:\oracle\diag\rdbms\source\source\incid
c:\oracle\diag\rdbms\source\source\incid
Diag
Diag Cdump
Cdump c:\oracle\diag\rdbms\source\source\cdump
c:\oracle\diag\rdbms\source\source\cdump
Health
Health Monitor
Monitor c:\oracle\diag\rdbms\source\source\hm
c:\oracle\diag\rdbms\source\source\hm
Default
Default Trace
Trace File
File c:\oracle\diag\rdbms\source\source\trace
c:\oracle\diag\rdbms\source\source\trace
Active
Active Problem
Problem Count
Count 11
Active
Active Incident
Incident Count
Count 77

© 2009 Oracle Corporation 239


Automatic Diagnostic Repository
• adrci
ADRCI:
ADRCI: Release
Release 11.1.0.7.0
11.1.0.7.0 -- Production
Production on
on Mon
Mon Apr
Apr 27
27 16:58:37
16:58:37 2009
2009

Copyright
Copyright (c)
(c) 1982,
1982, 2007,
2007, Oracle.
Oracle. All
All rights
rights reserved.
reserved.

ADR
ADR base
base == "c:\oracle"
"c:\oracle"
adrci>
adrci> help
help

• Step 1: Check and set ADRCI homes


• adrci> show homes
• adrci> set homepath diag\rdbms\source\source
• Step 2: Define the editor, e.g.:
• adrci> set editor uedit32
• Step 3: Check alert.log, problems and incidents
• adrci> show alert -tail 50 -f
• adrci> show problem
• adrci> show incident

© 2009 Oracle Corporation 240


Automatic Diagnostic Repository
•adrci
• Helpful notes:
• Note: 443529.1
11g How To Package And Send ORA-00600/ORA-07445
Diagnostic Information To Support.
• Note: 564269.1
Retention Policy for ADR Incidents
• SHORTP_POLICY:
Used to purge informations that have a short life.
Default: 720 => 30 days
• LONGP_POLICY:
To purge ADR contents that have a long life.
Default: 8760 => 365 days

© 2009 Oracle Corporation 241


Automatic Diagnostic Repository
• DatabaseControl




© 2009 Oracle Corporation 242


Automatic Diagnostic Repository
• DatabaseControl

© 2009 Oracle Corporation 243


Agenda

Preparation

Upgrade

News and Task List


Parameters
Processes
Diagnostics & Tuning Miscellaneous
Tools
Automatisms
Performance Testing LOB & SecureFiles
Flashback
ADR
Best Practices Compression

© 2009 Oracle Corporation 244


Compression
• Index compression available since 8i
• Table compression available since 9.2
• Designated for DWH
• Direct path and bulk INSERTs, CREATE TABLE .. AS SELECT
• Didn't work for INSERT/UPDATE/DELETE
• Before 11g syntax:
CREATE
CREATE TABLE
TABLE sales_history…
sales_history… COMPRESS
COMPRESS

• New 11g syntax:


CREATE
CREATE TABLE
TABLE sales_history…
sales_history…
COMPRESS
COMPRESS FOR
FOR DIRECT_LOAD
DIRECT_LOAD OPERATIONS
OPERATIONS

© 2009 Oracle Corporation 245


Advanced Compression
• Advanced Compression in Oracle 11g works for:
• Structured and unstructured data
• Backups
• Datapump exports
• Data Guard gap resolution (11.1.0.7 => LGWR ASYNC)
• Reduces resource requirements and costs!!!
• Storage

• Typically 2x to 4x compression possible


PCTFREE PCTFREE
DML reached: Further DML reached:
uncompressed Compression! uncompressed Compression!
Overhead

Free Space

uncompressed

compressed

© 2009 Oracle Corporation 246


‘Real World’ Compression
10 largest ERP database tables

Space
MB

Table Scans
0.4

0.3
DML Performance
(seconds)
Time

0.2 40

3x Savings

(seconds)
30
0.1

Time
20
0

10
2.5x faster
0

< 3% overhead

© 2009 Oracle Corporation 247


Compression Advisor - Free Download
• http://www.oracle.com/technology/products/database/compression/index.html

© 2009 Oracle Corporation 248

Вам также может понравиться