Tuesday, April 18, 2017

see protocols which used in networking

network monitoring and security protocols

Sunday, April 16, 2017


CONCURRENT PROGRAM NAME BASED ON THE REQUEST ID

With the following query, you can get the concurrent program name based on the Concurrent request ID

Select program from FND_CONC_REQ_SUMMARY_V
where request_id = ‘Your request ID’;

Start and stop Concurrent Manager in 11i Apps


adcmctl.sh is one of the scripts in oracle applications 11i for starting and stopping Concurrent Manger service. It requires apps username and password to run this script. Using this predefined script we can start, stop, abort and check the status of Concurrent Manger Service.

Starting Service of CM:

# su - applebis

$ cd /ebis/ebisapps/ebiscomn/admin/scripts/PRODDB_ebis/

$ sh adcmctl.sh start apps/appspw

Sample Output:
mydb:applprod$sh adcmctl.sh start apps/apps
You are running adcmctl.sh version 115.31
Starting concurrent manager for PROD_806_BALANCE …
Starting PROD_0725@PROD_806_BALANCE Internal Concurrent Manager
Default printer is noprint
adcmctl.sh: exiting with status 0

Stoping Service of CM:

# su - applebis

$ cd /ebis/ebisapps/ebiscomn/admin/scripts/PRODDB_ebis/

$ sh adcmctl.sh stop apps/appspw

Sample Output:
mydb:applprod$sh adcmctl.sh stop apps/apps
You are running adcmctl.sh version 115.31
Shutting down concurrent managers for PROD_806_BALANCE …
Submitted request 15895555 for CONCURRENT FND SHUTDOWN
adcmctl.sh: exiting with status 0


Status of CM:

# su - applebis

$ cd /ebis/ebisapps/ebiscomn/admin/scripts/PRODDB_ebis/

$ sh adcmctl.sh status apps/appspw

Sample Output:


mydb:applprod$sh adcmctl.sh status apps/apps
You are running adcmctl.sh version 115.31
Internal Concurrent Manager is Active.
adcmctl.sh: exiting with status 0


Please check is there any concurrent process is there before starting concurrent processing server. If the concurrent process still exists after shutdown kindly wait for some time for clearing the requests

The bellow command will tell you how many concurrent processes are running.Here applprod is the user for the application file system.

For finding FNDLIBR process:

ps -ef|grep applprod|grep FNDLIBR

For counting FNDLIBR process

ps -ef|grep applprod|grep FNDLIBR|wc –l

For killling FNDLIBR process

kill -9 <PID>


Find Concurrent manager logs on Oracle App

Concurrent Mangers log files are located in the $APPLCSF/$APPLLOG location.
cd $APPLCSF/$APPLLOG
For ICM Log                                       –> ls -lrt *$TWO_TASK*
For Standard manager Log                  –> ls -lrt w*.mgr
For Conflict Resolution manager Log –> ls -lrt c*.mgr

We can also get the ICM manager logfile location with below query

SELECT 'ICM_LOG_NAME=' || fcp.logfile_name
FROM fnd_concurrent_processes fcp, fnd_concurrent_queues fcq
WHERE fcp.concurrent_queue_id = fcq.concurrent_queue_id
AND fcp.queue_application_id = fcq.application_id
AND fcq.manager_type = '0'
AND fcp.process_status_code = 'A';

Sample Output:

'ICM_LOG_NAME='||FCP.LOGFILE_NAME
-----------------------------------------------------------
ICM_LOG_NAME=/ebis/ebisapps/ebiscomn/admin/log/PRODDB_ebis/PRODDB_0417.mgr

Saturday, April 15, 2017


How to Flush Mail Queue in Linux

# mailq

# sendmail -bp

Sample Outputs


                /var/spool/mqueue (3 requests)

-----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recipient-----------
v3G31Qbu031236      147 Sun Apr 16 08:31 <root@ebis.expolanka.com>
                 (host map: lookup (expolanka.com): deferred)
                                         <dbateam@expolanka.com>

You can cd to /var/spool/mqueue and delete all files if you want to get rid of all messages in the queue:

# cd /var/spool/mqueue/
# ls
# rm *

 # /etc/init.d/sendmail restart

----------------------------------------------------------------------------------------------------------------------

vi /etc/mail/mailertable

