Thursday, November 23, 2023

How to use strace to figure out what files are being accessed by a shell script

I had a situation where an ebs-supplied script adstrtal.sh would not start - it kept throwing error
ORA-12541: TNS:no listener
Although $TNS_ADMIN was correctly set, and sqlplus and tnsping would confirm that the database was open and the listener was up, accepting connections on the desired port.

The sqlnet.log file created in the same directory from which I executed adstrtal.sh displayed the connection being attempted:
Fatal NI connect error 12541, connecting to:
 (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=EBS32.oric.no)(CID=(PROGRAM=sqlplus)(HOST=oric-ebsapp-utv.oric.no)(USER=ebs)))
 (ADDRESS=(PROTOCOL=TCP)(HOST=162.20.5.225)(PORT=1521)))
We are not using default port 1521, but a different port.

I then used strace to find the source of the error, like this:
strace -f -o /tmp/strace.out ./adstrtal.sh apps/****
When going through the /tmp/strace.out file, I was pointed in the right direction:
openat(AT_FDCWD, "$INST_TOP/ora/10.1.3/network/admin/EBS32_oric-ebsapp-utv_ifile.ora", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
Turns out that adstrtal.sh was looking for a tnsnames.ora entry not in the tnsnames.ora in $TNS_ADMIN ($INST_TOP/ora/10.1.2/network/admin) but rather in $INST_TOP/ora/10.1.3/network/admin.

As soon as I had added the correct tnsnames.ora entry, the adstrtall.sh script worked.

Solution to ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA

I had a situation where the error
ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA
was thrown when connecting to a PDB.

The PDB was up and the listener runnning and serving the service_name which I wanted to connect to:

Solution was to reverse the order of directory_path in sqlnet.ora from
NAMES.DIRECTORY_PATH= (EZCONNECT,TNSNAMES)
to
NAMES.DIRECTORY_PATH= (TNSNAMES,EZCONNECT )

Friday, November 10, 2023

What are EBS snapshots?

I found this info in the document Oracle® Applications Maintenance Utilities Release 12.1 Part No. E13676-02 There are two types of snapshots: APPL_TOP snapshotsand global snapshots.

  • An APPL_TOP snapshot lists patches and versions of files in the APPL_TOP.
  • A global snapshot lists patches and latest versions of files in the entire Applications system (that is, across all APPL_TOPs).

    Both APPL_TOP snapshots and global snapshots may be either current view snapshots or named view snapshots.

    A current view snapshot is created once and updated when appropriate to maintain a consistent view.

    A partial view snapshot allows you to synchronize only selected files from a current view.

    A named view snapshot is a copy of the current view snapshot at a particular time (not necessarily the latest current view snapshot), and is not updated.