Tuesday, March 25, 2025

How to change Apex Admin Password

  • Introduction: Oracle APEX is a low-code development platform that helps you build scalable, secure enterprise apps. To access the APEX, we need ADMIN credential.This guide will walk you through to change Apex Admin Password.
  • Prerequisites: Oracle Apex should be installed.
  • Environment Used:
    Hostname
    : apex
    IP: 192.168.101.10
    ORACLE_SID : APEXDB
    PDB: APEXPDB
    Apex: 24.1
    ORDS: 24.2

  • Now let's change the ADMIN password.

1. You will get below error if ADMIN password is incorrect.
2. Stop running ORDS services by killing its PID.

3. Now change the password using below steps:

[oracle@apex ~]$ cd /u02/app/oracle/apex24_1/apex/
[oracle@apex apex]$ ls
apexins1.sql 			apex_rest_config_nocdb.sql  apxdvins_nocdb.sql 
apxremov_nocdb.sql  		builder  devins.sql	apxrtins_nocdb.sql
apexins2.sql            	apex_rest_config.sql apxdvins.sql      
apexins3.sql            	appins.sql          apxdwngrd.sql      
apexins_adb.sql         	apxappcon.sql       apxpatch_cdb.sql   
apexins_cdb.sql         	apxchpwd.sql        apxpatch_nocdb.sql 
apexins_nocdb.sql       	apxdevrm_cdb.sql    apxpatch.sql       
apexins.sql             	apxdevrm_nocdb.sql  apxremov1.sql      
apex_rest_config_cdb.sql	apxdevrm.sql       apxremov2.sql      
apex_rest_config_core.sql 	apxdvins_cdb.sql  apxremov_cdb.sql   
apxremov.sql       		core          	images
apxrtins1.sql      		coreins2.sql  	install2024-09-25_04-11-58.log
apxrtins2.sql      		coreins3.sql  	LICENSE.txt
apxrtins3.sql      		coreins4.sql  	load_trans.sql
apxrtins_cdb.sql  		coreins5.sql  	utilities
coreins.sql			apxrtins.sql       dbcsconf.sql
apxsilentins.sql   dbcsins.sql	
[oracle@apex apex]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Mon Mar 24 18:12:21 2025
Version 19.24.0.0.0

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

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

SQL> show pdbs
     CON_ID CON_NAME                             OPEN MODE  RESTRICTED
---------- ------------------------------------- ---------- ----------
         2 PDB$SEED                             READ ONLY  NO
         3 APEXPDB                              READ WRITE NO

SQL> alter session set container=APEXPDB;

Session altered.

SQL> show pdbs
     CON_ID CON_NAME                             OPEN MODE  RESTRICTED
---------- ------------------------------------- ---------- ----------
         3 APEXPDB                              READ WRITE NO

SQL> @apxchpwd.sql
...set_appun.sql
================================================================================
This script can be used to change the password of an Oracle APEX
instance administrator. If the user does not yet exist, a user record will be
created.
================================================================================
Enter the administrator's username [ADMIN]
User "ADMIN" exists.
Enter ADMIN's email [xxxxxxxxxxx@gmail.com]
Enter ADMIN's password []    

----> Provide the password & keep a note of it.

Changed password of instance administrator ADMIN. SQL>
4. Now Access the Apex Admin via browser with new password:
http://192.168.101.10:8080/ords/apex_admin

Apex Admin Login
Admin Home

Thank you for reading!

I hope this content has been helpful to you. Your feedback and suggestions are always welcome — feel free to leave a comment or reach out with any queries.

Abhishek Shrivastava

📧 Email: oraeasyy@gmail.com
🌐 Website: www.oraeasy.com

Tuesday, March 18, 2025

How to upgrade timezone version file - TSTZ

  • Introduction: In Oracle, the timezone_file refers to the time zone data file that Oracle Database uses to store and manage time zone information. This file contains rules for daylight saving time and standard time for various regions. This guide will walk you through to update the timezone_file step-by-step.

  • Time Zone Files Location:
  • o Oracle stores time zone files in the $ORACLE_HOME/oracore/zoneinfo/ directory.
    o The files are named as timezlrg_XX.dat (large time zone file) and timezone_XX.dat (small time zone file), where XX represents the version number.

  • Prerequisites:
  • o Downtime required at Database end for 45 mins.

  • Environment:
  • Hostname: test
    IP: 192.168.101.15
    ORACLE_SID : orcl

  • Now let's upgrade the timezone_file step by step:
1. First check the current timezone file and also the available timezone file to be upgraded:

SQL> SELECT version FROM v$timezone_file;

   VERSION
----------
        32

SQL>
SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 ORCLPDB2                       READ WRITE NO
SQL>
SQL> alter session set container=ORCLPDB2;

Session altered.

SQL> SELECT version FROM v$timezone_file;

   VERSION
----------
        32

SQL>
SQL> exit

[oracle@test binaries]$ cd $ORACLE_HOME/oracore/zoneinfo/
[oracle@test zoneinfo]$ ls -lrth
total 49M
-rw-r--r--. 1 oracle oinstall  337K Dec 18  2012      timezone_13.dat
-rw-r--r--. 1 oracle oinstall  773K Dec 18  2012      timezlrg_14.dat
-rw-r--r--. 1 oracle oinstall  280K Dec 18  2012      timezone_4.dat
-rw-r--r--. 1 oracle oinstall  269K Dec 18  2012      timezone_2.dat
-rw-r--r--. 1 oracle oinstall  775K Jun 17  2014      timezlrg_10.dat
-rw-r--r--. 1 oracle oinstall  296K Dec  9  2015      timezone_8.dat
-rw-r--r--. 1 oracle oinstall  334K Dec  9  2015      timezone_17.dat
-rw-r--r--. 1 oracle oinstall  337K Dec  9  2015      timezone_14.dat
-rw-r--r--. 1 oracle oinstall  338K Dec  9  2015      timezone_11.dat
-rw-r--r--. 1 oracle oinstall  603K Dec  9  2015      timezlrg_8.dat
-rw-r--r--. 1 oracle oinstall  336K Jun 22  2016      timezone_22.dat
-rw-r--r--. 1 oracle oinstall  338K Jun 22  2016      timezone_10.dat
-rw-r--r--. 1 oracle oinstall  763K Jun 22  2016      timezlrg_25.dat
-rw-r--r--. 1 oracle oinstall  764K Jun 22  2016      timezlrg_18.dat
-rw-r--r--. 1 oracle oinstall  767K Jul 25  2016      timezlrg_27.dat
-rw-r--r--. 1 oracle oinstall  335K Jul 25  2016      timezone_27.dat
-rw-r--r--. 1 oracle oinstall  280K Aug 10  2016      timezone_3.dat
-rw-r--r--. 1 oracle oinstall  335K Aug 10  2016      timezone_26.dat
-rw-r--r--. 1 oracle oinstall  333K Aug 10  2016      timezone_25.dat
-rw-r--r--. 1 oracle oinstall  333K Aug 10  2016      timezone_24.dat
-rw-r--r--. 1 oracle oinstall  336K Aug 10  2016      timezone_23.dat
-rw-r--r--. 1 oracle oinstall  336K Aug 10  2016      timezone_21.dat
-rw-r--r--. 1 oracle oinstall  336K Aug 10  2016      timezone_20.dat
-rw-r--r--. 1 oracle oinstall  268K Aug 10  2016      timezone_1.dat
-rw-r--r--. 1 oracle oinstall  336K Aug 10  2016      timezone_19.dat
-rw-r--r--. 1 oracle oinstall  334K Aug 10  2016      timezone_18.dat
-rw-r--r--. 1 oracle oinstall  336K Aug 10  2016      timezone_16.dat
-rw-r--r--. 1 oracle oinstall  337K Aug 10  2016      timezone_15.dat
-rw-r--r--. 1 oracle oinstall  337K Aug 10  2016      timezone_12.dat
-rw-r--r--. 1 oracle oinstall  783K Aug 10  2016      timezlrg_9.dat
-rw-r--r--. 1 oracle oinstall  588K Aug 10  2016      timezlrg_7.dat
-rw-r--r--. 1 oracle oinstall  573K Aug 10  2016      timezlrg_6.dat
-rw-r--r--. 1 oracle oinstall  574K Aug 10  2016      timezlrg_5.dat
-rw-r--r--. 1 oracle oinstall  519K Aug 10  2016      timezlrg_4.dat
-rw-r--r--. 1 oracle oinstall  516K Aug 10  2016      timezlrg_3.dat
-rw-r--r--. 1 oracle oinstall  497K Aug 10  2016      timezlrg_2.dat
-rw-r--r--. 1 oracle oinstall  768K Aug 10  2016      timezlrg_26.dat
-rw-r--r--. 1 oracle oinstall  759K Aug 10  2016      timezlrg_24.dat
-rw-r--r--. 1 oracle oinstall  771K Aug 10  2016      timezlrg_23.dat
-rw-r--r--. 1 oracle oinstall  767K Aug 10  2016      timezlrg_22.dat
-rw-r--r--. 1 oracle oinstall  765K Aug 10  2016      timezlrg_21.dat
-rw-r--r--. 1 oracle oinstall  772K Aug 10  2016      timezlrg_20.dat
-rw-r--r--. 1 oracle oinstall  483K Aug 10  2016      timezlrg_1.dat
-rw-r--r--. 1 oracle oinstall  768K Aug 10  2016      timezlrg_19.dat
-rw-r--r--. 1 oracle oinstall  761K Aug 10  2016      timezlrg_17.dat
-rw-r--r--. 1 oracle oinstall  783K Aug 10  2016      timezlrg_16.dat
-rw-r--r--. 1 oracle oinstall  773K Aug 10  2016      timezlrg_15.dat
-rw-r--r--. 1 oracle oinstall  765K Aug 10  2016      timezlrg_13.dat
-rw-r--r--. 1 oracle oinstall  768K Aug 10  2016      timezlrg_12.dat
-rw-r--r--. 1 oracle oinstall  769K Aug 10  2016      timezlrg_11.dat
-rw-r--r--. 1 oracle oinstall  344K Aug 10  2016      timezone_9.dat
-rw-r--r--. 1 oracle oinstall  281K Aug 10  2016      timezone_7.dat
-rw-r--r--. 1 oracle oinstall  280K Aug 10  2016      timezone_6.dat
-rw-r--r--. 1 oracle oinstall  280K Aug 10  2016      timezone_5.dat
-rw-r--r--. 1 oracle oinstall  765K Sep 28  2016      timezlrg_28.dat
-rw-r--r--. 1 oracle oinstall  334K Sep 28  2016      timezone_28.dat
-rw-r--r--. 1 oracle oinstall  770K Dec  5  2016      timezlrg_29.dat
-rw-r--r--. 1 oracle oinstall  334K Dec  5  2016      timezone_29.dat
-rw-r--r--. 1 oracle oinstall  333K May  3  2017      timezone_30.dat
-rw-r--r--. 1 oracle oinstall  768K May  3  2017      timezlrg_30.dat
-rw-r--r--. 1 oracle oinstall  333K Nov  6  2017      timezone_31.dat
-rw-r--r--. 1 oracle oinstall  769K Nov  6  2017      timezlrg_31.dat
-rw-r--r--. 1 oracle oinstall   52K Jun 14  2018      timezdif.csv
-rw-r--r--. 1 oracle oinstall   59K Jun 14  2018      readme.txt
-rw-r--r--. 1 oracle oinstall  333K Jun 20  2018      timezone_32.dat
-rw-r--r--. 1 oracle oinstall  769K Jun 20  2018      timezlrg_32.dat
-rw-r--r--. 1 oracle oinstall  400K Jul 14  2024      timezone_43.dat
-rw-r--r--. 1 oracle oinstall  400K Jul 14  2024      timezone_42.dat
-rw-r--r--. 1 oracle oinstall  397K Jul 14  2024      timezone_41.dat
-rw-r--r--. 1 oracle oinstall  407K Jul 14  2024      timezone_40.dat
-rw-r--r--. 1 oracle oinstall  407K Jul 14  2024      timezone_39.dat
-rw-r--r--. 1 oracle oinstall  411K Jul 14  2024      timezone_38.dat
-rw-r--r--. 1 oracle oinstall  411K Jul 14  2024      timezone_37.dat
-rw-r--r--. 1 oracle oinstall  411K Jul 14  2024      timezone_36.dat
-rw-r--r--. 1 oracle oinstall  411K Jul 14  2024      timezone_35.dat
-rw-r--r--. 1 oracle oinstall  414K Jul 14  2024      timezone_34.dat
-rw-r--r--. 1 oracle oinstall  416K Jul 14  2024      timezone_33.dat
-rw-r--r--. 1 oracle oinstall  923K Jul 14  2024      timezlrg_43.dat
-rw-r--r--. 1 oracle oinstall  923K Jul 14  2024      timezlrg_42.dat
-rw-r--r--. 1 oracle oinstall  921K Jul 14  2024      timezlrg_41.dat
-rw-r--r--. 1 oracle oinstall  955K Jul 14  2024      timezlrg_40.dat
-rw-r--r--. 1 oracle oinstall  970K Jul 14  2024      timezlrg_39.dat
-rw-r--r--. 1 oracle oinstall 1009K Jul 14  2024      timezlrg_38.dat
-rw-r--r--. 1 oracle oinstall 1009K Jul 14  2024      timezlrg_37.dat
-rw-r--r--. 1 oracle oinstall 1019K Jul 14  2024      timezlrg_36.dat
-rw-r--r--. 1 oracle oinstall 1018K Jul 14  2024      timezlrg_35.dat
-rw-r--r--. 1 oracle oinstall 1021K Jul 14  2024      timezlrg_34.dat
-rw-r--r--. 1 oracle oinstall 1021K Jul 14  2024      imezlrg_33.dat
-rw-r--r--. 1 oracle oinstall   74K Jul 14  2024      readme_43.txt
-rw-r--r--. 1 oracle oinstall   74K Jul 14  2024      readme_42.txt
-rw-r--r--. 1 oracle oinstall   74K Jul 14  2024      readme_41.txt
-rw-r--r--. 1 oracle oinstall   74K Jul 14  2024      readme_40.txt
-rw-r--r--. 1 oracle oinstall   74K Jul 14  2024      readme_39.txt
-rw-r--r--. 1 oracle oinstall   74K Jul 14  2024      readme_38.txt
-rw-r--r--. 1 oracle oinstall   74K Jul 14  2024      readme_37.txt
-rw-r--r--. 1 oracle oinstall   74K Jul 14  2024      readme_36.txt
-rw-r--r--. 1 oracle oinstall   74K Jul 14  2024      readme_35.txt
-rw-r--r--. 1 oracle oinstall   74K Jul 14  2024      readme_34.txt
-rw-r--r--. 1 oracle oinstall   74K Jul 14  2024      readme_33.txt
drwxr-xr-x. 2 oracle oinstall  4.0K Oct 14 02:31      big
drwxr-xr-x. 2 oracle oinstall  4.0K Oct 14 02:31      little
[oracle@test zoneinfo]$

