Database Upgrade Steps From 12c To 19c - 26DEC21

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 54

Database upgrade steps from 12c to 19c.

===================================

*) Ensure that application down for the database upgrade.


*) once application down by application team, we will start the full database backup before
upgrading the database.
1) dbq01 3) dbq06 5) dbq08 7) agent13c
2) dbq03 4) dbq07 6) dbq09 8) +ASM
#? 6
Environment set: dbq09
Oracle Sid: dbq091
Oracle Home: /u01/app/oracle/oradbq09/product/12.1.0.2

[oracle@oraracq53-01 ~]$ srvctl status database -d dbq09 -v


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.
[oracle@oraracq53-01 ~]$
[oracle@oraracq53-01 ~]$ crontab -l|grep dbq09
00 23 * * * sh -c '. $HOME/oraenv.sh dbq09 ; $HOME/rdbms/scripts/dailyprocess.sh' >
/u01/app/oracle/oradbq09/admin/dbq09/job_lists/dailyprocess.lst 2>&1

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

*) Take the backup of oracle home for 12c.


cd $HOME/dguard/scripts
[oracle@oraracq53-01 scripts]$ ls -lrt back*
-rwxr-xr-x 1 oracle dba 4660 Mar 23 2021 backupMyHome.sh
[oracle@oraracq53-01 scripts]$
[oracle@oraracq53-01 scripts]$ ./backupMyHome.sh -h

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]$

*) Disable the crontab jobs for the database.


crontab -l|grep dbq09
crontab -e
crontab -l|grep dbq09

*) Create the blackout database in OEM.


*) Take the object count details.
SQL> create table upgrade_19c_objects as select * from dba_objects;
Table created.
SQL> select count(*) from dba_objects;
COUNT(*)
----------
94603
SQL> select count(*) from upgrade_19c_objects;
COUNT(*)
----------
94603
*) Take a pfile backup and database configuration and service details using srvctl:-

SQL> create pfile='/backup00/oradbq09/upgrade/initupgrade12c.ora' from spfile;

File created.

SQL> !srvctl status database -d dbq09 -v

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.

SQL> !srvctl config database -d dbq09 -a

Database unique name: dbq09

Database name:

Oracle home: /u01/app/oracle/oradbq09/product/12.1.0.2


Oracle user: oracle

Spfile: +DATA/dbq09/spfiledbq09.ora

Password file: +DATA/DBQ09/orapwdbq09

Domain:

Start options: open

Stop options: immediate

Database role: PRIMARY

Management policy: AUTOMATIC

Server pools:

Disk Groups: DATA,FRA

Mount point paths:

Services: scgma_dbq09_q3

Type: RAC

Start concurrency:

Stop concurrency:

Database is enabled

Database is individually enabled on nodes:

Database is individually disabled on nodes:

OSDBA group: dba

OSOPER group: dba

Database instances: dbq091,dbq092,dbq093

Configured nodes: oraracq53-01,oraracq53-02,oraracq53-03

Database is administrator managed

SQL> !srvctl config service -d dbq09 -s scgma_dbq09_q3 -a

Warning:-a option has been deprecated and will be ignored.

Service name: scgma_dbq09_q3

Server pool:

Cardinality: 3
Disconnect: false

Service role: PRIMARY

Management policy: AUTOMATIC

DTP transaction: false

AQ HA notifications: false

Global: false

Commit Outcome: false

Failover type:

Failover method:

TAF failover retries:

TAF failover delay:

Connection Load Balancing Goal: LONG

Runtime Load Balancing Goal: NONE

TAF policy specification: NONE

Edition:

Pluggable database name:

Maximum lag time: ANY

SQL Translation Profile:

Retention: 86400 seconds

Replay Initiation Time: 300 seconds

Session State Consistency: DYNAMIC

GSM Flags: 0

Service is enabled

Preferred instances: dbq091,dbq092,dbq093

Available instances:
*) Create restore point on the database.
SQL> show parameter compatible

NAME TYPE VALUE


------------------------------------ ----------- ------------------------------
compatible string 12.1.0.2.0
noncdb_compatible boolean FALSE
SQL>
SQL>
SQL> create restore point before_upgrade_12c_to_19c_26DEC21 guarantee flashback database;
Restore point created.
SQL> select name from v$restore_point;

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]$

