Pages

Search This Blog

Friday, January 31, 2020

X11-Forwarding (or) DISPLAY settings on Linux Servers


For Oracle installations, to launch GUI, we should have X11 to be enabled and set DISPLAY variables.

1) To enable X11 forwarding on Linux servers:

Install required packages as first step.

X11-forwarding  : ✔  (remote display is forwarded through SSH)

$ yum install xorg-x11-xauth xorg-x11-fonts-* xorg-x11-font-utils xorg-x11-fonts-Type1 xdpyinfo -y

Set below three parameters:

$ vi /etc/ssh/sshd_config 
    X11Forwarding yes
    X11DisplayOffset 10
    X11UseLocalhost no
 

$ systemctl restart sshd

$ systemctl status sshd.service


2) Set DISPLAY variable 

echo $DISPLAY, if not set then export DISPLAY=<hostname/IPADDRESS>:<port>

Ex: $ export DISPLAY=oracledemo:0.0
      $ echo $DISPLAY
   oracledemo:0.0



Concurrent Program failed with ORACLE error 20100 in FDPSTP

FND_FILE creation failed.

In the concurrent program log file, we see below message.

ORACLE error 20100 in FDPSTP 
 Cause: FDPSTP failed due to ORA-20100: ORA-20100: File o2710130.tmp creation failed. File could not be opened or operated on as requested. 
 Action: Make sure the directory - /applptmp - is a valid directory with write permiss 


Checks for this error:

Option - 1:  Check your applptmp variable

applmgr@oracledemo ~
EBS: echo $APPLPTMP
/applptmp
applmgr@oracledemo ~
EBS:


Option - 2: Go to the applptmp directory and try to create or modify a file with applmgr.

applmgr@oracledemo ~
EBS: touch file
applmgr@oracledemo ~
EBS:


I'm able to create a file, so no issue with this.

Option - 3: Check utl_file_dir parameter in the database.

SQL> show parameter utl_file_dir

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
utl_file_dir                         string      /applptmp


This variable is pointing to right directory.


Option - 4: Create a test file using FND_FILE.

SQL> exec FND_FILE.PUT_LINE(FND_FILE.LOG, 'THIS IS A TEST');
BEGIN FND_FILE.PUT_LINE(FND_FILE.LOG, 'THIS IS A TEST'); END;

*
ERROR at line 1:
ORA-20100: ORA-20100: File o2711023.tmp creation failed.
File could not be opened or operated on as requested.
Action: Make sure the directory - /applptmp - is a valid directory with write
permissions and is accessible from the database server node for write
operations. This
ORA-06512: at "APPS.FND_FILE", line 319
ORA-06512: at "APPS.FND_FILE", line 364
ORA-06512: at "APPS.FND_FILE", line 421
ORA-06512: at line 1


This has failed and it written the error message clearly, /applptmp is a valid directory with write permissions and is accessible from the database server node for write.

About our environment, we have database on one server and application on another server.  On verification, somehow /applptmp is mounted on AppTier but not on DBTier, hence concurrent requests are failing.  Once we mounted the /applptmp on DBTier all requests got completed successfully.

SQL>exec FND_FILE.PUT_LINE(FND_FILE.LOG, 'THIS IS A TEST');

PL/SQL procedure successfully completed.





Thursday, January 30, 2020

Find different components (Apache, Java, JRE, Forms...etc) version for Oracle E-Business Suite R12

Use below commands to find different components version in Oracle Apps R12.

1) Apache Version:

$IAS_ORACLE_HOME/Apache/Apache/bin/httpd -v

2) Java Version:

sh -c "`awk -F= '$1 ~ /^JSERVJAVA.*$/ {print $2}' $ADMIN_SCRIPTS_HOME/java.sh` -version;"

3) Client JRE Version:

cat $FORMS_WEB_CONFIG_FILE|grep sun_plugin_version| cut -c 1-35
(or)
grep plugin $CONTEXT_FILE

4) Forms Version:

$ORACLE_HOME/bin/frmcmp_batch|grep Forms| grep Version

5) Perl Version:

$IAS_ORACLE_HOME/perl/bin/perl -v|grep built

6) PL/SQL Version:

$ORACLE_HOME/bin/frmcmp_batch|grep PL/SQL|grep Version

Wednesday, January 29, 2020

Drop Unused UNDO Tablespace

1) Check how many UNDO tablespaces are available on your database:

