12 August 2023

Essential Linux Commands for File Management, Monitoring, and Oracle EBS Administration

Essential Linux & Oracle EBS Commands — Quick Reference

Essential Linux Commands for File Management, Monitoring, and Oracle EBS Administration

A compact reference of commonly used Linux and Oracle E-Business Suite commands. Each command includes a short description to help you understand its purpose before execution.

📂 File Transfer and Archive Management

Synchronize files with compression while preserving attributes

Efficiently copy files between systems while compressing data and preserving timestamps, permissions, and ownership.

rsync -az /path/to/source username@host:/path/to/destination

Extract files from a tar archive excluding the inst directory

Unpacks a tar archive to root / while ignoring files inside the inst folder.

tar xfv --exclude='inst/*' -C /

🔍 Searching and Managing Files

Delete files older than 30 days and print their names

Removes old files to free space while printing each deleted filename for confirmation.

find . -mtime +30 -exec rm -f {} \; -print

List files modified within the last 2 minutes

Helps identify recently updated files with detailed metadata (long listing, sorted by time).

find . -type f -mmin -2 -exec ls -ltr {} \;

Find all PDF files and count per directory

Counts how many .PDF files exist in each directory (case-sensitive pattern in this example).

find . -type f -name "*.PDF" | grep -o '/./' | sort | uniq -c

Count number of files in each directory

Quickly checks file distribution across folders by listing each directory with its file count.

find . -type d -exec sh -c 'echo -n "{}: "; find "{}" -maxdepth 1 -type f | wc -l' \;

Delete files older than 10 days and print their names

Removes files older than 10 days and prints each filename as it is deleted.

find . -mtime +10 -exec rm -f {} \; -print

⚙️ Monitoring Processes and Services

Check Oracle Concurrent Manager processes

Verifies if FNDLIBR processes (Concurrent Managers) are running.

ps -ef | grep FNDLIBR

Check Oracle HTTP Server / Apache processes

Lists active Apache or HTTPD processes.

ps -ef | grep apache
ps -ef | grep httpd

Check Forms server processes

Confirms if Oracle Forms runtime processes are active.

ps -ef | grep forms

Check OACore WebLogic managed server processes

Displays running OACore JVM processes (useful for EBS WebLogic troubleshooting).

ps -ef | grep oacore

Check if a port is listening

Tests if a specific port is active and accepting connections.

netstat -an | grep <port>

List open ports with associated processes

Shows which processes are bound to a given port (requires appropriate privileges).

netstat -nlpa | grep <port>

Show processes using port 5557

Finds detailed process info for applications using port 5557.

netstat -anp | grep 5557

Test TCP connection (PostgreSQL example)

Checks if a remote host and port (e.g., PostgreSQL 5432) are reachable using netcat.

nc -zv 10.0.2.155 5432

Verify connection with telnet

Uses telnet to manually test host and port connectivity (useful for quick debugging).

telnet <host_name> <port>

📑 Configuration File Exploration

Quickly extract important port, URL, and service configurations from your Oracle EBS $CONTEXT_FILE.

grep -i oacore_server_ports $CONTEXT_FILE
grep -i oafm_server_ports $CONTEXT_FILE
grep -i appldcp $CONTEXT_FILE
grep -i s_shared $CONTEXT_FILE
grep s_url_protocol $CONTEXT_FILE
grep "s_endUserMonitoringURL" $CONTEXT_FILE
grep "s_external_url" $CONTEXT_FILE
grep "s_webentryhost" $CONTEXT_FILE
grep "s_webentrydomain" $CONTEXT_FILE
grep "s_webdomain" $CONTEXT_FILE
grep "s_login_page" $CONTEXT_FILE
grep "s_active_webport" $CONTEXT_FILE
grep "s_webssl_port" $CONTEXT_FILE
grep "s_webentryurlprotocol" $CONTEXT_FILE
grep "httpslistenparameter" $CONTEXT_FILE
grep "s_enable_sslterminator" $CONTEXT_FILE
grep "adminport" $CONTEXT_FILE
grep "URL" $CONTEXT_FILE
grep $APPLTMP $CONTEXT_FILE
grep $APPLPTMP $CONTEXT_FILE

🖥️ Oracle EBS Managed Server Status

List OACore and OAFM managed servers

Displays all configured managed servers inside the domain directory.