[oracle@oraracq53-01 admin]$ cd $ORACLE_HOME/jdk/bin


[oracle@oraracq53-01 bin]$ pwd
/u01/app/oracle/oradbq09/product/12.1.0.2/jdk/bin
[oracle@oraracq53-01 bin]$
[oracle@oraracq53-01 bin]$
[oracle@oraracq53-01 bin]$ java -jar
/u01/app/oracle/oradbq09/product/19.3.0/rdbms/admin/preupgrade.jar FILE DIR
/backup00/oradbq09/upgrade
==================
PREUPGRADE SUMMARY
==================
/backup00/oradbq09/upgrade/preupgrade.log
/backup00/oradbq09/upgrade/preupgrade_fixups.sql
/backup00/oradbq09/upgrade/postupgrade_fixups.sql

Execute fixup scripts as indicated below:

Before upgrade:

Log into the database and execute the preupgrade fixups


@/backup00/oradbq09/upgrade/preupgrade_fixups.sql

After the upgrade:

Log into the database and execute the postupgrade fixups


@/backup00/oradbq09/upgrade/postupgrade_fixups.sql

Preupgrade complete: 2021-12-26T20:19:20


[oracle@oraracq53-01 bin]$ cat /backup00/oradbq09/upgrade/preupgrade.log|more
Report generated by Oracle Database Pre-Upgrade Information Tool Version
19.0.0.0.0 Build: 11 on 2021-12-26T20:19:20

Upgrade-To version: 19.0.0.0.0

=======================================
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

Oracle Component Upgrade Action Current Status


---------------- -------------- --------------
Oracle Server [to be upgraded] VALID
JServer JAVA Virtual Machine [to be upgraded] VALID
Oracle XDK for Java [to be upgraded] VALID
Real Application Clusters [to be upgraded] VALID
Oracle Workspace Manager [to be upgraded] VALID
Oracle Text [to be upgraded] VALID
Oracle XML Database [to be upgraded] VALID
Oracle Java Packages [to be upgraded] VALID

*
* 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.

The database contains 5 objects in the recycle bin.

The recycle bin must be completely empty before database upgrade.


RECOMMENDED ACTIONS
===================
2. Ensure there is adequate tablespace for the upgrade.

Auto Min Size


Tablespace Size Extend For Upgrade Action
---------- ---------- -------- ----------- --------
SYSTEM 5120 MB ENABLED 3262 MB Adjust
datafile
MAXBYTES

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.

3. Run 12.1.0.2.0 $ORACLE_HOME/rdbms/admin/utlrp.sql to recompile invalid


objects. You can view the individual invalid objects with

SET SERVEROUTPUT ON;


EXECUTE DBMS_PREUP.INVALID_OBJECTS;

3 objects are INVALID.

There should be no INVALID objects in SYS/SYSTEM or user schemas before


database upgrade.

4. Perform one of the following:


1) Expire user accounts that use only the old 10G password version and
follow the procedure recommended in Oracle Database Upgrade Guide under
the section entitled, "Checking for Accounts Using Case-Insensitive
Password Version".
2) Explicitly set SQLNET.ALLOWED_LOGON_VERSION_SERVER in the 19
SQLNET.ORA to a non-Exclusive Mode value, such as "11". (This is a short
term approach and is not recommended because it will retain known
security risks associated with the 10G password version.)

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.

5. (AUTOFIXUP) Gather stale data dictionary statistics prior to database


upgrade in off-peak time using:

EXECUTE DBMS_STATS.GATHER_DICTIONARY_STATS;

Dictionary statistics do not exist or are stale (not up-to-date).

Dictionary statistics help the Oracle optimizer find efficient SQL


execution plans and are essential for proper upgrade timing. Oracle
recommends gathering dictionary statistics in the last 24 hours before
database upgrade.
For information on managing optimizer statistics, refer to the 12.1.0.2
Oracle Database SQL Tuning Guide.

INFORMATION ONLY
================
6. Here are ALL the 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

Review the information before upgrading.

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.

8. Here is a count of invalid objects by Oracle-maintained users:

Oracle-Maintained User Name Number of INVALID Objects


--------------------------- -------------------------
PUBLIC 1
SYS 1

Review the information before upgrading.

9. Here is a count of invalid objects by Application users:

Application User Name Number of INVALID Objects


--------------------------- -------------------------
SCG_MYACCT_CUSTOM3 1

