Friday, 12 April 2019


Dbms_Scheduler.Create_Job
The dbms_scheduler.create_job procedure is used to create scheduler jobs.  Here is an example of it being used to call a stored procedure:
begin
dbms_scheduler.create_job (
   job_name           =>  'run_load_sales',
   job_type           =>  'STORED_PROCEDURE',
   job_action         =>  'system.load_sales',
   start_date         =>  '01-MAR-2010 03:00:00 AM',
   repeat_interval    =>  'FREQ=DAILY',
   enabled            =>  TRUE);
END;
/
This creates the job named run_load_sales which executes the stored procedure system.load_sales.  The start date is configured as 3:00 AM on March 1 and the frequency is set to daily.  Normally, jobs are disabled when they are created, but the line beginning enabled automatically enables this job at creation.
See these important notes on when an old dbms_scheduler job is still running at job execution time.  Also, there are tips about this in Dr. Hall's recommended book "Oracle Job Scheduling"
NOTE: Scheduled jobs are now treated like other database objects and need to have unique names within a schema.  For example, you cannot create a job named load_sales if you already have a procedure by that name.
Each time this job is executed, the scheduler evaluates the repeat_intervalto determine the next time this job should be run.  In this case, at 3:00 AM on March 1st it evaluates freq=daily and determines that the job should be run daily and, with no other criteria, schedules the next running of the job at 3:00 AM on March 2nd.
There are a large number of expressions that can be used to define the repeat interval for a job.  Here are a few examples:
repeat_interval
Description
freq=hourly
Run every hour
freq=daily; byhour=3
Run at 3 am every day
freq=daily; byhour=8,20
Run at 8 am and 8 pm every day
freq=monthly; bymonthday=1
Run on the first day of every month
freq=monthly; bymonthday=-1
Run on the last day of every month
freq=yearly; bymonth=sep; bymonthday=20;
Run yearly on September 20th

Table 19.3:  repeat_interval Expressions
There are almost unlimited permutations possible for the repeat_interval value.  These are only a few possibilities but should get you started.
Creating a Job That Calls an Executable
The job type executable allows you to create jobs which execute a command or script at the operating system level.  The syntax is similar to creating other jobs, but the job type is set to executable and the job action should include the full path to the command or script to be executed.
begin
dbms_scheduler.create_job (
   job_name           =>  'migrate_files',
   job_type           =>  'executable',
   job_action         =>  '/home/oracle/bin/migrate_files.sh',
   start_date         =>  '01-mar-2010 07:00:00 am',
   repeat_interval    =>  'freq=daily',
   enabled            =>  true);
end;
/
When the date comes up to execute this job, Oracle executes the migrate_files.sh script as the user who the database is running under (typically oracle.)  That user must already have execute privileges on the script or command to be run in order for the job to succeed.
Changing a Job
You can change anything about a scheduled job, except its name, using the dbms_scheduler.set_attribute procedure.  The job name is given, followed by the attribute that you wish to change, and finally, the new value for that attribute.
begin
dbms_scheduler.set_attribute (
name               =>  'run_load_sales',
attribute          =>  'repeat_interval',
value              =>  'freq=daily; byhour=3');
end;
/
A job can be changed while it is running, but the changes will not take effect until the next run of the job.
Running a Job Manually
If you want to run a job immediately, call the dbms_scheduler.run_job procedure.
begin
dbms_scheduler.run_job (job_name => 'run_load_sales');
end;
/
This causes the named job to be run immediately.
Stopping Running Jobs
Running jobs can be stopped using the dbms_scheduler.stop_jobprocedure.
begin
dbms_scheduler.stop_job (job_name => 'run_load_sales');
end;
/
This only stops the running job and does not affect future running of this job.
Disabling and Enabling Jobs
The dbms_schedulerpackage includes the procedures disable and enable to disable and enable jobs.  When a job is disabled, it will not be run.
begin
dbms_scheduler.disable (job_name => 'run_load_sales');
end;
/
If the job is running when the disable procedure is called, you get an error.  You can stop the running job as shown in the last example, or you can add force => true to the disable statement.
To re-enable a job which has been disabled, use the enable procedure.
begin
dbms_scheduler.enable (job_name => 'run_load_sales');
end;
/
The job will now be run based on its original schedule.  Multiple jobs can be disabled or enabled at the same time by separating their names with a comma.
Dropping Jobs
To permanently drop a job, call the procedure dbms_scheduler.drop_job.  As with disabling and enabling jobs, multiple jobs can be specified by separating them with commas.
begin
dbms_scheduler.drop_job ('run_load_sales');
end;
/
If a job is running when you try to drop it, you get an error.  You can stop the job, then drop it or set the force parameter to true.  Setting force to true causes the running job to be stopped, and then the job is dropped from the scheduler.