As per the above the current timezone file is 32. Also we have maximum available timezone file is 43, so that we can upgrade till timezone file 43.

2.Now run the utltz_* scripts present in $ORACLE_HOME/rdbms/admin/ to upgrade timezone file. We need to run the same for CDB & each PDBs:
At CDB:

[oracle@test admin]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Thu Mar 6 04:10:47 2025
Version 19.24.0.0.0

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

Connected to:
Oracle Database 19c Standard Edition 2 Release 19.0.0.0.0 - Production
Version 19.24.0.0.0

SQL>
SQL> @$ORACLE_HOME/rdbms/admin/utltz_countstats.sql

Session altered.

.
Amount of TSTZ data using num_rows stats info in DBA_TABLES.
.

For SYS tables first ...
Note: empty tables are not listed.
Stat date - Owner.TableName.ColumnName - num_rows
17/04/2019 - SYS.AQ$_ALERT_QT_S.CREATION_TIME - 3
17/04/2019 - SYS.AQ$_ALERT_QT_S.DELETION_TIME - 3
17/04/2019 - SYS.AQ$_ALERT_QT_S.MODIFICATION_TIME - 3
17/04/2019 - SYS.AQ$_AQ$_MEM_MC_S.CREATION_TIME - 3
17/04/2019 - SYS.AQ$_AQ$_MEM_MC_S.DELETION_TIME - 3
17/04/2019 - SYS.AQ$_AQ$_MEM_MC_S.MODIFICATION_TIME - 3
17/04/2019 - SYS.AQ$_AQ_PROP_TABLE_S.CREATION_TIME - 1
17/04/2019 - SYS.AQ$_AQ_PROP_TABLE_S.DELETION_TIME - 1
17/04/2019 - SYS.AQ$_AQ_PROP_TABLE_S.MODIFICATION_TIME - 1
17/04/2019 - SYS.AQ$_ORA$PREPLUGIN_BACKUP_QTB_S.CREATION_TIME - 1
17/04/2019 - SYS.AQ$_ORA$PREPLUGIN_BACKUP_QTB_S.DELETION_TIME - 1
17/04/2019 - SYS.AQ$_ORA$PREPLUGIN_BACKUP_QTB_S.MODIFICATION_TIME - 1
17/04/2019 - SYS.AQ$_PDB_MON_EVENT_QTABLE$_S.CREATION_TIME - 1
17/04/2019 - SYS.AQ$_PDB_MON_EVENT_QTABLE$_S.DELETION_TIME - 1
17/04/2019 - SYS.AQ$_PDB_MON_EVENT_QTABLE$_S.MODIFICATION_TIME - 1
17/04/2019 - SYS.AQ$_SCHEDULER$_EVENT_QTAB_S.CREATION_TIME - 3
17/04/2019 - SYS.AQ$_SCHEDULER$_EVENT_QTAB_S.DELETION_TIME - 3
17/04/2019 - SYS.AQ$_SCHEDULER$_EVENT_QTAB_S.MODIFICATION_TIME - 3
17/04/2019 - SYS.AQ$_SCHEDULER$_REMDB_JOBQTAB_S.CREATION_TIME - 1
17/04/2019 - SYS.AQ$_SCHEDULER$_REMDB_JOBQTAB_S.DELETION_TIME - 1
17/04/2019 - SYS.AQ$_SCHEDULER$_REMDB_JOBQTAB_S.MODIFICATION_TIME - 1
17/04/2019 - SYS.AQ$_SCHEDULER_FILEWATCHER_QT_S.CREATION_TIME - 1
17/04/2019 - SYS.AQ$_SCHEDULER_FILEWATCHER_QT_S.DELETION_TIME - 1
17/04/2019 - SYS.AQ$_SCHEDULER_FILEWATCHER_QT_S.MODIFICATION_TIME - 1
17/04/2019 - SYS.AQ$_SUBSCRIBER_TABLE.CREATION_TIME - 1
17/04/2019 - SYS.AQ$_SUBSCRIBER_TABLE.DELETION_TIME - 1
17/04/2019 - SYS.AQ$_SUBSCRIBER_TABLE.MODIFICATION_TIME - 1
17/04/2019 - SYS.AQ$_SYS$SERVICE_METRICS_TAB_S.CREATION_TIME - 4
17/04/2019 - SYS.AQ$_SYS$SERVICE_METRICS_TAB_S.DELETION_TIME - 4
17/04/2019 - SYS.AQ$_SYS$SERVICE_METRICS_TAB_S.MODIFICATION_TIME - 4
17/04/2019 - SYS.KET$_AUTOTASK_STATUS.ABA_START_TIME - 1
17/04/2019 - SYS.KET$_AUTOTASK_STATUS.ABA_STATE_TIME - 1
17/04/2019 - SYS.KET$_AUTOTASK_STATUS.MW_RECORD_TIME - 1
17/04/2019 - SYS.KET$_AUTOTASK_STATUS.MW_START_TIME - 1
17/04/2019 - SYS.KET$_AUTOTASK_STATUS.RECONCILE_TIME - 1
17/04/2019 - SYS.KET$_CLIENT_CONFIG.FIELD_2 - 7
17/04/2019 - SYS.KET$_CLIENT_CONFIG.LAST_CHANGE - 7
15/10/2024 - SYS.OPTSTAT_HIST_CONTROL$.SPARE6 - 45
15/10/2024 - SYS.OPTSTAT_HIST_CONTROL$.SVAL2 - 45
15/10/2024 - SYS.OPTSTAT_SNAPSHOT$.TIMESTAMP - 84
17/04/2019 - SYS.OPTSTAT_USER_PREFS$.CHGTIME - 72
17/04/2019 - SYS.RADM_FPTM$.TSWTZ_COL - 1
17/04/2019 - SYS.REG$.NTFN_GROUPING_START_TIME - 2
17/04/2019 - SYS.REG$.REG_TIME - 2
17/04/2019 - SYS.SCHEDULER$_EVENT_LOG.LOG_DATE - 29
17/04/2019 - SYS.SCHEDULER$_GLOBAL_ATTRIBUTE.ATTR_TSTAMP - 11
17/04/2019 - SYS.SCHEDULER$_JOB.END_DATE - 21
17/04/2019 - SYS.SCHEDULER$_JOB.LAST_ENABLED_TIME - 21
17/04/2019 - SYS.SCHEDULER$_JOB.LAST_END_DATE - 21
17/04/2019 - SYS.SCHEDULER$_JOB.LAST_START_DATE - 21
17/04/2019 - SYS.SCHEDULER$_JOB.NEXT_RUN_DATE - 21
17/04/2019 - SYS.SCHEDULER$_JOB.START_DATE - 21
17/04/2019 - SYS.SCHEDULER$_SCHEDULE.END_DATE - 4
17/04/2019 - SYS.SCHEDULER$_SCHEDULE.REFERENCE_DATE - 4
17/04/2019 - SYS.SCHEDULER$_WINDOW.ACTUAL_START_DATE - 9
17/04/2019 - SYS.SCHEDULER$_WINDOW.END_DATE - 9
17/04/2019 - SYS.SCHEDULER$_WINDOW.LAST_START_DATE - 9
17/04/2019 - SYS.SCHEDULER$_WINDOW.MANUAL_OPEN_TIME - 9
17/04/2019 - SYS.SCHEDULER$_WINDOW.NEXT_START_DATE - 9
17/04/2019 - SYS.SCHEDULER$_WINDOW.START_DATE - 9
Total numrows of SYS TSTZ columns is : 70713
There are in total 169 SYS TSTZ columns.