expolanka.com esmtp:[10.2.20.160]


restart sendmail

----------------------------------------------------------------------------------------------------------------------

qtool.pl Tool

Sendmail mail server does not provide any command to remove messages from the mail queue. The above will delete all messages from the mail queue. You can use qtool.pl scriptlocated in sendmail source code contrib directory as follows:
# mailq
Sample outputs:
  /var/spool/mqueue (1 request)
-----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recipient-----------
p61J75u5037681      893 Fri Jul  1 14:07 
      8BITMIME   (Deferred: Connection timed out with example.com.)
      
  Total requests: 1
Note down Q-ID p61J75u5037681 and run qtool.pl as follows:
# ./qtool.pl -C /etc/mail/sendmail.cf -d /var/spool/mqueue/p61J75u5037681
Where,
  • -C /etc/mail/sendmail.cf – Specify sendmail config file.
  • -d /var/spool/mqueue/p61J75u5037681 – Delete the messages specified by source. In this case by Q-ID.
  • To delete all messages queued for the example.com domain. First, you need to set QIDS either using the mailq command or manually as follows:
    QIDS="qid1 qid2 qidN"
    OR
    QIDS="$(mailq | grep -B1 'example.com' | grep '^[a-z]'  | awk  '{print $1}' | sed  's/\*$//')"
    Use the following bash for loop to delete all messages for example.com:
    for q in $QIDS
    do
      /usr/local/bin/qtool.pl -C /etc/mail/sendmail.cf -d /var/spool/mqueue/$q
    done

    More links and information:




How to change a machines hostname in Red Hat 6

There are several ways to change the hostname of a machine running Redhat 6.  These also works on CentOS, Fedora and older/other Redhat variants.

First: The "hostname" command.

You can use the hostname command to see the current host name of the system.

# hostname
ebisapps.expolanka.com


You can also use the hostname command to change the host name of the machine.

# hostname ebis.expolanka.com

Then issue the hostname command again to see the changes.
# hostname
ebis.expolanka.com

This only makes a temporary or non-persistent change of hostname.

Second: The /etc/sysconfig/network configuration file. (preferred method)

In order for the change to survive a reboot, or to make it persistent, you must change it in the /etc/sysconfig/network file.

Open the file in your favorite editor and change the following line to reflect your desired hostname.

# vi /etc/sysconfig/network

HOSTNAME=ebis.expolanka.com

After making changing to the configuration file you need to restart the network service in order to read that file.

# /etc/init.d/network restart

NOTE: Do not do this remotely (via ssh) or you will lose your connection.

If you issue the hostname command now, you will see the hostname has changed.

Third: The /proc/sys/kernel/hostname entry.
Another simple way to change the hostname is to echo the hostname into the /proc/sys/kernel/hostname file.

# echo "ebis.expolanka.com" > /proc/sys/kernel/hostname

NOTE: Using the /etc/sysconfig/network file is the preferred method to set the permanent hostname of a system.  Anything in the /proc/sys/kernel/hostname file will be overridden by the /etc/sysconfig/network file during a reboot.

If you are using Red Hat 7 (RHEL7), CentOS 7 or newed versions of Fedora click below of instructions on changing your hostname.

http://www.putorius.net/2015/04/how-to-change-system-hostname-in-red.html

Thursday, April 6, 2017


General Requirements for Install / Clone Oracle Apps 11i 32bit in  REHL 5 

Oracle Applications Installation Update Notes, Release 11i (11.5.10.2) (Doc ID 316806.1)

 Red Hat Enterprise Linux 5 (RHEL5). The article is based on a server installation similar to this, with a minimum of 2G swap, secure Linux disabled and the following package groups installed.
  • GNOME Desktop Environment
  • Editors
  • Graphical Internet
  • Text-based Internet
  • Development Libraries
  • Development Tools
  • Legacy Software Development
  • Server Configuration Tools
  • Administration Tools
  • Base
  • Legacy Software Support
  • System Tools
  • X Window System


Operating System Name
Supported Version
Oracle Linux (32-bit)
4, 5 - installation and maintenance pack

Operating System
Required Patches
Oracle Linux 5*
Red Hat Enterprise Linux 5* (base and
Advanced Platform)
Update 1 (Oracle Linux 5.1) or higher is required