Review the information before upgrading.

ORACLE GENERATED FIXUP SCRIPT


=============================
All of the issues in database DBQ09
which are identified above as BEFORE UPGRADE "(AUTOFIXUP)" can be resolved by
executing the following

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.

Found 2 user directory objects to be checked: DATA_PUMP_DIR1,


OPATCH_TEMP_DIR.

Starting in Release 18c, symbolic links are not allowed in directory


object paths used with BFILE data types, the UTL_FILE package, or
external tables.

11. (AUTOFIXUP) Gather dictionary statistics after the upgrade using the
command:

EXECUTE DBMS_STATS.GATHER_DICTIONARY_STATS;

Oracle recommends gathering dictionary statistics after upgrade.

Dictionary statistics provide essential information to the Oracle


optimizer to help it find efficient SQL execution plans. After a database
upgrade, statistics need to be re-gathered as there can now be tables
that have significantly changed during the upgrade or new tables that do
not have statistics gathered yet.

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;

This recommendation is given for all preupgrade runs.

Fixed object statistics provide essential information to the Oracle


optimizer to help it find efficient SQL execution plans. Those
statistics are specific to the Oracle Database release that generates
them, and can be stale upon database upgrade.

For information on managing optimizer statistics, refer to the 12.1.0.2


Oracle Database SQL Tuning Guide.

ORACLE GENERATED FIXUP SCRIPT


=============================
All of the issues in database DBQ09
which are identified above as AFTER UPGRADE "(AUTOFIXUP)" can be resolved by
executing the following

SQL>@/backup00/oradbq09/upgrade/postupgrade_fixups.sql

[oracle@oraracq53-01 bin]$
Purge recyclebin: -

As per recommended by running preupgrade scripts, We should implement the recommendation.


SQL> select count(*) from dba_recyclebin;

COUNT(*)
----------
5
SQL> purge dba_recyclebin;

DBA Recyclebin purged.

SQL> select count(*) from dba_recyclebin;

COUNT(*)
----------
0
*) Increase the system tablespaces maxbytes size.

SQL> set lines 200


SQL> select file_name,bytes/1024/1024,AUTOEXTENSIBLE,MAXBYTES,MAXBLOCKS from
dba_Data_files where tablespace_name='SYSTEM';

FILE_NAME BYTES/1024/1024 AUT MAXBYTES


MAXBLOCKS
---------------------------------------------------------------------- --------------- --- ---------- ----------
+DATA/DBQ09/DATAFILE/system.479.1051866145 5120 YES 2147483648
262144

SQL> alter database datafile '+DATA/DBQ09/DATAFILE/system.479.1051866145' autoextend on


maxsize 30g;

Database altered.

SQL> select file_name,bytes/1024/1024,AUTOEXTENSIBLE,MAXBYTES,MAXBLOCKS from


dba_Data_files where tablespace_name='SYSTEM';

FILE_NAME BYTES/1024/1024 AUT MAXBYTES


MAXBLOCKS
---------------------------------------------------------------------- --------------- --- ---------- ----------
+DATA/DBQ09/DATAFILE/system.479.1051866145 5120 YES 3.2212E+10
3932160

*) Run the utlrp.sql


SQL> @?/rdbms/admin/utlrp.sql

Run 12.1.0.2.0 $ORACLE_HOME/rdbms/admin/utlrp.sql to recompile invalid

objects. You can view the individual invalid objects with


SQL> SET SERVEROUTPUT ON;

SQL> EXECUTE DBMS_PREUP.INVALID_OBJECTS;

SYS/SYSTEM INVALID OBJECTS

OWNER |OBJECT_NAME |OBJECT_TYPE

--------------------------------------------------------------------------------------------------------------------------------

SYS CDB_JAVA_POLICY VIEW

NON SYS/SYSTEM INVALID OBJECTS

OWNER |OBJECT_NAME |OBJECT_TYPE

--------------------------------------------------------------------------------------------------------------------------------

PUBLIC CDB_JAVA_POLICY SYNONYM

SCG_MYACCT_CUSTOM3 BATCH_JOB_STATUS VIEW


PL/SQL procedure successfully completed.

SQL> set pages 1000

SQL> select dbms_metadata.get_ddl('VIEW','CDB_JAVA_POLICY','SYS') from dual;

DBMS_METADATA.GET_DDL('VIEW','CDB_JAVA_POLICY','SYS')