.
For non-SYS tables ...
Note: empty tables are not listed.
Stat date - Owner.Tablename.Columnname - num_rows
17/04/2019 - GSMADMIN_INTERNAL.AQ$_CHANGE_LOG_QUEUE_TABLE_S.CREATION_TIME - 1
17/04/2019 - GSMADMIN_INTERNAL.AQ$_CHANGE_LOG_QUEUE_TABLE_S.DELETION_TIME - 1
17/04/2019 - GSMADMIN_INTERNAL.AQ$_CHANGE_LOG_QUEUE_TABLE_S.MODIFICATION_TIME -1
17/04/2019 - WMSYS.AQ$_WM$EVENT_QUEUE_TABLE_S.CREATION_TIME - 1
17/04/2019 - WMSYS.AQ$_WM$EVENT_QUEUE_TABLE_S.DELETION_TIME - 1
17/04/2019 - WMSYS.AQ$_WM$EVENT_QUEUE_TABLE_S.MODIFICATION_TIME - 1
17/04/2019 - WMSYS.WM$WORKSPACES_TABLE$.CREATETIME - 1
17/04/2019 - WMSYS.WM$WORKSPACES_TABLE$.LAST_CHANGE - 1
Total numrows of non-SYS TSTZ columns is : 8
There are in total 20 non-SYS TSTZ columns.
Total Minutes elapsed : 0
Session altered.

SQL>

SQL>

SQL> @$ORACLE_HOME/rdbms/admin/utltz_countstar.sql

Session altered.

.
Estimating amount of TSTZ data using COUNT(*).
This might take some time ...
.

For SYS tables first ...
Note: empty tables are not listed.
Owner.TableName.ColumnName - COUNT(*) of that column
SYS.AQ$_ALERT_QT_S.CREATION_TIME - 4
SYS.AQ$_ALERT_QT_S.DELETION_TIME - 4
SYS.AQ$_ALERT_QT_S.MODIFICATION_TIME - 4
SYS.AQ$_AQ$_MEM_MC_S.CREATION_TIME - 3
SYS.AQ$_AQ$_MEM_MC_S.DELETION_TIME - 3
SYS.AQ$_AQ$_MEM_MC_S.MODIFICATION_TIME - 3
SYS.AQ$_AQ_PROP_TABLE_S.CREATION_TIME - 1
SYS.AQ$_AQ_PROP_TABLE_S.DELETION_TIME - 1
SYS.AQ$_AQ_PROP_TABLE_S.MODIFICATION_TIME - 1
SYS.AQ$_ORA$PREPLUGIN_BACKUP_QTB_S.CREATION_TIME - 1
SYS.AQ$_ORA$PREPLUGIN_BACKUP_QTB_S.DELETION_TIME - 1
SYS.AQ$_ORA$PREPLUGIN_BACKUP_QTB_S.MODIFICATION_TIME - 1
SYS.AQ$_PDB_MON_EVENT_QTABLE$_S.CREATION_TIME - 1
SYS.AQ$_PDB_MON_EVENT_QTABLE$_S.DELETION_TIME - 1
SYS.AQ$_PDB_MON_EVENT_QTABLE$_S.MODIFICATION_TIME - 1
SYS.AQ$_SCHEDULER$_EVENT_QTAB_S.CREATION_TIME - 3
SYS.AQ$_SCHEDULER$_EVENT_QTAB_S.DELETION_TIME - 3
SYS.AQ$_SCHEDULER$_EVENT_QTAB_S.MODIFICATION_TIME - 3
SYS.AQ$_SCHEDULER$_REMDB_JOBQTAB_S.CREATION_TIME - 1
SYS.AQ$_SCHEDULER$_REMDB_JOBQTAB_S.DELETION_TIME - 1
SYS.AQ$_SCHEDULER$_REMDB_JOBQTAB_S.MODIFICATION_TIME - 1
SYS.AQ$_SCHEDULER_FILEWATCHER_QT_S.CREATION_TIME - 1
SYS.AQ$_SCHEDULER_FILEWATCHER_QT_S.DELETION_TIME - 1
SYS.AQ$_SCHEDULER_FILEWATCHER_QT_S.MODIFICATION_TIME - 1
SYS.AQ$_SUBSCRIBER_TABLE.CREATION_TIME - 1
SYS.AQ$_SUBSCRIBER_TABLE.DELETION_TIME - 1
SYS.AQ$_SUBSCRIBER_TABLE.MODIFICATION_TIME - 1
SYS.AQ$_SYS$SERVICE_METRICS_TAB_S.CREATION_TIME - 4
SYS.AQ$_SYS$SERVICE_METRICS_TAB_S.DELETION_TIME - 4
SYS.AQ$_SYS$SERVICE_METRICS_TAB_S.MODIFICATION_TIME - 4
SYS.ATSK$_SCHEDULE_CONTROL.MRCT_TASK_TIME_TZ - 1
SYS.KET$_AUTOTASK_STATUS.ABA_START_TIME - 1
SYS.KET$_AUTOTASK_STATUS.ABA_STATE_TIME - 1
SYS.KET$_AUTOTASK_STATUS.MW_RECORD_TIME - 1
SYS.KET$_AUTOTASK_STATUS.MW_START_TIME - 1
SYS.KET$_AUTOTASK_STATUS.RECONCILE_TIME - 1
SYS.KET$_CLIENT_CONFIG.FIELD_2 - 7
SYS.KET$_CLIENT_CONFIG.LAST_CHANGE - 7
SYS.OPTSTAT_HIST_CONTROL$.SPARE6 - 45
SYS.OPTSTAT_HIST_CONTROL$.SVAL2 - 45
SYS.OPTSTAT_SNAPSHOT$.TIMESTAMP - 1015
SYS.OPTSTAT_USER_PREFS$.CHGTIME - 72
SYS.RADM_FPTM$.TSWTZ_COL - 1
SYS.REG$.NTFN_GROUPING_START_TIME - 2
SYS.REG$.REG_TIME - 2
SYS.SCHEDULER$_EVENT_LOG.LOG_DATE - 18
SYS.SCHEDULER$_GLOBAL_ATTRIBUTE.ATTR_TSTAMP - 11
SYS.SCHEDULER$_JOB.END_DATE - 22
SYS.SCHEDULER$_JOB.LAST_ENABLED_TIME - 22
SYS.SCHEDULER$_JOB.LAST_END_DATE - 22
SYS.SCHEDULER$_JOB.LAST_START_DATE - 22
SYS.SCHEDULER$_JOB.NEXT_RUN_DATE - 22
SYS.SCHEDULER$_JOB.START_DATE - 22
SYS.SCHEDULER$_JOB_RUN_DETAILS.LOG_DATE - 18
SYS.SCHEDULER$_JOB_RUN_DETAILS.REQ_START_DATE - 18
SYS.SCHEDULER$_JOB_RUN_DETAILS.START_DATE - 18
SYS.SCHEDULER$_SCHEDULE.END_DATE - 4
SYS.SCHEDULER$_SCHEDULE.REFERENCE_DATE - 4
SYS.SCHEDULER$_WINDOW.ACTUAL_START_DATE - 9
SYS.SCHEDULER$_WINDOW.END_DATE - 9
SYS.SCHEDULER$_WINDOW.LAST_START_DATE - 9
SYS.SCHEDULER$_WINDOW.MANUAL_OPEN_TIME - 9
SYS.SCHEDULER$_WINDOW.NEXT_START_DATE - 9
SYS.SCHEDULER$_WINDOW.START_DATE - 9
SYS.WRI$_ALERT_HISTORY.CREATION_TIME - 46
SYS.WRI$_ALERT_HISTORY.TIME_SUGGESTED - 46
SYS.WRI$_OPTSTAT_HISTHEAD_HISTORY.SAVTIME - 3213
SYS.WRI$_OPTSTAT_HISTHEAD_HISTORY.SPARE6 - 3213
SYS.WRI$_OPTSTAT_IND_HISTORY.SAVTIME - 248
SYS.WRI$_OPTSTAT_IND_HISTORY.SPARE6 - 248
SYS.WRI$_OPTSTAT_OPR.END_TIME - 27
SYS.WRI$_OPTSTAT_OPR.SPARE6 - 27
SYS.WRI$_OPTSTAT_OPR.START_TIME - 27
SYS.WRI$_OPTSTAT_OPR_TASKS.END_TIME - 602
SYS.WRI$_OPTSTAT_OPR_TASKS.SPARE6 - 602
SYS.WRI$_OPTSTAT_OPR_TASKS.START_TIME - 602
SYS.WRI$_OPTSTAT_TAB_HISTORY.SAVTIME - 297
SYS.WRI$_OPTSTAT_TAB_HISTORY.SPARE6 - 297
SYS.WRM$_DATABASE_INSTANCE.STARTUP_TIME_TZ - 6
SYS.WRM$_SNAPSHOT.BEGIN_INTERVAL_TIME_TZ - 2
SYS.WRM$_SNAPSHOT.END_INTERVAL_TIME_TZ - 2
SYS.XS$PRIN.END_DATE - 15
SYS.XS$PRIN.START_DATE - 15
Total count * of SYS TSTZ columns is : 11074
There are in total 169 SYS TSTZ columns.

