Tuesday, May 2, 2023

Certificate validation failure (missing or misconfigured Wallet)

Symptoms: 

Your Oracle PLSQL routine is trying to access a https website and you get such an error:

Exception in "begin_request":

Error Stack: ORA-29273: HTTP request failed

ORA-29024: Certificate validation failure

ORA-06512: at "SYS.UTL_HTTP", line 380

ORA-06512: at "SYS.UTL_HTTP", line 1189

Backtrace: ORA-06512: at "SYS.UTL_HTTP", line 380

ORA-06512: at "SYS.UTL_HTTP", line 1189


Cause: 

This is because there is no handshaking with encryptation channel between your database connection and the website that only respondes via https.


Solution:

All you need to do is to download the cert files from the https website you are trying to access (preferebly via firefox that is much easier to download).
Figure 1


Figure 2.

Figure 3.


  • So now, go to your server and create a specific directory for your wallet and create one:

mkdir /u01/oracle-wallet -p

  • Copy your certificate files to this folder

cp $STAGE_DIR/certificados/*.pem /u01/oracle-wallet

  • Create the wallet

cd /u01/oracle-wallet
orapki wallet create -wallet https_wallet -pwd <create_new_password> -auto_login

  • Add the certificate files to the wallet

cd /u01/oracle-wallet

orapki wallet add -wallet https_wallet -cert <your-cert-file>.pem -trusted_cert -pwd <set_your_password_created>

  • List all added certificates into the wallet
cd /u01/oracle-wallet/https_wallet
orapki wallet display -wallet .


  • Certainly you will need to configure the ACL (Access Control List) from your database, adjusting the code below.

$ sqlplus system/<password_user>

BEGIN
    DBMS_NETWORK_ACL_ADMIN.APPEND_HOST_ACE(
        host => '*',
        ace => xs$ace_type(privilege_list => xs$name_list('connect','resolve','http'),
                           principal_name => '<YOUR_SCHEMA_HERE>',
                           principal_type => xs_acl.ptype_db));
END;
/

  • To test that is working, adapt your code to include the wallet path and password, such example:

DECLARE
  req   UTL_HTTP.req;
  resp  UTL_HTTP.resp;
BEGIN
  UTL_HTTP.SET_WALLET('file:<wallet_path_here>', '<your_password>';
  req := UTL_HTTP.begin_request('https://<https_address>');
  resp := UTL_HTTP.get_response(req);
  UTL_HTTP.end_response(resp);
END;
/


Hope this help.


Friday, June 24, 2022

ORA-01722 While Creating new APEX Interactive Grid Or Interactive Report

Symptoms: 

While trying to create new Interactive Grids or Interactive Reports in APEX applications, everything works as expected until the SAVE button is clicked and the following error message is displayed:

ORA-01722: invalid number

The problem appears to be only with Save but not with the query during runtime.


Cause: 

The issue appears due to the reason that the action is being performed through a language other than English through the browser plugin.


Solution:

Append the string &p_lang=en to the URL in the browser address bar

Reload the page designer and test the behavior.

In order to get rid of this error, Customer need to install the language components for the corresponding language.


And belive, it works!


Source: ORA-01722 While Creating new Interactive Grid Or Interactive Report (MOS Doc ID 2859399.1)

Monday, September 13, 2021

Grant java privileges to run under Oracle Database

Symptoms:
You have a java code running under Oracle Database and needs to adjust the privileges to run the code.


Cause:
Some exemple of errors when trying to execute your java code:

"the Permission ("java.io.FilePermission" "/u01/data/yourfile.dat" "write") has not been granted to <YOUR-USER>. The PL/SQL to grant this is dbms_java.grant_permission( '<YOUR-USER>', 'SYS:java.io.FilePermission', '/u01/data/yourfile.dat', 'write' )"

or 

"the Permission ("java.net.SocketPermission" "localhost:0" "listen,resolve") has not been granted to <YOUR-USER>. The PL/SQL to grant this is dbms_java.grant_permission( '<YOUR-USER>', 'SYS:java.net.SocketPermission', 'localhost:0', 'listen,resolve' )"


Solution:
Set the variables according to your needs and give the privileges:

begin
  dbms_java.grant_permission( '<YOUR-USER>', 'SYS:java.io.FilePermission', '/u01/data/-', 'read,write,delete' );

  dbms_java.grant_permission( '<YOUR-USER>', 'SYS:java.net.SocketPermission', '*', 'accept,listen,connect,resolve' );
end;
/


Note:

A pathname that ends in "/*" (where "/" is the file separator character,File.separatorChar) indicates a directory and all the files contained in that directory.

A pathname that ends with "/-" indicates a directory and (recursively) all files and subdirectories contained in that directory.


Hope this helps.

Friday, June 18, 2021

When starting Oracle Listener gets an error TNS-00525: Insufficient privilege for operation

Symptoms:
When trying to start the Oracle Listener, it returns an error regarding permission but not clear on the logs what it is:

TNSLSNR for Linux: Version 19.0.0.0.0 - Production
System parameter file is /u01/ora19c/product/19.3.0/network/admin/listener.ora
Log messages written to /u01/ora19c/diag/tnslsnr/sandbox19js/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=sandbox19js)(PORT=1521)))
Error listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
TNS-12555: TNS:permission denied
 TNS-12560: TNS:protocol adapter error
  TNS-00525: Insufficient privilege for operation
   Linux Error: 1: Operation not permitted


Cause:
In the directory /var/tmp/.oracle there exist some socket files which do not belong to UNIX user oracle and group dba, but to another user.
When the Listener process starts, it tries to create the following socket files:
  /var/tmp/.oracle/s#<pid>.1
  /var/tmp/.oracle/s#<pid>.2
  /var/tmp/.oracle/sREGISTER

where <pid> is the ID of the operating system process for the Listener.

Solution:
As UNIX user root, delete all socket files from directory /var/tmp/.oracle
Then as oracle owner UNIX user, starts the Listener by executing the command "lsnrctl start".

Wednesday, June 2, 2021

libnsl.so.1: cannot open shared object file: No such file or directory

Symptoms:

Installed the Oracle InstantClient on Linux Linux 8 (packages instantclient-basic-linux.x64-19.11.0.0.0dbru.zip and instantclient-sqlplus-linux.x64-19.11.0.0.0dbru.zip) and later configured the environment variables:
export ORACLE_HOME=/u01/instantclient_19_11/
export LD_LIBRARY_PATH=$ORACLE_HOME
export TNS_ADMIN=/u01/instantclient_19_11/network/admin
export PATH=$ORACLE_HOME:$PATH

When calling the sqlplus utilitary, it presents an error regarding Linux packages missing with message:
sqlplus: error while loading shared libraries: libnsl.so.1: cannot open shared object file: No such file or directory.


Cause: 

SqlPlus uses a few linux libraries and one of that is exactly the libnsl.
However there are a few packages with similar names (or endings) that does not solve the issue.


Solution:

Simply install the package libnsl with command:
yum install libnsl -y

Thursday, February 18, 2021

ORA-00800: soft external error, arguments: [Set Priority Failed], [VKTM]

Symptoms: 

When starting up the Oracle 19c, it raises an error on the trace file and also creates an incident file with the message:

ORA-00800: soft external error, arguments:  [Set Priority Failed], [VKTM], [Check traces and OS configuration], [Check Oracle document and MOS notes], []


Cause: 

As given by the MOS article (Doc ID 2718971.1)

"19c moved to OL7/UEK4. UEK4 requires rt_period and rt_runtime set for the cgroup from where the d/b is started.

Typically the root one unless the customer is setting up their own cgroups or using system user slices.

It requires the proper values such as the 95%. For this problem, ORA-800 will have the following message in the incident. "


Solution:

Check the priority of VKTM @RDBMS level:

SQL> select a.ksppinm "Parameter", b.ksppstvl "Session Value", c.ksppstvl "Instance Value", a.KSPPDESC "Describtion"

from x$ksppi a, x$ksppcv b, x$ksppsv c

where a.indx = b.indx and a.indx = c.indx and a.ksppinm like '_%' and a.ksppinm like '_highest_priority_process%';


If not "VKTM" is not prioritiesed, please elevate the priority :

SQL> alter system set "_high_priority_processes"='VKTM' scope=spfile;


Restart DB and verify the same

SQL> show parameter "_high_priority_processes";


As root user, change file permission and owner

$ chmod root.oinstall $ORACLE_HOME/bin/oradism

$ chmod u+s oradism


Restart the database and check if it solved the error.

Otherwise, check the MOM Doc ID given above.


Hope that helps you.

Friday, January 22, 2021

RIB error ORA-21700 object does not exist or is marked for delete

Symptoms: 

At random times the Oracle Retail Integration Bus (aka RIB) gets certain errors such as:

GETNXT(?,?,?,?,?,?,?) and/or ORA-21700 object does not exist or is marked for delete.

This error is kind of confusion because if you look at the database, the object exists and it's valid.


Cause: 

Several causes can lead to this behavior, but most commonly some database objects in RMS has changed and RIB detects such modification in the signature.

Invalid or missing objects in RMS database also can be the reason.


Solution:

These steps described will recreate the RIB objects under RMS database.

An important point there is to run the commands from the latest RIB patch applied.

For this, create a staging area, copy from the patch and unzip the file: retail-public-payload-database-object-types-14.1.3.jar


1. Bring down all the RIB managed-servers.

2. Run:

$ cd /u01/stage/rib/hotfixes/<your_patch/staging/

$ unzip retail-public-payload-database-object-types-14.1.3.jar

$ sqlplus rms_user/passwd

   @InstallAndCompileAllRibOracleObjects.sql

3. Compile all objects to make sure objects are valid.

   sqlplus / as sysdba

   @?/rdbms/admin/utlrp;


4. Bring up the RIB.


Hope this help


Configure the Oracle DB Access Control List to avoid error like ORA-24247: network access denied

Symptoms:  You try to make external connections from the Oracle Database and receive erros like ORA-24247: network access denied by access c...