Sie sind auf Seite 1von 3

Upgrading oracle DB

from 11.20.3 onwards to 18c

Note : all scripts below are based on database msafd as an example.

References :
Oracle Support Document 2418045.1 (Oracle DB 18c - Complete Checklist for Manual Upgrades to Non-CDB
Oracle Database 18c) can be found at:
https://support.oracle.com/epmos/faces/DocumentDisplay?id=2418045.1

Oracle Database 18c upgrade Guide :


https://docs.oracle.com/en/database/oracle/oracle-database/18/upgrd/index.html

INSTALL 18c binaries

Location of install files:

GDC1DLDCORA001:/u01/app/oracle/DB_SOFT/LINUX.X64_180000_db_home.zip

You must move this zip file to the new $ORACLE_HOME dir, and unzip it there directly
(it behaves differently than previous releases)

PRE-UPGRADE tasks

on the primary database, run the following :


SYS@msafd> purge dba_recyclebin;

SYS@msafd> SELECT o.name FROM sys.obj$ o, sys.user$ u, sys.sum$ s WHERE o.type#


= 42 AND bitand(s.mflags, 8) =8;

SYS@msafd> @/u01/app/oracle/product/18.0.0/dbhome_1/rdbms/admin/emremove

SYS@msafd> EXEC DBMS_STATS.GATHER_DICTIONARY_STATS;

SYS@msafd> @?/rdbms/admin/EXEC DBMS_STATS.GATHER_DICTIONARY_STATS;

[oracle@rdc1vldcora101:msafd]$ ${ORACLE_HOME}/jdk/bin/java -jar


/u01/app/oracle/product/18.0.0/dbhome_1/rdbms/admin/preupgrade.jar FILE TEXT DIR
/home/oracle/scripts/upgrade

SYS@msafd> @/home/oracle/scripts/upgrade/preupgrade_fixups.sql
SYS@msafd> SELECT * FROM DBA_DEPENDENCIES WHERE referenced_name IN
('UTL_TCP','UTL_SMTP','UTL_MAIL','UTL_HTTP','UTL_INADDR','DBMS_LDAP') AND owner
NOT IN ('SYS','PUBLIC','ORDPLUGINS')

SYS@msafd> select current_scn from v$database;  keep this SCN apart, so that you can use it in case of
restore

SYS@msafd> create restore point before_upgrade18c;  can be used also in case of restore

Take a backup of the controlfile (just copy one)

on the standby server:

Stop the standby processes and the instance (shut immediate)

UPGRADE tasks

on the primary, execute the following

SYS@msafd>shut immediate

[oracle@rdc1vldcora101:msafd]$ cp [OLD_OH]/dbs/*msafd* [NEW_OH]/dbs/

[oracle@rdc1vldcora101:msafd]$ vi /etc/oratab  Modify OH for msafd in /etc/oratab

[oracle@rdc1vldcora101:msafd]$ export ORACLE_SID=msafd;export ORAENV_ASK=NO;. oraenv

SYS@msafd> startup upgrade;

[oracle@rdc1vldcora101:msafd]$ cd $ORACLE_HOME/bin

[oracle@rdc1vldcora101:msafd]$ ./dbupgrade  this can last ½ hour

SYS@msafd>STARTUP

SYS@msafd>@?/rdbms/admin/utlu122s.sql

SYS@msafd>@?/rdbms/admin/catuppst.sql

POST-UPGRADE TASKS

SYS@msafd>@postupgrade_fixups.sql

If the Pre-Upgrade Information Tool instructed you to upgrade the time zone files after completing the
database upgrade: From 18.1 onwards, timezone upgrade scripts are included in the target ORACLE_HOME
under rdbms/admin directory. Customer can use those files to perform time zone upgrade instead of the
ones included in this document.
Please refer to Oracle Documentation on how to upgrade a time zone file manually:
Database Globalization Support Guide
Section 4.7.3 Steps to Upgrade Time Zone File and Timestamp with Time Zone Data

SQL>exec DBMS_DST.BEGIN_PREPARE(new_version)
SQL>exec DBMS_DST.FIND_AFFECTED_TABLES
SQL>select * from sys.dst$affected_tables;

Start up the database in UPGRADE mode

SQL> SHUT IMMEDIATE


SQL> STARTUP UPGRADE
SQL>exec DBMS_DST.BEGIN_UPGRADE(31)

Das könnte Ihnen auch gefallen