Upload
vuliem
View
230
Download
1
Embed Size (px)
Citation preview
Reduced Memory FootprintOracle Database 12cUpgrade & Migrate
Sandra SkehinBoeblingen Bootcamp February 2014
Sandra SkehinSIG Washington DC April 2014
The following is intended to outline our general product
direction. It is intended for information purposes only, and
may not be incorporated into any contract. It is not a
commitment to deliver any material, code, or functionality,
Safe Harbor Statement
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Different Ways to Upgrade, Migrate & Consolidate to Oracle Database 12c2
commitment to deliver any material, code, or functionality,
and should not be relied upon in making purchasing
decision. The development, release, and timing of any
features or functionality described for Oracle’s products
remains at the sole discretion of Oracle.
Agenda
� Different Ways to
Upgrade, Migrate & Consolidate
with Oracle Database 12c
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Different Ways to Upgrade, Migrate & Consolidate to Oracle Database 12c3
with Oracle Database 12c
Terminology: Upgrade vs. Migration
� Database Upgrade
– Dictionary only
– No data will be touched, changed or moved
� Migration
Move to new hardware, a new OS, another character set
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Different Ways to Upgrade, Migrate & Consolidate to Oracle Database 12c4
– Move to new hardware, a new OS, another character set
– NOTE: YOU MUST UPGRADE ASM BEFORE THE DATABASE
Upgrade to Oracle Database 12c
Oracle9.2.0.8
Oracle10.1.0.5
Oracle10.2.0.5
Oracle11.1.0.7
Oracle ≥≥≥≥11.2.0.2
Oracle12.1.0.1
Oracle 9.2Oracle 9.2(GA:(GA: Jul 2002)Jul 2002)
Oracle 10.1Oracle 10.1(GA:(GA: Jan 2004)Jan 2004)
≥≥≥≥11.2.0.211.2.0.29.2.0.89.2.0.8
≥≥≥≥11.2.0.211.2.0.210.1.0.510.1.0.5
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Different Ways to Upgrade, Migrate & Consolidate to Oracle Database 12c5
(GA:(GA: Jan 2004)Jan 2004)
Oracle 10.2Oracle 10.2(GA:(GA: Jul 2005)Jul 2005)
Oracle 11.1Oracle 11.1(GA:(GA: Aug 2007)Aug 2007)
Oracle 11.2Oracle 11.2(GA:(GA: Sep 2009)Sep 2009)
DIRECTDIRECT≥≥≥≥11.2.0.211.2.0.2
DIRECTDIRECT11.1.0.711.1.0.7
DIRECTDIRECT10.2.0.510.2.0.5
Please note: This graph will apply to database upgrades only!
Upgrade Options to Oracle Database 12c
LessDowntime?
Oracle 11.2.0.2
Oracle 10.2Near-ZeroDowntime?
LogicalStandby
TransientStandby
expdp/impdp
catctl.pl
DBUA HWHW
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Different Ways to Upgrade, Migrate & Consolidate to Oracle Database 12c6
Oracle 11.2.0.2
Oracle 11.2.0.3/4
TransportableTablespaces
Standby
Full Trans-portable Exp/Imp RMAN
Inc Bck
+
catctl.pl
Golden Gate
Migration Options to Oracle Database 12c
LessDowntime?Oracle 10.2
Near-ZeroDowntime?
+
expdp/impdp
SQL*Loader
CTAS, COPY
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Different Ways to Upgrade, Migrate & Consolidate to Oracle Database 12c7
Oracle 11.2.0.2
Oracle 11.2.0.3/4
+
Full Trans-portable Exp/Imp RMAN
Inc Bck
+
TransportableTablespaces
SQL*Loader
TDB Only sameEndianness
Golden Gate
Agenda
� Supported Versions
� Database Upgrade Enhancements
� Plug into Oracle Multitenant
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Different Ways to Upgrade, Migrate & Consolidate to Oracle Database 12c12
� Information and Resources
� preupgrd.sql
� Executes pre-upgrade checks
� Runs in source environment
New Pre-Upgrade Script
Upgrade SQL Automation
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Different Ways to Upgrade, Migrate & Consolidate to Oracle Database 12c13
� Runs in source environment
� Generates fixup scripts
– preupgrade_fixups.sql
– postupgrade_fixups.sql
� MOS Note:884522.1
� catctl.pl
� Runs database upgrade in parallel
� Up to 40% faster upgrade
New Parallel Upgrade
Faster Upgrade – Less Downtime
catctl.plcatctl.pl
script3.sqlscript3.sqlscript2.sqlscript2.sqlscript1.sqlscript1.sql
catctl.pl
script3.sqlscript2.sqlscript1.sql
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Different Ways to Upgrade, Migrate & Consolidate to Oracle Database 12c14
� Up to 40% faster upgrade
� Used and proven by selected Oracle Database 11g customers
script4.sqlscript4.sql
script5.sqlscript5.sql
script6.sqlscript6.sql
script6.sqlscript6.sql
script7.sqlscript7.sql
script8.sqlscript8.sql
script9.sqlscript9.sql
script10.sqlscript10.sql
script11.sqlscript11.sql
script4.sql
script5.sql
script6.sql
script6.sql
script7.sql
script8.sql
script9.sql
script10.sql
script11.sql
New Parallel Upgrade
Faster Upgrade – Less Downtime
$> $ORACLE_HOME/perl/bin/perl catctl.pl -n 8 catupgrd.sql
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Different Ways to Upgrade, Migrate & Consolidate to Oracle Database 12c15
� Pre-Upgrade Automation
� Parallel Upgrade
� RMAN Integration
Database Upgrade Assistant
Simplified Upgrade
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Different Ways to Upgrade, Migrate & Consolidate to Oracle Database 12c16
� RMAN Integration
� Guaranteed Restore Points
� Activity and Alert Log
Agenda
� Supported Versions
� Database Upgrade Enhancements
� Plug into Oracle Multitenant
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Different Ways to Upgrade, Migrate & Consolidate to Oracle Database 12c17
� Information and Resources
Plug into Oracle Multitenant
� Roads to Pluggable Databases
� Creation of a new PDB
� Cloning a PDB
� Upgrade and plugin as PDB
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Different Ways to Upgrade, Migrate & Consolidate to Oracle Database 12c18
� Upgrade and plugin as PDB
� Full Transportable Export/Import
Creation of a New Pluggable Database
� Fast provisioning from PDB$SEED
– PDB_FILE_NAME_CONVERT
� Import data with impdpCDB
PDB$SEED
CDBCDB
PDB$SEEDPDB$SEED
PDB1PDB1create pluggable database PDB1admin user adm1 identified by pwd;
i
m
p
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Different Ways to Upgrade, Migrate & Consolidate to Oracle Database 12c19
impdp
– Dump file or NETWORK_LINK
– imp for ≤ Oracle 9i
p
d
p
Plug into Oracle Multitenant
� Roads to Pluggable Databases
� Creation of a new PDB
� Cloning a PDB
� Upgrade and plugin as PDB
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Different Ways to Upgrade, Migrate & Consolidate to Oracle Database 12c20
� Upgrade and plugin as PDB
� Full Transportable Export/Import
Cloning of a Pluggable Database
� Fast cloning of a PDB
– Local:
– Remote:
CDB1CDB1
PDB$SEEDPDB$SEED
PDB1PDB1 PDB2PDB2
create pluggable database
PDB2 from PDB1;
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Different Ways to Upgrade, Migrate & Consolidate to Oracle Database 12c21
– Remote:
� Planned for a future patch set or release
CDB2CDB2
PDB$SEEDPDB$SEED
PDB1PDB1
create pluggable database
PDB1 from PDB1@CDB1;
Plug into Oracle Multitenant
� Roads to Pluggable Databases
� Creation of a new PDB
� Cloning a PDB
� Upgrade and plugin as PDB
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Different Ways to Upgrade, Migrate & Consolidate to Oracle Database 12c22
� Upgrade and plugin as PDB
� Full Transportable Export/Import
Upgrade and Plugin as PDB
� Database upgrade
� Start database read-only
� Create XML description file
� Shutdown database
CDB
PDB$SEED
CDBCDB
PDB$SEEDPDB$SEED
PDB1PDB1
exec DBMS_PDB.DESCRIBE('PDB1.xml');
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Different Ways to Upgrade, Migrate & Consolidate to Oracle Database 12c23
� Shutdown database
� Plugin database
� Sanity operations DB1DB1
create pluggable database PDB1
using ('PDB1.xml') nocopy tempfile reuse;
start ?/rdbms/admin/noncdb_to_pdb.sql
PDB1PDB1
xmlxml
Plug into Oracle Multitenant
� Roads to Pluggable Databases
� Creation of a new PDB
� Cloning a PDB
� Upgrade and plugin as PDB
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Different Ways to Upgrade, Migrate & Consolidate to Oracle Database 12c24
� Upgrade and plugin as PDB
� Full Transportable Export/Import
Traditional Transportable Tablespaces
DESTINATION Database 11.2.0.3SOURCE Database 10.2.0.4
Rebuild meta information(views, synonyms, trigger, roles etc)
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Different Ways to Upgrade, Migrate & Consolidate to Oracle Database 12c25
DESTINATION Database 11.2.0.3
SYSTEM
SYSAUX
UNDO
TEMP
APP
HUGO
VIEWSVIEWS
CODECODE
PRIVSPRIVS
SOURCE Database 10.2.0.4
SYSTEM
SYSAUX
UNDO
TEMP
APP
HUGO
VIEWSVIEWS
CODECODE
PRIVSPRIVS
Read Only
Full Transportable Export/Import
� Combining:
– Transportable Tablespaces with
– Data Pump taking care of all meta information with optional
– RMAN incremental backups to decrease downtime
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Different Ways to Upgrade, Migrate & Consolidate to Oracle Database 12c26
� This works:
– Cross platform
– With or without Oracle Multitenant
– Source can be Oracle 11.2.0.3 (recommend 11.2.0.4)
– Target must be at least Oracle 12.1.0.1
Full Transportable Export/Import with Copies
DESTINATION Database 12.1.0.1SOURCE Database 11.2.0.3
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Different Ways to Upgrade, Migrate & Consolidate to Oracle Database 12c27
DESTINATION Database 12.1.0.1
APP
HUGO
SOURCE Database 11.2.0.3VIEWSVIEWS
CODECODE
PRIVSPRIVS
APP
HUGO
SYSTEM
SYSAUX
UNDOTEMP
SYSTEM
SYSAUX
UNDOTEMP
VIEWSVIEWS
CODECODE
PRIVSPRIVS
Data Pump
Read Only
Full Transportable Export/Import with Backups
DESTINATION Database 12.1.0.1SOURCE Database 11.2.0.3
Convert and apply Convert and apply backupsbackups
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Different Ways to Upgrade, Migrate & Consolidate to Oracle Database 12c28
DESTINATION Database 12.1.0.1
APP
HUGO
SOURCE Database 11.2.0.3VIEWSVIEWS
CODECODE
PRIVSPRIVS
APP
HUGO
SYSTEM
SYSAUX
UNDOTEMP
SYSTEM
SYSAUX
UNDOTEMP
VIEWSVIEWS
CODECODE
PRIVSPRIVS
Data Pump
Read Only
Agenda
� Supported Versions
� Database Upgrade Enhancements
� Plug into Oracle Multitenant
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Different Ways to Upgrade, Migrate & Consolidate to Oracle Database 12c29
� Information and Resources
Summary
� Upgrade to Oracle Database 12c
– Now parallel and faster
– Detailed checks and fixup scripts
� Plug into Oracle Multitenant
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Different Ways to Upgrade, Migrate & Consolidate to Oracle Database 12c30
– Many options
� Full Transportable Export/Import
– Simplifies Transportable Tablespaces
– Works cross platform
– Minimal downtime with RMAN
Resources
� http://OTN.oracle.com/goto/upgradeTech White Paper:
– Upgrade to Oracle Database 12c
� http://OTN.oracle.com/goto/datapump
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Different Ways to Upgrade, Migrate & Consolidate to Oracle Database 12c31
� http://OTN.oracle.com/goto/datapumpTech White Paper:
– Full Transportable Export-Import
Example:Full Transportable Tablespace expdmp/impdmp
New Full Transportable Tablespace
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Different Ways to Upgrade, Migrate & Consolidate to Oracle Database 12c32
• Application Data?• Tablespaces – Read only mode
Environments:
Source Database 11.2.0.4 IBM: Linux on System z
TBSpace Name Datafile Name
HR_1 /u01/app/oracle/oradata/hr_db/hr_101.dbf
HR_2 /u01/app/oracle/oradata/hr_db/hr_102.dbf
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Different Ways to Upgrade, Migrate & Consolidate to Oracle Database 12c33
HR_2 /u01/app/oracle/oradata/hr_db/hr_102.dbf
Target Database 12.1.0.1 IBM: Linux on System z
Target � ORACLE_SID HR_PDB
Datafiles � /u01/app/oracle/oradata/hr_pdb/
Checks and Setup on Source
Ensure no logical or physical dependencies between objects in different tablespaces which are NOT being transported.:
– Containment check as follows:-
SQL> EXECUTE DBMS_TTS.TRANSPORT_SET_CHECK('hr_1,hr_2', TRUE);
– Check for violations from above as follows:-
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Different Ways to Upgrade, Migrate & Consolidate to Oracle Database 12c34
SQL> SELECT * FROM TRANSPORT_SET_VIOLATIONS
– Create a directory object in the source DB
SQL> CREATE DIRECTORY dp_dir AS ’/u01/app/datafiles’;
– Place the hr_1 and hr_2 tablespaces in read-only mode for duration of export.
SQL> ALTER TABLESPACE hr_1 READ ONLY;
SQL> ALTER TABLESPACE hr_2 READ ONLY;
Full Transportable Tablespace Migration
� Invoke the Data Pump export utility:
expdp system/manager full=y transportable=always version=12 \
directory=dp_dir dumpfile=full_tts.dmp metrics=y exclude=statistics \
logfile=full_tts_export.log
Note: VERSION=12 because source is 11.2.0.4
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Different Ways to Upgrade, Migrate & Consolidate to Oracle Database 12c35
Note: VERSION=12 because source is 11.2.0.4
� Check export Log for list of data files to be moved
On Target server copy all datafiles to be moved....
$ cd /u01/app/oracle/oradata/hr_pdb/
$ cp /net/<source-server>/u01/app/oracle/oradata/hr_db/hr_101.dbf .
$ cp /net/<source-server>/u01/app/oracle/oradata/hr_db/hr_102.dbf .
...................
Full Transportable Tablespace Migration
� Create a directory object on the destination database for import:-
SQL> CREATE DIRECTORY dp_dir AS '/u01/app/oracle/oradata/hr_pdb';
SQL> GRANT read, write on directory dp_dir to system;
� Invoke full transportable import on destination PDB database:-
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Different Ways to Upgrade, Migrate & Consolidate to Oracle Database 12c36
$ impdp system/manager@hr_pdb directory=dp_dir \
dumpfile=full_tts.dmp logfile=full_tts_imp.log metrics=y \
transport_datafiles='/u01/app/oracle/oradata/hr_pdb/hr_101.dbf',\
'/u01/app/oracle/oradata/hr_pdb/hr_102.dbf'
Note: Command line or parameter file can be used
– Check import log file for errors
Full Transportable Tablespace Migration
� On completion of import, tablespaces will be placed in read/write mode on destination PDB.
� Return source database tablespaces to read/write once import has completed:-
SQL> ALTER TABLESPACE hr_1 READ WRITE;
SQL> ALTER TABLESPACE hr_2 READ WRITE;
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Different Ways to Upgrade, Migrate & Consolidate to Oracle Database 12c37
SQL> ALTER TABLESPACE hr_2 READ WRITE;
Reference: White Paper.
http://www.oracle.com/technetwork/database/enterprise-edition/full-transportable-wp-12c-1973971.pdf
Note: NFS mount point – 12c impdp requires volume exported with (insecure) option
# cat /etc/exports /nfs *(rw,no_root_squash,insecure)
ORA-39097 – May require Fix for Patch 17583185 (11.2.0.x and 12.1))
Full Transportable Tablespace Migration
Limitations:-
� Tablespaces in read-only mode a problem – RMAN backups can be used.
� Different “endianness”:-
– RMAN CONVERT DATAFILE command to convert the data.
– GET_FILE or PUT_FILE procedures from the DBMS_FILE_TRANSFER package
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Different Ways to Upgrade, Migrate & Consolidate to Oracle Database 12c38
– No transport of encrypted tablespaces to platform of different endianness
� XDB repository cannot be transported(XML schemas can!)
� AWR repository cannot be transported
– Use the awrextr.sql and awrload.sql scripts to move between source and target dbs
� Source and target databases must use compatible database character sets
Demo
Upgrade 11.2.0.3 -> 12.1.0.1
� Preupgrd.sql
� DBUA
� Plug in upgraded db to 12.1.0.1 Container Database– Database upgrade
– Start database read-only
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Different Ways to Upgrade, Migrate & Consolidate to Oracle Database 12c39
– Start database read-only
– Create XML description file
» exec dbms_pdb.describe(pdb_descr_file=>'/home/oracle/SIG1unplug.xml');
– Shutdown database
– Plugin database
» create pluggable database PDB3 as clone using '/home/oracle/SIG1unplug.xml';
– Sanity operations
» @?/rdbms/admin/noncdb_to_pdb.sql
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Different Ways to Upgrade, Migrate & Consolidate to Oracle Database 12c40
The preceding is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development,
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Different Ways to Upgrade, Migrate & Consolidate to Oracle Database 12c41
relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle's products remains at the sole discretion of Oracle.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Different Ways to Upgrade, Migrate & Consolidate to Oracle Database 12c42