ls $EBS_DOMAIN_HOME/servers/ | grep oacore
ls $EBS_DOMAIN_HOME/servers/ | grep oafm

Check status of specific managed servers

Runs admanagedsrvctl.sh to verify if servers are up or down.

./admanagedsrvctl.sh status oacore_server1
./admanagedsrvctl.sh status forms_server1
./admanagedsrvctl.sh status oafm_server1
./admanagedsrvctl.sh status forms-c4ws_server1

Loop through multiple servers in one go

Automates status checks for multiple managed servers in a single command.

for srv in oacore_server1 oafm_server1 forms_server1 forms-c4ws_server1; do
  ./admanagedsrvctl.sh status $srv
done

🖥️ Terminal Multiplexing with Tmux

Start a new tmux session

Create a detachable terminal session so you can run long jobs and come back to them later.

tmux

Detach from a running session

Press Ctrl+B then D to detach and leave the session running in background.

CTRL+B D

Reattach to a detached session

Reconnect to a previously detached tmux session.

tmux a

🔑 SSH Key Generation and Setup

Generate RSA SSH key (PEM format)

Creates a 2048-bit RSA private/public keypair in PEM format for compatible SSH setups.

ssh-keygen -t rsa -b 2048 -m PEM

Generate ECDSA SSH key

Creates a high-strength ECDSA key (521-bit) for modern SSH security.

ssh-keygen -t ecdsa -b 521

Add public key to authorized_keys

Append your public key so that the corresponding private key can be used to SSH in.

cat id_rsa.pub >> authorized_keys

🔐 File Attributes and Permissions

Add immutable attribute (protect file)

Prevents file deletion or modification even by root until the attribute is removed.

chattr +i <file_name>

Remove immutable attribute

Allows modifications after removing the immutable flag.

chattr -i <file_name>

💽 Disk and Filesystem Identification

List block devices with UUIDs and mount points

Shows block device names, unique identifiers, and where they're mounted.

lsblk -o NAME,UUID,MOUNTPOINT

Display detailed block device info

Prints device information such as LABEL, UUID and filesystem type.

blkid

✍️ Quick Text Replacement

Replace “deny” with “allow” in config.xml

Performs an inline replacement and saves the file using the classic Ex editor.

ex -s -c '%s/deny/allow/g|x' config.xml

27 September 2022

Change APPS password Oracle EBZ R12 (12.2)

APPS Password Change – Oracle EBS R12.2

🛠️ Changing APPS Password in Oracle EBS R12.2

Note: Always ensure you take proper backups before altering APPS, APPLSYS, or APPS_NE user passwords.

🔐 Tables to Backup

  • FND_USER
  • FND_ORACLE_USERID
create table FND_USER_BK as select * from FND_USER;
create table FND_ORACLE_USERID_BK as select * from FND_ORACLE_USERID;

⛔ Step 1: Shut Down the Application Tier

cd /u01/app/PROD
. EBSapps.env run
cd $ADMIN_SCRIPTS_HOME
adstpall.sh

🔄 Step 2: Change APPLSYS Password

A. Using FNDCPASS

FNDCPASS apps/<appspwd> 0 Y system/manager SYSTEM APPLSYS <new_password>

B. Using AFPASSWD

AFPASSWD -c apps@UAT -s APPLSYS

⚙️ Step 3: Run AutoConfig

cd /u01/app/PROD
. EBSapps.env run
cd $ADMIN_SCRIPTS_HOME
adautocfg.sh

🚀 Step 4: Restart Admin Server

cd $ADMIN_SCRIPTS_HOME
sh adadminsrvctl.sh start

📊 Step 5: Verify Server Status

sh adadminsrvctl.sh status

🔁 Step 6: Update WebLogic Datasource Password

A. For AD TXK Delta 7 or Higher

perl $FND_TOP/patch/115/bin/txkManageDBConnectionPool.pl
Choose: updateDSPassword

B. For AD TXK Delta Below 7

  1. Login to WebLogic Console
  2. Click "Lock and Edit"
  3. Navigate: Services → Data Sources
  4. Select EBSDataSource
  5. Update apps user password in Connection Pool
  6. Click “Activate Changes”

04 March 2022

RMAN Backup Script

 #!/bin/bash