CREATE OR REPLACE FORCE NONEDITIONABLE VIEW "SYS"."CDB_JAVA_POLICY" CONTAINER

_DATA

("KIND", "GRANTEE", "TYPE_SCHEMA", "TYPE_NAME", "NAME", "ACTION", "ENABLED", "S

EQ", "CON_ID", "CON$NAME" INVISIBLE, "CDB$NAME" INVISIBLE, "CON$ERRNUM" INVISIBL

E, "CON$ERRMSG" INVISIBLE) AS

SELECT k."KIND",k."GRANTEE",k."TYPE_SCHEMA",k."TYPE_NAME",k."NAME",k."ACTION",

k."ENABLED",k."SEQ",k."CON_ID", k.CON$NAME, k.CDB$NAME, k.CON$ERRNUM, k.CON$ERRM

SG FROM CONTAINERS("SYS"."DBA_JAVA_POLICY") k

SQL>

SQL> alter view sys.CDB_JAVA_POLICY compile;

Warning: View altered with compilation errors.

We can drop the invalid objects after taking the metadata bkp.

SQL> SQL> DROP VIEW sys.CDB_JAVA_POLICY;

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"

SQL> drop SYNONYM public.CDB_JAVA_POLICY;

drop SYNONYM public.CDB_JAVA_POLICY

ERROR at line 1:

ORA-00995: missing or invalid synonym identifier

SQL> drop public SYNONYM CDB_JAVA_POLICY;

Synonym dropped.

SQL>

SQL>

SQL> select object_name,object_type,status,owner from dba_objects where status='INVALID';

OBJECT_NAME OBJECT_TYPE
STATUS

--------------------------------------------------------------------------------------------------------------------------------
----------------------- -------

OWNER

--------------------------------------------------------------------------------------------------------------------------------

BATCH_JOB_STATUS VIEW
INVALID

SCG_MYACCT_CUSTOM3

SQL> alter view SCG_MYACCT_CUSTOM3.BATCH_JOB_STATUS compile;


Warning: View altered with compilation errors.

Disable Logon Trigger

alter TRIGGER SYSTEM.SEU_REQUIRE_NONDEFAULT_SERVICE disable;

*) Dictionary gather stats :-

SQL> EXECUTE DBMS_STATS.GATHER_DICTIONARY_STATS;


PL/SQL procedure successfully completed.

SQL> EXECUTE DBMS_STATS.GATHER_FIXED_OBJECTS_STATS;

PL/SQL procedure successfully completed

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.

[oracle@oraracq53-01 log]$ cat $HOME/oratab_env

# 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

# db name|oracle home|bkup base|bkup instance|day of full|RMAN target|snap Y/N|db uname|stdby


partner|stdby uname
#

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.

PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed.

Package created.

No errors.

Package body created.

PL/SQL procedure successfully completed.

No errors.

Package created.
No errors.

Package body created.

No errors.

Executing Oracle POST-Upgrade Fixup Script

Auto-Generated by: Oracle Preupgrade Script

Version: 19.0.0.0.0 Build: 11

Generated on: 2021-12-26 20:19:20

For Source Database: DBQ09

Source Database Version: 12.1.0.2.0

For Upgrade to Version: 19.0.0.0.0

Preup Preupgrade

Action Issue Is

Number Preupgrade Check Name Remedied Further DBA Action

------ ------------------------ ---------- --------------------------------

10. dir_symlinks YES None.

11. post_dictionary YES None.

12. post_fixed_objects NO Informational only.

Further action is optional.

The fixup scripts have been run and resolved what they can. However,

there are still issues originally identified by the preupgrade that

have not been remedied and are still present in the database.

Depending on the severity of the specific issue, and the nature of

the issue itself, that could mean that your database upgrade is not

fully complete. To resolve the outstanding issues, start by reviewing

the postupgrade_fixups.sql and searching it for the name of

the failed CHECK NAME or Preupgrade Action Number listed above.


There you will find the original corresponding diagnostic message

from the preupgrade which explains in more detail what still needs

to be done.

PL/SQL procedure successfully completed.

Session altered.

SQL> show parameter cluster_

NAME TYPE VALUE

------------------------------------ ----------- ------------------------------

cdb_cluster_name string

cluster_database boolean TRUE

cluster_database_instances integer 3

