Professional Documents
Culture Documents
Database Upgrade Steps From 12c To 19c - 26DEC21
Database Upgrade Steps From 12c To 19c - 26DEC21
Database Upgrade Steps From 12c To 19c - 26DEC21
===================================
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Advanced Analytics and Real Application Testing options
SQL> select sum(bytes/1024/1024/1024) from dba_Segments;
SUM(BYTES/1024/1024/1024)
-------------------------
1218.33325
[oracle@oraracq53-01 ~]$ hostname
oraracq53-01
[oracle@oraracq53-01 ~]$ cd $RMAN_SCRIPTS
[oracle@oraracq53-01 rman]$ ls -lrt rman*
-rwxr-xr-x 1 oracle dba 557 Mar 17 2020 rman_for_nocat_disk.sh
-rwxr-xr-x 1 oracle dba 491 Mar 17 2020 rman_for_disk.sh
-rwxr-xr-x 1 oracle dba 372 Mar 26 2020 rman_for_ALS.sh
-rwxr-xr-x 1 oracle dba 473 May 6 2020 rman_for_NBU.sh
-rwxr-xr-x 1 oracle dba 505 Mar 1 2021 rman_for_DD.sh
[oracle@oraracq53-01 rman]$nohup ./rman_for_DD.sh
Argmument: Comment
-------------------------------------------------
-db DB_NAME - Database name to free standby of
-back_dir dir - Directory to backup, defaults to $ORA_BKUP/admin
-tar_file filename - Name of tar file, defaults to OH_{DB_NAME)_20211226.tar.gz
-restart N - Script is restartable and each step is numbered, deaults to 0
[oracle@oraracq53-01 scripts]$ ./backupMyHome.sh -db dbq09 -back_dir /backup00/oradbq09/upgrade
In job backupMyHome running step 10 - cleanupPatch at Sun Dec 26 20:52:22 PST 2021 for sid:dbq091
In job backupMyHome finished step 10 - cleanupPatch at Sun Dec 26 20:52:29 PST 2021 for sid:dbq091
In job backupMyHome running step 20 - checkFreeSpace at Sun Dec 26 20:52:29 PST 2021 for
sid:dbq091
In job backupMyHome finished step 20 - checkFreeSpace at Sun Dec 26 20:52:29 PST 2021 for
sid:dbq091
In job backupMyHome running step 30 - backupHome at Sun Dec 26 20:52:29 PST 2021 for sid:dbq091
In job backupMyHome finished step 30 - backupHome at Sun Dec 26 21:05:57 PST 2021 for sid:dbq091
You have mail in /var/spool/mail/oracle
[oracle@oraracq53-01 scripts]$
File created.
Instance dbq091 is running on node oraracq53-01 with online services scgma_dbq09_q3. Instance
status: Open,HOME=/u01/app/oracle/oradbq09/product/12.1.0.2.
Instance dbq092 is running on node oraracq53-02 with online services scgma_dbq09_q3. Instance
status: Open,HOME=/u01/app/oracle/oradbq09/product/12.1.0.2.
Instance dbq093 is running on node oraracq53-03 with online services scgma_dbq09_q3. Instance
status: Open,HOME=/u01/app/oracle/oradbq09/product/12.1.0.2.
Database name:
Spfile: +DATA/dbq09/spfiledbq09.ora
Domain:
Server pools:
Services: scgma_dbq09_q3
Type: RAC
Start concurrency:
Stop concurrency:
Database is enabled
Server pool:
Cardinality: 3
Disconnect: false
AQ HA notifications: false
Global: false
Failover type:
Failover method:
Edition:
GSM Flags: 0
Service is enabled
Available instances:
*) Create restore point on the database.
SQL> show parameter compatible
NAME
-------------------------------------------------------------------------------------------------------------------------------
-
BEFORE_DOWNGRADING_19C_12C_21DEC21
BEFORE_UPGRADE_12C_19C_19DEC21
GRP_1639978734875
BEFORE_UPGRADE_12C_TO_19C_26DEC21
Pre-upgrade scripts:- (dbupgdiag.sql)
[oracle@oraracq53-01 admin]$
Before upgrade:
=======================================
Status of the database prior to upgrade
=======================================
Database Name: DBQ09
Container Name: dbq09
Container ID: 0
Version: 12.1.0.2.0
DB Patch Level: DATABASE PATCH SET UPDATE 12.1.0.2.211019
Compatible: 12.1.0.2.0
Blocksize: 8192
Platform: Linux x86 64-bit
Timezone File: 32
Database log mode: ARCHIVELOG
Readonly: FALSE
Edition: EE
*
* ALL Components in This Database Registry:
*
Component Current Current Original Previous Component
CID Version Status Version Version Schema
---------- ----------- ----------- ----------- ----------- ------------
CATALOG 12.1.0.2.0 VALID 12.1.0.2.0 12.1.0.2.0 SYS
CATJAVA 12.1.0.2.0 VALID 12.1.0.2.0 12.1.0 SYS
CATPROC 12.1.0.2.0 VALID 12.1.0.2.0 12.1.0 SYS
CONTEXT 12.1.0.2.0 VALID 12.1.0.2.0 12.1.0.1.0 CTXSYS
JAVAVM 12.1.0.2.0 VALID 12.1.0.2.0 12.1.0.2.0 SYS
OWM 12.1.0.2.0 VALID 12.1.0.2.0 12.1.0.1.0 WMSYS
RAC 12.1.0.2.0 VALID 12.1.0.2.0 12.1.0.2.0 SYS
XDB 12.1.0.2.0 VALID 12.1.0.2.0 12.1.0 XDB
XML 12.1.0.2.0 VALID 12.1.0.2.0 12.1.0 SYS
==============
BEFORE UPGRADE
==============
REQUIRED ACTIONS
================
1. (AUTOFIXUP) Empty the RECYCLEBIN immediately before database upgrade.
Tablespaces that are not AUTOEXTEND must have sufficient space for the
upgrade process. Minimum sizes are estimates.
If an AUTOEXTEND tablespace is listed above, it is because datafile
maximum size is limited and has to be increased to meet upgrade process
requirements.
Your database system has at least one account with only the 10G password
version (see the PASSWORD_VERSIONS column of DBA_USERS).
Starting with Oracle Database release 12.2.0.1, Exclusive Mode is the new
default password-based authentication mode. All Exclusive Mode
login/authentication attempts will fail for preexisting user accounts
which only have the 10G password version and neither the 11G or 12C
password version (see DBA_USERS.PASSWORD_VERSIONS.) For more information,
refer to "Understanding Password Case Sensitivity and Upgrades" in the
Oracle Database Upgrade Guide.
EXECUTE DBMS_STATS.GATHER_DICTIONARY_STATS;
INFORMATION ONLY
================
6. Here are ALL the components in this database registry:
7. Check the Oracle Backup and Recovery User's Guide for information on how
to manage an RMAN recovery catalog schema.
If you are using a version of the recovery catalog schema that is older
than that required by the RMAN client version, then you must upgrade the
catalog schema.
It is good practice to have the catalog schema the same or higher version
than the RMAN client version you are using.
SQL>@/backup00/oradbq09/upgrade/preupgrade_fixups.sql
=============
AFTER UPGRADE
=============
REQUIRED ACTIONS
================
None
RECOMMENDED ACTIONS
===================
10. Recreate directory objects to remove any symbolic links from directory
paths. To identify paths that contain symbolic links before upgrading,
use OS commands like UNIX file or WINDOWS dir. After upgrading, run
$ORACLE_HOME/rdbms/admin/utldirsymlink.sql to identify directory objects
with symbolic links in the path.
11. (AUTOFIXUP) Gather dictionary statistics after the upgrade using the
command:
EXECUTE DBMS_STATS.GATHER_DICTIONARY_STATS;
12. Gather statistics on fixed objects after the upgrade and when there is a
representative workload on the system using the command:
EXECUTE DBMS_STATS.GATHER_FIXED_OBJECTS_STATS;
SQL>@/backup00/oradbq09/upgrade/postupgrade_fixups.sql
[oracle@oraracq53-01 bin]$
Purge recyclebin: -
COUNT(*)
----------
5
SQL> purge dba_recyclebin;
COUNT(*)
----------
0
*) Increase the system tablespaces maxbytes size.
Database altered.
--------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------
DBMS_METADATA.GET_DDL('VIEW','CDB_JAVA_POLICY','SYS')
_DATA
E, "CON$ERRMSG" INVISIBLE) AS
SELECT k."KIND",k."GRANTEE",k."TYPE_SCHEMA",k."TYPE_NAME",k."NAME",k."ACTION",
SG FROM CONTAINERS("SYS"."DBA_JAVA_POLICY") k
SQL>
We can drop the invalid objects after taking the metadata bkp.
View dropped.
DBMS_METADATA.GET_DDL('SYNONYM','CDB_JAVA_POLICY','PUBLIC')
--------------------------------------------------------------------------------
CREATE OR REPLACE NONEDITIONABLE PUBLIC SYNONYM "CDB_JAVA_POLICY" FOR "SYS"."C
DB_JAVA_POLICY"
ERROR at line 1:
Synonym dropped.
SQL>
SQL>
OBJECT_NAME OBJECT_TYPE
STATUS
--------------------------------------------------------------------------------------------------------------------------------
----------------------- -------
OWNER
--------------------------------------------------------------------------------------------------------------------------------
BATCH_JOB_STATUS VIEW
INVALID
SCG_MYACCT_CUSTOM3
Once preupgrade steps is done, Create the oracle environment base profile for 19c home and start he
xming apps and invoke the dbua tool from 19c home.
# Maintain this file for all RDBMS, ASM or EM Agent added to the cluster or host
# Values are provided to set_variables.sh. Copy the file to all members of the cluster
# Use this entry format, ten values, separated by pipes ; NA when Not Applicable
dbq01|/u01/app/oracle/oradbq01/product/12.1.0.2|/backup00|1|All|DDO|Y|dbq01|NA|NA
#dbq03|/u01/app/oracle/oradbq03/product/12.1.0.2|/backup00|2|All|DDO|N|dbq03|NA|NA
dbq03|/u01/app/oracle/oradbq03/product/19.3.0|/backup00|2|All|DDO|N|dbq03|NA|NA
#dbq06|/u01/app/oracle/oradbq06/product/12.1.0.2|/backup00|3|All|DDO|N|dbq06|NA|NA
dbq06|/u01/app/oracle/oradbq06/product/19.3.0|/backup00|3|All|DDO|N|dbq06|NA|NA
#dbq07|/u01/app/oracle/oradbq07/product/12.1.0.2|/backup00|1|All|DDO|N|dbq07|NA|NA
dbq07|/u01/app/oracle/oradbq07/product/19.3.0|/backup00|1|All|DDO|N|dbq07|NA|NA
##dbq08|/u01/app/oracle/oradbq08/product/12.1.0.2|/backup00|2|All|DDO|N|dbq08|NA|NA
dbq08|/u01/app/oracle/oradbq08/product/19.3.0|/backup00|2|All|DDO|N|dbq08|NA|NA
dbq09|/u01/app/oracle/oradbq09/product/12.1.0.2|/backup00|3|All|DDO|N|dbq09|NA|NA
##dbq09|/u01/app/oracle/oradbq09/product/19.3.0|/backup00|3|All|DDO|N|dbq09|NA|NA
Post upgrade steps:-
SQL> @//backup00/oradbq09/upgrade/postupgrade_fixups.sql
Session altered.
Package created.
No errors.
No errors.
Package created.
No errors.
No errors.
Preup Preupgrade
Action Issue Is
The fixup scripts have been run and resolved what they can. However,
have not been remedied and are still present in the database.
the issue itself, that could mean that your database upgrade is not
from the preupgrade which explains in more detail what still needs
to be done.
Session altered.
cdb_cluster_name string
cluster_database_instances integer 3
cluster_interconnects string
SQL>
SQL>
9 rows selected.
inmemory_prefer_xmem_memcompress string
SQL>
SQL>
NAME
--------------------------------------------------------------------------------
BEFORE_DOWNGRADING_19C_12C_21DEC21
BEFORE_UPGRADE_12C_19C_19DEC21
GRP_1639978734875
BEFORE_UPGRADE_12C_TO_19C_26DEC21
GRP_1640582688680
SQL>
Spfile: +DATA/dbq09/spfiledbq09.ora
Domain:
Server pools:
Services: scgma_dbq09_q3
Type: RAC
Start concurrency:
Stop concurrency:
Database is enabled
CSS critical: no
CPU count: 0
Memory target: 0
Maximum memory: 0
Server pool:
Cardinality: 3
AQ HA notifications: false
Global: false
Failover type:
Failover method:
Failover retries:
Failover delay:
Edition:
Hub service:
Drain timeout:
Stop option:
Session State Consistency: DYNAMIC
GSM Flags: 0
Service is enabled
Available instances:
CSS critical: no
Trigger altered.
Argmument: Comment
----------------------------------------------------------------
[oracle@oraracq53-01 scripts]$
dbq091
Issue in SpFileCheck : Our spfile reference of in the pfile does not match
+DATA/DBQ09/SPFILEDBQ09.ORA
USERNAME PROFILE
------------------------------ ----------------------------------------
REMOTE_SCHEDULER_AGENT DEFAULT
DBSFWUSER DEFAULT
GGSYS DEFAULT
SYSRAC DEFAULT
SYS$UMF DEFAULT
QUEST ORACLE_SYSTEM
CTXSYS ORACLE_SYSTEM
7 rows selected.
COUNT(*) OWNER
---------- ------------------------------------------------------------
1 SCG_MYACCT_CUSTOM3
oraracq53-
01,dbq09,20211226,19.3.0,QA,10.53.52.0/22,PRIMARY,4158104461,Y,Y,Y,Y,N,Y,N,Y,Y,Y,Y,N,Y,Y,N,N,N,Y,
Y
archive_lag_target=1800
db_recovery_file_dest_size=805306368000
listener_networks=""
sga_target=10737418240
diagnostic_dest=/u01/app/oracle/oradbq09
resource_manager_plan=SCHEDULER[0x444A]:DEFAULT_MAINTENANCE_PLAN
cluster_database=true
cpu_count=12
audit_file_dest="/u01/app/oracle/oradbq09/admin/dbq09/adump"
db_create_file_dest="+DATA"
#dbq091.local_listener="(ADDRESS=(PROTOCOL=TCP)(HOST=10.53.52.196)(PORT=1521))"
compatible=12.1.0.2.0
open_cursors=1000
control_file_record_keep_time=40
max_dump_file_size=10M
processes=1000
sessions=1524
pga_aggregate_target=3221225472
db_recovery_file_dest="+FRA"
db_block_size=8192
log_archive_format=%t_%s_%r.dbf
sga_max_size=10737418240
control_files='+DATA/DBQ09/CONTROLFILE/current.478.1051866087','+FRA/DBQ09/CONTROLFILE/
current.612.1051866087'
audit_trail=DB
db_name="dbq09"
db_files=1000
db_domain=""
remote_login_passwordfile=EXCLUSIVE
db_unique_name="dbq09"
undo_retention=1500
remote_listener=oraracq53.sempra.com:1521
dbq091.instance_number=1
dbq092.instance_number=2
dbq093.instance_number=3
dbq091.undo_tablespace=UNDOTBS1
dbq092.undo_tablespace=UNDOTBS2
dbq093.undo_tablespace=UNDOTBS3
dbq091.thread=1
dbq092.thread=2
dbq093.thread=3
[oracle@oraracq53-01 scripts]$
[oracle@oraracq53-01 scripts]$
SQL>
Create the softlink for spfile in oracle_home/dbs location for all three nodes..
Spfile=’+DATA/DBQ09/spfiledbq09.ora’
[oracle@oraracq53-01 dbs]$
[oracle@oraracq53-01 dbs]$
Copy the tnsnames.ora file from 12c home to 19c home in all three nodes.
/u01/app/oracle/oradbq09/product/19.3.0/network/admin
[oracle@oraracq53-01 admin]$
[oracle@oraracq53-01 admin]$
[oracle@oraracq53-01 admin]$
User altered.
User altered.
User altered.
User altered.
User altered.
SQL> exit
USERNAME PROFILE
------------------------------ ----------------------------------------
QUEST ORACLE_SYSTEM
REMOTE_SCHEDULER_AGENT ORACLE_SYSTEM
DBSFWUSER ORACLE_SYSTEM
GGSYS ORACLE_SYSTEM
SYSRAC ORACLE_SYSTEM
CTXSYS ORACLE_SYSTEM
SYS$UMF ORACLE_SYSTEM
7 rows selected.
COUNT(*) OWNER
---------- ------------------------------------------------------------
1 SCG_MYACCT_CUSTOM3
oraracq53-
01,dbq09,20211226,19.3.0,QA,10.53.52.0/22,PRIMARY,4158104461,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,N,Y,Y,N,N,N,Y,Y
SQL> /
SYS PREUPGRADE_DIR
/u01/app/oracle/oradbq09/product/19.3.0/rdbms/admin 0
SYS XMLDIR
/u01/app/oracle/oradbq09/product/19.3.0/rdbms/xml 0
SYS XSDDIR
/u01/app/oracle/oradbq09/product/19.3.0/rdbms/xml/schema 0
SYS ORACLE_OCM_CONFIG_DIR2
/u01/app/oracle/oradbq09/product/19.3.0/ccr/state 0
SYS ORACLE_OCM_CONFIG_DIR
/u01/app/oracle/oradbq09/product/19.3.0/ccr/state 0
SYS DBMS_OPTIM_LOGDIR
/u01/app/oracle/oradbq09/product/19.3.0/cfgtoollogs 0
SYS OPATCH_TEMP_DIR
/u01/app/oracle/oradbq09/product/12.1.0.2/QOpatch 0
SYS DBMS_OPTIM_ADMINDIR
/u01/app/oracle/oradbq09/product/19.3.0/rdbms/admin 0
SYS JAVA$JOX$CUJS$DIRECTORY$
/u01/app/oracle/oradbq09/product/19.3.0/javavm/admin/ 0
SYS DATA_PUMP_DIR
/u01/app/oracle/oradbq09/product/12.1.0.2/rdbms/log/ 0
SYS OPATCH_INST_DIR
/u01/app/oracle/oradbq09/product/19.3.0/OPatch 0
SYS OPATCH_SCRIPT_DIR
/u01/app/oracle/oradbq09/product/19.3.0/QOpatch 0
SYS OPATCH_LOG_DIR
/u01/app/oracle/oradbq09/product/19.3.0/rdbms/log
Directory created.
[oracle@oraracq53-01 scripts]$ ./check_database.sh -db dbq09
USERNAME PROFILE
------------------------------ ----------------------------------------
QUEST ORACLE_SYSTEM
REMOTE_SCHEDULER_AGENT ORACLE_SYSTEM
DBSFWUSER ORACLE_SYSTEM
GGSYS ORACLE_SYSTEM
SYSRAC ORACLE_SYSTEM
CTXSYS ORACLE_SYSTEM
SYS$UMF ORACLE_SYSTEM
7 rows selected.
COUNT(*) OWNER
---------- ------------------------------------------------------------
1 SCG_MYACCT_CUSTOM3
oraracq53-
01,dbq09,20211226,19.3.0,QA,10.53.52.0/22,PRIMARY,4158104461,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,N,Y,Y,N,Y,N,Y,Y
-------------------------------------------------------------------------------- ------------------------------
------------------------------
SQL>
SQL>
System altered.
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.13.0.0.0
[oracle@oraracq53-01 scripts]$
Instance dbq092 is running on node oraracq53-02 with online services scgma_dbq09_q3. Instance
status: Open.
Instance dbq093 is running on node oraracq53-03 with online services scgma_dbq09_q3. Instance
status: Open.
Upgraded from 12c to 19c is done successfully with post steps as well.