Sunday, 5 March 2023

12c to 19c upgrade manual

 Executing the pre-upgrade jar tool 

The pre-upgrade information tool is available in the new release oracle home, in path
$ORACLE_HOME/rdbms/admin/preupgrade.jar 
mkdir -p /u02/preupgrade 
Run the preupgrade tool 
/u02/app/oracle/product/12.2.0.1/db_1/jdk/bin/java -jar /u01/app/oracle/product/19c/db_1/rdbms/admin/preupgrade.jar DIR /u02/preupgrade
select name,open_mode,log_mode from v$database;
@preupgrade_fixups.sql 
Performing the pre-upgrade actions 
Run the preupgrade_fixups.sql

 

select file_name from dba_data_files;
alter database datafile '/u01/app/oradata/PROD/datafile/system.dbf' resize 1g;
alter database datafile '/u01/app/oradata/PROD/datafile/syaux.dbf' resize 700m;
alter database datafile '/u01/app/oradata/PROD/datafile/undotbs.dbf' resize 600m;
select file_name from dba_temp_files;
alter database tempfile '/u01/app/oradata/PROD/datafile/temp.dbf' resize 300m;
 
 Backing up the database / create a gaurantee restore point
>create restore point before_upgrade_19c guarantee flashback database;
>select name,guarnatee_flashback_database, time from v$restore_point;

Upgrading the database

  • sqlplus / as sysdba
  • shutdown immediate;
  • exit
  • copy the spfile, password file and listener from old ORACLE_HOME to new 19c ORACLE_HOME.
 cd $ORACLE_HOME/dbs
cp spfileorcl.ora orapwdprod.ora /u01/app/oracle/product/19c/db_1/dbs
cd $ORACLE_HOME/network/admin
cp listener.ora tnsnames.ora /u01/app/oracle/product/19c/db_1/network/admin
Stop listner running on 12c home and start it from 19c home.
start the database from 19c ORACLE_HOME and start the updgrade.
sqlplus / as sysdba
startup upgrade
select name,open_mode, status from v$database, v$instance;
Run the DB Upgrade utility
cd $ORACLE_HOME
pwd
cd bin
./dbupgrade -n 8
check out and wait for 30 minute 
check the upgrade summary log
startup database manually and
select name,open_mode, status from v$database, v$instance;

Execute Post-Upgrade Status Tools, utlusts.sql
  • @$ORACLE_HOME/rdbms/admin/utlusts.sql TEXT
  • Recompile the INVALID objects using utlrp.sql
@$ORACLE_HOME/rdbms/admin/utlrp.sql
@$ORACLE_HOME/rdbms/admin/utlusts.sql TEXT
 
Performing the post-upgrade actions.
> Connect to sqlplus and run the postupgrade_fixup.sql script
sqlplus / as sysdba
@/u02/preupgrade postupgrade_fixup.sql
 
>Upgrade the timezone file version
sqlplus / as sysdba
select version from v$timezone_file;
@ORACLE_HOME/rdbms/admin/utltz_countstats.sql
@ORACLE_HOME/rdbms/admin/utltz_countstar.sql
@ORACLE_HOME/rdbms/admin/utltz_upg_check.sql
@ORACLE_HOME/rdbms/admin/utltz_upg_apply.sql
select version from v$timezone_file; 

Performing the post-upgrade actions.
>Gather statistics on fixed objects
 
>connect to sqlplus  as sys user  and execute 
sql>execute dbms_stats.gather_fixed_objects_stats;

select name from v$restore_point;
drop restore point before_upgrade_19c;

alter sytem set compatible='19.0.0' scope=spfile;
shutdown immediate;
startup;
show parameter compatible;
 
select name,open_mode, status from v$database, v$instance;
set line 1234 pages 1234
col comments for a30
col action for a15
select * from dba_registry_history;



 

 

 

No comments:

Post a Comment