Sunday, June 11, 2017

Oracle Shutdown Immediate Waiting On Active Process

Oracle Shutdown Immediate Waiting On Active Process


Usually whenever we try to shutdown an oracle database with immediate option it will wait for some active process to get terminate. This may take long time and it also depends on the number of processes.

Use below command to find out the active sessions on database:


bash-3.00$ ps -ef | grep LOCAL=NO
oracle 17862     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17882     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17854     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17890     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17906     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17848     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17978     1   0   Jun 13 ?           0:03 oracletest (LOCAL=NO)
oracle 17908     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17918     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17910     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17852     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17866     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17930     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17914     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17874     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17932     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17986     1   0   Jun 13 ?           0:03 oracletest (LOCAL=NO)
oracle 17952     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17936     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17836     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17944     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17974     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17948     1   0   Jun 13 ?           0:05 oracletest (LOCAL=NO)
oracle 17898     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17878     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17876     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17900     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17924     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17902     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17892     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17894     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17956     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17966     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17940     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17834     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17960     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)
oracle 17934     1   0   Jun 13 ?           0:00 oracletest (LOCAL=NO)

We need to kill the process only with option LOCAL=NO.

The below is the handy UNIX command which can be used for killing these idle active session on database which are avoiding the database to shutdown with immediate option.


ps -ef|grep 'oracletest (LOCAL=NO)'|grep -v grep|awk '{print$2}'|xargs -i kill -9 {}

Now verify the processes again with ps -ef | grep LOCAL=NO it should not return any list. If these processes killed then the database will shutdown.

Sunday, June 4, 2017

No Concurrent Manager Is Defined To Process This Request, So It Cannot Be Processed.

No Concurrent Manager Is Defined To Process This Request, So It Cannot Be Processed. 


APPLIES TO:

Oracle Inventory Management - Version 11.5.10.CU2 to 12.2 [Release 11.5.10 to 12.2]
Information in this document applies to any platform.

SYMPTOMS

There are stuck transactions in mtl_transactions_interface table for ship confirm receiving transactions with the following error:

ERROR
No concurrent manager is defined to process this request, so it cannot be processed.

CAUSE

The concurrent manager log shows the following:

Starting RCVOLTM Concurrent Manager : 10-MAR-2016 06:56:27
Process monitor session ended : 10-MAR-2016 06:56:27
Process monitor session started : 10-MAR-2016 06:58:27
CONC-SM TNS FAIL
Call to PingProcess failed for FNDOPP

<the above continues to loop repeatedly for some time>
. . .
Routine AFPEIM encountered an error while starting concurrent manager
RCVOLTM.
The manager is not able to start properly.
The manager has been put on a SYSTEM HOLD to allow the system administrator to address the issue.
When addressed, the "Fixed" button on the Administer Managers screen can be pressed to restart the manager.


SOLUTION

The concurrent manager log shows there is a problem with this instance, the log shows errors similar to what is reported in Note 1312632.1, please engage your DBA and perform these steps:

Please perform the following steps:

1. Stop all middle tier services including the concurrent managers. Make sure no FNDLIBR, FNDSM, or other dead processes are running.

2. Stop and then restart the database.

3. Connect to SQLPLUS as APPS user and run the following :

   EXEC FND_CONC_CLONE.SETUP_CLEAN;
   COMMIT;
   EXIT;

4. Reference Note.260887.1 regarding the Steps to Clean Nonexistent Nodes or IP Addresses from FND_NODES.

5.. Run AutoConfig on all tiers, firstly on the DB tier and then the APPS tiers and Web tiers to repopulate the required system tables.

6. Connect to SQLPLUS as APPS user and run the following statement :

   select CONCURRENT_QUEUE_NAME
   from FND_CONCURRENT_QUEUES
   where CONCURRENT_QUEUE_NAME like 'FNDSM%';

If the above SQL does not return any value please do the following:

   cd $FND_TOP/patch/115/sql

Connect to SQLPLUS as APPS user and run the following script :

   SQL> @afdcm037.sql;

Reference Note 218893.1 How to Create The Service Manager 'FNDSM' on Oracle Applications to create libraries for FNDSM and create managers for preexisting nodes.

Check again that FNDSM entries now exist:

   select CONCURRENT_QUEUE_NAME
   from FND_CONCURRENT_QUEUES
   where CONCURRENT_QUEUE_NAME like 'FNDSM%';

7. Please run the Concurrent Manager Recovery feature to address any Concurrent Manager / Concurrent Processing issues within the Oracle Application Manager.

8. Start the middle tier services including your concurrent manager.

9. Retest the issue.

Reference metalink Doc ID 2116530.1

RC-50221: Warning: Port Pool 50 is not free

RC-50221: Warning: Port Pool 50 is not free