.
For non-SYS tables ...
Note: empty tables are not listed.
Owner.TableName.ColumnName - COUNT(*) of that column
GSMADMIN_INTERNAL.AQ$_CHANGE_LOG_QUEUE_TABLE_S.CREATION_TIME - 1
GSMADMIN_INTERNAL.AQ$_CHANGE_LOG_QUEUE_TABLE_S.DELETION_TIME - 1
GSMADMIN_INTERNAL.AQ$_CHANGE_LOG_QUEUE_TABLE_S.MODIFICATION_TIME - 1
WMSYS.AQ$_WM$EVENT_QUEUE_TABLE_S.CREATION_TIME - 1
WMSYS.AQ$_WM$EVENT_QUEUE_TABLE_S.DELETION_TIME - 1
WMSYS.AQ$_WM$EVENT_QUEUE_TABLE_S.MODIFICATION_TIME - 1
WMSYS.WM$WORKSPACES_TABLE$.CREATETIME - 1
WMSYS.WM$WORKSPACES_TABLE$.LAST_CHANGE - 1
Total count * of non-SYS TSTZ columns is : 8
There are in total 20 non-SYS TSTZ columns.
Total Minutes elapsed : 0

Session altered.

SQL>



SQL> @$ORACLE_HOME/rdbms/admin/utltz_upg_check.sql

Session altered.

INFO: Starting with RDBMS DST update preparation.
INFO: NO actual RDBMS DST update will be done by this script.
INFO: If an ERROR occurs the script will EXIT sqlplus.
INFO: Doing checks for known issues ...
INFO: Database version is 19.0.0.0 .
INFO: This database is a Multitenant database.
INFO: Current container is CDB$ROOT .
INFO: Updating the RDBMS DST version of the CDB / CDB$ROOT database
INFO: will NOT update the RDBMS DST version of PDB databases in this CDB.
WARNING: There are 1 open PDBs .
WARNING: They will be closed when running utltz_upg_apply.sql .
INFO: Database RDBMS DST version is DSTv32 .
INFO: No known issues detected.
INFO: Now detecting new RDBMS DST version.
A prepare window has been successfully started.
INFO: Newest RDBMS DST version detected is DSTv43 .
INFO: Next step is checking all TSTZ data.
INFO: It might take a while before any further output is seen ...
A prepare window has been successfully ended.
INFO: A newer RDBMS DST version than the one currently used is found.
INFO: Note that NO DST update was yet done.
INFO: Now run utltz_upg_apply.sql to do the actual RDBMS DST update.
INFO: Note that the utltz_upg_apply.sql script will
INFO: restart the database 2 times WITHOUT any confirmation or prompt.

Session altered.

SQL>
SQL>
SQL> @$ORACLE_HOME/rdbms/admin/utltz_upg_apply.sql

Session altered.

INFO: If an ERROR occurs, the script will EXIT SQL*Plus.
INFO: The database RDBMS DST version will be updated to DSTv43 .
INFO: This database is a Multitenant database.
INFO: Current container is CDB$ROOT .
INFO: Updating the RDBMS DST version of the CDB / CDB$ROOT database
INFO: will NOT update the RDBMS DST version of PDB databases in this CDB.
WARNING: There are 1 open PDBs .
WARNING: They will be closed when CDB$ROOT is restarted
WARNING: This script will restart the database 2 times
WARNING: WITHOUT asking ANY confirmation.
WARNING: Hit control-c NOW if this is not intended.
INFO: Restarting the database in UPGRADE mode to start the DST upgrade.
Database closed.
Database dismounted.
ORACLE instance shut down.
ORACLE instance started.

Total System Global Area 1459616616 bytes
Fixed Size 9177960 bytes
Variable Size 855638016 bytes
Database Buffers 587202560 bytes
Redo Buffers 7598080 bytes
Database mounted.
Database opened.

INFO: Starting the RDBMS DST upgrade.
INFO: Upgrading all SYS owned TSTZ data.
INFO: It might take time before any further output is seen ...
An upgrade window has been successfully started.
INFO: Restarting the database in NORMAL mode to upgrade non-SYS TSTZ data.
Database closed.
Database dismounted.
ORACLE instance shut down.
ORACLE instance started.

Total System Global Area 1459616616 bytes
Fixed Size 9177960 bytes
Variable Size 855638016 bytes
Database Buffers 587202560 bytes
Redo Buffers 7598080 bytes
Database mounted.
Database opened.

INFO: Upgrading all non-SYS TSTZ data.
INFO: It might take time before any further output is seen ...
INFO: Do NOT start any application yet that uses TSTZ data!
INFO: Next is a list of all upgraded tables:
Table list: "GSMADMIN_INTERNAL"."AQ$_CHANGE_LOG_QUEUE_TABLE_L"
Number of failures: 0
Table list: "GSMADMIN_INTERNAL"."AQ$_CHANGE_LOG_QUEUE_TABLE_S"
Number of failures: 0
Table list: "MDSYS"."SDO_DIAG_MESSAGES_TABLE"
Number of failures: 0
Table list: "DVSYS"."AUDIT_TRAIL$"
Number of failures: 0
Table list: "DVSYS"."SIMULATION_LOG$"
Number of failures: 0
INFO: Total failures during update of TSTZ data: 0 .
An upgrade window has been successfully ended.
INFO: Your new Server RDBMS DST version is DSTv43 .
INFO: The RDBMS DST update is successfully finished.
INFO: Make sure to exit this SQL*Plus session.
INFO: Do not use it for timezone related selects.

Session altered.

SQL>
SQL> exit

At PDB:

[oracle@test admin]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Thu Mar 6 04:15:33 2025
Version 19.24.0.0.0

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

Connected to:
Oracle Database 19c Standard Edition 2 Release 19.0.0.0.0 - Production
Version 19.24.0.0.0

SQL> SELECT version FROM v$timezone_file;

VERSION
----------
        43

SQL> show pdbs

CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 ORCLPDB2                       READ WRITE NO

SQL> alter session set container=ORCLPDB2;

Session altered.

SQL> SELECT version FROM v$timezone_file;

VERSION
----------
        32

SQL> @$ORACLE_HOME/rdbms/admin/utltz_countstats.sql

Session altered.

.
Amount of TSTZ data using num_rows stats info in DBA_TABLES.
.
For SYS tables first ...
Note: empty tables are not listed.
Stat date  - Owner.TableName.ColumnName - num_rows
17/04/2019 - SYS.AQ$_ALERT_QT_S.CREATION_TIME - 3
17/04/2019 - SYS.AQ$_ALERT_QT_S.DELETION_TIME - 3
17/04/2019 - SYS.AQ$_ALERT_QT_S.MODIFICATION_TIME - 3
17/04/2019 - SYS.AQ$_AQ$_MEM_MC_S.CREATION_TIME - 3
17/04/2019 - SYS.AQ$_AQ$_MEM_MC_S.DELETION_TIME - 3
17/04/2019 - SYS.AQ$_AQ$_MEM_MC_S.MODIFICATION_TIME - 3
17/04/2019 - SYS.AQ$_AQ_PROP_TABLE_S.CREATION_TIME - 1
17/04/2019 - SYS.AQ$_AQ_PROP_TABLE_S.DELETION_TIME - 1
17/04/2019 - SYS.AQ$_AQ_PROP_TABLE_S.MODIFICATION_TIME - 1
17/04/2019 - SYS.AQ$_ORA$PREPLUGIN_BACKUP_QTB_S.CREATION_TIME - 1
17/04/2019 - SYS.AQ$_ORA$PREPLUGIN_BACKUP_QTB_S.DELETION_TIME - 1
17/04/2019 - SYS.AQ$_ORA$PREPLUGIN_BACKUP_QTB_S.MODIFICATION_TIME - 1
...
...
Total numrows of SYS TSTZ columns is : 82193
There are in total 169 SYS TSTZ columns.
.
For non-SYS tables ...
Note: empty tables are not listed.
Stat date  - Owner.Tablename.Columnname - num_rows
17/04/2019 - GSMADMIN_INTERNAL.AQ$_CHANGE_LOG_QUEUE_TABLE_S.CREATION_TIME - 1
17/04/2019 - GSMADMIN_INTERNAL.AQ$_CHANGE_LOG_QUEUE_TABLE_S.DELETION_TIME - 1
17/04/2019 - GSMADMIN_INTERNAL.AQ$_CHANGE_LOG_QUEUE_TABLE_S.MODIFICATION_TIME - 1
17/04/2019 - WMSYS.AQ$_WM$EVENT_QUEUE_TABLE_S.CREATION_TIME - 1
17/04/2019 - WMSYS.AQ$_WM$EVENT_QUEUE_TABLE_S.DELETION_TIME - 1
17/04/2019 - WMSYS.AQ$_WM$EVENT_QUEUE_TABLE_S.MODIFICATION_TIME - 1
17/04/2019 - WMSYS.WM$WORKSPACES_TABLE$.CREATETIME - 1
17/04/2019 - WMSYS.WM$WORKSPACES_TABLE$.LAST_CHANGE - 1
Total numrows of non-SYS TSTZ columns is : 8
There are in total 20 non-SYS TSTZ columns.
Total Minutes elapsed : 0

Session altered.

SQL>
SQL>
SQL> @$ORACLE_HOME/rdbms/admin/utltz_countstar.sql

Session altered.

Estimating amount of TSTZ data using COUNT(*).
This might take some time ...

