Oracle Database

Upgrade Database timezone file in oracle 19c upgrade

Upgrade Timezone file

We may need to upgrade database timezone file during database upgrade from 11g to 19c. Below recommend action is from preupgrade.jar information tool.

Upgrade the database time zone file using the DBMS_DST package.

The database is using time zone file version 14 and the target 19 release ships with time zone file version 32.

Oracle recommends upgrading to the desired (latest) version of the time zone file.  For more information, refer to "Upgrading the Time Zone File and Timestamp with Time Zone Data" in the 19 Oracle Database Globalization Support Guide.

Below are the steps to Upgrade the database timezone file

Connect to sqlplus and start the database in upgrade mode

sqlplus / as sysdba
shutdown immediate;
startup upgrade;

Check the current timezone file version

SELECT * FROM v$timezone_file;

--output:
SQL> SELECT * FROM v$timezone_file;

FILENAME		VERSION     CON_ID
-------------------- ---------- ----------
timezlrg_14.dat 	     14 	 0

Start the upgrade window

SET SERVEROUTPUT ON
DECLARE
l_tz_version PLS_INTEGER;
BEGIN
l_tz_version := DBMS_DST.get_latest_timezone_version;
DBMS_OUTPUT.put_line('l_tz_version=' || l_tz_version);
DBMS_DST.begin_upgrade(l_tz_version);
END;

--output
SQL> SET SERVEROUTPUT ON
DECLARE
l_tz_version PLS_INTEGER;
BEGIN
l_tz_version := DBMS_DST.get_latest_timezone_version;
DBMS_OUTPUT.put_line('l_tz_version=' || l_tz_version);
DBMS_DST.begin_upgrade(l_tz_version);
END;
/SQL>   2    3    4    5    6    7    8
l_tz_version=32
An upgrade window has been successfully started.

PL/SQL procedure successfully completed.

Start the database in normal mode

shutdown immediate;
startup;

Do the upgrade

SET SERVEROUTPUT ON
DECLARE
  l_failures   PLS_INTEGER;
BEGIN
  DBMS_DST.upgrade_database(l_failures);
  DBMS_OUTPUT.put_line('DBMS_DST.upgrade_database : l_failures=' || l_failures);
  DBMS_DST.end_upgrade(l_failures);
  DBMS_OUTPUT.put_line('DBMS_DST.end_upgrade : l_failures=' || l_failures);
END;


--output
SQL> SET SERVEROUTPUT ON
DECLARE
  l_failures   PLS_INTEGER;
BEGIN
  DBMS_DST.upgrade_database(l_failures);
  DBMS_OUTPUT.put_line('DBMS_DST.upgrade_database : l_failures=' || l_failures);
  DBMS_DST.end_upgrade(l_failures);
  DBMS_OUTPUT.put_line('DBMS_DST.end_upgrade : l_failures=' || l_failures);
END;
/SQL>   2    3    4    5    6    7    8    9  
Table list: "MDSYS"."SDO_DIAG_MESSAGES_TABLE"
Number of failures: 0
.
.
<output truncated>
.
.
Table list: "GSMADMIN_INTERNAL"."AQ$_CHANGE_LOG_QUEUE_TABLE_S"
Number of failures: 0
DBMS_DST.upgrade_database : l_failures=0
An upgrade window has been successfully ended.
DBMS_DST.end_upgrade : l_failures=0

PL/SQL procedure successfully completed.

SQL> 

Check the new timezone settings

SELECT * FROM v$timezone_file;

--output
SQL> SELECT * FROM v$timezone_file;

FILENAME		VERSION     CON_ID
-------------------- ---------- ----------
timezlrg_32.dat 	     32 	 0

Timezone file has been upgraded to version 32.

Oracle 19c database installation on Linux

19c database installation

Description:

In this post I will describe the step by step installation of Oracle database 19c 64-bit on Oracle Linux 7 64-bit and creation of a single instance 19c database.

We will be covering the following steps:

  1. Oracle Database Installation Prerequisites
  2. Installation of Oracle 19.3.0.0 binaries
  3. Creation of single instance database

Download the software binaries from the below link:
https://www.oracle.com/database/technologies/oracle19c-linux-downloads.html

1. Oracle Database Installation Prerequisites

Start a terminal session and enter the following command as root:

# yum install oracle-database-preinstall-19c

Create the directories where Oracle binaries has to be installed:

# mkdir -p /u01/app/oracle/product/19.3.0/dbhome_1
# chown -R oracle:oinstall /u01
# chmod -R 775 /u01

Set the environment variables:
Edit /home/oracle/.bash_profile and add the below lines,

# Oracle ENV Settings
export TMP=/tmp
export TMPDIR=$TMP

export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/19.3.0/dbhome_1
export ORA_INVENTORY=/u01/app/oraInventory
export ORACLE_UNQNAME=db19c
export ORACLE_SID=db19c
export PDB_NAME=pdb1
export PATH=/usr/sbin:/usr/local/bin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

Unzip the database binary software:
Switch to ORACLE_HOME directory and unzip the database binary software,


# cd $ORACLE_HOME
# unzip /u01/software/db-soft/LINUX.X64_193000_db_home.zip

2. Installation of Oracle 19.3.0.0 binaries

Log into the oracle user and set the environment variables.

Here I am using VNC viewer to do the installation in graphical mode. Refer the link to Install and configure VNC Server on Linux 7

# cd /home/oracle
# . .bash_profile
# cd $ORACLE_HOME
# ./runInstaller

Click on Set Up Software only

Select the Single instance database installation

Choose Enterprise Edition

Verify the ORACLE_BASE and ORACLE_HOME locations

Select the OS Groups for the installation

Uncheck the Automatically run configuration scripts, Here we will do this manually

Verify the prerequisite output

Install the missing packages and click on Check again

# yum install kmod-20-21*
# yum install kmod-libs-20-21*

Check Summary and click on Install

Run root.sh script as root user

Database binary installation completed.

3. Creation of single instance database using DBCA

Login to oracle user run dbca. The dbca utility is typically located in ORACLE_HOME/bin directory.

Choose Create a database

Select Advance configuration, In Advanced configuration, you can customize storage locations, management database options, and different passwords for Admin user accounts.

Choose Database type: Oracle single instance database and General Purpose or Transaction Processing template

Provide the Global database name & SID
Enable Create as Container database and provide the PDB name

Choose File System and Provide the Database files location details

Enable Specify Fast Recovery Area and provide the location and size

If no listener is available, create a new one

Data Vault Option,

Choose Automatic Memory Management (if your physical memory is less than 4 GB) and Provide the Memory Target.

Note: If the total physical memory of your database instance is greater than 4 GB, then you cannot select the Use Automatic Memory Management option. Instead, use automatic shared memory management.

Specify the Processes count, This will be the maximum number of processes that can simultaneously connect to the database.

Use Unicode (AL32UTF8) Select this option to support multiple languages for your database users and database applications

Management Option

specify the passwords for the administrative accounts such as SYSSYSTEM, and PDBADMIN.

Choose Create database and and click on Next

Review the summary information and click on Finish

Database created successfully..

[oracle@ol7-dev software]$ export ORACLE_SID=db19c
[oracle@ol7-dev software]$ sqlplus

SQL*Plus: Release 19.0.0.0.0 - Production on Tue Nov 10 23:45:18 2020
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.

Enter user-name: /as sysdba

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL> select name, open_mode from v$database;

NAME      OPEN_MODE
--------- --------------------
DB19C     READ WRITE