SQL> select tablespace_name, contents from dba_tablespaces where contents = 'UNDO';

TABLESPACE_NAME                CONTENTS
------------------------------ ---------
UNDOTBS1                       UNDO
UNDOTBS2                       UNDO


2) Check which UNDO tablespace is being used currently:

SQL> show parameter undo_tablespace

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
undo_tablespace                      string      UNDOTBS1


3) Validate that, any object that it is using other undo_tablespace than current undo_tablespace.

set pagesize 100
set lines 200
set long 999
col username for a9
SELECT a.name,b.status , d.username , d.sid , d.serial#
FROM   v$rollname a,v$rollstat b, v$transaction c , v$session d
WHERE  a.usn = b.usn
AND    a.usn = c.xidusn
AND    c.ses_addr = d.saddr
AND    a.name IN (
  SELECT segment_name
  FROM dba_segments
 WHERE tablespace_name = 'UNDOTBS2');

4) If none of the object is using second undo_tablespace, then use below command to drop the unused undo_tablespace.

SQL> DROP TABLESPACE UNDOTBS2 INCLUDING CONTENTS AND DATAFILES;



Database Size and Free Space

Check your database size and free space:

col 'Database Size' for a15
col 'Free Space' for a15
Select round(sum(used.bytes) / 1024 / 1024/1024 ) || ' GB' "Database Size",round(free.p / 1024 / 1024/1024) || ' GB' "Free Space"
from (select bytes from v$datafile
      union all
      select bytes from v$tempfile
      union all
      select bytes from v$log) used, (select sum(bytes) as p from dba_free_space) free group by free.p;


Friday, January 24, 2020

Disable Firewall on OCI Linux Servers

How to disable firewall on OCI Linux Servers / regular on-premise servers?

Below commands will work for OCI Linux OS Version 7, so please check your O.S Version before execute these commands.

Check OS Version:

For Oracle Linux:
 $ cat /etc/oracle-release (OR)  just type "hostnamectl" on the command line.

For Redhat Linux:
$ cat /etc/redhat-release

1) Check if firewall is running or not.

$ firewall-cmd --state

2) Stop firewall.

$ systemctl stop firewalld.service

Note: If you simply stop the firewall, once server rebooted, your firewall be started running again.  If you don't want to enable firewall rules after reboot permanently disable the firewall.

3) Disable firewall.

$ systemctl disable firewalld.service

4) Cross check if firewall is running or not.

$ firewall-cmd --state


If your OS Version is 6, to stop firewall you need to use iptables service.  Remember all commands needs to be run from root user, if not at least you should have sudo access to run these commands.

1) Status of firewalls

$ service iptables status

2) Stop firewalls.

$ service iptables stop

3) Disable firewalls.

$ chkconfig iptables off




Timezone Change on OCI Linux Hosts

How to change Timezone on Oracle Cloud Infrastructure (OCI) Linux Servers:

All our OCI servers by default they are in GMT timezone, but we wanted them to be in US CST time.
So we have changed timezone as shown below.

1) Login to the host as root user and change directory to /etc and do the following.

    cd /etc/

2) Check localtime file.

    $ls -ltr localtime    ## It is softlink and pointed to GMT time.
  lrwxrwxrwx. 1 root root 37 Jan  24  2020 localtime -> /usr/share/zoneinfo/GMT
   
3) Remove the softlink that pointed to GMT.

  unlink localtime

4) Create a new softlink pointing to US CST time.

    ln -s /usr/share/zoneinfo/America/Chicago localtime  


DBA Directory

1) How to check existing DBA Directories in a database:

col OWNER for a10
col DIRECTORY_NAME for a35
col DIRECTORY_PATH for a75
set lines 200
select * from dba_directories;


2) Create a new DBA Directory or modify existing directory path:

create or replace directory DMPDIR as '/u01/datapump';

3) Grant required privileges to the DBA Directory to access by a user.

grant read,write on directory DMPDIR to <username>;

4) Grant required privileges to the DBA Directory to access by every user.

grant read,write on directory DMPDIR to public;

Tuesday, January 21, 2020

Cancel Concurrent Request From Backend

Run this as 'APPS' user:

1) Concurrent Request Status:

select status_code,phase_code from fnd_concurrent_requests where  request_id=&1;  

2) Cancel Concurrent Request:

update fnd_concurrent_requests set status_code='D', phase_code='C' where request_id=&1; 
commit; 

3)  Update Concurrent request as 'Complete Normal'

update fnd_concurrent_requests set status_code='C',phase_code='C' where request_id=&1;

commit;

4)  Cancel All Pending Concurrent Requests

Updating base tables directly is not supported or recommended by Oracle – this update would be OK to execute in a non-production instance. In a production instance, use APIs or cancel the pending requests through the forms interface.

update FND_CONCURRENT_REQUESTS set phase_code='C',status_code='D' where phase_code='P' ;

commit;


Workflow Notification Mailer (Oracle E-Business Suite) Status, Stop and Start from backend.

Run all scripts as 'APPS' user.

1) Workflow Notification Mailer Status:

select component_status
from fnd_svc_components
where component_id =
(select component_id
from fnd_svc_components
where component_name = 'Workflow Notification Mailer');


2) Workflow Mailer Services / Service components Status:

select fcq.USER_CONCURRENT_QUEUE_NAME Container_Name, DECODE(fcp.OS_PROCESS_ID,NULL,'NotRunning',fcp.OS_PROCESS_ID) PROCID,
fcq.MAX_PROCESSES TARGET,
fcq.RUNNING_PROCESSES ACTUAL,
fcq.ENABLED_FLAG ENABLED,
fsc.COMPONENT_NAME,
fsc.STARTUP_MODE,
fsc.COMPONENT_STATUS
from APPS.FND_CONCURRENT_QUEUES_VL fcq, APPS.FND_CP_SERVICES fcs, APPS.FND_CONCURRENT_PROCESSES
fcp, fnd_svc_components fsc
where fcq.MANAGER_TYPE = fcs.SERVICE_ID
and fcs.SERVICE_HANDLE = 'FNDCPGSC'
and fsc.concurrent_queue_id = fcq.concurrent_queue_id(+)
and fcq.concurrent_queue_id = fcp.concurrent_queue_id(+)
and fcq.application_id = fcp.queue_application_id(+)
and fcp.process_status_code(+) = 'A'
order by fcp.OS_PROCESS_ID, fsc.STARTUP_MODE;


3) Workflow Mailes Status:

select  *
from    wf_notifications
where   1=1
and     begin_Date >= sysdate-1
--and     mail_status='FAILED'
order by begin_Date desc;


4) Stop Notification Mailer from backend:
This will deactivate notification mailer.  Run this script as apps user.

declare
p_retcode number;
p_errbuf varchar2(100);
m_mailerid fnd_svc_components.component_id%TYPE;
begin
select component_id
into m_mailerid
from fnd_svc_components
where component_name = 'Workflow Notification Mailer';
fnd_svc_component.stop_component(m_mailerid, p_retcode, p_errbuf);
commit;
end;
/


5) Start Notification Mailer from backend:

Run this script as apps user.

declare
p_retcode number;
p_errbuf varchar2(100);
m_mailerid fnd_svc_components.component_id%TYPE;
begin
select component_id
into m_mailerid
from fnd_svc_components
where component_name = 'Workflow Notification Mailer';
fnd_svc_component.start_component(m_mailerid, p_retcode, p_errbuf);
commit;
end;
/




Tuesday, January 14, 2020

Oracle Enterprise Manager Cloud Control 13c SYSMAN Password Reset

Steps to reset the password for SYSMAN in Oracle Enterprise Manager Cloud Control 13c:

The following information must be specified when the command is executed.

1. sys password(sys_pwd)
2. New password for sysman(new_pwd)

Steps to reset,

1. Stop all OMS process
cd $OMS_HOME/bin
emctl stop oms

2. Change the SYSMAN password
cd $OMS_HOME/bin
emctl config oms -change_repos_pwd -use_sys_pwd -sys_pwd <sys password> -new_pwd <new sysman password>

Example Output:
$ ./emctl config oms -change_repos_pwd -use_sys_pwd -sys_pwd ******* -new_pwd *********
Oracle Enterprise Manager Cloud Control 13c Release 2
Copyright (c) 1996, 2016 Oracle Corporation.  All rights reserved.

Changing passwords in backend ...
Passwords changed in backend successfully.
Updating repository password in Credential Store...
Successfully updated Repository password in Credential Store.
Restart all the OMSs using 'emctl stop oms -all' and 'emctl start oms'.
Successfully changed repository password.