cluster_interconnects string

SQL>

SQL>

SQL> col COMP_NAME form a40

SQL> set lines 200

SQL> select COMP_ID,COMP_NAME,VERSION,STATUS from dba_registry;


COMP_ID COMP_NAME VERSION STATUS

------------------------------ ---------------------------------------- ------------------------------ -----------

CATALOG Oracle Database Catalog Views 19.0.0.0.0 VALID

CATPROC Oracle Database Packages and Types 19.0.0.0.0 VALID

JAVAVM JServer JAVA Virtual Machine 19.0.0.0.0 VALID

XML Oracle XDK 19.0.0.0.0 VALID

CATJAVA Oracle Database Java Packages 19.0.0.0.0 VALID

RAC Oracle Real Application Clusters 19.0.0.0.0 VALID

XDB Oracle XML Database 19.0.0.0.0 VALID

OWM Oracle Workspace Manager 19.0.0.0.0 VALID

CONTEXT Oracle Text 19.0.0.0.0 VALID

9 rows selected.

SQL> show parameter spfile

NAME TYPE VALUE

------------------------------------ ----------- ------------------------------

spfile string +DATA/dbq09/spfiledbq09.ora


SQL> show parameter comp

NAME TYPE VALUE

------------------------------------ ----------- ------------------------------

cell_offload_compaction string ADAPTIVE

compatible string 12.1.0.2.0

db_index_compression_inheritance string NONE

inmemory_prefer_xmem_memcompress string

nls_comp string BINARY

noncdb_compatible boolean FALSE

plsql_v2_compatibility boolean FALSE

SQL>

SQL>

SQL> select name from v$restore_point;

NAME

--------------------------------------------------------------------------------

BEFORE_DOWNGRADING_19C_12C_21DEC21

BEFORE_UPGRADE_12C_19C_19DEC21

GRP_1639978734875

BEFORE_UPGRADE_12C_TO_19C_26DEC21

GRP_1640582688680

SQL>

SQL> !srvctl config database -d dbq09 -a

Database unique name: dbq09


Database name:

Oracle home: /u01/app/oracle/oradbq09/product/19.3.0

Oracle user: oracle

Spfile: +DATA/dbq09/spfiledbq09.ora

Password file: +DATA/DBQ09/orapwdbq09

Domain:

Start options: open

Stop options: immediate

Database role: PRIMARY

Management policy: AUTOMATIC

Server pools:

Disk Groups: DATA,FRA

Mount point paths:

Services: scgma_dbq09_q3

Type: RAC

Start concurrency:

Stop concurrency:

Database is enabled

Database is individually enabled on nodes:

Database is individually disabled on nodes:

OSDBA group: dba

OSOPER group: dba

Database instances: dbq091,dbq092,dbq093

Configured nodes: oraracq53-01,oraracq53-02,oraracq53-03

CSS critical: no

CPU count: 0

Memory target: 0

Maximum memory: 0

Default network number for database services:


Database is administrator managed

SQL> !srvctl config service -d dbq09 -s scgma_dbq09_q3

Service name: scgma_dbq09_q3

Server pool:

Cardinality: 3

Service role: PRIMARY

Management policy: AUTOMATIC

DTP transaction: false

AQ HA notifications: false

Global: false

Commit Outcome: false

Failover type:

Failover method:

Failover retries:

Failover delay:

Failover restore: NONE

Connection Load Balancing Goal: LONG

Runtime Load Balancing Goal: NONE

TAF policy specification: NONE

Edition:

Pluggable database name:

Hub service:

Maximum lag time: ANY

SQL Translation Profile:

Retention: 86400 seconds

Replay Initiation Time: 300 seconds

Drain timeout:

Stop option:
Session State Consistency: DYNAMIC

GSM Flags: 0

Service is enabled

Preferred instances: dbq091,dbq092,dbq093

Available instances:

CSS critical: no

Service uses Java: false

SQL>Enable the logon triggers:-

SQL> ALTER TRIGGER SYSTEM.SEU_REQUIRE_NONDEFAULT_SERVICE enable;

Trigger altered.

Post checks for Sempra standard:-

[oracle@oraracq53-01 scripts]$ ls -lrt ch*

-rwxr-xr-x 1 oracle dba 3234 Aug 26 2020 check_asm_space.sh

-rwxr-xr-x 1 oracle dba 4727 Sep 17 2020 check_if_standby_current.sh