Update 1 (RHEL 5.1) or higher is required.
The following packages are not part of the Oracle Linux 5 or RHEL 5 distribution media and must be installed manually1:
  • compat-libstdc++-egcs-1.1.2-1
  • compat-libcwait-2.1-1
  • compat-oracle-el5-1.0-5
  • openmotif21-2.1.30-11.EL5
Ensure that the following are installed from the Oracle Linux 5 or RHEL 5 distribution media:
  • binutils-2.17.50.0.6-5.el5
  • libXp-1.0.0-8.1.el5
  • compat-glibc-2.3.4-2.26
  • compat-libgcc-296-2.96-138
  • compat-libstdc++-33-3.2.3-61
  • compat-db-4.2.52-5.1
Note : 

 RPM List

rpm -ivh kernel-headers-2.6.18-194.el5.i386.rpm
rpm -ivh glibc-headers-2.5-49.i386.rpm
rpm -ivh glibc-devel-2.5-49.i386.rpm
rpm -ivh compat-libstdc++-egcs-1.1.2-1.i386.rpm
rpm -ivh compat-libcwait-2.1-1.i386.rpm
rpm -ivh compat-binutils215-2.15.92.0.2-24.i386.rpm
rpm -ivh compat-gcc-34-3.4.6-4.i386.rpm
rpm -ivh compat-libf2c-34-3.4.6-4.i386.rpm
rpm -ivh compat-gcc-34-g77-3.4.6-4.i386.rpm
rpm -ivh compat-gcc-34-c++-3.4.6-4.i386.rpm
rpm -ivh libgomp-4.4.0-6.el5.i386.rpm
rpm -ivh gcc-4.1.2-48.el5.i386.rpm
rpm -ivh libstdc++-devel-4.1.2-48.el5.i386.rpm
rpm -ivh gcc-c++-4.1.2-48.el5.i386.rpm
rpm -ivh libXp-1.0.0-8.1.el5.i386.rpm
rpm -ivh  libXau-devel-1.0.1-3.1.i386.rpm
rpm -ivh libXp-devel-1.0.0-8.1.el5.i386.rpm
rpm -ivh openmotif21-2.1.30-11.EL5.i386.rpm
rpm -ivh binutils-2.17.50.0.6-14.el5.i386.rpm
rpm -ivh libXp-1.0.0-8.1.el5.i386.rpm
rpm -ivh  compat-glibc-headers-2.3.4-2.26.i386.rpm
rpm -ivh compat-glibc-2.3.4-2.26.i386.rpm
rpm -ivh compat-libgcc-296-2.96-138.i386.rpm
rpm -ivh compat-libstdc++-33-3.2.3-61.i386.rpm
rpm -ivh compat-db-4.2.52-5.1.i386.rpm



General Requirements for UNIX/Linux

This section outlines requirements that apply to all UNIX/Linux operating systems. Specific requirements are listed under separate headings.

Kernel Settings

For recommended kernel settings, refer to the database installation guide (software and hardware requirements section) for your platform. Also refer to My Oracle Support Note 169706.1, "Oracle Database on Unix AIX,HP-UX,Linux,Mac OS X,Solaris,Tru64 Unix Operating Systems Installation and Configuration Requirements Quick Reference (8.0.5 to 11.2)".

LD_LIBRARY_PATH Environment Variable

Dynamic libraries are used as part of the relinking and execution processes. The LD_LIBRARY_PATH environment variable is used by Oracle Applications to locate the required dynamic libraries at runtime. Rapid Install sets LD_LIBRARY_PATH as follows:
On each application tier server node:
LD_LIBRARY_PATH is set in three places:
·         $APPL_TOP/admin/adovars.env
·         $ORACLE_HOME/<CONTEXT_NAME>.env, in both the 8.0.6 and iAS Oracle home directories
To change the value in any of the application tier locations, use the Edit Parameters function of the OAM AutoConfig tool to update the following fields (as required). Then, run AutoConfig (adautocfg.sh) to implement the changes.
Parameter
Value
adovars
LD_LIBRARY_PATH or SHLIB_PATH (HP-UX PA-RISC only) or LIBPATH (IBM AIX only)
iAS Oracle Home
LD_LIBRARY_PATH or SHLIB_PATH (HP-UX PA-RISC only) or LIBPATH (IBM AIX only)
Tools Oracle Home
LD_LIBRARY_PATH or SHLIB_PATH (HP-UX PA-RISC only) or LIBPATH (IBM AIX only)