3. Stop Admin Server on the primary OMS and restart OMS.
cd <oms home>/bin
emctl stop oms -all
emctl start oms


4. Check that OMS is up and running.

cd <oms home>/bin
emctl status oms -details


Monday, January 13, 2020

How To Retrive APPS Password – R12

Steps to find apps password in R12:

    1)    Connect as SYSTEM or SYS USER
    2)    Create Function to decrypt the encrypt password
    3)    Query for the encrypted password
    4)    Query for decrypt the password
    5)    validate the apps password 


STEP 1:
[oracle@localhost]$sqlplus [system or sys]/<password>

STEP 2:
$SQL>create FUNCTION apps.decrypt_get_pwd(in_chr_key IN VARCHAR2,in_chr_encrypted_pin IN VARCHAR2)
RETURN VARCHAR2 AS LANGUAGE JAVA NAME 'oracle.apps.fnd.security.WebSessionManagerProc.decrypt(java.lang.String,java.lang.String) return java.lang.String';
/

Function created.

STEP 3:
$SQL>select ENCRYPTED_FOUNDATION_PASSWORD from apps.fnd_user where USER_NAME='GUEST';
ENCRYPTED_FOUNDATION_PASSWORD
——————————————————————————–
FDSFJKSFSDIO43345NFDF983TRFI3R3OFVFDJVOERGF3REFNOEFEFEWFDSCSDCDSFDS

STEP 4:
$SQL>SELECT apps.decrypt_get_pwd('GUEST/ORACLE',FDSFJKSFSDIO43345NFDF983TRFI3R3OFVFDJVOERGF3REFNOEFEFEWFDSCSDCDSFDS) from dual;

Output:
APPS.DECRYPT_PIN_FUNC('GUEST/ORACLE','FDSFJKSFSDIO43345NFDF983TRFI3R3OFVFDJVOERGF3REFNOEFEFEWFDSCSDCDSFDS')
..........................................................................................................
welcome

STEP 5:
$SQL> conn apps/welcome
Connected.


Find inactive FORMS Sessions older than 2hours

Script to find inactive forms sessions older than 2hours:

SELECT
p.spid,
s.process,
s.status,
s.machine,
to_char(s.logon_time,'mm-dd-yy hh24:mi:ss') Logon_Time,
s.last_call_et/3600 Last_Call_ET,
s.action,
s.program,
s.module,
s.sid,
s.serial#,
s.CLIENT_IDENTIFIER
FROM
V$SESSION s
, V$PROCESS p
WHERE
s.paddr = p.addr
AND
s.username IS NOT NULL
AND
s.username = 'APPS'
AND
s.osuser = 'oracle'
AND
s.last_call_et/3600 > 2
and
s.program like '%frmweb%'
and
s.status='INACTIVE' order by logon_time;


Tar / Untar


1) To compress an entire directory
tar -czvf <filename>.tar.gz /home/oracle/data/ 

2) To compress multiple directories and files, execute:
tar -czvf <filename>.tar.gz /home/oracle/data/ /home/oracle/pics/ /home/oracle/<some filename> 

3) To use bzip2 compression instead of gzip by passing the -j option to the tar command:
tar -cjvf <filename>.tar.bz2 /home/oracle/data/

4) To exclude certain files when creating a tarball. The syntax is:
tar -zcvf <filename>.tar.gz --exclude='dir1' --exclude='regex' dir1

 For example, exclude ~/Downloads/ directory:
 tar -czvf /share/backup.tar.gz --exclude="Downloads" /home/oracle/

5) To view files stored in an archive:
tar -ztvf <filename>.tar.gz
tar -jtvf <filename>.tar.bz2


6) To extracting an archive / tar:
tar -xzvf <filename>.tar.gz
tar -xjvf <filename>.tar.bz2


7) To extract the contents of the archive/tar into a specific directory such as /home/oracle/backups/? Try passing the -C DIR option:
tar -xzvf <filename>.tar.gz -C /home/oracle/backups/
tar -xjvf <filename>.tar.bz2 -C /tmp


8) Other Options:
tar cvf - 11.2.0.3    | gzip -c > 11.2.0.3.tar.gz  # To tar a directory
gunzip -c /ora/11.2.0.3.tar.gz   | tar xvf -  ## To untar a directory
tar -zxf /share/apps.tar.gz --directory /appl/   ## Extract to a directory