For SYS tables first ...
Note: empty tables are not listed.
Owner.TableName.ColumnName - COUNT(*) of that column
SYS.AQ$_ALERT_QT_S.CREATION_TIME - 3
SYS.AQ$_ALERT_QT_S.DELETION_TIME - 3
SYS.AQ$_ALERT_QT_S.MODIFICATION_TIME - 3
SYS.AQ$_AQ$_MEM_MC_S.CREATION_TIME - 3
SYS.AQ$_AQ$_MEM_MC_S.DELETION_TIME - 3
SYS.AQ$_AQ$_MEM_MC_S.MODIFICATION_TIME - 3
SYS.AQ$_AQ_PROP_TABLE_S.CREATION_TIME - 1
SYS.AQ$_AQ_PROP_TABLE_S.DELETION_TIME - 1
SYS.AQ$_AQ_PROP_TABLE_S.MODIFICATION_TIME - 1
SYS.AQ$_ORA$PREPLUGIN_BACKUP_QTB_S.CREATION_TIME - 1
SYS.AQ$_ORA$PREPLUGIN_BACKUP_QTB_S.DELETION_TIME - 1
SYS.AQ$_ORA$PREPLUGIN_BACKUP_QTB_S.MODIFICATION_TIME - 1
SYS.AQ$_PDB_MON_EVENT_QTABLE$_S.CREATION_TIME - 1
SYS.AQ$_PDB_MON_EVENT_QTABLE$_S.DELETION_TIME - 1
SYS.AQ$_PDB_MON_EVENT_QTABLE$_S.MODIFICATION_TIME - 1
SYS.AQ$_SCHEDULER$_EVENT_QTAB_S.CREATION_TIME - 3
SYS.AQ$_SCHEDULER$_EVENT_QTAB_S.DELETION_TIME - 3
SYS.AQ$_SCHEDULER$_EVENT_QTAB_S.MODIFICATION_TIME - 3
SYS.AQ$_SCHEDULER$_REMDB_JOBQTAB_S.CREATION_TIME - 1
SYS.AQ$_SCHEDULER$_REMDB_JOBQTAB_S.DELETION_TIME - 1
SYS.AQ$_SCHEDULER$_REMDB_JOBQTAB_S.MODIFICATION_TIME - 1
SYS.AQ$_SCHEDULER_FILEWATCHER_QT_S.CREATION_TIME - 1
SYS.AQ$_SCHEDULER_FILEWATCHER_QT_S.DELETION_TIME - 1
SYS.AQ$_SCHEDULER_FILEWATCHER_QT_S.MODIFICATION_TIME - 1
SYS.AQ$_SUBSCRIBER_TABLE.CREATION_TIME - 1
SYS.AQ$_SUBSCRIBER_TABLE.DELETION_TIME - 1
SYS.AQ$_SUBSCRIBER_TABLE.MODIFICATION_TIME - 1
SYS.AQ$_SYS$SERVICE_METRICS_TAB_S.CREATION_TIME - 4
SYS.AQ$_SYS$SERVICE_METRICS_TAB_S.DELETION_TIME - 4
SYS.AQ$_SYS$SERVICE_METRICS_TAB_S.MODIFICATION_TIME - 4
SYS.ATSK$_SCHEDULE_CONTROL.MRCT_TASK_TIME_TZ - 1
SYS.KET$_AUTOTASK_STATUS.ABA_START_TIME - 1
SYS.KET$_AUTOTASK_STATUS.ABA_STATE_TIME - 1
SYS.KET$_AUTOTASK_STATUS.MW_RECORD_TIME - 1
SYS.KET$_AUTOTASK_STATUS.MW_START_TIME - 1
SYS.KET$_AUTOTASK_STATUS.RECONCILE_TIME - 1
SYS.KET$_CLIENT_CONFIG.FIELD_2 - 7
SYS.KET$_CLIENT_CONFIG.LAST_CHANGE - 7
SYS.OPTSTAT_HIST_CONTROL$.SPARE6 - 45
SYS.OPTSTAT_HIST_CONTROL$.SVAL2 - 45
SYS.OPTSTAT_SNAPSHOT$.TIMESTAMP - 740
SYS.OPTSTAT_USER_PREFS$.CHGTIME - 72
SYS.RADM_FPTM$.TSWTZ_COL - 1
SYS.REG$.NTFN_GROUPING_START_TIME - 2
SYS.REG$.REG_TIME - 2
SYS.SCHEDULER$_EVENT_LOG.LOG_DATE - 10
SYS.SCHEDULER$_GLOBAL_ATTRIBUTE.ATTR_TSTAMP - 11
SYS.SCHEDULER$_JOB.END_DATE - 20
SYS.SCHEDULER$_JOB.LAST_ENABLED_TIME - 20
SYS.SCHEDULER$_JOB.LAST_END_DATE - 20
SYS.SCHEDULER$_JOB.LAST_START_DATE - 20
SYS.SCHEDULER$_JOB.NEXT_RUN_DATE - 20
SYS.SCHEDULER$_JOB.START_DATE - 20
SYS.SCHEDULER$_JOB_RUN_DETAILS.LOG_DATE - 10
SYS.SCHEDULER$_JOB_RUN_DETAILS.REQ_START_DATE - 10
SYS.SCHEDULER$_JOB_RUN_DETAILS.START_DATE - 10
SYS.SCHEDULER$_SCHEDULE.END_DATE - 4
SYS.SCHEDULER$_SCHEDULE.REFERENCE_DATE - 4
SYS.SCHEDULER$_WINDOW.ACTUAL_START_DATE - 9
SYS.SCHEDULER$_WINDOW.END_DATE - 9
SYS.SCHEDULER$_WINDOW.LAST_START_DATE - 9
SYS.SCHEDULER$_WINDOW.MANUAL_OPEN_TIME - 9
SYS.SCHEDULER$_WINDOW.NEXT_START_DATE - 9
SYS.SCHEDULER$_WINDOW.START_DATE - 9
SYS.WRI$_OPTSTAT_HISTHEAD_HISTORY.SAVTIME - 3319
SYS.WRI$_OPTSTAT_HISTHEAD_HISTORY.SPARE6 - 3319
SYS.WRI$_OPTSTAT_IND_HISTORY.SAVTIME - 259
SYS.WRI$_OPTSTAT_IND_HISTORY.SPARE6 - 259
SYS.WRI$_OPTSTAT_OPR.END_TIME - 21
SYS.WRI$_OPTSTAT_OPR.SPARE6 - 21
SYS.WRI$_OPTSTAT_OPR.START_TIME - 21
SYS.WRI$_OPTSTAT_OPR_TASKS.END_TIME - 611
SYS.WRI$_OPTSTAT_OPR_TASKS.SPARE6 - 611
SYS.WRI$_OPTSTAT_OPR_TASKS.START_TIME - 611
SYS.WRI$_OPTSTAT_TAB_HISTORY.SAVTIME - 295
SYS.WRI$_OPTSTAT_TAB_HISTORY.SPARE6 - 295
SYS.XS$PRIN.END_DATE - 15
SYS.XS$PRIN.START_DATE - 15
Total count * of SYS TSTZ columns is : 10889
There are in total 169 SYS TSTZ columns.

For non-SYS tables ...
Note: empty tables are not listed.
Owner.TableName.ColumnName - COUNT(*) of that column
GSMADMIN_INTERNAL.AQ$_CHANGE_LOG_QUEUE_TABLE_S.CREATION_TIME - 1
GSMADMIN_INTERNAL.AQ$_CHANGE_LOG_QUEUE_TABLE_S.DELETION_TIME - 1
GSMADMIN_INTERNAL.AQ$_CHANGE_LOG_QUEUE_TABLE_S.MODIFICATION_TIME - 1
WMSYS.AQ$_WM$EVENT_QUEUE_TABLE_S.CREATION_TIME - 1
WMSYS.AQ$_WM$EVENT_QUEUE_TABLE_S.DELETION_TIME - 1
WMSYS.AQ$_WM$EVENT_QUEUE_TABLE_S.MODIFICATION_TIME - 1
WMSYS.WM$WORKSPACES_TABLE$.CREATETIME - 1
WMSYS.WM$WORKSPACES_TABLE$.LAST_CHANGE - 1
Total count * of non-SYS TSTZ columns is : 8
There are in total 20 non-SYS TSTZ columns.
Total Minutes elapsed : 0

Session altered.

SQL>
SQL>
SQL> @$ORACLE_HOME/rdbms/admin/utltz_upg_check.sql

Session altered.

INFO: Starting with RDBMS DST update preparation.
INFO: NO actual RDBMS DST update will be done by this script.
INFO: If an ERROR occurs the script will EXIT sqlplus.
INFO: Doing checks for known issues ...
INFO: Database version is 19.0.0.0 .
INFO: This database is a Multitenant database.
INFO: This database is a PDB.
INFO: Current PDB is ORCLPDB2 .
INFO: Database RDBMS DST version is DSTv32 .
INFO: No known issues detected.
INFO: Now detecting new RDBMS DST version.
A prepare window has been successfully started.
INFO: Newest RDBMS DST version detected is DSTv43 .
INFO: Next step is checking all TSTZ data.
INFO: It might take a while before any further output is seen ...
A prepare window has been successfully ended.
INFO: A newer RDBMS DST version than the one currently used is found.
INFO: Note that NO DST update was yet done.
INFO: Now run utltz_upg_apply.sql to do the actual RDBMS DST update.
INFO: Note that the utltz_upg_apply.sql script will
INFO: restart the database 2 times WITHOUT any confirmation or prompt.

Session altered.

SQL>

SQL>
SQL> @$ORACLE_HOME/rdbms/admin/utltz_upg_apply.sql

Session altered.

INFO: If an ERROR occurs, the script will EXIT SQL*Plus.
INFO: The database RDBMS DST version will be updated to DSTv43 .
INFO: This database is a Multitenant database.
INFO: This database is a PDB.
INFO: Current PDB is ORCLPDB2 .
WARNING: This script will restart the database 2 times
WARNING: WITHOUT asking ANY confirmation.
WARNING: Hit control-c NOW if this is not intended.
INFO: Restarting the database in UPGRADE mode to start the DST upgrade.
Pluggable Database closed.
Pluggable Database opened.
INFO: Starting the RDBMS DST upgrade.
INFO: Upgrading all SYS owned TSTZ data.
INFO: It might take time before any further output is seen ...
An upgrade window has been successfully started.
INFO: Restarting the database in NORMAL mode to upgrade non-SYS TSTZ data.
Pluggable Database closed.
Pluggable Database opened.
INFO: Upgrading all non-SYS TSTZ data.
INFO: It might take time before any further output is seen ...
INFO: Do NOT start any application yet that uses TSTZ data!

INFO: Next is a list of all upgraded tables:
Table list: "GSMADMIN_INTERNAL"."AQ$_CHANGE_LOG_QUEUE_TABLE_L"
Number of failures: 0
Table list: "GSMADMIN_INTERNAL"."AQ$_CHANGE_LOG_QUEUE_TABLE_S"
Number of failures: 0
Table list: "MDSYS"."SDO_DIAG_MESSAGES_TABLE"
Number of failures: 0
Table list: "DVSYS"."AUDIT_TRAIL$"
Number of failures: 0
Table list: "DVSYS"."SIMULATION_LOG$"
Number of failures: 0
INFO: Total failures during update of TSTZ data: 0 .
An upgrade window has been successfully ended.
INFO: Your new Server RDBMS DST version is DSTv43 .
INFO: The RDBMS DST update is successfully finished.
INFO: Make sure to exit this SQL*Plus session.
INFO: Do not use it for timezone related selects.

Session altered.

SQL> 
SQL> exit
3. Now take the bounce of database and check timezone file at both CDB & PDB level:

[oracle@test admin]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Thu Mar 6 04:28:19 2025
Version 19.24.0.0.0

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

Connected to:
Oracle Database 19c Standard Edition 2 Release 19.0.0.0.0 - Production
Version 19.24.0.0.0

SQL>
SQL>
SQL> shut immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
SQL>
SQL> startup
ORACLE instance started.

Total System Global Area 1459616616 bytes
Fixed Size                  9177960 bytes
Variable Size             855638016 bytes
Database Buffers          587202560 bytes
Redo Buffers                7598080 bytes
Database mounted.
Database opened.
SQL>
SQL> SELECT version FROM v$timezone_file;

VERSION
----------
43

SQL> alter session set container=ORCLPDB2;

Session altered.

SQL> SELECT version FROM v$timezone_file;

VERSION
----------
43