Source: R&D/Internet

adcfgclone Fails on Apps Tier with Error : sqlplus: error while loading shared libraries: libclntsh.so.10.1: cannot open shared object file: No such file or directory (Doc ID 2390797.1)

Error:
adcfgclone Fails on Apps Tier with below error which is reported in RCloneApplyAppstier_04200721.log /u01/TEMP/app/fs1/EBSapps/10.1.2/bin/sqlplus: error while loading shared libraries: libsqlplus.so: cannot open shared object file: No such file or directory <<<<<<< *******FATAL ERROR******* PROGRAM : (/u01/xxx/app/fs1/xxx/appl/fnd/12.0.0/patch/115/bin/txkManageDBConnectionPool.pl) TIME : Fri Apr 20 07:25:59 2018 FUNCTION: main::validateAppsSchemaCredentials [ Level 1 ] ERRORMSG: Invalid APPS database user credentials. No updates Performed /u01/TEMP/app/fs1/EBSapps/10.1.2/bin/sqlplus: error while loading shared libraries: libclntsh.so.10.1: cannot open shared object file: No such file or directory <<<<< *******FATAL ERROR******* PROGRAM : (/u01/xxx/app/fs1/xxx/appl/fnd/12.0.0/patch/115/bin/txkChkFormsLaunchMethod.pl) TIME : Fri Apr 20 07:26:06 2018 FUNCTION: [ Level 1 ] ERRORMSG: *******FATAL ERROR******* PROGRAM : (/u01/xxx/app/fs1/xx/appl/fnd/12.0.0/patch/115/bin/txkChkFormsLaunchMethod.pl) TIME : Fri Apr 20 07:26:06 2018 FUNCTION: main::validateAppsSchemaCredentials [ Level 1 ] ERRORMSG: Invalid APPS database user credentials. START: Executing /u01/xxx/app/fs1/inst/apps/xxxx/admin/install/txkWfClone.sh -nopromptmsg txkWfClone.sh exited with status 127 ERROR: txkWfClone.sh execution failed, exit code 127 == 20APR2018_Logfiles\run\fmwT2PApply\CLONE2018-04-20_07-21-34_1451479129.log == /bin/chmod: cannot access '/u01/xx/app/fs1/FMW_Home/webtier//lib32/libagtsh.so.1.0': No such file or directory /bin/chmod: cannot access '/u01/xxx/app/fs1/FMW_Home/webtier//lib32/libclntsh.so.11.1': No such file or directory == 20APR2018_Logfiles\run\fmwT2PApply\CLONE2018-04-20_07-21-34_1451479129.error == WARNING : Apr 20, 2018 07:23:21 - WARNING - CLONE-20247 Not all file permission operations are successful. WARNING : Apr 20, 2018 07:23:21 - CAUSE - CLONE-20247 Some files were missing from the Oracle Home /u01/xxx/app/fs1/FMW_Home/webtier/. WARNING : Apr 20, 2018 07:23:21 - ACTION - CLONE-20247 Check the clone log file and permission restore log file /u01/xxx/app/fs1/inst/apps/xxx/admin/log/clone/run/fmwT2PApply/1524198199575_permissionApplyOuput.log for more details about the missing files. == 1524198199575_permissionApplyOuput.log == /bin/chmod: cannot access '/u01/xxx/app/fs1/FMW_Home/webtier//lib32/libagtsh.so.1.0': No such file or directory /bin/chmod: cannot access '/u01/xxx/app/fs1/FMW_Home/webtier//lib32/libclntsh.so.11.1': No such file or directory $ sh /u01/xxx/fs1/inst/apps/xxxx/admin/install/txkWfClone.sh txkWfClone.sh started at Sun Apr 22 14:48:28 +03 2018
The environment settings are as follows ... ORACLE_HOME : /u01/xxx/fs1/xxx/10.1.2 ORACLE_SID : TWO_TASK : CLONE PATH : ------ Executable : /u01/TEST/fs1/EBSapps/10.1.2/bin/sqlplus Enter the APPS username: apps Enter the APPS password: sqlplus: error while loading shared libraries: libclntsh.so.10.1: cannot open shared object file: No such file or directory ERRORCODE = 127 ERRORCODE_END

