slide1
Download
Skip this Video
Download Presentation
How an Oracle Database 12 c Upgrade Works in a Multitenant Environment

Loading in 2 Seconds...

play fullscreen
1 / 83

How an Oracle Database 12 c Upgrade Works in a Multitenant Environment - PowerPoint PPT Presentation


  • 355 Views
  • Uploaded on

How an Oracle Database 12 c Upgrade Works in a Multitenant Environment. Introduction & Overview. Overview on Oracle Multitenant. Plug Into Oracle Multitenant. Working with Oracle Multitenant. Introduction & Overview. Overview on Oracle Multitenant. Plug Into Oracle Multitenant.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' How an Oracle Database 12 c Upgrade Works in a Multitenant Environment' - jagger


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
slide3

Introduction & Overview

Overview on Oracle Multitenant

Plug Into Oracle Multitenant

Working with Oracle Multitenant

Upgrade, Migrate & Consolidate to Oracle Database 12c

slide5

Introduction & Overview

Overview on Oracle Multitenant

Plug Into Oracle Multitenant

Working with Oracle Multitenant

Upgrade, Migrate & Consolidate to Oracle Database 12c

look before you leap
Look Before You Leap!

Some well-know concepts will change

  • Look at new documentation in the Administrator’s Guide around 150 pages .
  • You don’t have to use Oracle Multitenant.
  • Oracle Database 12c non-Multitenant works as expected.
database upgrade blog
Database Upgrade Blog
  • http://blogs.oracle.com/UPGRADE
database upgrade otn web site
Database Upgrade: OTN Web Site
  • http://otn.oracle.com/goto/upgrade
oracle multitenant implementation
Oracle Multitenant – Implementation
  • Multitenant container database
    • Administration from CDB
  • A CDB can contain one ormany pluggable databases
    • Data and code resides in the PDBs
    • Applications connect to PDBs
  • Simple and fast provisioning,cloning, plugin, patching andupgrade

PDB1

PDB2

PDB3

PDB1

PDB$SEED

PDB$SEED

CDB2

CDB1

oracle multitenant behind the scenes
Oracle Multitenant – Behind the scenes
  • One SGA
  • One set of background processes
  • One SPFILE

PDB1

PDB2

PDB3

Redo

Control

Flashback

spfile

CDB

PDB$SEED