SQL> exit
Disconnected from Oracle Database 19c Standard Edition 2 Release 19.0.0.0.0 - Production
Version 19.24.0.0.0
[oracle@test admin]$


Thank you for reading!

I hope this content has been helpful to you. Your feedback and suggestions are always welcome — feel free to leave a comment or reach out with any queries.

Abhishek Shrivastava

📧 Email: oraeasyy@gmail.com
🌐 Website: www.oraeasy.com

Tuesday, March 11, 2025

How to change the DB name - DBNEWID Utility

  • Introduction: DBNEWID is a database utility that can change the internal database identifier (DBID) and the database name (DBNAME) for an operational database. This guide will walk you through the DBNEWID utility step-by-step.

  • Ramifications of Changing the DBID and DBNAME: Before you change the DBID and DBNAME of a database with the DBNEWID utility, review these guidelines. Also post changing the DBID/DBNAME previous backups and archivelogs will not be useful.

  • Syntax:
  • o To change both DBID & DBNAME: nid TARGET=sys/password@orcl DBNAME=orcl2
    o To change only DBNAME: nid TARGET=sys/password@orcl DBNAME=orcl2 SETNAME=YES
    o To change only DBID: nid TARGET=sys/password@orcl

  • Prerequisites:
  • o Downtime required at Database end for 30 mins.
    o Full RMAN DB backup to rollback in case of any issue.

  • Environment:
  • Hostname: apex
    IP: 192.168.101.7
    ORACLE_SID : APEXDB
    DB NAME: APEX

  • Now let's use DBNEWID utility to change DBNAME only step by step:
1. Check DB status and Create pfile :

SQL> select DBID, NAME, open_mode, database_role from v$database;

DBID        NAME      OPEN_MODE    DATABASE_ROLE
----------- --------- ------------ ---------------
3003259501  APEX      READ WRITE   PRIMARY

SQL> create pfile='/home/oracle/pfilebkp.ora' from spfile;
File created.

SQL> exit

2. Now shutdown the database and start in mount state :

SQL> shut immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup mount
ORACLE instance started.
Total System Global Area 1560280200 bytes
Fixed Size                  9178248 bytes
Variable Size            1342177280 bytes
Database Buffers          201326592 bytes
Redo Buffers                7598080 bytes
Database mounted.

SQL> select DBID, NAME, open_mode, database_role from v$database;
DBID        NAME      OPEN_MODE    DATABASE_ROLE
----------- --------- ------------ ----------------
3003259501  APEX      MOUNTED      PRIMARY

SQL>

3. Now run nid command to change DB name. Here we will change DB name from APEX to APEXDB

[oracle@apex ~]$ nid TARGET=/ DBNAME=apexdb SETNAME=YES

DBNEWID: Release 19.0.0.0.0 - Production on Thu Mar 6 20:28:05 2025

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

Connected to database APEX (DBID=3003259501)

Connected to server version 19.24.0
Control Files in database:
    /u02/app/oracle/oradata/APEXDB/control01.ctl
    /u02/app/oracle/fast_recovery_area/APEXDB/control02.ctl

Change database name of database APEX to APEXDB? (Y/[N]) => 

Y

Proceeding with operation Changing database name from APEX to APEXDB Control File /u02/app/oracle/oradata/APEXDB/control01.ctl - modified Control File /u02/app/oracle/fast_recovery_area/APEXDB/control02.ctl - modified Datafile /u02/app/oracle/oradata/APEXDB/system01.db - wrote new name Datafile /u02/app/oracle/oradata/APEXDB/sysaux01.db - wrote new name Datafile /u02/app/oracle/oradata/APEXDB/undotbs01.db - wrote new name Datafile /u02/app/oracle/oradata/APEXDB/pdbseed/system01.db - wrote new name Datafile /u02/app/oracle/oradata/APEXDB/pdbseed/sysaux01.db - wrote new name Datafile /u02/app/oracle/oradata/APEXDB/users01.db - wrote new name Datafile /u02/app/oracle/oradata/APEXDB/pdbseed/undotbs01.db - wrote new name Datafile /u02/app/oracle/oradata/APEXDB/apexpdb/system01.db - wrote new name Datafile /u02/app/oracle/oradata/APEXDB/apexpdb/sysaux01.db - wrote new name Datafile /u02/app/oracle/oradata/APEXDB/apexpdb/undotbs01.db - wrote new name Datafile /u02/app/oracle/oradata/APEXDB/apexpdb/users01.db - wrote new name Datafile /u02/app/oracle/oradata/APEXDB/apexpdb/apex232_01.db - wrote new name Datafile /u02/app/oracle/oradata/APEXDB/apexpdb/apex241_01.db - wrote new name Datafile /u02/app/oracle/oradata/APEXDB/apexpdb/test01.db - wrote new name Datafile /u02/app/oracle/oradata/APEXDB/apexpdb/statpack01.db - wrote new name Datafile /u02/app/oracle/oradata/APEXDB/temp01.db - wrote new name Datafile /u02/app/oracle/oradata/APEXDB/pdbseed/temp012024-09-25_00-10-37-758-AM.db - wrote new name Datafile /u02/app/oracle/oradata/APEXDB/apexpdb/temp01.db - wrote new name Control File /u02/app/oracle/oradata/APEXDB/control01.ctl - wrote new name Control File /u02/app/oracle/fast_recovery_area/APEXDB/control02.ctl - wrote new name Instance shut down Database name changed to APEXDB. Modify parameter file and generate a new password file before restarting. Successfully changed database name. DBNEWID - Completed successfully.
4. Now change DB name value in pfile from APEX to APEXDB. Then startup database with pfile.

[oracle@apex ~]$ cat pfilebkp.ora
apexdb.__data_transfer_cache_size=0
apexdb.__db_cache_size=150994944
apexdb.__inmemory_ext_roarea=0
apexdb.__inmemory_ext_rwarea=0
apexdb.__java_pool_size=184549376
apexdb.__large_pool_size=16777216
apexdb.__oracle_base='/u02/app/oracle' #ORACLE_BASE set from environment
apexdb.__pga_aggregate_target=536870912
apexdb.__sga_target=1023410176
apexdb.__shared_io_pool_size=50331648
apexdb.__shared_pool_size=603979776
apexdb.__streams_pool_size=0
apexdb.__unified_pga_pool_size=0
*.archive_lag_target=1200
*.audit_file_dest='/u02/app/oracle/admin/apexdb/adump'
*.audit_trail='db'
*.compatible='19.0.0'
*.control_files='/u02/app/oracle/oradata/APEXDB/control01.ctl','/u02/app/oracle/fast_recovery_area/APEXDB/control02.ctl'
*.db_block_size=8192
*.db_file_name_convert='/u02','/u01'
*.db_name='apexdb'
*.db_recovery_file_dest='/u02/app/oracle/fast_recovery_area'
*.db_recovery_file_dest_size=12732m
*.db_unique_name='APEXDBDC'
*.diagnostic_dest='/u02/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=apexdbXDB)'
*.enable_pluggable_database=true
*.log_archive_max_processes=30
*.memory_target=1476m
*.nls_language='AMERICAN'
*.nls_territory='AMERICA'
*.open_cursors=300
*.processes=300
*.remote_login_passwordfile='EXCLUSIVE'
*.standby_file_management='AUTO'
*.undo_tablespace='UNDOTBS1'

