Tuesday, May 30, 2023

Errors ORA-12154, ORA-29003 when connecting to Autonomous Data Warehouse using Django

When connection to Autonomous Data Warehouse Using Django web framework first we come across “ORA-12154” error. That means Django cannot be able to connect to the Oracle Database service name with the settings in settings.py file.

File "C:\django\db\backends\oracle\base.py", line 254, in get_new_connection return Database.connect( cx_Oracle.DatabaseError: ORA-12154: TNS:could not resolve the connect identifier specified

First copy the tnsnames.ora into local system and test tnsping.

C:\> tnsping <service Name>

If the tnsping is working fine, then below are the passible reason for ORA-12154 error
  • TNS_ADMIN might not be configured or set the right path
  • There might be a typo in service name
  • Connection details in settings.py might not be correct
We found that TNS_ADMIN is not set to the right path and updating the correct path resolved the issue. But we have received new error

ORA-29003: SSL transport detected mismatched server certificate

Django supports Oracle Database 19c or higher versions but cx_oracle python driver required. We verified that required driver is installed. We try to connect using SQL*PLUS but still receiving same error. That means there is no issue with the settings.

After research we found that 12c client is not supported for new mTLS authentication as per document “ALERT: Action Required for Autonomous Databases (Doc ID 2911553.1)”

We have installed Oracle 19c client and were able to connect without any issues.

Below are the options to resolve the issue

1. Install certified oracle client versions 11.2.0.4.220719 (or later), 18.19 (or later), 19.2 (or later), 21 (base release or later)

2. Update Autonomous database instance to allow both TLS and mTLS authentication.
  • Goto Autonomous Database Details page --> Network --> click Edit in the Mutual TLS (mTLS) Authentication field.
  • Change the value to allow TLS authentication, deselect Require mutual TLS (mTLS) authentication
  • Click Update
3. Use ssl_server_dn_match=no in the connect string (when using 12c client updating the value to “no” didn’t help )

I hope this helps.

Thanks
Satishbabu G, Oracle ACE Pro

Oracle "Hyperion EPMA Server" service is not coming online

I have come across below issue wtih Oracle Hyperion. When we restarted Hyperion server, the “Hyperion EPMA Server” service is not coming online and application is down.

Here are the Errors from event.log

EPMA_Server

[EPMA Server Startup] ERROR SVR_ERR_PROCESSMGR_CANT_INIT_SESSIONMGR:Cannot initialize the Session Manager.Hyperion.DimensionServer.Interface.Exceptions.EPMAServiceException: Cannot initialize the Session Manager. ---> Hyperion.CommonServices.Exceptions.SessionManagerException: An error was encountered by the CAS Security Provider: Class: java.lang.NullPointerException

StackTrace:

at Hyperion.DimensionServer.SessionManager.CasSecurityProvider.GetDataBaseDetails(String& vendor, String& serverName, Int32& dbPort, String& dbName, String& username, String& password, String& jdbcUrl)

at Hyperion.DimensionServer.SessionManager.SessionManager.InitializeSqlConnectionString()

at Hyperion.DimensionServer.SessionManager.SessionManager.Initialize(String configFileName, Boolean restorePastInstanceSessions, Boolean enableCaching)

--- End of inner exception stack trace ---


Hyperion EPMA DimmensionServer

Service cannot be started. Hyperion.DimensionServer.Interface.Exceptions.EPMAServiceException: Cannot initialize the Session Manager. ---> Hyperion.CommonServices.Exceptions.SessionManagerException: An error was encountered by the CAS Security Provider: Class: java.lang.NullPointerException
StackTrace:
at Hyperion.DimensionServer.SessionManager.CasSecurityProvider.GetDataBaseDetails(String& vendor, String& serverName, Int32& dbPort, String& dbName, String& username, String& password, String& jdbcUrl)
at Hyperion.DimensionServer.SessionManager.SessionManager.InitializeSqlConnectionString()
at Hyperion.DimensionServer.SessionManager.SessionManager.Initialize(String configFileName, Boolean restorePastInstanceSessions, Boolean enableCaching)
--- End of inner exception stack trace ---


The event log is no much helpful. But note that the Hyperion EPMA Service will not come up if you have any issues with database. Check the logs to see any “ORA- “errors .

I found below error in EssbaseAdminServices0.log

#### <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <> <> <> <1329242417925> ORA-28001: the password has expired

Now it’s clear that Database user password expired.

SQL> select USERNAME, ACCOUNT_STATUS from dba_users where USERNAME = ‘SHARED_SERVICES’;
USERNAME ACCOUNT_STATUS
------------------------------ --------------------------------
SHARED_SERVICES EXPIRED(GRACE)

Do not change the password. If you change the password then you need to re-configure the Hyperion service in order to use the new password.

If you know the password then set the using below command.
SQL> Alter user SHARED_SERVICES identified by ‘xxxxxx’;

If you don’t know the password then reset the password following below steps
SQL> select password from sys.user$ where name='SHARED_SERVICES';

PASSWORD
------------------------------
61266722B44D5BG418

SQL> alter user QWERTY identified by values '61266722B44D5BG418’;
User altered.

Also make sure to modify PASSWORD_LIFE_TIME to “UNLIMITED” for DEFAULT or User profile that you are using

SQL> alter profile default limit PASSWORD_LIFE_TIME unlimited;
Profile altered.

Regards,
Satishbabu Gunukula
http://www.oracleracexpert.com

Sunday, May 14, 2023

UN World Innovation Day: Igniting Change through Creativity and Collaboration

Whenever there is a global challenge, the Innovation has always played an important role to solving challenges. Every year the United Nations celebrates Innovation Day on the 21st of April to recognizes the importance of innovation in harnessing the economic potential of nations. As world faces unprecedented crises in health, education, the future of work and economy, it is important for us to find innovative solutions together

The United Nations (UN) has set forth 17 Sustainable Development Goals (SDGs) to tackle wide range of global challenges by 2030 which includes climate change, poverty, eradication and beyond. We will explore how Generative Artificial Intelligence (AI) can be used to achieve of these goals for better future.

                           

The UN World Innovation Day Hack 2023 is not just another hackathon; it's a unique opportunity to collaborate with encouraging individuals to creatively utilize their skills to generate new ideas and solutions for various critical areas. These include health and wellbeing, economic growth, decent work, and quality education. Hackathon brings together creative minds from around the world to generate innovative solutions for pressing issues. By bringing together a diverse group of talented individuals, the hackathon helps to provide meaningful solutions to pressing challenges.

Hackathon gives an opportunity to connect with new people from various backgrounds, experiences and expertise come together to collaborate, share ideas, and push the boundaries of innovation. You will have the opportunity to learn from each other, explore, generate innovative solutions, and network with inspiring individual beyond the event.

This year's hackathon introduces two brand new challenges:
  • GPT4Good
  • Data4Good
These challenges can address crucial areas where innovation can make a significant impact.

In the "GPT4Good" challenge, participants will explore the potential of GPT (Generative Pre-trained Transformer) models to address social, environmental, and humanitarian issues. The GPT is a cutting-edge artificial intelligence technology, has the power to generate human-like text, making it a valuable tool for various applications. From enhancing accessibility to fostering sustainable practices, participants will harness the power of GPT to create innovative solutions that contribute to the greater good.



The "Data4Good" challenge focuses on leveraging the power of data to drive positive change. With the proliferation of data in our digital age, there is a tremendous opportunity to extract insights and make informed decisions that benefit society. To address critical issues such as participants will work with diverse datasets, apply data analytics, visualization, and machine learning techniques to address critical issues. Participants will be encouraged to explore how data can be ethically collected, analyzed, and utilized to address pressing global issues.

The UN World Innovation Day Hack 2023 event schedule, spanning from May12th to May 15th, promises an exhilarating journey filled with creativity, collaboration, and problem-solving.



The UN World Innovation Day Hack 2023 is made possible through collaboration with Hackmakers, a global community of changemakers and innovators, joins hands with sponsors such as Oracle, AI4Diversity, Polygon, Unstoppable Domains, Buzzy and Wand to support this event. These organizations bring their expertise, resources, and mentorship to provide participants with the necessary tools to transform their ideas into tangible solutions.

The Hackathons bring over 1000+ participants and mentors around the world. In this blog post, I express my deep gratitude to all the mentors who generously contribute their time, expertise, and support to guide teams and projects during these hackathons as they play essential role in making these events successful.

To find answers to common queries and gain a better understanding of the hackathon logistics visit the official hackathon FAQ page at https://www.worldinnovationday.com/faq .

To access valuable resources and guides visit resources page at https://www.worldinnovationday.com/resources. It will provide necessary tools and knowledge to overcome challenges and push the boundaries of innovation.

To access Challenge and Sponsored resources details, visit the challenge resource page
https://www.worldinnovationday.com/challenge-resources.

Join on this transformative journey, meet incredible individuals, test your skills, and deliver meaningful impacts. Together, let's unleash the potential of innovation and create a world that thrives on collaboration, inclusivity, and positive change.

Conclusion: The UN World Innovation Day Hack 2023 is a global celebration of creativity, collaboration, and innovation. As an official Mentor for this event, I am honored to be part of a community to address pressing global challenges through technology and creative thinking. As we work together, let us continue to inspire, guide, and empower the next generation of innovators for better future.


#WorldInnovationDay #Hackathon #GptForGood #DataForGood #Innovation #Collaboration

Regards
Satishbabu G, Oracle ACE Pro


Thursday, March 2, 2023

Oracle AutoUpgrade with source and Target Database on different servers

AutoUpgrade utility can be used on upgrading databases from 12c R2 release (12.2 + DBJAN2019RU and newer) and it has Analyze, Fixup, Deploy and Upgrade processing modes. 

Before you proceed make sure you meet following requirements.
  • create config file
  • Source Database should be running in original oracle home
  • The Database server should be registered in DNS
  • JAVA8 required for Autoupgrade to run. Oracle 12c R2 (12.2.0.1) or newer oracle homes have a java version by default.
  • If you run AutoUpgrade in batch or script mode use “noconsole” parameter
From Oracle 19c (10.3) autoupgrade.jar file exists by default, for earlier releases you must download latest autoupgrade.jar file from Oracle support.

There are four AutoUpgrade modes and each mode performs different steps
  •  Analyze Mode: Setup, Pre-checks.
  • Fixups Mode: Setup, Pre-checks, and Pre-fixups.
  • Deploy Mode: Setup, Guaranteed Restore Point, Pre-upgrade, Pre-checks, Pre-fixups, Drain,      Database Upgrade, Post-checks, Post-fixups, and Post-upgrade.
  • Upgrade Mode: Setup, Database Upgrade, Post-checks, and Post-fixups.
Analyze Mode: This mode runs few checks to see weather database is ready for upgrade. In this mode it only reads data from database to analyze and does not perform any changes.

You can run this step on source database before you setup target.

Run below command to start AutoUpgrade Analyze

$ORACLE_HOME/jdk/bin/java -jar $ORACLE_HOME/rdbms/admin/autoupgrade.jar – config /home/oracle/autoupgrade/config.txt -mode analyze

Make sure you analyze output files for errors and run fixup on Source database server. You should see SID.html and SID_preupgrade.log files

Note that this mode also generates status files such as status.json, progress.json which can be located under cfgtoollogs/upgrade/auto/status.

Status.json – This file contains High level status of upgrade.
Progress.json – This file has contains status of progress of all upgrades

In case if target database is not on the same server then you must set the source home path in the configuration file, so that Autoupgrade analyze can run on source oracle home.

For example,
upgrade1.source_home=/home/oracle/product/12.2.0.1/dbhome_1 # Source ORACLE_HOME Path
upgrade1.target_home=/home/oracle/product/19.0.0.0/dbhome_1 # Target ORACLE_HOME Path

Fixups Mode : This mode performs all required automated fix up that are required before you start an upgrade. In this mode it creates guaranteed restore point.

Run below command on source Database server to run fixups.

$ORACLE_HOME/jdk/bin/java -jar $ORACLE_HOME/rdbms/admin/autoupgrade.jar – config /home/oracle/autoupgrade/config.txt -mode fixups

Deploy Mode: This mode performs all required actions for an upgrade, which include analyze, fixups, upgrade and post upgrade steps. You will use this mode when source and target Oracle Home’s are on the same server. This mode also creates guaranteed restore point.

Run below command on source Database server to run fixups.

$ORACLE_HOME/jdk/bin/java -jar $ORACLE_HOME/rdbms/admin/autoupgrade.jar – config /home/oracle/autoupgrade/config.txt -mode Deploy

Move the database from source to Target Database server and perform Upgrade mode.

Upgrade Mode: You will run this Autoupgrade mode when you are moving database to Target server or don’t have source Oracle home access. This mode is used only when you are moving to new server. But note that this mode doesn’t create guaranteed restore point and it doesn’t perform the post upgrade steps.

Before you perform upgrade make sure you copy the during_upgrade_pfile_dbname.ora from source to target Oracle Home with default name init<SID>.ora. You can also create the spfile using during_upgrade_pfile_dbname.ora which can be found under temp directory.

SQL> create spfile from pfile=' /home/oracle/autoupgrade/au21/TESTDB/temp/during_upgrade_pfile_testdb.ora';

On Target database server start the database in upgrade mode and run below command to upgrade

$ORACLE_HOME/jdk/bin/java -jar $ORACLE_HOME/rdbms/admin/autoupgrade.jar – config /home/oracle/autoupgrade/config.txt -mode upgrade

After upgrade make sure you perform post upgrade steps manually

· Copy network files sql.net ora, listener,ora, tnsnames.ora files..etc
· Restart of database in case of RAC
· Remove guaranteed restore point

Thanks & Regards,
https://oracleracexpert.com, Oracle ACE

Wednesday, February 22, 2023

Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class

When launching Database configuration assistant (DBCA) you may encounter this error. The “java.lang.NoClassDefFoundError” error encounter when it could not initialize class “sun.awt.X11.XToolkit”. 

This normally occur when launching Graphic user interface (GUI)

No protocol specified
Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11.XToolkit
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at java.awt.Toolkit$2.run(Toolkit.java:860)
at java.awt.Toolkit$2.run(Toolkit.java:855)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:854)
at com.jgoodies.looks.LookUtils.isLowResolution(LookUtils.java:484)
at com.jgoodies.looks.LookUtils.<clinit>(LookUtils.java:249)
at com.jgoodies.looks.plastic.PlasticLookAndFeel.<clinit>(PlasticLookAndFeel.java:135)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at javax.swing.SwingUtilities.loadSystemClass(SwingUtilities.java:1879)
at javax.swing.UIManager.setLookAndFeel(UIManager.java:582)
at oracle.install.commons.util.Application.startup(Application.java:976)
at oracle.install.commons.flow.FlowApplication.startup(FlowApplication.java:181)
at oracle.install.commons.flow.FlowApplication.startup(FlowApplication.java:198)
at oracle.assistants.common.base.driver.AssistantApplication.startup(AssistantApplication.java:336)
at oracle.assistants.dbca.driver.DBConfigurator.startup(DBConfigurator.java:378)
at oracle.assistants.dbca.driver.DBConfigurator.main(DBConfigurator.java:513)

