0% found this document useful (0 votes)
22 views38 pages

Yu 12cR2 Upgrade

Oracle DBA.

Uploaded by

posh pandey
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views38 pages

Yu 12cR2 Upgrade

Oracle DBA.

Uploaded by

posh pandey
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 38

Upgrade or migrate your

Oracle databases to
12cR2: tools, methods
and paths

MAY 16 & 17, 2018

CLEVELAND PUBLIC AUDITORIUM, CLEVELAND, OHIO

WWW.NEOOUG.ORG/GLOC
Kai Yu
• Technical Staff, Dell EMC Database Engineering
• 25+ years experience in IT Industry
• Specializing in Database, Cloud, Virtualization and IT Infrastructure
• Author and Speaker (150+ sessions)
• IOUG Cloud Computing SIG Co-founder &Vice President
• Oracle ACE Director since 2010,
• OAUG Innovator of Year (2011)
• Oracle Excellence Award-Technologist of the Year: Cloud
Architect by Oracle Magazine (2012)
• My Blog: http://kyuoracleblog.wordpress.com/
Agenda

• Methods and Paths for Oracle database 12cR2 Upgrade


• Tools for Oracle Database 12cR2 Upgrade
• Upgrade Multitenant Database to Oracle 12cR2
• Oracle RAC Database Upgrade Examples
Oracle Database 12c Upgrade Methods

• Plan Your major upgrade Process


‒ Prepare upgrade
Understand the new database release, research and select the upgrade
path/method, develop the test plan, backup plan, prepare upgrade scripts
‒ Test your upgrade process:
Perform test upgrade on your test database.
‒ Test the upgraded test database
Perform the tests on the upgraded test database, identify/fix issues,
test the upgraded test database: functionality tests/performance tests
‒ Prepare and backup the production Database
Prepare the upgrade, backup the current production database
‒ Upgrade the production Database
Perform the upgrade, make another backup after the upgrade
‒ Tune and Adjust the New Production Database
Tune the database, use the database new features and adapt any new
DBA procedures
Oracle Database 12c Upgrade Methods

• Methods to upgrade your database to Oracle 12c


‒ Database Upgrade : upgrade your current database to Oracle 12c
 Database Upgrade Assistance(DBUA)
 Manual upgrade using parallel Upgrade Utility /command-line tools
‒ Data Migration: migrate data from old database to 12cR2 database
 Data pump: export data from old database and import
 Create table as select
 Transportable tablespaces, or transportable database
 RMAN Duplicate
‒ Special Methods to minimize database downtime during migration
 Rolling upgrade
 Rolling upgrade with Data Guard
 GoldenGate
‒ Upgrade PDB database using unplug/plug
Oracle Database 12c Upgrade Methods
• How to choose the proper upgrade or the migration methods
factors to consider:
‒ Choose between migration or upgrade
Migrate: move the database to new HW Infrastructure, DB version
Upgrade: DB version in-place upgrade on the same HW Infrastructure
‒ Migration methods: upgrade source/destination: platform, servers,
storage,
big endian vs little endian of the platforms
‒ Acceptable database downtime requirement for upgrade
‒ Database size : a large database migration takes long time
‒ Upgrade path: from database version and to database version
‒ Standalone database or RAC Database
‒ Application certification on the new database version
‒ New Database features to adapt
Oracle Database 12cR (18c) Upgrade Methods

• Oracle Database Upgrade Path to 12cR2


‒ Supported Direct Upgrade by catctl.pl or DBUA:
11.2.0.3 or later,12.1.0.1 or 12.1.0.2, 12.2.0.1 12.2.0.2 (18c)
‒ Direct Upgrade not supported for below 11.2.0.3:
two steps upgrade cases:
1) 11.2.02, 11.1.0.7  11.2.0.412.2
2) 10.2.0.2, 10.2.0.3,10.2.0.4,10.2.0.5,10.1.0.5 12.1.0.212.2
3) 9.2.0.8 11.2.0.412.2
Tools for Oracle Database 12c Upgrade