[oracle@apex ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Thu Mar 6 20:30:19 2025
Version 19.24.0.0.0

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

Connected to an idle instance.

SQL> startup pfile='/home/oracle/pfilebkp.ora';
ORACLE instance started.

Total System Global Area 1560280200 bytes
Fixed Size                  9178248 bytes
Variable Size            1342177280 bytes
Database Buffers          201326592 bytes
Redo Buffers                7598080 bytes
Database mounted.
Database opened.

SQL> select DBID, NAME, open_mode, database_role from v$database;

DBID        NAME      OPEN_MODE            DATABASE_ROLE
----------- --------- -------------------- ----------------
3003259501  APEXDB    READ WRITE           PRIMARY

SQL>

5. Now create spfile from pfile and then restart DB with spfile

SQL> create spfile from pfile='/home/oracle/pfilebkp.ora';

File created.

SQL> shut immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup
ORACLE instance started.

Total System Global Area 1560280200 bytes
Fixed Size                  9178248 bytes
Variable Size            1342177280 bytes
Database Buffers          201326592 bytes
Redo Buffers                7598080 bytes
Database mounted.
Database opened.

SQL> select DBID, NAME, open_mode, database_role from v$database;

DBID        NAME      OPEN_MODE            DATABASE_ROLE
----------- --------- -------------------- ----------------
3003259501  APEXDB    READ WRITE           PRIMARY

SQL>

6. Now change the DB name is listener.ora & tnsnames.ora file and reload the Listener. Also take full DB backup as old backups will be not useful.

Thank you for reading!

I hope this content has been helpful to you. Your feedback and suggestions are always welcome — feel free to leave a comment or reach out with any queries.

Abhishek Shrivastava

📧 Email: oraeasyy@gmail.com
🌐 Website: www.oraeasy.com

Tuesday, March 4, 2025

Switchover to Standby using DG Broker

  • Introduction: In Oracle, a switchover is a role transition operation between the primary and standby databases in a Data Guard environment. A switchover allows you to switch roles between the primary and standby databases in a planned manner, without data loss. This is typically done for maintenance, testing, or load balancing. Here we will do switchover activity using DG broker step-by-step.

  • Prerequisites:
  • o Downtime required at Database end for 30 mins.
    o Application and Database connectivity for Standby site.
    o Primary and Standby databases should be in sync.
    o DG Broker should be configured between Primary and Standby.

  • Environment:
  • Server Primary Standby
    Hostname Source Target
    IP 192.168.80.51 192.168.80.111
    OS OEL 9 OEL 9
    SID ORCLDC ORCLDR
    Service Name ORCLDC ORCLDR

  • Now start Switchover activity step by step:
1. Check DB status and sync between Primary and Standby
At Primary:

SQL> select NAME,DB_UNIQUE_NAME,DATABASE_ROLE,OPEN_MODE,SWITCHOVER_STATUS from v$database;

NAME       DB_UNIQUE_NAME                 DATABASE_ROLE     OPEN_MODE           SWITCHOVER_STATUS
---------  ------------------------------ ----------------  ------------------  --------------------
ORCL       ORCLDC                         PRIMARY           READ WRITE          TO STANDBY

SQL> set lines 200 pages 300
SQL> alter session set nls_date_format= 'DD-MON-YYYY HH24:MI:SS';

Session altered.

SQL> select d.db_unique_name, d.database_role, a.thread#, b.last_seq, a.applied_seq, a.last_app_timestamp, b.last_seq - a.applied_seq ARC_DIFF
FROM
(select thread#, MAX(sequence#) applied_seq, MAX(next_time) last_app_timestamp from gv$archived_log where applied='YES' group by thread#) a,
(select thread#, MAX(sequence#) last_seq from gv$archived_log group by thread#) b,
(select db_unique_name, database_role from v$database) d 
where a.thread#=b.thread#;

DB_UNIQUE_NAME          DATABASE_ROLE       THREAD#  LAST_SEQ  APPLIED_SEQ  LAST_APP_TIMESTAMP     ARC_DIFF
----------------------  ------------------  -------  --------  -----------  ----------------------  --------
ORCLDC                 PRIMARY             1        62        62           24-JAN-2025 10:27:01    0

At Standby:

SQL> select NAME,DB_UNIQUE_NAME,DATABASE_ROLE,OPEN_MODE,SWITCHOVER_STATUS from v$database;

NAME       DB_UNIQUE_NAME                 DATABASE_ROLE       OPEN_MODE               SWITCHOVER_STATUS
---------  ------------------------------ ------------------- ----------------------  --------------------
ORCL       ORCLDR                         PHYSICAL STANDBY    READ ONLY WITH APPLY    NOT ALLOWED

SQL> set lines 200 pages 300
SQL> alter session set nls_date_format= 'DD-MON-YYYY HH24:MI:SS';

Session altered.

SQL> select d.db_unique_name, d.database_role, a.thread#, b.last_seq, a.applied_seq, b.last_seq - a.applied_seq ARC_DIFF, a.last_app_timestamp,
round((sysdate - a.last_app_timestamp) * 24 * 60, 2) Gap_in_Mins, round((sysdate - a.last_app_timestamp) * 24 * 60 * 60, 2) Gap_in_Seconds
FROM
(select thread#, MAX(sequence#) applied_seq, MAX(next_time) last_app_timestamp from gv$archived_log where REGISTRAR='RFS' and applied='YES' group by thread#) a,
(select thread#, MAX(sequence#) last_seq from gv$archived_log group by thread#) b,
(select db_unique_name, database_role from v$database) d 
where a.thread#=b.thread#;

DB_UNIQUE_NAME          DATABASE_ROLE       THREAD#  LAST_SEQ  APPLIED_SEQ  ARC_DIFF  LAST_APP_TIMESTAMP     GAP_IN_MINS  GAP_IN_SECONDS
----------------------  ------------------  -------  --------  -----------  --------  ----------------------  -----------  --------------
ORCLDR                 PHYSICAL STANDBY     1        62        62           0         24-JAN-2025 10:27:01    12.85        771

2. Now run verify command on Primary to check switchover status

SQL> alter database switchover to orcldr verify;
Database altered.
If no error is showing then proceed for Switchover.
If you receive any warning message like below then check DB alert log and take action accordingly.

SQL> alter database switchover to orcldr verify;
alter database switchover to orcldr verify
*
ERROR at line 1:
ORA-16475: succeeded with warnings, check alert log for more details

3. Switchover to Standby. Monitor DB alert log for any issue

[oracle@source ~]$ dgmgrl sys@orcldc
DGMGRL for Linux: Release 19.0.0.0.0 - Production on Fri Jan 24 10:40:44 2025
Version 19.24.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
Welcome to DGMGRL, type "help" for information.
Password:
Connected to "ORCLDC"
Connected as SYSDBA.
DGMGRL> 
DGMGRL> switchover to orcldr
Performing switchover NOW, please wait...
Operation requires a connection to database "orcldr"
Connecting ...
Connected to "ORCLDR"
Connected as SYSDBA.
New primary database "orcldr" is opening...
Operation requires start up of instance "orcldc" on database "orcldc"
Starting instance "orcldc"...
Unable to connect to database using (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=source)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORCLDC_DGMGRL)(INSTANCE_NAME=orcldc)(SERVER=DEDICATED)))
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
Failed.
[W000 2025-01-24T10:42:16.151+05:30] Failed to attach to (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=source)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORCLDC_DGMGRL)(INSTANCE_NAME=orcldc)(SERVER=DEDICATED))).
Please complete the following steps to finish switchover:
start up instance "orcldc" of database "orcldc"

DGMGRL> exit

4. Now start new Standby (orcldc) in mount state. Also new Primary (orcldr) will be started in read/write state automatically, just verify its status.
At new Primary:

[oracle@target ~]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Fri Jan 24 10:43:15 2025
Version 19.24.0.0.0
Copyright (c) 1982, 2024, Oracle.  All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.24.0.0.0

SQL> 
SQL> set lines 200 pages 1000
col open_mode for a15
col HOST_NAME for a15
select NAME,DATABASE_ROLE,OPEN_MODE,INSTANCE_NUMBER,INSTANCE_NAME,HOST_NAME,VERSION,STARTUP_TIME,STATUS from gv$database,gv$instance;
SQL> 

NAME      DATABASE_ROLE    OPEN_MODE       INSTANCE_NUMBER INSTANCE_NAME    HOST_NAME       VERSION           STARTUP_T STATUS
--------- ---------------- --------------- --------------- ---------------- --------------- ----------------- --------- ------------
ORCL      PRIMARY          READ WRITE                    1 orcldr           target          19.0.0.0.0        24-JAN-25 OPEN

SQL> show parameter dest_2

NAME                                 TYPE        VALUE
------------------------------------ ----------- ---------------------------------------------------------
db_create_online_log_dest_2          string      
log_archive_dest_2                   string      service="orcldc", ASYNC NOAFFIRM delay=0 optional compression=disable max_failure=0 reopen=300 db_unique_name="orcldc" net_timeout=30, valid_for=(online_logfile,all_roles)
log_archive_dest_20                  string      
log_archive_dest_21                  string      
log_archive_dest_22                  string      
log_archive_dest_23                  string      
log_archive_dest_24                  string      
log_archive_dest_25                  string      
log_archive_dest_26                  string      
log_archive_dest_27                  string      
log_archive_dest_28                  string      
log_archive_dest_29                  string      

SQL>

At new Standby:

[oracle@source ~]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Fri Jan 24 10:43:00 2025
Version 19.24.0.0.0
Copyright (c) 1982, 2024, Oracle.  All rights reserved.
Connected to an idle instance.

SQL> 
SQL> startup mount
ORACLE instance started.

Total System Global Area 1459616616 bytes
Fixed Size                  9177960 bytes
Variable Size            1174405120 bytes
Database Buffers          268435456 bytes
Redo Buffers                7598080 bytes
Database mounted.

SQL> set lines 200 pages 1000
SQL> col open_mode for a15
SQL> col HOST_NAME for a15
SQL> select NAME,DATABASE_ROLE,OPEN_MODE,INSTANCE_NUMBER,INSTANCE_NAME,HOST_NAME,VERSION,STARTUP_TIME,STATUS from gv$database,gv$instance;

SQL> 

NAME      DATABASE_ROLE    OPEN_MODE       INSTANCE_NUMBER INSTANCE_NAME    HOST_NAME       VERSION           STARTUP_T STATUS
--------- ---------------- --------------- --------------- ---------------- --------------- ----------------- --------- ------------
ORCL      PHYSICAL STANDBY MOUNTED                       1 orcldc           source          19.0.0.0.0        24-JAN-25 MOUNTED

SQL> show parameter dest_2

NAME                                 TYPE        VALUE
------------------------------------ ----------- ---------------------------------------------------------
db_create_online_log_dest_2          string      
log_archive_dest_2                   string      
log_archive_dest_20                  string      
log_archive_dest_21                  string      
log_archive_dest_22                  string      
log_archive_dest_23                  string      
log_archive_dest_24                  string      
log_archive_dest_25                  string      
log_archive_dest_26                  string      
log_archive_dest_27                  string      
log_archive_dest_28                  string      
log_archive_dest_29                  string      

SQL>

Note: On standby Log archive dest 2 value will be reset automatically post switchover. Also MRP will be started automatically as well.
5. Now do some log switches on new Primary and check the sync.

SQL> alter system switch logfile;

System altered.

SQL> /

System altered.

Similarly you can do switchback activity. Just change the service name from ORCLDR  to ORCLDC while running switchover command in DGMGRL.

Thank you for reading!

I hope this content has been helpful to you. Your feedback and suggestions are always welcome — feel free to leave a comment or reach out with any queries.

Abhishek Shrivastava

📧 Email: oraeasyy@gmail.com
🌐 Website: www.oraeasy.com

Saturday, March 1, 2025

Oracle Data Guard (DG) Broker Configuration

  • Introduction: Data Guard Broker is a management tool for Oracle Data Guard, which simplifies the configuration, monitoring, and administration of Data Guard environments. It provides a centralized, automated interface to manage primary and standby databases.
    Command-Line (DGMGRL) & GUI (Enterprise Manager) – Can be managed using DGMGRL (Data Guard Broker command-line) or Oracle Enterprise Manager Cloud Control. This guide will walk you through the Data Guard Broker step-by-step.

  • Prerequisites: Below are the requirements for Data Guard Broker.
    1. Oracle Database Enterprise Edition (Standard Edition does not support Data Guard).
    2. Same Database Version & Patch Level on both primary and standby.
    3. Oracle Data Guard Feature Installed on both systems.

  • Environment:
  • Server Primary Standby
    Hostname Source Target
    IP 192.168.80.51 192.168.80.111
    OS OEL 9 OEL 9
    SID ORCLDC ORCLDR
    Service Name ORCLDC ORCLDR

  • Now start DG Broker configuration step by step:
1. Reset Archive dest 2 parameter in both Primary & Standby in order to avoid "ORA-16698: member has a LOG_ARCHIVE_DEST_n parameter with SERVICE attribute set" while adding database in DG Broker.
Primary

SQL> show parameter log_archive_dest_2

NAME                                 TYPE            VALUE
------------------------------------ -----------     ------------------------------
log_archive_dest_2                   string          service="orcldr", ASYNC NOAFFIRM delay=0 optional compression=disable max_failure=0 reopen=300 
													 db_unique_name="orcldr" net_timeout=30, valid_for=(online_logfile,all_roles)

SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_2='' scope=both;

System altered.

Standby

SQL> show parameter log_archive_dest_2

NAME                                 TYPE            VALUE
------------------------------------ -----------     ------------------------------
log_archive_dest_2                   string          service="orcldc", ASYNC NOAFFIRM delay=0 optional compression=disable max_failure=0 reopen=300 
													 db_unique_name="orcldc" net_timeout=30, valid_for=(online_logfile,all_roles)

SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_2='' scope=both;

System altered.

2. Set dg_broker_start parameter true in both Primary & Standby.
Primary