Additional Information:
See AutoConfig in Oracle Applications Maintenance Utilities.




On the database server node:
LD_LIBRARY_PATH is set in $ORACLE_HOME/<CONTEXT_NAME>.env.

Linux x86 and Linux x86-64 (AMD64/EM64T) Requirements

This section describes requirements that are specific to Linux x86 and Linux x86-64 (AMD64/EM64T). Oracle Applications (11i) is supported on Linux x86 or Linux x86-64 (AMD64/EM64T) running the 32-bit version of the operating system only.

Note:
You can only install Oracle Applications on an x86-64 architecture server if the operating system is 32-bit Linux or Windows. If your operating system is 64-bit, contact your operating system vendor to obtain a 32-bit operating system before installing Oracle Applications.

All Linux x86 and Linux x86-64 (AMD64/EM64T) Operating Systems

Oracle Linux 4, Oracle Linux 5, Red Hat Enterprise Linux AS/ES 2.1, Red Hat Enterprise Linux AS/ES 3, Red Hat Enterprise Linux AS/ES 4, Red Hat Enterprise Linux 5, SUSE Linux Enterprise Server 8, SUSE Linux Enterprise Server 9, SUSE Linux Enterprise Server 10 all have dependencies on the following components. Dependencies that pertain only to a subset of Linux x86 and x86-64 (AMD64/EM64T) operating systems are listed under separate headings.

Kernel Requirements

The following table lists the required minimum kernel versions (to determine version, enter: $ uname -r).
Operating System
Kernel
Red Hat Enterprise Linux 5
2.6.18-8.EL

glibc Requirements

The following table lists the required minimum glibc versions (to determine this, enter: $ rpm -q glibc).
Operating System
glibc
Oracle Linux 5
2.5-18




Domain Name System (DNS) Resolver Parameters

Two Domain Name System (DNS) resolver parameters (timeout and attempts) are set by default to low values when the operating system is installed. These low values may cause attempted network connections to an Oracle database to fail. If this happens, add or update the following entries to these minimum settings in the /etc/resolv.conf file on each server node:
options attempts:5
options timeout:15

Net Service Listeners in Multi-user Installations

Give all users in a multi-user installation write privileges to the .oracle directory:
$ chmod 777 /var/tmp/.oracle

Oracle Linux 4 and 5, Red Hat Enterprise Linux 3, 4 and 5 and SUSE Linux Enterprise Server 8, 9 and 10

This section describes requirements that apply only to Oracle Linux 4 and 5, Red Hat Enterprise Linux 3, 4 and 5 and SUSE Linux Enterprise Server 8, 9 and 10.

Verifying Host Names

Use the following to verify host name settings:
For Oracle Linux 4 and 5, Red Hat Enterprise Linux 3, 4 and 5:
1.       Verify that the /etc/hosts file is formatted as follows:
2.        127.0.0.1 localhost.localdomain localhost
<ip_address> <node_name>.<domain_name> <node_name>
3.       Verify that the /etc/sysconfig/network file is formatted as follows:
4.        HOSTNAME=<node_name>.<domain_name>
5.         
6.       If the /etc/sysconfig/networking/profiles/default/network file exists, remove it.
7.       If you changed any files in the previous steps, restart the system.


Modifying the Number of Open File Descriptors

Open the /etc/security/limits.conf file and change the existing values for "hard" and "soft" parameters as follows. Restart the system after making changes.
For Oracle Linux 4 and 5, Red Hat Enterprise Linux 3, 4 and 5 and SUSE Linux Enterprise Server 9 and 10:
* hard nofile 65535
* soft nofile 4096
For SUSE Linux Enterprise Server 8:
* hard nofile 32768
* soft nofile 32768

Modifying the Port Range Values

Open the /etc/sysctl.conf file and change the value of net.ipv4.ip_local_port_range as follows. Restart the system after making changes.
net.ipv4.ip_local_port_range = 10000 65000
Please note that this range is a recommended range, and may need to be adjusted according to the specific needs of the user's environment in order to avoid port conflicts.