• Data Migration Tools


‒ Data pump: export data from old database and import
Migrate full or partial data, It takes time to migrate a large Database.
‒ Transportable tablespaces, or transportable database:
Reduce the migration time by copying the datafile, not export/import rows,
Migration across the platforms and DB versions.
‒ RMAN Duplicate: migrate the data to new servers, not upgrade DB version.
‒ Create table as select
copy full or partial data to the new database
‒ Use standby database , GoldenGate or shareplex to synchronize the data
(for minimal downtime)
Tools for Oracle Database 12c Upgrade

• Upgrade tools
‒ Database Upgrade Assistance(DBUA)
GUI tool automates the upgrade process
launch during with Oracle installer or as a standalone tool any time later
Work with the direct upgrade path
GUI tool automates the upgrade
‒ Pre-upgrade information tool : 12.2 introduced a java script preupgeade.jar
 a single .jar file to replace preupgrd.sql and utluppkg.sql
 Invoked from command line:
java -jar /tmp/preupgrade.jar TERMINAL TEXT
 script location: $ORACLE_HOME/rdbms/admin/preupgrade.jar
 Advised to run this tool to check it the database is ready for upgrade
 Output: preupgrade.log, pre-upgrade fixup scripts, post-upgrade fixups in text/XML
 The fixup scripts help DBAs to trace, resolve the issues before upgrade.
 Can run the fixup scripts many times.
Tools for Oracle Database 12c Upgrade
‒ Pre-upgrade information tool : preupgeade.jar
 MOS note: 884522.1: preupgrade_12201_cbuild_003.zip from upgrade from
12.0.1,12.0.2, 11.2.0.3, 11.2.0.4 to 12cR2 (12.2.0.1)
$java –jar $ORACLE_HOME/rdbms/admin/preupgrade.jar TEXT
Show: the current DB status information
Tools for Oracle Database 12c Upgrade

• Before Upgrade: Required Actions, Recommended Actions, Info


Tools for Oracle Database 12c Upgrade

• Recommended Actions:
Tools for Oracle Database 12c Upgrade

• After Upgrade: Required Actions, Recommended Actions, Info


Tools for Oracle Database 12c Upgrade

‒ Parallel Upgrade Utility: catctl.pl and dbupgrade Script


 Upgrade simultaneously components without in special order
 Reduce the upgrade time by running multiple SQL processes
 dbupgrade to start catctl.pl or run catctl.pl separately
 Use –c option to include a list of PDBs to upgrade –c ’PDB1 PDB2’
 -n specifies the number of processes to use for parallel operation
 Example: Use parallel/upgrade utility on multitenant databases