The main causes of the issue is
1. The DISPLAY variable is NOT set or value is not correct.
2. X Windows is not installed
3. Oracle user not added to ACL (Access Control List)

If launching from server make sure you have any X Windows software installed and install org-x11-apps.x86_64 package

If you are launching from a local workstation, make sure you have XGraphics software such as Exceed, VLC…etc tools installed. Then You can set DISPLAY by using below command

CSH
$ setenv DISPLAY <IP Address of workstation or server>:0

SSH or KSH
$ export DISPLAY=<IP Address of workstation or server>:0

In Some cases, users may face issue when installing Oracle software on Ubuntu or Linux environment.

>>> Could not execute auto check for display colors using command /usr/bin/xdpyinfo. Check if the DISPLAY variable is set. Failed <<<<

Some requirement checks failed. You must fulfill these requirements before
continuing with the installation,
Continue? (y/n) [n] Y

>>> Ignoring required pre-requisite failures. Continuing...
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2019-08-01_12-17-01PM. Please wait ....oracle$:~$ No protocol specified
Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11.XToolkit

In this scenario, verify weather JDK installed on the system or not using below command
$ java -version

If not installed then installing required JDK will resolve the issue. If the problem persists, then run below command by logging as root

$ xhost +

Switch back to Oracle user and run the installation.

Thanks,
https://oracleracexpert.com, Oracle ACE Pro