creation of a cdb
Creation of a CDB
  • Two options:
    • DBCA
      • Highly recommended
    • Command line CREATE DATABASE
      • Not recommend as all options will have to be created
  • CREATE DATABASE cdb12
  • [...]
  • ENABLE PLUGGABLE DATABASE
    • SEED FILE_NAME_CONVERT=(\'/oradata/cdb12/\',\'/oradata/pdbseed/\')
    • SYSTEM DATAFILES SIZE 125M AUTOEXTEND ON NEXT 10M MAXSIZE […]
command line creation of a cdb
Command Line Creation of a CDB
  • Administrative scripts have to be started via catcon.pl:
    • catdb.sql will run all scripts for all options
    • Most useful catcon.pl options:
      • -u Username and optionally password
      • -d Directory containing the script to execute (default: current directory)
      • -e Echo on
      • -s Spools the output of every script
      • -l Directory to write logfiles into (default: current directory)
      • -b Base name for logfiles (mandatory option)

$> perlcatcon.pl -u SYS -d $ORACLE_HOME/rdbms/admin -e -s -b create_dictionarycatdb.sql

cdb pdb who s who
CDB-PDB: Who\'s who?
  • After plugging a PDB into a CDB:
    • Data resides in the PDB
    • References will get created in the CDB
    • Some dictionary objects get inherited from the CDB

PDB$SEED

CDB$ROOT

EMP

DEPT

PDB

TAB$

OBJ$

SOURCE$

OBJ$

TAB$

SOURCE$

cdb pdb who s who1
CDB-PDB: Who\'s who?
  • Tablespaces
    • Global UNDO and TEMP in CDB$ROOT
    • PDBs can have their own TEMP
    • All PDBs must share CDB\'s UNDO

PDB$SEED

CDB$ROOT

PDB

DATA1

SYSTEM

SYSTEM

DATA2

SYSAUX

SYSAUX

TEMP_PDB

SYSTEM

TEMP

SYSAUX

UNDO

cdb pdb who s who2
CDB-PDB: Who\'s who?
  • Common user
    • Exists in the CDB and all current and future PDBs
    • All Oracle-supplied users are common users
      • CDB1> create user c##adm identified by topsecret;
  • Local user
    • Exists ina PDB only

PDB$SEED

C##ADM

HUGO

C##BOSS

APP

SYS

C##ADM

C##BOSS

SYS

CDB$ROOT

PDB

slide16

Introduction & Overview

Overview on Oracle Multitenant

Plug Into Oracle Multitenant

Working with Oracle Multitenant

Upgrade, Migrate & Consolidate to Oracle Database 12c

upgrade sql automation
Upgrade SQL Automation
  • New Pre-Upgrade Script
  • preupgrd.sql
  • Executes pre-upgrade checks
  • Runs in source environment
  • Generates fixup scripts
    • preupgrade_fixups.sql
    • postupgrade_fixups.sql
  • MOS Note:884522.1
faster upgrade less downtime
Faster Upgrade – Less Downtime

catctl.pl

script1.sql

script2.sql

script3.sql

  • catctl.pl
  • Runs database upgrade in parallel
  • Up to 35% faster upgrade
  • Used and proven by selected Oracle Database 11g global customers
    • Telco billing
    • >100 SAP systems
    • Large DWH
  • New Parallel Upgrade

script4.sql

script7.sql

script9.sql

script8.sql

script10.sql

script5.sql

script11.sql

script6.sql

script6.sql

faster upgrade less downtime1
Faster Upgrade – Less Downtime

$> $ORACLE_HOME/perl/bin/perl catctl.pl -n 8 catupgrd.sql

  • New Parallel Upgrade
simplified upgrade
Simplified Upgrade
  • Database Upgrade Assistant
  • Pre-Upgrade Automation
  • Parallel Upgrade
  • RMAN Integration
  • Guaranteed Restore Points
  • Activity and Alert Log
enterprise manager mass and rac upgrades
Enterprise Manager Mass and RAC Upgrades
  • EM Cloud Control
  • Mass Upgrades
  • Grid Infrastructure Upgrades
  • RAC Database Upgrades
  • Standby Database Upgrades
creation of a new pluggable database
Creation of a New Pluggable Database
  • Fast provisioning from PDB$SEED
    • PDB_FILE_NAME_CONVERT

create pluggable database PDB1

admin user adm1 identified by pwd;

impdp

  • Import data with impdp
    • Dump file or NETWORK_LINK
    • imp for ≤ Oracle 9i

PDB1

PDB$SEED

CDB

cloning of a pluggable database
Cloning of a Pluggable Database
  • Fast cloning of a PDB
    • Local:
    • Remote:
      • Part of first patch set for Oracle Database 12c (12.1.0.2)
      • Works since PSU3 for Oracle 12.1.0.1

create pluggable database

PDB2 from PDB1;

PDB1

PDB2

PDB1

create pluggable database

PDB1 from [email protected];

PDB$SEED

PDB$SEED

CDB2

CDB1

upgrade and plugin as pdb
Upgrade and Plugin as PDB
  • Database upgrade
  • Start database read-only
  • Create XML description file
  • Shutdown database
  • Plugin database
  • Sanity operations

PDB1xml

exec DBMS_PDB.DESCRIBE(\'PDB1.xml\');

PDB1

PDB$SEED

CDB

create pluggable database PDB1using (\'PDB1.xml\') nocopytempfile reuse;

DB1

Read Only

start ?/rdbms/admin/noncdb_to_pdb.sql

full transportable export import
Full Transportable Export/Import

impdp

Database Link

  • Create a fresh database/PDB
  • Create database link to source
  • Tablespaces read-only – downtime!
  • Copy datafiles to destination
  • Run impdp on NETWORK_LINK

PDB1

PDB$SEED

  • impdpoow/[email protected] NETWORK_LINK=DB1 VERSION=12 FULL=Y TRANSPORTABLE=ALWAYS METRICS=Y LOGFILE=oow_dir:src112fullimp.logTRANSPORT_DATAFILE=\'/oradata/ts1.dbf\' …

Read Only

CDB

DB1

slide26

Introduction & Overview

Overview on Oracle Multitenant

Plug Into Oracle Multitenant

Working with Oracle Multitenant

Upgrade, Migrate & Consolidate to Oracle Database 12c

working with oracle multitenant
Working with Oracle Multitenant

Upgrade all or some

Oracle Golden Gate Upgrade

Rolling Upgrade

Real Applications Clusters (RAC) Upgrade

1

2

3

4

Upgrade, Migrate & Consolidate to Oracle Database 12c

upgrade everything at once
Upgrade: Everything at once
  • Upgrade everything at once
    • Run preupgrd.sql
    • Start CDB in new $OH in UPGRADE mode
    • Run catctl.pl

-n How many PDB‘s are upgraded together

Def. cpu_count/2 Max 32

-N How many Sql process threads

per PDB Def 2 Max 8

    • Recompile

catcon.pl -n 1 -e -b utlrp -d \'\'\'.\'\'\' utlrp.sql

PDB1

PDB3

PDB2

PDB1

PDB2

PDB3

PDB4

PDB4

PDB$SEED

PDB$SEED

UPGRADE

UPGRADE

UPGRADE

UPGRADE

UPGRADE

CDB1 – Oracle 12.1.0.2

CDB1 – Oracle 12.1.0.1

UPGRADE

upgrade everything at once1
Upgrade: Everything at once
  • Advantage:
    • Simple to deploy
  • Disadvantage:
    • Hard to find common downtime
    • More downtime for individual PDBs
    • Order of upgrades
      • Defaults to con_id order
      • Inclusion lists –c or exclusion lists -C
        • Override the upgrade order
        • May have to write script to invoke catctl.pl

multiple times to control the order

PDB1

PDB3

PDB2

PDB1

PDB2

PDB3

PDB4

PDB4

PDB$SEED

PDB$SEED

UPGRADE

UPGRADE

UPGRADE

UPGRADE

UPGRADE

CDB1 – Oracle 12.1.0.2

CDB1 – Oracle 12.1.0.1

UPGRADE

upgrade one at a time or more
Upgrade: One at a time or more
  • In CDB1:
    • SQL> @preupgrd.sql
    • SQL> alter pluggable database pdb1 close;
    • SQL> alter pluggable database pdb1 unplug into \'/stage/pdb1.xml\';
        • Don\'t forget to backup the XML file!!!
  • In CDB2:
    • SQL> create pluggable database pdb1 using \'/stage/pdb1.xml\';
    • SQL> alter pluggable database pdb1open upgrade;
    • $ORACLE_HOME/perl/bin/perl catctl.pl-c \'PDB1\' catupgrd.sql
    • $ORACLE_HOME/perl/bin/perl catcon.pl -n 1 -e -b utlrp

-d \'\'\'.\'\'\' -c \'PDB1\' utlrp.sql

PDB1xml

PDB1

PDB1

PDB$SEED

PDB$SEED

UPGRADE

CDB2 – Oracle 12.1.0.2

CDB1 – Oracle 12.1.0.1

upgrade one at a time or more1
Upgrade: One at a time or more
  • Advantage:
    • Easier to schedule for individual PDBs
    • Less downtime
    • More control
  • Disadvantage:
    • More manual tasks
    • Need for a 2nd CDB
      • This will require more memory

PDB1xml

PDB1

PDB1

PDB$SEED

PDB$SEED

CDB2 – Oracle 12.1.0.2

CDB1 – Oracle 12.1.0.1

best practices
Best Practices
  • Character sets
    • PDB character set must match CDB\'s character set
      • Right now different character sets in CDB/PDB are not allowed
    • Some will be converted during plugin (must be binary subset of CDB character set)
    • DMU 2.0 can convert character sets before or after plug-in
      • http://www.oracle.com/technetwork/database/database-technologies/globalization/dmu/overview/index.html
    • See Oracle 12c Globalization Guide, Chap.2:Choosing a Database Character Set for a Multitenant Container Databasehttp://docs.oracle.com/cd/E16655_01/server.121/e17750/ch2charset.htm#NLSPG1035

PDB1

PDB$SEED

DB1

CDB

best practices1
Best Practices
  • Adjust the default maintenance windows per PDB
    • Weekday: 10pm to 2am (4 hours)
    • Weekend: 6am to 2am (20 hours)
best practices2
Best Practices
  • Resource Manager is a must
    • Set resource consumption for:
      • CPU
      • Session
      • Parallel servers
    • Policy definition for shares and limits
      • Example with CPU_COUNT=24 on CDB level:
best practices3
Best Practices
  • Have your redo logfiles on VERY fast disks
    • Otherwise the LGWR will become the bottleneck
parameter
Parameter
  • Which parameters can be set within a PDB?
  • Where can I define parameters specific to a PDB
    • SPFILE: parameters for the CDB and all PDBs
    • V$SYSTEM_PARAMETER:

SELECT name

FROM v$parameter

WHERE ispdb_modifiable=\'TRUE\';

PDB1

PDB1

PDB$SEED

PDB$SEED

CDB2

CDB1

SELECT name, value

FROM v$system_parameter

WHERE con_id=n;

backup recovery
Backup & Recovery
  • Backup and recovery with RMAN
    • Entire CDB with all PDBs
    • Just the CDB$ROOT only
    • PDBs:

BACKUP DATABASE PLUS ARCHIVELOG;

RESTORE DATABASE;RECOVER DATABASE;

BACKUP DATABASE ROOT;

RESTORE DATABASE ROOT;RECOVER DATABASE ROOT;

BACKUP PLUGGABLE DATABASE sales, hr;RESTORE PLUGGABLE DATABASE \'pdb$seed\', sales, hr; RECOVER PLUGGABLE DATABASE \'pdb$seed\', sales, hr;;

diagnosing issues
Diagnosing Issues
  • Where the fun part starts … alert.log and traces

?

Happened in which PDB?

fallback strategy strategy
Fallback Strategy – Strategy
  • Never start an upgrade or migration without evaluating and testing your options for going back ...
  • Complete RMAN Online Backup is always a must
  • Clarify:
    • Fallback requirements in minutes/hours/days
    • How to deal with issues happening during the upgrade
    • How to deal with issues hours/days after the upgrade
    • Will you get additional downtime to change COMPATIBLE?

Upgrade, Migrate & Consolidate to Oracle Database 12c

parameter compatible
Parameter COMPATIBLE
  • Minimum COMPATIBLE in Oracle Database 12c: 11.0.0
    • 11.0.0 and 11.1.0 are equivalent
    • Recommendation:
      • Change it 7-10 days after upgrade – but restart required
    • SQL>
    • COMPATIBLE can\'t be turned back

alter system set compatible=\'12.1.0\' scope=spfile;

COMPATIBLE must be increased to ≥11.0.0

COMPATIBLE can remain on 11.x.y

Downgrade possible

Upgrade, Migrate & Consolidate to Oracle Database 12c

fallback strategy issues during upgrade
Fallback Strategy - Issuesduringupgrade

ALWAYS take a complete ONLINE backup with RMAN

≥ 11.0

FullONLINEBackup

PartialOFFLINEBackup

GuaranteedRestore Point

Change COMPATIBLE parameter?

Yes

Yes

No

Full restore andrecovery

Partial Restore

Flashback to GRP

Upgrade, Migrate & Consolidate to Oracle Database 12c

fallback online backup
Fallback: Online Backup
  • Restore a backup
    • Complete online backup (RMAN)
    • Please verify:
      • Where is your backup located? Tapes, HD, off site...
      • Does the restore work?
      • How long will the restore take?
      • How long will the recovery take?
    • Recommendation:
      • Have a valid online backup in any case – and test it!!!

Upgrade, Migrate & Consolidate to Oracle Database 12c

fallback offline backup
Fallback: Offline Backup
  • Restore a partial offlinebackup
    • Put all data tablespaces in read-only mode
      • That\'s downtime!
    • Shutdown the database IMMEDIATE
    • Copy SYSTEM, UNDO, TOOLS, SYSAUX, XDB, DRSYS and ODM data files plus control files and redo logs
    • In case of failure:
      • Shutdown and copy all partial backup files back
      • Startup in the old environment and recreate TEMP
    • Advantages:
      • Fast and simple, even COMPATIBLE can be changed

Upgrade, Migrate & Consolidate to Oracle Database 12c

fallback restore point
Fallback: Restore Point
  • Flashback to a guaranteed restore point
    • COMPATIBLE cannot be changed

UPGRADE

Upgrade, Migrate & Consolidate to Oracle Database 12c

fallback strategy issues after upgrade
Fallback Strategy – Issues after upgrade

AGAIN take a complete ONLINE backup with RMAN after the upgrade

≥ 11.1

Change COMPATIBLE parameter?

Yes

Yes

No

Data PumpRe-Import

OracleGolden Gate

Downgrade

Upgrade, Migrate & Consolidate to Oracle Database 12c

fallback data pump
Fallback: Data Pump
  • Downgrade with expdp/impdp to 10.x
    • MOS Note:553337.1
    • Prepare an empty database for the import “just in case”
    • Then:
        • Run expdp from the 12.1 database home with the VERSION parameter equal to the target database COMPATIBLE setting
        • Import using impdp from the target database home
    • NETWORK_LINK can be used for downgrades as well

Upgrade, Migrate & Consolidate to Oracle Database 12c

fallback golden gate

1

2

Fallback: Golden Gate
  • Downgrade with Oracle Golden Gate
    • Version/platform independent

Source

Upgradeddestinationdatabase

“Downgrade”

Upgrade, Migrate & Consolidate to Oracle Database 12c

fallback downgrade
Fallback: Downgrade
  • Downgrade with catdwgrd.sql
    • MOS Note:883335.1andMOS Note:443890.1
    • Downgrade possible to:
      • Oracle 11.1.0.7
      • Oracle 11.2.0.x
    • Do not change COMPATIBLE

Upgrade, Migrate & Consolidate to Oracle Database 12c

fallback downgrade1
Fallback: Downgrade

Downgrade with catdwgrd.sql

Reload with catrelod.sql

SQL> startup downgrade pfile=pfile_name

SQL> alter pluggable database all open downgrade;

$ORACLE_HOME/perl/bin/perl catcon.pl -n 1 -e -b catdwgrd -d \'\'\'.\'\'\' -r catdwgrd.sql

SQL> startup database mount;

SQL> alter database open upgrade;

SQL> alter pluggable database all open upgrade;

$ORACLE_HOME/perl/bin/perl catcon.pl -n 1 -e -b catrelod -d \'\'\'.\'\'\' catrelod.sql

$ORACLE_HOME/perl/bin/perl catcon.pl -n 1 -e -b utlrp -d \'\'\'.\'\'\' utlrp.sql

Upgrade, Migrate & Consolidate to Oracle Database 12c

working with oracle multitenant1
Working with Oracle Multitenant

Upgrade all or some

Oracle Golden Gate Upgrade

Rolling Upgrade

Real Applications Clusters (RAC) Upgrade

1

2

3

4

Upgrade, Migrate & Consolidate to Oracle Database 12c

oracle golden gate
Oracle Golden Gate
  • Paid option of the database
    • Migratable license for 1 year which includes Active Data Guard
  • Works with many Oracle database versions
    • Golden Gate 12.1 supports Oracle ≥ 11.1.0.6
      • Golden Gate 11.2 supports Oracle ≥ 10.2.0.4
        • For earlier database versions (8i (DML only), 9i-11.1) use Golden Gate 10.4
  • Oracle GoldenGate Installation and Setup Guide
  • Also works with non-Oracle databases (DB2, Teradata …)
  • GoldenGate OTN page: http://www.oracle.com/technetwork/middleware/goldengate/overview/index.html

Upgrade, Migrate & Consolidate to Oracle Database 12c

near zero downtime
Near-Zero Downtime
  • Platform migration with near-zero downtime

NEW

10TB

10TB

OLD

<5 mins

Oracle 10.2.0.3

HP-UX Itanium

Oracle 11.2.0.4

OL5.8 64bit

Upgrade, Migrate & Consolidate to Oracle Database 12c

slide53

Capture: committed transactions are captured (and can be filtered) as they occur by reading the transaction logs

Capture

NEW

10TB

OLD

<5 mins

Oracle 10.2.0.3

HP-UX Itanium

Oracle 11.2.0.4

OL5.8 64bit

Upgrade, Migrate & Consolidate to Oracle Database 12c

slide54

Trail: stages and queues data for routing

Capture

Trail

NEW

10TB

10TB

OLD

<5 mins

Oracle 10.2.0.3

HP-UX Itanium

Oracle 11.2.0.4

OL5.8 64bit

Upgrade, Migrate & Consolidate to Oracle Database 12c

slide55

Build up the target database using:- Transportable Tablespaces x-Platform- Export/Import with Data Pump

Capture

Trail

NEW

10TB

10TB

OLD

<5 mins

Oracle 10.2.0.3

HP-UX Itanium

Oracle 11.2.0.4

OL5.8 64bit

Upgrade, Migrate & Consolidate to Oracle Database 12c

slide56

Pump: distributes data for routing to target(s)

Pump

Capture

Trail

NEW

10TB

10TB

OLD

<5 mins

Oracle 10.2.0.3

HP-UX Itanium

Oracle 11.2.0.4

OL5.8 64bit

Upgrade, Migrate & Consolidate to Oracle Database 12c

slide57

Route: data is compressed, encrypted for routing to target(s)

Trail

Pump

Capture

Trail

NEW

10TB

10TB

OLD

<5 mins

Oracle 10.2.0.3

HP-UX Itanium

Oracle 11.2.0.4

OL5.8 64bit

Upgrade, Migrate & Consolidate to Oracle Database 12c

slide58

Delivery: applies data with transaction integrity, transforming the data as required

Delivery

Trail

Pump

Capture

Trail

NEW

10TB

10TB

OLD

<5 mins

Oracle 10.2.0.3

HP-UX Itanium

Oracle 11.2.0.4

OL5.8 64bit

Upgrade, Migrate & Consolidate to Oracle Database 12c

slide59

GoldenGate works bidirectionally -from higher to lower release as well!

Delivery

Trail

Pump

Capture

Trail

Bi-directional

NEW

10TB

10TB

OLD

<5 mins

Oracle 10.2.0.3

HP-UX Itanium

Oracle 11.2.0.4

OL5.8 64bit

Upgrade, Migrate & Consolidate to Oracle Database 12c

using oracle goldengate for multitenant databases
Using Oracle GoldenGate for Multitenant Databases
  • In the new Oracle Database 12c multitenant architecture, there are some additional considerations for Oracle .
  • When capturing from any pluggable database (PDB) that is plugged into a container database, you only need to set up a single Oracle GoldenGate Integrated Capture (Extract) process.
  • This is because all of the changes in a PDB are actually written to a single stream of redo data that is managed by the container.
  • Since multiple PDBs can contain the same owner.tablename, we have included the option to add in the PDB name.

Upgrade, Migrate & Consolidate to Oracle Database 12c

using oracle goldengate for multitenant databases1
Using Oracle GoldenGate for Multitenant Databases
  • Objects can be uniquely identified across an entire multitenant system. In the Extract parameter file you can now use 3 part names, like pdb.owner.object.
  • When delivering data into a PDB, the Delivery (Replicat) process should connect directly to the PDB.
  • Data in the trails can include operations from multiple PDBs. So, in the Replicat parameter file, you can do the 3-part to 2-part naming conversion.
  • Data from multiple PDBs can be applied to a single PDB.

Upgrade, Migrate & Consolidate to Oracle Database 12c

using oracle goldengate for multitenant databases2
Using Oracle GoldenGate for Multitenant Databases

Upgrade, Migrate & Consolidate to Oracle Database 12c

working with oracle multitenant2
Working with Oracle Multitenant

Upgrade all or some

Oracle Golden Gate Upgrade

Rolling Upgrade

Real Applications Clusters (RAC) Upgrade

1

2

3

4

Upgrade, Migrate & Consolidate to Oracle Database 12c

basic facts and information
Basic Facts and Information
  • Different types of standby databases

Upgrade, Migrate & Consolidate to Oracle Database 12c

transient logical standby
Transient Logical Standby
  • Concept:
    • Build up a Physical Standby database
    • Convert the Physical Standby into a Logical Standby
    • Upgrade the Logical Standby database
    • Switchover – Standby will be production system now
    • Then: Flashback the former production database
    • Convert it into a Physical Standby
    • Upgrade just by log apply
    • Eventually: Switchover to the original setup

Upgrade, Migrate & Consolidate to Oracle Database 12c

transient logical standby workflow
Transient Logical Standby - Workflow

Guaranteed Restore Point

FLASHBACKDATABASE TO ...

SWITCHOVER

SWITCHOVER

New $OH

LogminerBuild

PROD

PROD

PSTBY

PSTBY

synchronize

synchronize= UPGRADE

synchronize

New $OH

+

Upgrade



PROD

KEEP IDENTITY

CONVERT TOPHYSICAL

LSTBY

LSTBY

PSTBY

Upgrade, Migrate & Consolidate to Oracle Database 12c

dbms rolling

NEW

DBMS_ROLLING
  • Data Guard Simple Rolling Upgrade
    • Semi-automation of Transient Logical Standby Rolling Upgrade
    • Works with Data Guard Broker
    • Procedure DBMS_ROLLING
    • Usable for maintenance tasks beginning with Oracle 12.1.0.1
    • Usable for upgrades beginning with the first patch set of Oracle 12c
      • DBMS_ROLLING usage will require a license for Active Data Guard
  • START_PLAN
  • SWITCHOVER
  • FINISH_PLAN
  • ROLLBACK_PLAN
  • INIT_PLAN
  • DESTROY_PLAN
  • BUILD_PLAN
  • SET_PARAMETER

Upgrade, Migrate & Consolidate to Oracle Database 12c

dbms rolling planning setup phase

NEW

DBMS_ROLLING - Planning & Setup Phase
  • Generate an upgrade plan
    • Call DBMS_ROLLING.INIT_PLAN
      • Generates an upgrade plan with a configuration specific set of instructions to guide the administrator through the upgrade process
    • Call DBMS_ROLLING.SET_PARAMETER
      • Modify parameters of the rolling upgrade
  • Prepare your changes to the database

Upgrade, Migrate & Consolidate to Oracle Database 12c

dbms rolling execution phase

NEW

DBMS_ROLLING – Execution Phase
  • Start the Execution Phase
    • Call DBMS_ROLLING.START_PLAN
      • Configures primary and standby databases participating in the upgrade
  • Make changes to the standby database
    • Upgrade time
  • Role exchange
    • Call DBMS_ROLLING.SWITCHOVER
      • Swaps roles between current primary and new primary with the changes, switchover is only downtime required

Upgrade, Migrate & Consolidate to Oracle Database 12c

dbms rolling end phase

NEW

DBMS_ROLLING – End Phase
  • Finish the Rolling Upgrade
    • Call DBMS_ROLLING.FINISH_PLAN
      • Completes upgrade of the old primary and bystanders and resynchronizes with the new primary

Upgrade, Migrate & Consolidate to Oracle Database 12c

working with oracle multitenant3
Working with Oracle Multitenant

Upgrade all or some

Oracle Golden Gate Upgrade

Rolling Upgrade

Real Application Cluster (RAC) Upgrade

1

2

3

4

Upgrade, Migrate & Consolidate to Oracle Database 12c

rac upgrade
RAC upgrade
  • Each RAC pluggable database can be made available on either every instance of the RAC or a subset of the instances.
  • When upgrading a RAC pluggable databases the instances must be shutdown. Multitenant Database(s) can be taken out of the RAC and upgraded like any other RAC database upgrade.
  • Not much difference between regular upgrade and a RAC upgrade.
grid infrastructure installation
Grid Infrastructure installation

Always install/upgrade Oracle Clusterwarefirst!

Install it into a new Grid Infrastructure home.

grid infrastructure installation1
Grid Infrastructure Installation
  • Oracle Home/Base
    • Part of the GI homeis owned by root onceroot.sh/rootupgrade.shhas been run
    • Grid Infrastructureshould be in a differentlocation than thedatabase\'s ORACLE_BASE

GI

DB

Upgrade, Migrate & Consolidate to Oracle Database 12c

rac upgrade1
RAC Upgrade
  • Old Oracle Home (PreUpgrade)
    • Create a guaranteed restore point in order to flashback in case of failureCREATE RESTORE POINT UPGRADE GUARANTEE FLASHBACK DATABASE;
    • Execute Pre-upgrade tool preupgrd.sql
      • $ORACLE_HOME/perl/bin/perl $ORACLE_HOME/rdbms/admin/catcon.pl -n 1 -d $ORACLE_HOME/rdbms/admin -l /home/oracle/joe-b preupgrdpreupgrd.sql
    • Execute Pre-upgrade fix-up scripts.
      • ALTER PLUGGABLE DATABASE ALL OPEN;
      • $ORACLE_HOME/perl/bin/perl $ORACLE_HOME/rdbms/admin/catcon.pl -n 1 -d $ORACLE_HOME/cfgtoollogs/cdbupgr/preupgrade -l /home/oracle/joe-b preupgrade_fixupspreupgrade_fixups.sql
rac upgrade2
RAC Upgrade
    • Old Oracle Home (PreUpgrade)
    • Specific steps for RAC environments:
      • Set cluster_database=falseALTER SYSTEM SET CLUSTER_DATABASE=FALSE SCOPE=SPFILE;
      • Stop all instancessrvctl stop database -d <db_name>
      • Switch to new Oracle Home to do the upgrade.
  • New Oracle Home (Upgrade)
    • Connect with sqlplus:sqlplus / as sysdba
rac upgrade3
RAC Upgrade
  • New Oracle Home (Upgrade)
    • Bring the CDB$ROOT instance into upgrade mode:STARTUP UPGRADE
    • Bring all PDBs into upgrade mode:ALTER PLUGGABLE DATABASE ALL OPEN UPGRADE;
    • cd$ORACLE_HOME/rdbms/admin
    • Perform the upgrade in parallel:$ORACLE_HOME/perl/bin/perl catctl.pl -d $ORACLE_HOME/rdbms/admin -n 16 -M -l /home/oracle/joe catupgrd.sql
    • The important file with timings per PDB and a quick check is called upg_summary.loglocated in: $ORACLE_HOME/cfgtoollogs/<SID>/upgrade/upg_summary.log
rac upgrade4
RAC Upgrade
  • New Oracle Home (Post Upgrade)
    • Only in case -M hasn\'t been used then the CDB remains open during the upgrade of the PDBs and will need to be shutdown manually post upgrade:SHUTDOWN IMMEDIATE
    • Followed by a startup all PDBs must be opened now for recompilationSTARTUP ALTER PLUGGABLE DATABASE ALL OPEN;
    • Execute the postupgrade_fixups.sql:$ORACLE_HOME/perl/bin/perl $ORACLE_HOME/rdbms/admin/catcon.pl -n 1 -d $ORACLE_HOME/cfgtoollogs/cdbupgr/preupgrade -l /home/oracle/joe-b postupgrade_fixups postupgrade_fixups.sql
rac upgrade5
RAC Upgrade
  • New Oracle Home (Post Upgrade)
    • cd $ORACLE_HOME/rdbms/admin
    • The recompilation is done via catcon.pl using the utlrp.sql script from within?/rdbms/admin:
      • $ORACLE_HOME/perl/bin/perl catcon.pl -n 1 -e -b utlrp -d \'\'\'.\'\'\' utlrp.sql
    • Drop the guaranteed restore pointDROP RESTORE POINT UPGRADE;
rac upgrade6
RAC Upgrade
  • New Oracle Home (Post Upgrade)
    • Specific steps for RAC environments
    • Set cluster_database=true againALTER SYSTEM SET CLUSTER_DATABASE=TRUE SCOPE=SPFILE;
    • Start all instances
  • Database Upgrade Assistant (DBUA) along with MASS Upgrades via EM Cloud control will automate all these steps for you.
  • Rolling Upgrade will also works in a RAC Multitenant environment.
credits go to
CREDITS GO TO…..
  • Mike Dietrich
  • Roy Swonger
ad