SQL> STARTUP UPGRADE
SQL> ALTER PLUGGABLE DATABASE ALL OPEN UPGRADE
cd $ORACLE_HOME/rdbms/admin
ORACLE_HOME/perl/bin/perl catctl.pl -n 4 -M
$ORACLE_HOME/rdbms/admin -n 16 -l /home/oracle catupgrd.sql
( -l location of the spool log file
-M: keeps CDB$ROOT in UPGRADE mode while PDBS are upgraded)
(check $ORACLE_HOME/cfgtoollogs/<SID>/upgrade/upg_summary.log
SQL>STARTUP
Upgrade Multitenant Database to 12cR2

‒ Three options:
 Non-CDB to PDB
 Everything at once
 Unplug/Plug
‒ Upgrade and Plugin as PDB
 12cR1 non CDB PDB in 12cR2
 Steps:
. Start 12cR1 database read-only
. Create XML description file: exec

. Shutdown Database
exec DBMS_PDB.DESCRIBE('PDB1.xml');
. Plugin database :
create pluggable database PDB1
using ('PDB1.xml') nocopy tempfile reuse;
. Sanity Operations:
start ?/rdbms/admin/noncdb_to_pdb.sql
Upgrade Multitenant Database to 12cR2

‒ Upgrade Options: Everything at Once vs. Unplug/Plug

(Refer to Carol Tagliaferri’s Database Upgrade presentation at Oracle Database 12.2 Beta User Group Test
Event )
Upgrade Multitenant Database to 12cR2

• Everything at Once

• Run preupgrade.jar
Ensure all PDBs are open
SQL> ALTER PLUGGABLE DATABASE ALL OPEN;
java –jar $<12.2_ORACLE_HOME>/rdbms/admin/preupgrade.jar TERMINAL TEXT
• Perform pre-upgrade fixups
Repeat the following steps for each PDB:
alter session set container PDB1;
@$ORACLE_BASE/cfgtoollogs/CDB1/preupgrade/preupgrade_fixups_pdb1.sql
• preupgrade.jar runs in every container: CDB$ROOTPDB$SEE, All PDBs
• Results get logged to consolidated preupgrade.log
– $ORACLE_BASE/cfgtoollogs/CDB/preupgrade/preupgrade.log
• Specific changes for each container in preupgrade_<PDB>.log
Upgrade Multitenant Database to 12cR2
In CDB – Oracle 12.2.0.1:
SQL> STARTUP UPGRADE
SQL> ALTER PLUGGABLE DATABASE ALL OPEN UPGRADE;

cd $ORACLE_HOME/rdbms/admin
$ORACLE_HOME/perl/bin/perl catctl.pl -d $ORACLE_HOME/rdbms/admin -n 16 –M -l
/home/oracle/upgrade catupgrd.sql

See $ORACLE_HOME/cfgtoollogs/<SID>/upgrade/upg_summary.log

SQL> STARTUP
SQL> 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/upgrade
-b postupgrade_fixups postupgrade_fixups.sql
$ORACLE_HOME/perl/bin/perl catcon.pl -n 1 -e -b utlrp -d '''.''' utlrp.sql
Upgrade Multitenant Database to 12cR2
Upgrade one at a time:
 In CDB1:
 Copy new preupgrade.jar into CBD1's
$ORACLE_HOME/rdbms/admin
 SQL> alter pluggable database PDB1 open;
 java –jar /
$ORACLE_HOME/rdbms/admin/preupgrade.jar TERMINAL TEXT –c PDB1
 SQL> alter session set container=PDB1;
 SQL> @/u01/app/oracle/cfgtoollogs/CDB1/
preupgrade/preupgrade_fixups_pdb1.sql
 SQL> alter sesstion set container=CDB$ROOT;
 SQL> alter pluggable database PDB1 close;
 SQL> alter pluggable database PDB1 unplug
into '/stage/pdb1.xml';
 SQL> exit
Upgrade Multitenant Database to 12cR2

Upgrade one at a time:


• In CDB2:
SQL> alter session set container=CDB$ROOT;
 SQL> create pluggable database PDB1 using
'/stage/pdb1.xml' file_name_convert=(
'/oradata/CDB1/pdb1', '/oradata/CDB2/pdb1');
 SQL> alter pluggable database PDB1 open upgrade;
 SQL> exit
 $> cd $ORACLE_HOME/rdbms/admin
 $> $ORACLE_HOME/perl/bin/perl catctl.pl
–c 'PDB1' catupgrd.sql
 SQL> alter session set container=PDB1;
 SQL> startup
 SQL>
@/u01/app/oracle/cfgtoollogs/CDB1/preupgrade/postupgrade_f
ixups_pdb1.sql
 SQL> @?/rdbms/admin/utlrp.sql
Upgrade Oracle RAC Database to 12cR2

• Upgrade Oracle RAC Database


‒ Upgrade Oracle Grid Infrastructure to 12.2.0.1 Grid Infrastructure
‒ Install Oracle 12.2.0.1 RAC Software
‒ Upgrade RAC to 12.2.0.1 RAC database
• Example 1: Upgrade 11.2.0.4 RAC database to 12.2.0.1 RAC
‒ Upgrade Oracle Grid Infrastructure to 12.2.0.1 Grid Infrastructure
unzip grid_home1.zip -d /u01/app/12.2.0/grid
/u01/app/12.2.0/grid/gridSetup.sh &
Upgrade Oracle RAC Database to 12cR2

• Upgrade Oracle RAC Database


‒ Upgrade Oracle Grid Infrastructure to 12.2.0.1 Grid Infrastructure
‒ Install Oracle 12.2.0.1 RAC Software
‒ Upgrade RAC to 12.2.0.1 RAC database
• Example 1: Upgrade 11.2.0.4 RAC database to 12.2.0.1 RAC
‒ Upgrade Oracle Grid Infrastructure to 12.2.0.1 Grid Infrastructure
unzip grid_home1.zip -d /u01/app/12.2.0/grid
/u01/app/12.2.0/grid/gridSetup.sh &
Upgrade Oracle RAC Database to 12cR2
Upgrade Oracle RAC Database to 12cR2

• Install Oracle 12.2.0.2 RAC Software


Upgrade Oracle RAC Database to 12cR2
‒ Upgrade Oracle 11.2.0.4 RAC Database to 12.2.0.1
[oracle@bposvr107 bin]$ ./dbua &
Upgrade Oracle RAC Database to 12cR2

‒ Upgrade Oracle 11.2.0.4 RAC Database to 12.2.0.1


[oracle@bposvr107 bin]$ ./dbua &
Upgrade Oracle RAC Database to 12cR2

‒ Upgrade Oracle 11.2.0.4 RAC Database to 12.2.0.1


Upgrade result:
Upgrade Oracle RAC Database to 12cR2

‒ Upgrade Oracle 11.2.0.4 RAC Database to 12.2.0.1


Upgrade result: this upgrade process runs 95 minutes
Upgrade Oracle RAC Database to 12cR2

• Example 2: Upgrade 12.1.0.2 RAC database to 12.2.0.1 RAC


‒ Upgrade Oracle Grid Infrastructure to 12.2.0.1 Grid Infrastructure
/u01/app/12.2.0/grid/gridSetup.sh &
Upgrade Oracle RAC Database to 12cR2

• Example 2: Upgrade 12.1.0.2 RAC database to 12.2.0.1 RAC


Upgrade Oracle RAC Database to 12cR2

• Example 2: Upgrade 12.1.0.2 RAC database to 12.2.0.1 RAC


‒ Upgrade Oracle Grid Infrastructure to 12.2.0.1 Grid Infrastructure
/u01/app/12.2.0/grid/gridSetup.sh &
Upgrade Oracle RAC Database to 12cR2

• Example 2: Upgrade 12.1.0.2 RAC database to 12.2.0.1 RAC


Upgrade Oracle RAC Database to 12cR2

• Example 2: Upgrade 12.1.0.2 RAC database to 12.2.0.1 RAC


Need to set the compatiablity parameters for diskgroups
Upgrade Oracle RAC Database to 12cR2

• Example 2: Upgrade 12.1.0.2 RAC database to 12.2.0.1 RAC


Upgrade Oracle RAC Database to 12cR2
• Example 2: Upgrade 12.1.0.2 RAC database to 12.2.0.1 RAC

…………………..
Upgrade Oracle RAC Database to 12cR2

• Example 2: Upgrade 12.1.0.2 RAC database to 12.2.0.1 RAC


Agenda

• Methods and Paths for Oracle database 12cR2 Upgrade


• Tools for Oracle Database 12cR2 Upgrade
• Upgrade Multitenant Database to Oracle 12cR2
• Oracle RAC Database Upgrade Examples
Thank You and QA
• Contact me at [email protected] or visit my Oracle Blog at
http://kyuoracleblog.wordpress.com/

You might also like