For Oracle Linux 5 and Red Hat Enterprise Linux 5 only :
# ln -s /usr/bin/ld215 /usr/bin/ld

Download and apply the OS library patch 6078836 from My Oracle Support and create the following symbolic link:
# ln -s /usr/lib/libdb.so.2 /usr/lib/libdb.so.3
  1. Verify that the host name setting is correct. The command should return a fully qualified host name. For example: <host_name>.<domain_name>.

# hostname -f

Monday, April 3, 2017


OPatch Installation Steps 

opatch


(I) Prerequisites
--------------------

Before you install or deinstall the patch, ensure that you meet the following requirements:

1. Ensure that you shut down all the services running from the Oracle home.

2. Go through the README file for installation guides

3.      Ensure that you have OPatch 19 Release 12.2.0.1.19 or higher. Oracle recommends that you use the latest version available for  19 Release 12.2.0.1.19. 
Note:
If you do not have OPatch latest version then download it from patch# 6880880 for  19.XX or  12.XX

For information about OPatch documentation, including any known issues, see My Oracle Support Document 293369.1 OPatch documentation list:



$ cd /u01/software

$ unzip p31602782_198000DBRU_AIX64-5L.zip


Export Path
---------------

$ echo $PATH

$  echo $ORACLE_HOME
/u01/app/oracle/product/19.0.0/dbhome1

$ export PATH=$PATH:/u01/app/oracle/product/19.0.0/dbhome1/OPatch


(Only for Installation) Determine whether any currently installed interim patches conflict with this patch 31602782 as shown below:


$ cd <PATCH_TOP_DIR>/31602782

$ opatch prereq CheckConflictAgainstOHWithDetail -ph ./

-------------------------------------------------------------------------------------

(II) Installation  
-------------------
To install the patch, follow these steps: 
Shutdown  all databases and listeners running in this oracle_home

1. Set your current directory to the directory where the patch is located and then run the OPatch utility by entering the following commands:

$ cd <PATCH_TOP_DIR>/31602782

$ opatch apply

2. Verify whether the patch has been successfully installed by running the following command:

$ opatch lsinventory

3. Start the services from the Oracle home.


Postinstallation

Please go through the REAME of each patch before start Post-Installation process will be different for each patch

Perform the following postinstallation steps described in Loading Modified SQL Files Into the Database.

1.4.1 Loading Modified SQL Files Into the Database

To perform the postinstallation, follow these steps:

  1. The following steps load modified SQL files into the database.

    Datapatch is run to complete the post-install SQL deployment for the Update. For further details about Datapatch, including Known Issues and workarounds to common problems, see: Datapatch: Database 12c or later Post Patch SQL Automation (Doc ID 1585822.1).

    1. For each separate database running on the same shared Oracle home being patched, run the datapatch utility as described in the following table.

      Table 1-1 Steps to Run the Datapatch Utility for Standalone Database Versus Single or Multitenant (CDB or PDB) Database

      StepsStandalone DatabaseStepsSingle or Multitenant (CDB or PDB) Database

      1

      % sqlplus /nolog

      1

      % sqlplus /nolog

      2

      SQL> Connect / as sysdba

      2

      SQL> Connect / as sysdba

      3

      SQL> startup Footnote 1

      3

      SQL> startupFootnote 1

      4

      SQL> quit

      4

      SQL> alter pluggable database all open;Footnote 2

      5

      % cd $ORACLE_HOME/OPatch

      5

      SQL> quit

      6

      % ./datapatch -verbose

      6

      % cd $ORACLE_HOME/OPatch

      7

      % sqlplus /nolog

      7

      % ./datapatch -verbose

      8

      SQL> Connect / as sysdba

      8

      % sqlplus /nolog

      9

      SQL> shutdown

      9

      SQL> Connect / as sysdba

      10

      SQL> startupFoot 3

      10

      SQL> shutdown


      11

      SQL> startupFootnote 3



      12

      SQL> alter pluggable database all open;

1.4.2 - For no RU update patches


The following steps load modified SQL files into the database. For a RAC environment, perform these steps on only one node.

1. For each database instance running on the Oracle home being patched, connect to the database using SQL*Plus. Connect as SYSDBA and run the below script as follows:

$ sqlplus /nolog