-rwxr-xr-x 1 oracle dba 42088 Mar 23 2021 check_database.sh.createdIssue

-rwxr-xr-x 1 oracle dba 42370 Mar 23 2021 check_database.sh

-rwxr-xr-x 1 oracle dba 2252 May 11 2021 check_all_outstanding_alerts.sh

-rwxr-xr-x 1 oracle dba 7648 May 11 2021 check_composite_group.sh

-rwxr-xr-x 1 oracle dba 4637 Aug 3 14:15 check_if_homes_patched_same.sh

[oracle@oraracq53-01 scripts]$ ./check_database.sh -h

Argmument: Comment
----------------------------------------------------------------

-db DBNAME - Database to check

-dir DIRECTORY - If provided we score database to this dir

[oracle@oraracq53-01 scripts]$

[oracle@oraracq53-01 scripts]$ echo $ORACLE_SID

dbq091

[oracle@oraracq53-01 scripts]$ ./check_database.sh -db dbq09

Issue in SpFileCheck : Our spfile reference of in the pfile does not match
+DATA/DBQ09/SPFILEDBQ09.ORA

Issue in SpFileCheck : Our pfile /u01/app/oracle/oradbq09/product/19.3.0/dbs/initdbq091.ora different


size then oraracq53-02:/u01/app/oracle/oradbq09/product/19.3.0/dbs/initdbq092.ora

Issue in SpFileCheck : Our pfile /u01/app/oracle/oradbq09/product/19.3.0/dbs/initdbq091.ora different


size then oraracq53-03:/u01/app/oracle/oradbq09/product/19.3.0/dbs/initdbq093.ora

Issue in RacTNSCheck : tns /u01/app/oracle/oradbq09/product/19.3.0/network/admin/tnsnames.ora on


oraracq53-02 is different

Issue in RacTNSCheck : tns /u01/app/oracle/oradbq09/product/19.3.0/network/admin/tnsnames.ora on


oraracq53-03 is different

Issue in ProfileCheck : Standard profiles missing

Issue in ProfileCheck : OPS$ORACLE account missing privileges on DATA_PUMP_DIR

Issue in ProfileCheck : App scheamas without SEUXXX profiles exist

USERNAME PROFILE

------------------------------ ----------------------------------------

REMOTE_SCHEDULER_AGENT DEFAULT

DBSFWUSER DEFAULT

GGSYS DEFAULT

SYSRAC DEFAULT

SYS$UMF DEFAULT

QUEST ORACLE_SYSTEM
CTXSYS ORACLE_SYSTEM

7 rows selected.

Issue in InvalidObjects : invalid objects exist

COUNT(*) OWNER

---------- ------------------------------------------------------------

1 SCG_MYACCT_CUSTOM3

Issue in DataPumpDirectory : /u01/app/oracle/oradbq09/product/12.1.0.2/rdbms/log/ is under /u01

Issue in PatchCheck : _enable_ptime_update_for_sys is set to FALSE

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

[oracle@oraracq53-01 dbs]$ cat initdbq091.ora

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 dbs]$ ls -lrt

[oracle@oraracq53-01 scripts]$

[oracle@oraracq53-01 scripts]$

SQL>

Create the softlink for spfile in oracle_home/dbs location for all three nodes..

[oracle@oraracq53-01 dbs]$ cp -pr initdbq091.ora initdbq091.ora_bkp_26dec2021

[oracle@oraracq53-01 dbs]$ vi initdbq091.ora

Spfile=’+DATA/DBQ09/spfiledbq09.ora’

[oracle@oraracq53-01 dbs]$

[oracle@oraracq53-01 dbs]$ scp initdbq091.ora


oracle@oraracq53-02:/u01/app/oracle/oradbq09/product/19.3.0/dbs/initdbq092.ora

initdbq091.ora 100% 37 33.2KB/s


00:00

[oracle@oraracq53-01 dbs]$ scp initdbq091.ora


oracle@oraracq53-03:/u01/app/oracle/oradbq09/product/19.3.0/dbs/initdbq093.ora

initdbq091.ora 100% 37 36.3KB/s


00:00

[oracle@oraracq53-01 dbs]$

Copy the tnsnames.ora file from 12c home to 19c home in all three nodes.

[oracle@oraracq53-01 admin]$ pwd