# Source the Oracle environment
if [ -f ~/.bash_profile ]; then
  source ~/.bash_profile
fi

LOG_FILE="/home/oraprod/backup_PRODCDB_${DATE}.log"
BACKUP_DIR="/backup/"

# Create the backup directory if it doesn't exist
mkdir -p ${BACKUP_DIR}

# Run RMAN commands directly
${ORACLE_HOME}/bin/rman target / log=${LOG_FILE} <<EOF
run {
  allocate channel d1 type disk;
  allocate channel d2 type disk;
  allocate channel d3 type disk;
  
  # Database backup
  backup AS COMPRESSED BACKUPSET format '${BACKUP_DIR}/PRODCDB_bu_db_%d_t%t_s%s_p%p' database;
  
  # Archive logs
  sql 'alter system archive log current';
  sql 'alter system archive log current';
  sql 'alter system archive log current';
  sql 'alter system archive log current';
  sql 'alter system archive log current';
  
  backup AS COMPRESSED BACKUPSET format '${BACKUP_DIR}/PRODCDB_bu_al_t%t_s%s_p%p' archivelog all skip inaccessible delete input;
  
  # Controlfile backup
  backup format '${BACKUP_DIR}/PRODCDB_control%U' current controlfile;
  
  # Release channels
  release channel d1;
  release channel d2;
  release channel d3;
  
  # Crosscheck backup
  allocate channel d1 type disk;
  crosscheck backup;
  release channel d1;
}
EOF

# Check if the backup succeeded
if [ $? -eq 0 ]; then
  echo "RMAN backup completed successfully. Backup files are stored in ${BACKUP_DIR}."
else
  echo "RMAN backup failed. Check the log file: ${LOG_FILE}" >&2
  exit 1
fi

12 February 2022

Getting Error while login to WebLogic Console Oracle Application R12 (12.2.14)

Getting Error while login to WebLogic Console Oracle Application R12 (12.2)

The Server is not able to service this request: [Socket:000445]Connection rejected, filter blocked Socket, weblogic.security.net.FilterException: [Security:090220]rule 2

 

Issue:
The error I encountered is related to a feature in WebLogic known as a connection filter. This mechanism provides network-layer access control, enabling the server to block unwanted communication based on various criteria.

Solution:

We need to update the connection filter value to 'allow' in the config.xml file located in the $EBS_DOMAIN_HOME/config folder

 

[applprod@cloner12 ~]$ cd $EBS_DOMAIN_HOME/config

[applprod@cloner12 config]$ ls -l config.xml

-rw-r----- 1 applprod dba 55688 Jun 18 22:37 config.xml

[applprod@cloner12 config]$ grep connection-filter config.xml

    <connection-filter>oracle.apps.ad.tools.configuration.wls.filter.EBSConnectionFilterImpl</connection-filter>

    <connection-filter-rule>cloner12.githesh.com * * allow</connection-filter-rule>

    <connection-filter-rule>0.0.0.0/0 * * deny</connection-filter-rule>

 


Backup the config.xml

 

[applprod@cloner12 config]$ cp -rf  config.xml  config.xml_bk

And change the value from deny to allow

 

[applprod@cloner12 config]$ sed -i 's/<connection-filter-rule>0\.0\.0\.0\/0 \* \* deny<\/connection-filter-rule>/<connection-filter-rule>0.0.0.0\/0 * * allow<\/connection-filter-rule>/' config.xml

[applprod@cloner12 config]$ grep connection-filter config.xml

    <connection-filter>oracle.apps.ad.tools.configuration.wls.filter.EBSConnectionFilterImpl</connection-filter>

    <connection-filter-rule>cloner12.githesh.com * * allow</connection-filter-rule>

    <connection-filter-rule>0.0.0.0/0 * * allow</connection-filter-rule>

 


 

Stop and Start the admin server

[applprod@cloner12 config]$ cd $ADMIN_SCRIPTS_HOME

[applprod@cloner12 scripts]$ ./adadminsrvctl.sh stop

[applprod@cloner12 scripts]$ ./adadminsrvctl.sh start


 

WebLogic Console

 

 

Oracle E-Business Suite R12.2.14 Clone with Oracle 19c Database

Oracle E-Business Suite R12.2.14 Clone with Oracle 19c Database Oracle E-Business Suite R12.2.14 Clone with Oracle 1...