Change:

Issue happens only on Oracle Linux 7 and Red Hat Enterprise Linux 7

Issue only when performing clone, There might other instance which are working fine.

Cause:

binutils RPM is on higher version 2.27 whereas as per document Oracle E-Business Suite Installation and Upgrade Notes Release 12 (12.2) for Linux x86-64 (Doc ID 1330701.1) below version is expected.

binutils-2.23.52.0.1-16.el7.x86_64


Version of RPM can be determined using below query: 

rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE}(%{ARCH})\n" | grep binutils

Solution:

To implement the solution, please execute the following steps:

1. Check version of binutils RPM using below command rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE}(%{ARCH})\n" | grep binutils

2. If the version of RPM higher version than binutils-2.23.52.0.1-16.el7.x86_64 version then

3. Download the rpm below

binutils-2.23.52.0.1-16.el7.x86_64.rpm

4. Install RPM

rpm -U --force binutils-2.23.52.0.1-16.el7.x86_64.rpm


5. Retest the issue

Source: Metalink

Passwordless permissions (ssh) On Linux 5/6/7 64Bit

----------------------------------------------------------------------------------------------------------------
######################## Passwordless permissions (ssh) ########################
----------------------------------------------------------------------------------------------------------------

$ chmod 700 Mian Dir like (/u01)
$ cd /u01
$ chmod 700 username like (oracle)
$ cd sysa
$ chmod 700 .ssh
$ cd .ssh
$ chmod 600 authorized_keys
or
$ chmod 640 authorized_keys

########################### Start Linux 7.5 Permissions ###########################
$chmod 700 simbadb                     (On User)
$cd simbadb 
$chmod 700 .ssh                             (On .ssh dir)
$cd .ssh
$chmod 600 authorized_keys (On File)
$chmod 600 id_rsa         (On File)
$chmod 644 id_rsa.pub         (On File)
$chmod 644 known_hosts (On File)
############################ END Linux 7.5 Permissions ##########################
sys@bma ]$ ll -a
drwx------ 5 sys dba 4096 Dec 18 18:15 .
drwx------ 4 sys dba 4096 Dec 18 12:47 ..
-rw------- 1 sys dba 1190 Dec 18 18:37 .bash_history
-rwxrwxr-x 1 sys dba   33 Jun  2  2011 .bash_logout
-rwxrwxr-x 1 sys dba  176 Jun  2  2011 .bash_profile
-rwxrwxr-x 1 sys dba  124 Jun  2  2011 .bashrc
-rwxrwxr-x 1 sys dba  515 Jun 21  2011 .emacs
drwxrwxr-x 3 sys dba 4096 Aug 12  2002 .kde
drwxrwxr-x 4 sys dba 4096 Jun 22  2011 .mozilla
drwx------ 2 sys dba 4096 Dec 18 18:17 .ssh
-rwxrwxr-x 1 sys dba  658 Nov 12  2010 .zshrc
[sys@bma ~]$ cd .ssh
[sys@bma .ssh]$ ll
total 16
-rw------- 1 sys dba  872 Dec 18 18:38 authorized_keys
-rw------- 1 sys dba 1671 Dec 18 18:35 id_rsa
-rw-r--r-- 1 sys dba  407 Dec 18 18:35 id_rsa.pub
-rw-r--r-- 1 sys dba  788 Dec 18 18:17 known_hosts
[sys@bma .ssh]$

How to Find Last Analyzed Table Date In Apps R12

This query is finding the last analyzed Date in Apps R12:


select owner,table_name,last_analyzed, global_stats
from dba_tables
where owner not in ('SYS','SYSTEM')
order by owner,table_name;

Ping test in a shell script

[root@abcd oracle]# vi  $HOME/iplist
192.168.1.1
192.168.1.2
192.168.1.3
192.168.1.4
192.168.1.5
~
~
:wq!
[root@abcd oracle]# vi ping.sh
#!/bin/bash

for i in $( cat $HOME/iplist )
do
ping -q -c2 $i > /dev/null

if [ $? -eq 0 ]
then
echo $i "Pingable"
else
echo $i "Not Pingable"
fi
done
~
~
:wq!
[root@abcd oracle]# sh ping.sh
192.168.1.1 Pingable
192.168.1.2 Not Pingable
192.168.1.3 Pingable
192.168.1.4 Not Pingable
192.168.1.5 Pingable
[root@abcd oracle]#

Create a symbolic link in Unix

A symbolic link, also termed a soft link, is a special kind of file that points to another file, much like a shortcut in Windows or a Macintosh alias. Unlike a hard link, a symbolic link does not contain the data in the target file. It simply points to another entry somewhere in the file system. This difference gives symbolic links certain qualities that hard links do not have, such as the ability to link to directories, or to files on remote computers networked through NFS. Also, when you delete a target file, symbolic links to that file become unusable, whereas hard links preserve the contents of the file.
To create a symbolic link in Unix, at the Unix prompt, enter:
 ln -s source_file myfile
Replace source_file with the name of the existing file for which you want to create the symbolic link (this file can be any existing file or directory across the file systems). Replace myfile with the name of the symbolic link. The ln command then creates the symbolic link. After you've made the symbolic link, you can perform an operation on or execute myfile, just as you could with the source_file. You can use normal file management commands (for example, cprm) on the symbolic link.
Note:
If you delete the source file or move it to a different location, your symbolic file will not function properly. You should either delete or move it. If you try to use it for other purposes (for example, if you try to edit or execute it), the system will send a "file nonexistent" message.
Source: Internet

APP-FND-00204: Concurrent Manager encountered an error while running the spawned concurrent



Solution:

Receiving Transaction Manager Error APP-FND-00204 (Doc ID 2010065.1)
APPLIES TO:

Oracle Inventory Management - Version 12.2.4 and later
Information in this document applies to any platform.

SYMPTOMS

When attempting to receive the following error occurs:

ERROR
-----------------------
APP-FND-00204: Concurrent Manager encountered an error while running the spawned concurrent program Receiving Transaction Manager - RCVOLTM for your concurrent request 60.
TM-TIMEOUT.


STEPS
-----------------------
The issue can be reproduced at will with the following steps:
1. Receiving/receipts
2. Query PO
3. Enable line save error

BUSINESS IMPACT
-----------------------
The issue has the following business impact:
Due to this issue, users cannot receive
CAUSE

Profile INV: RPC Timeout was set to 300. 

SOLUTION

Set profile INV: RPC Timeout = 1000 at the site level. Make sure no setting on other levels.

Relog on application.

Try to receive again.

APP-FND-204 Concurrent Manager encountered an error while running the spawned concurrent program Receiving Transaction Manager - RCVOLTM for your concurrent request XXXXXX. TM-SVC LOCK HANDLE FAILED

This is happening because of large number of receiving processes being spawned at the same time.

Navigation:
·                     System Administrator (or comparable) Responsibility > Concurrent > Manager > Define
·                     Query for Manager='Receiving Transaction Manager'
·                     Click Work Shifts button and review value in Processes field (Increase the number of process)
·                     Go to: Concurrent -> Manager -> Administer
·                     Restart and Activate the Receiving Transaction Manager
·                     Refresh to check to make sure the target and actual processes = desired number of processes
·                     Retest the issue

If steps above still does not work, please perform the ADRELINK utility on the executable
as follows:

At UNIX prompt:
cd $PO_TOP/bin
adrelink.sh force=y ranlib=y "po RCVOLTM"

This relinks the executable for the Receiving Transaction Manager which is RCVOLTM. Now shut down and restart the Receiving Transaction Manager, you may have to click on RESTART, then
REFRESH and then click on ACTIVATE.

Source: Internet/Metalink