SQL> CONNECT / AS SYSDBA

SQL> @?/sqlpatch/31602782/postinstall.sql

2. Check the output for any errors.


(IV) Deinstallation
------------------------

Ensure to follow the Prerequsites (Section I). To deinstall the patch, follow these steps:


1. Deinstall the patch by running the following command:

$ opatch rollback -id 31602782
  
2. Start the services from the Oracle home.

3. Ensure that you verify the Oracle Inventory and compare the output with the one run before the patch installation and re-apply any patches that were rolled back as part of this patch apply. To verify the inventory, run the following command:

$ opatch lsinventory


How to fix “OPatch failed with error code 41”



Errors and fixes
for data patch fails

$ . oraenv
ORACLE_SID = [testcdb] ?

$ ./datapatch -verbose -pdbs CDB\$ROOT,TESTPDB
SQL Patching tool version 19.12.0.0.0 Production on Wed Oct  6 16:16:48 2021
Copyright (c) 2012, 2021, Oracle.  All rights reserved.

Log file for this invocation: /u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_42205464_2021_10_06_16_16_48/sqlpatch_invocation.log

Connecting to database...OK
Gathering database info...done

Note:  Datapatch will only apply or rollback SQL fixes for PDBs
       that are in an open state, no patches will be applied to closed PDBs.
       Please refer to Note: Datapatch: Database 12c Post Patch SQL Automation
       (Doc ID 1585822.1)

Bootstrapping registry and package to current versions...done
Determining current state...done

Current state of interim SQL patches:
Interim patch 32876380 (OJVM RELEASE UPDATE: 19.12.0.0.210720 (32876380)):
  Binary registry: Installed
  PDB CDB$ROOT: Not installed
  PDB TESTPDB: Not installed

Current state of release update SQL patches:
  Binary registry:
    19.12.0.0.0 Release_Update 210718143527: Installed
  PDB CDB$ROOT:
    Applied 19.8.0.0.0 Release_Update 200709022037 successfully on 12-SEP-20 12.11.40.138977 AM
  PDB TESTPDB:
    Applied 19.8.0.0.0 Release_Update 200709022037 successfully on 12-SEP-20 12.11.42.059852 AM

Adding patches to installation queue and performing prereq checks...done
Installation queue:
  For the following PDBs: CDB$ROOT TESTPDB
    No interim patches need to be rolled back
    Patch 32904851 (Database Release Update : 19.12.0.0.210720 (32904851)):
      Apply from 19.8.0.0.0 Release_Update 200709022037 to 19.12.0.0.0 Release_Update 210718143527
    The following interim patches will be applied:
      32876380 (OJVM RELEASE UPDATE: 19.12.0.0.210720 (32876380))

Installing patches...
Patch installation complete.  Total patches installed: 4

After fixing PDB$SEED, you can apply datapatch to it alone.

$ /u01/app/oracle/product/12.1.0.2/dbhome_1/OPatch/datapatch -verbose -pdbs 'PDB$SEED'

how to check data patch status.


SQL> set lines 300
SQL> select PATCH_ID,PATCH_TYPE,ACTION,STATUS,ACTION_TIME,DESCRIPTION from DBA_REGISTRY_SQLPATCH;

  PATCH_ID PATCH_TYPE ACTION          STATUS                    ACTION_TIME                                                   DESCRIPTION
---------- ---------- --------------- -------     --------------- ---     --------------------- ------------------------------       ----------------------------------------------------------------------
  31281355 RU  APPLY                      SUCCESS                   12-SEP-20 12.11.40.138977 AM             Database Release Update : 19.8 .0.0.200714 (31281355)
  32876380 INTERIM   APPLY           SUCCESS                   06-OCT-21 04.26.55.992418 PM            OJVM RELEASE UPDATE: 19.12.0.0.210720 (32876380)
  32904851 RU   APPLY                    SUCCESS                   06-OCT-21 04.26.55.985246 PM            Database Release Update : 19.12.0.0.210720 (32904851)


https://blogs.oracle.com/letthesunshinein/db12c-patching:-multitenant-datapatch-tips

  RMAN-20207: UNTIL TIME or RECOVERY WINDOW is before RESETLOGS time https://shivanandarao-oracle.com/2012/12/05/rman-20207-until-time-or-re...