Академический Документы
Профессиональный Документы
Культура Документы
1 Scope
The scope of this document is to provide the technical steps/activities to do the 19c upgrade
from lower version of Oracle 12c.
This document will suit for 19c upgrade from 12c release (only).
Before staring the upgrade need to ensure the below requirements are met.
2
Following are the possible upgrade path which need to be checked before upgrading to 19c. Its
strongly suggested to follow the intermediate upgrade patch if source and target not possible in direct
method.
2.1 Minimum version of the database that can be directly upgraded to Oracle 19c
Upgrade Matrix
Source Target
11.2.0.4 19c
12.1.0.2 19c
12.2.0.1 19c
18.1 19c
As an alternative for image processing and conversion, Oracle recommends that you store multimedia content in
SecureFiles LOBs, and use third party products, such as Piction. The ORDIM component remains in the registry and still
has a VALID status. Oracle Multimedia objects and packages remain in the database. However, these objects and
packages no longer function, and raise exceptions if there is an attempt made to use them. Oracle Locator is not affected
by the desupport of Oracle Multimedia.
3
security roles again.
If you upgrade an 11g database to Oracle Database 19c without deleting the 11g data security roles, then any data
security policies that include a data security role are invalid in the Oracle Database 19c database.
If your source version's time zone is already higher than the destination's home, then apply the matching or any
higher time zone patch to your destination home before upgrade. For latest DST patch refer to Note 412160.1
IF APEX is installed then it is recommended to upgrade APEX in the source DB first before upgrading DB. Refer
to Note 1088970.1
No INVALID object / Components in Source
Execute Preupgrade scripts before upgrade and review the preupgrade log for any issues.
Execute dbupgdiag.sql (refer Note 556610.1 to download this script) and verify whether there are any INVALID
components or objects owned by SYS/SYSTEM. If any, fix them before proceeding to upgrade the database. You
can execute utlrp.sql multiple times to VALIDate them, if still objects are INVALID, create a service request with
Oracle support.
/opt/app/oracle/product/12.1.0.2/db_1/jdk/bin/java -jar
/opt/app/oracle/product/19.3/db_1/rdbms/admin/preupgrade.jar FILE DIR /opt/app/oracle/product/
PREUPGRADE SUMMARY
==================
/opt/app/oracle/product/preupgrade.log
/opt/app/oracle/product/preupgrade_fixups.sql
/opt/app/oracle/product/postupgrade_fixups.sql
Check the preupgrade.log and Run the preupgrade_fixups.sql check for any manual action required.
Create pfile from spfile (backup the oldspfile) -- Keep it safe
-------------------------------
SQL>create pfile='/PATH/initdbname.ora' from spfile. -- Copy the pfile immediately
If you dont mention path then go to the $ORACLE_HOME/dbs and rename(backup) the pfile.
4
FROM v$session
WHERE status = 'ACTIVE'
opatch lsinventory details. -- For safety get the list of all installed patches
----------------------------------
$hostname
$cd $ORACLE_HOME/OPatch
$ls -ltr
$./opatch lsinventory
VERSION
----------
18
Note
-------
If version is 32 then leave as it is. If its lower than 18 then follow post upgrade step.
Make sure no files need media recovery and no files are in backup mode.
$export ORACLE_SID=SID
$export ORACLE_HOME=OLDHOME
5
$echo $ORACLE_SID
$echo $ORACLE_HOME
$sqlplus '/as sysdba'
SQL>SELECT SUBSTR(value,INSTR(value,'=',INSTR(UPPER(value),'SERVICE'))+1)
FROM v$parameter
WHERE name LIKE 'log_archive_dest%' AND UPPER(value) LIKE 'SERVICE%';
Table no logging:
----------------------
SQL>SELECT owner,tablespace_name
FROM dba_tables
WHERE table_name='AUD$';
Note: If the AUD$ table exists and is in use, upgrade performance can be effected depending on the
number of records in the table.
6
--------------------------------------------------
declare
v_param_list varchar2(2000);
cursor rec_c ( i_ACLID dba_network_acl_privileges.ACLID%type, i_ACL
dba_network_acl_privileges.ACL%type ) is
select rownum POSITION ,
ACL,
PRINCIPAL,
decode(privilege,'use-cli','use-client-certificates','use-pas','use-passwords',privilege) PRIVILEGE,
IS_GRANT,INVERT,
decode(START_DATE,null,'null','to_timestamp_tz('''||to_char(START_DATE,'YYYYMMDDHH24MISSXFFTZR')||''','
TZR'')') START_DATE,
decode(END_DATE,null,'null','to_timestamp_tz('''||to_char(END_DATE,'YYYYMMDDHH24MISSXFFTZR'||''',''YYYY
TZR'')')) END_DATE
from dba_network_acl_privileges a
where a.ACLID = i_ACLID and a.ACL = i_ACL ;
rec rec_c%rowtype ;
begin
for i in ( select distinct ACLID,ACL from dba_network_acl_privileges ) loop
open rec_c ( i.ACLID , i.acl ) ;
fetch rec_c into rec;
v_param_list:='acl=>'''||substr(rec.acl,instr(rec.acl,'/',-1)+1)||'''';
v_param_list:=v_param_list||',description=>'''||substr(rec.acl,11,length(rec.acl))||'''';
v_param_list:=v_param_list||',principal=>'''||rec.principal||'''';
v_param_list:=v_param_list||',privilege=>'''||rec.privilege||'''';
v_param_list:=v_param_list||',is_grant=>'||rec.is_grant;
v_param_list:=v_param_list||',start_date=>'||rec.END_DATE;
v_param_list:=v_param_list||',end_date=>'||rec.END_DATE||');';
dbms_output.put_line('exec dbms_network_acl_admin.create_acl('||v_param_list);
-- fetch rec_c into rec ; NOT FETCHING HERE TO AVOID DUPLICATES
while rec_c%FOUND loop
v_param_list:='acl=>'''||substr(rec.acl,instr(rec.acl,'/',-1)+1)||'''';
v_param_list:=v_param_list||',principal=>'''||rec.principal||'''';
v_param_list:=v_param_list||',is_grant=>'||rec.is_grant;
v_param_list:=v_param_list||',privilege=>'''||rec.privilege||'''';
v_param_list:=v_param_list||',position=>'||rec.POSITION;
v_param_list:=v_param_list||',start_date=>'||rec.END_DATE;
v_param_list:=v_param_list||',end_date=>'||rec.END_DATE||');';
dbms_output.put_line('exec DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE('||v_param_list);
fetch rec_c into rec ;
end loop;
close rec_c ;
7
1)+1)||''',host=>'''||rec2.host||''',lower_port=>'||rec2.lower_port||',upper_port=>'||rec2.upper_port||');';
dbms_output.put_line('exec
DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('||v_param_list);
end loop;
end loop;
end;
/
SQL>spool off
If it return any row run the below. -- Check notes once before process
You must resolve outstanding distributed transactions before performing the upgrade.
8
Check for Hidden & deprecated paramters:
------------------------------------------------------
Note: If any hidden parameter in parameter file you comment after DB upgrade then uncomment it
SQL>select name from sys.V$PARAMETER where name like '\_%' escape '\' and ISDEFAULT='FALSE';
Events:
SELECT (translate(value,chr(13)||chr(10),' ')) FROM sys.v$parameter2
WHERE UPPER(name) ='EVENT' AND isdefault='FALSE'
Trace Events:
SELECT (translate(value,chr(13)||chr(10),' ')) from sys.v$parameter2
WHERE UPPER(name) = '_TRACE_EVENTS' AND isdefault='FALSE'
Materialized views
-------------------------
(or)
SQL>set serveroutput on
DECLARE
v_xdb_installation_trigger number;
v_dropped_xdb_instll_trigger number;
v_dropped_xdb_instll_tab number;
9
BEGIN
select count(*) into v_xdb_installation_trigger
from dba_triggers
where trigger_name = 'XDB_INSTALLATION_TRIGGER' and owner = 'SYS';
ELSE
dbms_output.put_line('Please proceed to run the XDB install or upgrade. No objects need to be
dropped');
END IF;
END;
/
ps -ef|grep smon
echo $ORACLE_SID
echo $ORACLE_HOME
$sqlplus '/as sysdba'
SQL>select * from v$instance;
10
SQL>spool invalid_objects_before_upgrade_on_20Feb16.log
SQL>set lines 150
set pages 100
COLUMN object_name FORMAT A50
SELECT owner,
object_type,
object_name,
status
FROM dba_objects
WHERE status = 'INVALID'
ORDER BY owner, object_type, object_name;
SQL>spool off
$ cd $ORACLE_HOME/rdbms/admin
$ sqlplus "/ as sysdba"
SQL> @$ORACLE_HOME/rdbms/admin/utlrp.sql;
SQL>spool invalid_objects_before1_date.log
SQL>set lines 150
set pages 100
COLUMN object_name FORMAT A50
SELECT owner,
object_type,
object_name,
status
FROM dba_objects
WHERE status = 'INVALID'
ORDER BY owner, object_type, object_name;
SQL>spool off
Note:
-----
Any invalid SYS/SYSTEM objects found before upgrading the database are stored in the table named
registry$sys_inv_objs. Any invalid non-SYS/SYSTEM objects found before upgrading the database are
stored in registry$nonsys_inv_objs.
11
----------------------------------------------------------------------------------------
Check the Scn no and archive log file last generated.For safety take control file trace backup.
DBSIZE:
----------
Purge Recyclebin:
----------------------
Gather statistics
---------------------------
Oracle recommends collecting statistics the night before starting the upgrade to decrease the amount
of downtime
12
show parameter shared_pool_size;
show parameter java_pool_size;
show parameter sga_target;
show parameter sga_max;
show parameter memory;
show parameter job_queue_processes;
show parameter cluster;
show parameter pga;
show parameter spfile;
SQL>
$export ORACLE_SID=SID
$export ORACLE_HOME=OLDHOME
$echo $ORACLE_SID
$echo $ORACLE_HOME
ps -ef|grep smon
13
$export ORACLE_SID=SID
$export ORACLE_HOME=OLDHOME
echo $ORACLE_SID
echo $ORACLE_HOME
$sqlplus '/as sysdba'
SQL>Shutdown immediate;
Login to the oracle user and disable database releated job in the cron jobs.
$crontab -l
$crontab -e
cat /etc/oratab
echo $ORACLE_SID
echo $ORACLE_HOME
echo $PATH
echo $LD_LIBRARY_PATH
echo $ORA_NLS10
$env
go to new oracle home location and start the database in upgrade mode with 'new pfile'
cd $ORACLE_HOME/bin
Based on Oracle component upgrade will take couple of hours. Need to monitor upgrade logfile and
alert log file during DB upgrade window.
14
$ sqlplus "/as sysdba"
SQL> STARTUP
SQL> @?/rdbms/admin/utlusts.sql;
Sql>@/opt/app/oracle/product/postupgrade_fixups.sql;
Upgrade the Time Zone File Version After Upgrading Oracle Database:
Please go throw the below link for time zone upgradation from 18 to 32 version.
https://oracle-base.com/articles/misc/update-database-time-zone-file#check-current-timezone-version
15
Apex_verification.sq Sample_Apex_verify
l.txt _output.html
Oracle saying Workspace ID is less than 5 digits is not required to upgrade apex components.
Note: Incase Apex workspace ID more than 5 digit please follow the document then proceed apex upgradation.
ps -ef|grep smon
echo $ORACLE_SID
echo $ORACLE_HOME
$sqlplus '/as sysdba'
SQL>select * from v$instance;
SQL>spool invalid_objects_after_20Feb16.log
SQL>set lines 150
set pages 100
COLUMN object_name FORMAT A50
SELECT owner,
object_type,
object_name,
status
FROM dba_objects
WHERE status = 'INVALID'
ORDER BY owner, object_type, object_name;
SQL>spool off
16
Post:Check Components status
---------------------------
$export ORACLE_SID=SID
$export ORACLE_HOME=NewHOME
$echo $ORACLE_SID
$echo $ORACLE_HOME
$sqlplus '/as sysdba'
SQL>archive log list;
SQL>shutdown immediate;
SQL>startup mount;
SQL>alter database archivelog;
SQL>alter database open;
SQL>archive log list;
SQL>alter system archive log current;
crontab -e
cat /etc/oratab
17
After complete DB upgrade need to enable Maintenance mode and hand Over database to application team for
testing purpose.
18