Solution:

Means the port is used by some other program on your host. Use a different port pool number, or try to release the port which is already reserved

$ netstat -a | grep <port number>

Kill the process that use that port using "kill -9 <process id>" command or simply reboot the box (if possible).

Linux Important Files

Linux Important Files


/etc/passwd - User Settings

/etc/group - Group settings for users.

/etc/hosts -  Host name lookup information

/etc/sysctl.conf  - Kernel parameters for Linux.

/var/log/messages  - Check System and error logs and messages

/etc/oratab  - Oracle Registered instance (DBCA)

/etc/fstab  - Files to check for File System entries

/home/oracle/.bash_profile  - Oracle user profile setting file in Linux.

/proc/meminfo  - To determine To determine the RAM size

/etc/redhat- release - get the OS release information

/etc/security/limits.conf  - Specify process and open files related limits

/etc/selinux/config  - Enable or disable security feature.

Delete large number of files - LINUX

Delete large number of files - LINUX


Go to the folder location

cd < folder name>

A faster way of deleting files is the -delete flag:

find . -type f -delete

To show the filenames while deleting them:

find . -type f -print -delete

To show how many files will be deleted, then time how long it takes to delete them:

ls -1 | wc -l && time find . -type f -delete

The above commands will remove all the files in the folder, then you can use rm -rf to remove the folder.

How To Purge E-Mail Notifications From The Workflow Queue So The E-Mail Is Not Sent

How To Purge E-Mail Notifications From The Workflow Queue So The E-Mail Is Not Sent


APPLIES TO:

Oracle Workflow - Version 11.5.10.0 to 12.2 [Release 11.5.10 to 12.2]
Information in this document applies to any platform.
Checked for relevance on 06-JUL-2013


GOAL

The Workflow mailer has not been running. Which may have caused  a large number of e-mail notifications to accumulate in the queue.  How does one prevent these from being sent when the mailer is started.

SOLUTION

Please take a backup before making any of these changes and try this on a Test instance first as direct table updates from sqlplus are not supported.

1. Verify the current status of each notifications found in the WF_NOTIFICATIONS table that has potential for being sent when the Java Mailer gets started.


SQL> select notification_id, recipient_role, message_type, message_name, status, mail_status
     from wf_notifications
     where status in ('OPEN', 'CANCELED')
     And Mail_Status In ('MAIL', 'INVALID')
     order by notification_id;
Normally, only records where status = 'OPEN' and mail_status = 'MAIL' are notifications that would be sent, but there are programs that also can retry Canceled or Invalid notifications, so we included these as well.
This query should show which notifications are waiting to be e-mailed.

2) Use BEGIN_DATE in the where clause to help narrow down the emails not to get sent by the Mailer from a specific date range.

For example :

SQL> select notification_id, begin_date, recipient_role, message_type, message_name, status, mail_status
     from wf_notifications
     Where Status In ('OPEN', 'CANCELED')
     And Mail_Status In ('MAIL', 'INVALID')
     and begin_date < sysdate-30              -- List only emails older than 30 days ago
     order by notification_id;
 3) To update a notification so that it will not get e-mailed, simply set the MAIL_STATUS = 'SENT', and rebuild the Mailer queue using wfntfqup.sql
   The mailer will think the e-mail has already been sent and it will not send it again.
   Note : Users can still reply to all these notifications from the worklist page in the applications.

Example:

SQL> update WF_NOTIFICATIONS set mail_status = 'SENT'
     where mail_status in ('MAIL','INVALID')
     and Status In ('OPEN', 'CANCELED');

(Remember to include any other filters you want like begin_date < sysdate-30)
This will update all notifications waiting to be sent by the mailer to SENT, and therefore will not get emailed when the Mailer is restarted.


4) Run the script $FND_TOP/patch/115/sql/wfntfqup.sql to purge the WF_NOTIFICATION_OUT queue and rebuild it with data currently in the WF_NOTIFICATIONS table. This is what purges all notifications waiting in the queue to be sent.  It will then populate the queue with the current data in the wf_notifications table.

Since you have changed the mail_status = 'SENT" it will not enqueue these messages again.. Only the ones where mail_status = 'MAIL' and status = 'OPEN' will be placed in the WF_NOTIFICATION_OUT queue and sent by the mailer. (or CANCELED and INVALID if certain concurrent reports are run)

Example :

$ sqlplus usr/passwd@db @$FND_TOP/patch/115/sql/wfntfqup.sql APPSusr APPSpw FNDusr

Example Syntax:

$ sqlplus apps/apps@db @$FND_TOP/patch/115/sql/wfntfqup.sql apps apps applsys

5) Now start the Workflow Java Mailer.


Reference metalink Doc ID 372933.1