/u01/app/oracle/oradbq09/product/19.3.0/network/admin

[oracle@oraracq53-01 admin]$
[oracle@oraracq53-01 admin]$

[oracle@oraracq53-01 admin]$ scp tnsnames.ora


oracle@oraracq53-02:/u01/app/oracle/oradbq09/product/19.3.0/network/admin

tnsnames.ora 100% 1319 1.4MB/s


00:00

[oracle@oraracq53-01 admin]$ scp tnsnames.ora


oracle@oraracq53-03:/u01/app/oracle/oradbq09/product/19.3.0/network/admin

tnsnames.ora 100% 1319 1.4MB/s


00:00

[oracle@oraracq53-01 admin]$

SQL> alter user REMOTE_SCHEDULER_AGENT profile ORACLE_SYSTEM;

User altered.

SQL> alter user DBSFWUSER profile ORACLE_SYSTEM;

User altered.

SQL> alter user GGSYS profile ORACLE_SYSTEM;

User altered.

SQL> alter user SYSRAC profile ORACLE_SYSTEM;

User altered.

SQL> alter user SYS$UMF profile ORACLE_SYSTEM;

User altered.

SQL> exit

[oracle@oraracq53-01 scripts]$ ./check_database.sh -db dbq09

Issue in ProfileCheck : Standard profiles missing

Issue in ProfileCheck : OPS$ORACLE account missing privileges on DATA_PUMP_DIR


Issue in ProfileCheck : App scheamas without SEUXXX profiles exist

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.

Issue in InvalidObjects : invalid objects exist

COUNT(*) OWNER

---------- ------------------------------------------------------------

1 SCG_MYACCT_CUSTOM3

Issue in DataPumpDirectory : /u01/app/oracle/oradbq09/product/12.1.0.2/rdbms/log/ is under /u01

Issue in PatchCheck : _enable_ptime_update_for_sys is set to FALSE

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> /

OWNER DIRECTORY_NAME DIRECTORY_PATH


ORIGIN_CON_ID
------------------------------ ------------------------------------------------------------
---------------------------------------------------------------------- -------------

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_DIR1 /backup00/oradbq01/dpdump


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

SQL> create or replace directory DATA_PUMP_DIR as '/backup00/oradbq09/dpdump';

Directory created.
[oracle@oraracq53-01 scripts]$ ./check_database.sh -db dbq09

Issue in ProfileCheck : Standard profiles missing

Issue in ProfileCheck : App scheamas without SEUXXX profiles exist

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.

Issue in InvalidObjects : invalid objects exist

COUNT(*) OWNER

---------- ------------------------------------------------------------

1 SCG_MYACCT_CUSTOM3

Issue in PatchCheck : _enable_ptime_update_for_sys is set to FALSE

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> set pages 1000 line 150


col ParameterName SQL> for a30

col sessval for a30

col instval for a30

SELECT pi.ksppinm ParameterName, pcv.ksppstvl SessVal, psv.ksppstvl InstVal

FROM x$ksppi pi, x$ksppcv pcv, x$ksppsv psv

WHERE pi.indx = pcv.indx AND pi.indx = psv.indx AND pi.ksppinm LIKE


'_enable_ptime_update_for_sys';

PARAMETERNAME SESSVAL INSTVAL

-------------------------------------------------------------------------------- ------------------------------
------------------------------

_enable_ptime_update_for_sys FALSE FALSE

SQL>

SQL>

SQL> alter system set "_enable_ptime_update_for_sys"=TRUE scope=spfile;

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]$

[oracle@oraracq53-01 scripts]$ srvctl stop database -d dbq09 -o immediate

[oracle@oraracq53-01 scripts]$ srvctl status database -d dbq09 -v

Instance dbq091 is not running on node oraracq53-01

Instance dbq092 is not running on node oraracq53-02

Instance dbq093 is not running on node oraracq53-03

[oracle@oraracq53-01 scripts]$ srvctl start database -d dbq09

[oracle@oraracq53-01 scripts]$ srvctl status database -d dbq09 -v


Instance dbq091 is running on node oraracq53-01 with online services scgma_dbq09_q3. Instance
status: Open.

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.

Commentout for the crontab jobs in all the nodes;

Update the new oracle home in OEM.


End blackout in OEM:-

Upgraded from 12c to 19c is done successfully with post steps as well.

You might also like