Pages

Search This Blog

Tuesday, November 13, 2018

Unable To Run Frmf2xml.Sh or JDAPI Without X Window Display

Issue Details:
Unable to generate xml file using form2xml option, using below command:
$/appl/apps/tech_st/10.1.2/bin/frmf2xml.sh WGCLIENTAPPR.fmb
Oracle Forms 10.1.2 Forms to XML Tool
Copyright(c) 2001, 2005, Oracle.  All rights reserved.

Processing module WGCLIENTAPPR.fmb

Error initialising the Forms Jdapi:
_jni_initialize: Failed to create new forms context

Solution:
Reference document - Oracle Doc ID 1312459.1

Set the DISPLAY environment variable so that it points to a valid X server
or
set the environment variable FORMS_API_TK_BYPASS to true.

I did as shown below and it created a xml file.

export FORMS_API_TK_BYPASS=true

$/appl/apps/tech_st/10.1.2/bin/frmf2xml.sh WGCLIENTAPPR.fmb

Oracle Forms 10.1.2 Forms to XML Tool
Copyright(c) 2001, 2005, Oracle.  All rights reserved.

Processing module WGCLIENTAPPR.fmb
WARNING: Item OBJ1 - all ListItemElements must have an Index, Name and Value.
WARNING: Item OBJ2 - all ListItemElements must have an Index, Name and Value.
WARNING: Item OBJ4 - all ListItemElements must have an Index, Name and Value.
WARNING: Item PROP - all ListItemElements must have an Index, Name and Value.
XML Module saved as WGCLIENTAPPR_fmb.xml


Tuesday, October 16, 2018

Find Session(SID and Serial#) details using Process ID:

Find database session details using a process id(PID).

SELECT S.CLIENT_IDENTIFIER, s.status , s.TYPE , s.username , s.osuser , s.server ,
s.machine , s.module , s.logon_time , s.process , p.spid,
p.pid, s.SID, s.audsid, SYSDATE - (s.last_call_et / 86400) 
FROM gv$session s, gv$process p
WHERE s.paddr = p.addr(+) AND s.process ='&process';


How to Check if opatch requires Downtime?

How to Check if opatch requires Downtime?

1. Download the particular patch file
2. Check the file <Patch Number>/etc/config/inventory.xml
3. If the following entry is present
<instance_shutdown>true</instance_shutdown>

If it is true, then it requires down time.


Upload files to Oracle SR

Some times large files you may need to upload to the SR, always we cannot extract those large one's from the server and upload through browser.  Below one is the easiest way to upload files to the SR irrespective of size of the file.

curl -T <Upload File path/name> -u <metalink id>  https://transport.oracle.com/upload/issue/<SR Number>/ -k

Ex:
curl -T task_check.html -u sreenivasulu.papana@********.com  https://transport.oracle.com/upload/issue/3-*********/ -k


Tablespace usage

To check tablespace total size, free space, used and free percentage:

SELECT /* + RULE */  df.tablespace_name "Tablespace",
       df.bytes / (1024 * 1024 * 1024) "Size (GB)",
       SUM(fs.bytes) / (1024 * 1024 * 1024) "Free (GB)",
       Nvl(Round(SUM(fs.bytes) * 100 / df.bytes),1) "% Free",
       Round((df.bytes - SUM(fs.bytes)) * 100 / df.bytes) "% Used"
  FROM dba_free_space fs,
       (SELECT tablespace_name,SUM(bytes) bytes
          FROM dba_data_files
         GROUP BY tablespace_name) df
 WHERE fs.tablespace_name (+)  = df.tablespace_name
 GROUP BY df.tablespace_name,df.bytes
UNION ALL
SELECT /* + RULE */ df.tablespace_name tspace,
       fs.bytes / (1024 * 1024 * 1024),
       SUM(df.bytes_free) / (1024 * 1024 * 1024),
       Nvl(Round((SUM(fs.bytes) - df.bytes_used) * 100 / fs.bytes), 1),
       Round((SUM(fs.bytes) - df.bytes_free) * 100 / fs.bytes)
  FROM dba_temp_files fs,
       (SELECT tablespace_name,bytes_free,bytes_used
          FROM v$temp_space_header
         GROUP BY tablespace_name,bytes_free,bytes_used) df
 WHERE fs.tablespace_name (+)  = df.tablespace_name
 GROUP BY df.tablespace_name,fs.bytes,df.bytes_free,df.bytes_used
 ORDER BY 4 DESC;


To check Temp tablespace total size, used and free space.

SELECT   A.tablespace_name tablespace, D.gb_total,
         SUM (A.used_blocks * D.block_size) / 1024 / 1024 /1024 gb_used,
         D.gb_total - SUM (A.used_blocks * D.block_size) / 1024 / 1024 / 1024 gb_free
FROM     v$sort_segment A,
         (
         SELECT   B.name, C.block_size, SUM (C.bytes) / 1024 / 1024 / 1024 gb_total
         FROM     v$tablespace B, v$tempfile C
         WHERE    B.ts#= C.ts#
         GROUP BY B.name, C.block_size
         ) D
WHERE    A.tablespace_name = D.name
GROUP by A.tablespace_name, D.gb_total;