[oracle@source ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Thu Jan 23 11:32:27 2025
Version 19.24.0.0.0

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

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.24.0.0.0
SQL>
SQL> def
DEFINE _DATE           = "23-JAN-25" (CHAR)
DEFINE _CONNECT_IDENTIFIER = "orcldc" (CHAR)
DEFINE _USER           = "SYS" (CHAR)
DEFINE _PRIVILEGE      = "AS SYSDBA" (CHAR)
DEFINE _SQLPLUS_RELEASE = "1924000000" (CHAR)
DEFINE _EDITOR         = "vi" (CHAR)
DEFINE _O_VERSION      = "Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.24.0.0.0" (CHAR)
DEFINE _O_RELEASE      = "1924000000" (CHAR)
SQL>
SQL> show parameter dg_broker

NAME                              TYPE         VALUE
-----------------------	          ------------ ---------------------------------
dg_broker_config_file1            string       /u01/app/oracle/product/19.0.0/dbhome_1/dbs/dr1ORCLDC.dat
dg_broker_config_file2            string       /u01/app/oracle/product/19.0.0/dbhome_1/dbs/dr2ORCLDC.dat
dg_broker_start                   boolean      FALSE
SQL>
SQL> alter system set dg_broker_start=true scope=both sid='*';

System altered.

SQL> show parameter dg_broker_start

NAME                     TYPE        VALUE
------------------       ----------  --------
dg_broker_start          boolean     TRUE
SQL>
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.24.0.0.0
[oracle@source ~]$

Standby

[oracle@target~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Thu Jan 23 11:32:10 2025
Version 19.24.0.0.0

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

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

SQL>
SQL> def
DEFINE _DATE           = "23-JAN-25" (CHAR)
DEFINE _CONNECT_IDENTIFIER = "orcldr" (CHAR)
DEFINE _USER           = "SYS" (CHAR)
DEFINE _PRIVILEGE      = "AS SYSDBA" (CHAR)
DEFINE _SQLPLUS_RELEASE = "1924000000" (CHAR)
DEFINE _EDITOR         = "vi" (CHAR)
DEFINE _O_VERSION      = "Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.24.0.0.0" (CHAR)
DEFINE _O_RELEASE      = "1924000000" (CHAR)
SQL>

SQL> show parameter dg_broker

NAME                       TYPE        VALUE
--------------------	   ----------- ------------------------------
dg_broker_config_file1     string      /u01/app/oracle/product/19.0.0/dbhome_1/dbs/dr1ORCLDR.dat
dg_broker_config_file2     string      /u01/app/oracle/product/19.0.0/dbhome_1/dbs/dr2ORCLDR.dat
dg_broker_start            boolean     FALSE
SQL>

SQL> alter database recover managed standby database cancel;

Database altered.

SQL> alter system set dg_broker_start=true scope=both sid='*';

System altered.

SQL> show parameter dg_broker_start

NAME                     TYPE        VALUE
------------------       ----------  --------
dg_broker_start          boolean     TRUE

3. Now add configuration for DG Broker. We will do the same on Primary database.

[oracle@source ~]$ dgmgrl /
DGMGRL for Linux: Release 19.0.0.0.0 - Production on Thu Jan 23 11:55:25 2025
Version 19.24.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

Welcome to DGMGRL, type "help" for information.
Connected to "ORCLDC"
Connected as SYSDG.
DGMGRL> show configuration
ORA-16596: member not part of the Oracle Data Guard broker configuration

Configuration details cannot be determined by DGMGRL
DGMGRL>

Syntax: create configuration "Configuration Name" as primary database is "Primary DB unique name" connect identifier is "Primary TNS alias name";

DGMGRL> create configuration ORCLDG as primary database is ORCLDC connect identifier is ORCLDC; Configuration "orcldg" created with primary database "orcldc" DGMGRL> DGMGRL> show configuration Configuration - orcldg Protection Mode: MaxPerformance Members: orcldc - Primary database Fast-Start Failover: Disabled Configuration Status: DISABLED

Syntax: add database "Standby DB unique name" as connect identifier is "Standby TNS alias name";

DGMGRL> add database ORCLDR as connect identifier is ORCLDR; Database "orcldr" added DGMGRL> DGMGRL> show configuration Configuration - orcldg Protection Mode: MaxPerformance Members: orcldc - Primary database orcldr - Physical standby database Fast-Start Failover: Disabled Configuration Status: DISABLED DGMGRL> show configuration Configuration - orcldg Protection Mode: MaxPerformance Members: orcldc - Primary database orcldr - Physical standby database Warning: ORA-16853: apply lag has exceeded specified threshold Fast-Start Failover: Disabled Configuration Status: WARNING (status updated 3 seconds ago) DGMGRL> exit
4. Now set Archive dest 2 on Primary.

SQL> alter system set log_archive_dest_2='SERVICE=ORCLDR NOAFFIRM ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=ORCLDR';

System altered.
  
5. Now enable the DG Configuration.

[oracle@source ~]$ dgmgrl /
DGMGRL for Linux: Release 19.0.0.0.0 - Production on Thu Jan 23 11:55:25 2025
Version 19.24.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

Welcome to DGMGRL, type "help" for information.
Connected to "ORCLDC"
Connected as SYSDG.
DGMGRL> show configuration

Configuration - orcldg

  Protection Mode: MaxPerformance
  Members:
  orcldc - Primary database
    orcldr - Physical standby database

Fast-Start Failover: Disabled

Configuration Status:
DISABLED
DGMGRL> enable configuration;
Enabled.
DGMGRL> show configuration

Configuration - orcldg

  Protection Mode: MaxPerformance
  Members:
  orcldc - Primary database
    orcldr - Physical standby database

Fast-Start Failover: Disabled

Configuration Status:
SUCCESS   (status updated 43 seconds ago)

6. Now set Archive dest 2 on Standby. Also MRP will be started automatically as DG broker configuration has been enabled.

SQL> alter system set log_archive_dest_2='SERVICE=ORCLDC NOAFFIRM ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=ORCLDC';

System altered. 

SQL> alter database recover managed standby database disconnect from session;
alter database recover managed standby database disconnect from session
*
ERROR at line 1:
ORA-01153: an incompatible media recovery is active

SQL> select process,status,thread#,sequence#,block# from v$managed_standby where process like '%MRP%';

PROCESS   STATUS          THREAD#  SEQUENCE#     BLOCK#
--------- ------------ ---------- ---------- ----------
MRP0      APPLYING_LOG          1         52        514

SQL> set lines 200 pages 300
SQL> alter session set nls_date_format= 'DD-MON-YYYY HH24:MI:SS';
Session altered.

SQL> select d.db_unique_name, d.database_role, a.thread#, b.last_seq, a.applied_seq, b.last_seq - a.applied_seq ARC_DIFF, a.last_app_timestamp,
round((sysdate - a.last_app_timestamp)*24*60,2) Gap_in_Mins, round((sysdate - a.last_app_timestamp)*24*60*60,2) Gap_in_Seconds
FROM
(select thread#, MAX(sequence#) applied_seq, MAX(next_time) last_app_timestamp from gv$archived_log where REGISTRAR='RFS' and applied='YES' group by thread#) a,
(select thread#, MAX(sequence#) last_seq from gv$archived_log group by thread#) b,
(select db_unique_name,database_role from v$database) d where a.thread#=b.thread#;

DB_UNIQUE_NAME                 DATABASE_ROLE       THREAD#   LAST_SEQ APPLIED_SEQ   ARC_DIFF LAST_APP_TIMESTAMP   GAP_IN_MINS GAP_IN_SECONDS
------------------------------ ---------------- ---------- ---------- ----------- ---------- -------------------- ----------- --------------
ORCLDR                         PHYSICAL STANDBY          1         57          55          2 23-JAN-2025 12:04:11       11.37            682

SQL>/ 

DB_UNIQUE_NAME                 DATABASE_ROLE       THREAD#   LAST_SEQ APPLIED_SEQ   ARC_DIFF LAST_APP_TIMESTAMP   GAP_IN_MINS GAP_IN_SECONDS
------------------------------ ---------------- ---------- ---------- ----------- ---------- -------------------- ----------- --------------
ORCLDR                         PHYSICAL STANDBY          1         58          58          0 23-JAN-2025 12:30:15       13.72            823

7. Now check DG broker status on both Primary & Standby.
Primary

[oracle@source ~]$ dgmgrl /
DGMGRL for Linux: Release 19.0.0.0.0 - Production on Thu Jan 23 12:00:27 2025
Version 19.24.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

Welcome to DGMGRL, type "help" for information.
Connected to "ORCLDC"
Connected as SYSDG.

DGMGRL> show configuration

Configuration - orcldg

  Protection Mode: MaxPerformance
  Members:
  orcldc - Primary database
    orcldr - Physical standby database

Fast-Start Failover: Disabled

Configuration Status:
SUCCESS   (status updated 43 seconds ago)

DGMGRL>
DGMGRL>
DGMGRL> show database orcldc

Database - orcldc

  Role:               PRIMARY
  Intended State:     TRANSPORT-ON
  Instance(s):
    orcldc

Database Status:
SUCCESS

DGMGRL> show database orcldr

Database - orcldr

  Role:               PHYSICAL STANDBY
  Intended State:     APPLY-ON
  Transport Lag:      0 seconds (computed 0 seconds ago)
  Apply Lag:          0 seconds (computed 0 seconds ago)
  Average Apply Rate: 7.00 KByte/s
  Real Time Query:    OFF
  Instance(s):
    orcldr

Database Status:
SUCCESS

DGMGRL> exit

Standby

[oracle@target ~]$ dgmgrl /
DGMGRL for Linux: Release 19.0.0.0.0 - Production on Thu Jan 23 12:00:09 2025
Version 19.24.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

Welcome to DGMGRL, type "help" for information.
Connected to "ORCLDR"
Connected as SYSDG.

DGMGRL> show configuration

Configuration - orcldg

  Protection Mode: MaxPerformance
  Members:
  orcldc - Primary database
    orcldr - Physical standby database

Fast-Start Failover: Disabled

Configuration Status:
SUCCESS   (status updated 30 seconds ago)

DGMGRL> show database orcldc

Database - orcldc

  Role:               PRIMARY
  Intended State:     TRANSPORT-ON
  Instance(s):
    orcldc

Database Status:
SUCCESS

DGMGRL> show database orcldr

Database - orcldr

  Role:               PHYSICAL STANDBY
  Intended State:     APPLY-ON
  Transport Lag:      0 seconds (computed 1 second ago)
  Apply Lag:          0 seconds (computed 1 second ago)
  Average Apply Rate: 5.00 KByte/s
  Real Time Query:    OFF
  Instance(s):
    orcldr

Database Status:
SUCCESS

DGMGRL> exit


Thank you for reading!

I hope this content has been helpful to you. Your feedback and suggestions are always welcome — feel free to leave a comment or reach out with any queries.

Abhishek Shrivastava

📧 Email: oraeasyy@gmail.com
🌐 Website: www.oraeasy.com