Total Pageviews

Saturday, 4 February 2017

aud$ purge

http://docs.oracle.com/cd/E11882_01/appdev.112/e40758/d_audit_mgmt.htm#ARPLS241 


SCRIPT: Basic example to manage AUD$ table in 11.2 with dbms_audit_mgmt ( Doc ID 1362997.1 ) 



Here is an example job to purge audit records from AUD$: 



== The AUD$ cleanup should be executed only once === 

begin 
DBMS_AUDIT_MGMT.init_cleanup( 
audit_trail_type         => DBMS_AUDIT_MGMT.AUDIT_TRAIL_AUD_STD, 
default_cleanup_interval => 24); 
end; 


---set the last archive timestamp 180 days ago to purge the records older than 180 days 

begin 
DBMS_AUDIT_MGMT.SET_LAST_ARCHIVE_TIMESTAMP( 
audit_trail_type => DBMS_AUDIT_MGMT.AUDIT_TRAIL_AUD_STD, 
last_archive_time => sysdate - 180); 
end; 


----Create Daily archive timestamp job 

begin 
DBMS_SCHEDULER.CREATE_JOB ( 
job_name   => 'DAILY_AUDIT_ARCHIVE_TIMESTAMP', 
job_type   => 'PLSQL_BLOCK', 
job_action => 'BEGIN DBMS_AUDIT_MGMT.SET_LAST_ARCHIVE_TIMESTAMP ( 
AUDIT_TRAIL_TYPE => DBMS_AUDIT_MGMT.AUDIT_TRAIL_AUD_STD, 
LAST_ARCHIVE_TIME => sysdate-180)); END;', 
start_date => sysdate, 
repeat_interval => 'FREQ=HOURLY;INTERVAL=24', 
enabled    =>  TRUE, 
comments   => 'Create an archive timestamp' 
); 
end; 


begin 
sys.dbms_scheduler.enable( '"SYS"."DAILY_AUDIT_ARCHIVE_TIMESTAMP"' ); 
end; 


-----Create Daily Purge Job 

begin 
DBMS_AUDIT_MGMT.CREATE_PURGE_JOB( 
AUDIT_TRAIL_TYPE           => DBMS_AUDIT_MGMT.AUDIT_TRAIL_AUD_STD, 
AUDIT_TRAIL_PURGE_INTERVAL => 24 /* hours */, 
AUDIT_TRAIL_PURGE_NAME     => 'Daily_Audit_Purge_Job', 
USE_LAST_ARCH_TIMESTAMP    => TRUE 
); 
END; 




If you don't want to keep audit records you can manually purge all audit records from AUD$: 


====Manual purge===== 

BEGIN 
DBMS_AUDIT_MGMT.SET_LAST_ARCHIVE_TIMESTAMP( 
 audit_trail_type => DBMS_AUDIT_MGMT.AUDIT_TRAIL_AUD_STD, 
  last_archive_time => sysdate-1, 
 rac_instance_number => 1); 
END; 


BEGIN 
DBMS_AUDIT_MGMT.CLEAN_AUDIT_TRAIL( 
 audit_trail_type => DBMS_AUDIT_MGMT.AUDIT_TRAIL_AUD_STD, 
 use_last_arch_timestamp => TRUE); 
END; 



Audit Vault can be integrated with dbms_audit_mgmt to automatically purge audit records from AUD$ once they are inserted in AVDF repository, this is explained over here: 

http://docs.oracle.com/cd/E37100_01/doc.121/e27776/plugin_specific.htm#SIGAD41209 

Tuesday, 30 August 2016

Wrong fonts in PDF reports in R12

Edit the Environment file
$ vi $SID_Hostname.env
Add the following lines:
IX_PRINTING=$FND_TOP/resource/ixlib.cfg
export IX_PRINTING

IX_RENDERING=$FND_TOP/resource/pasta.cfg
export IX_RENDERING

Edit pasta.cfg file
$ cd $FND_TOP/resource
$ vi pasta.cfg
Add the following lines:
Font.Default.Plain=$FND_TOP/resource/ADUO.ttf
Font.Default.Bold=$FND_TOP)/resource/ADUOB.ttf
Edit ixlib.cfg file
$ vi ixlib.cfg
Add the following lines:
Font.Default.Plain=$FND_TOP/resource/ALBANYWT.ttf
Font.Default.Bold=(Full Path of $FND_TOP)/resource/ALBANYWT.ttf
Re-login as the appstier OS user(equivalent applmgr) and bounce the Concurrent manager

Sunday, 31 July 2016

FNLOAD OPTION

Concurrent Program

FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afcpprog.lct XXCUST_CP.ldt PROGRAM APPLICATION_SHORT_NAME="XXCUST" CONCURRENT_PROGRAM_NAME="XXCUST_CP"

FNDLOAD apps/apps O Y UPLOAD $FND_TOP/patch/115/import/afcpprog.lct XXCUST_CP.ldt UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE

Lookups

FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/aflvmlu.lct XXCUST_LKP.ldt FND_LOOKUP_TYPE APPLICATION_SHORT_NAME="XXCUST" LOOKUP_TYPE="XXCUST_LKP"

FNDLOAD apps/apps O Y UPLOAD $FND_TOP/patch/115/import/aflvmlu.lct  XXCUST_LKP.ldt UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE

Message

FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/afmdmsg.lct XXCUST_MESG.ldt FND_NEW_MESSAGES APPLICATION_SHORT_NAME="XXCUST" MESSAGE_NAME="XXCUST_MESG%"

FNDLOAD apps/apps O Y UPLOAD $FND_TOP/patch/115/import/afmdmsg.lct XXCUST_MESG.ldt UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE

Request Set and Link

FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/afcprset.lct XXCUST_RS.ldt REQ_SET REQUEST_SET_NAME='XXCUST_RS'

FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/afcprset.lct XXCUST_LNK.ldt REQ_SET_LINKS REQUEST_SET_NAME='XXCUST_LNK'


FNDLOAD apps/apps O Y UPLOAD $FND_TOP/patch/115/import/afcprset.lct  XXCUST_RS.ldt UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE

FNDLOAD apps/apps O Y UPLOAD $FND_TOP/patch/115/import/afcprset.lct  XXCUST_LNK.ldt UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE

Form Function

FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/afsload.lct XXCUST_FUNC.ldt FUNCTION FUNC_APP_SHORT_NAME='XXCUST' FUNCTION_NAME='XXCUST_FUNC'

FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/patch/115/import/afsload.lct XXCUST_FUNC.ldt

Profile

FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/afscprof.lct XXCUST_PROF.ldt PROFILE PROFILE_NAME="XXCUST_PROFILE" APPLICATION_SHORT_NAME="XXCUST"

FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/patch/115/import/afscprof.lct XXCUST_FUNC.ldt

Menu

FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afsload.lct XXCUST_MENU.ldt MENU MENU_NAME="XXCUST_MENU"

FNDLOAD apps/apps O Y UPLOAD $FND_TOP/patch/115/import/afsload.lct XXCUST_MENU.ldt

Data Definition

FNDLOAD apps/apps 0 Y DOWNLOAD $XDO_TOP/patch/115/import/xdotmpl.lct XXCUST_DD.ldt XDO_DS_DEFINITIONS APPLICATION_SHORT_NAME=XXCUST DATA_SOURCE_CODE=XXCUST_DS

FNDLOAD apps/apps O Y UPLOAD $FND_TOP/patch/115/import/afsload.lct XXCUST_DD.ldt

Tuesday, 26 July 2016

ld.so.1: rwconverter: fatal: libXm.so.4: open failed: No such file or directory

Applies to

Oracle® Applications Manager - Version 12.1.1 to 12.1.3 [Release 12.1]
Oracle Applications DBA - Version 12.1.1 to 12.1.3 [Release 12.1]
Oracle Solaris on SPARC (64-bit)

Symptoms

When attempting to "Generate Report Files" using adadmin utility or relinking 10.1.2 Oracle® Home using "adlnktools.sh",
the following error occurs.
ld.so.1: rwconverter: fatal: libXm.so.4: open failed: No such file or directory

Cause

motif package is not installed. This package provides the mising library "/usr/dt/lib/libXm.so" for Solaris 11 platform. The same can be checked by running below command.
Connect to root :
# pkg info -r motif
  Name: library/motif
  Summary: Motif toolkit
  Description: Motif 2.1 libraries, headers, xmbind and bindings
  Category: System/X11
  State: Not installed
  Publisher: solaris
  Version: 0.5.11
 Build Release: 5.11
  Branch: 0.175.0.0.0.0.0
Packaging Date: Tue Sep DD HH:MM:SS YYYY
  Size: 12.94 MB
  FMRI: pkg://solaris/library/motif@0.5.11,5.11-0.175.0.0.0.0.0:20110927T192002Z

Solution

1. Install motif package following below steps :
# pkg info -r motif
This will confirm whether motif is installed or not.
# pkg install motif
This will install the motif package.
2. Now the file "/usr/dt/lib/libXm.so" should present.

3. Relink the Oracle® Homes as per below steps :

Connect to appsTier : putty session
$ cd $IAS_ORACLE_HOME/appsutil/clone
$ sh adlnkweboh.sh

$ cd $ORACLE_HOME/appsutil/clone
$ sh adlnktools.sh
Both should be successful.

4. Run adadmin utility to "Generate report files" to retest the issue.

5. Migrate the solution as appropriate to other environments.

Can't load 'Sys/Hostname/Hostname.so' for module Sys::Hostname: wrong ELF class: ELFCLASS64

Can't load 'Sys/Hostname/Hostname.so' for module Sys::Hostname: wrong ELF class: ELFCLASS64
Version:

Oracle R12 version 12.1.3 in OEL 64 bit

Issue:

Error messages were found in the adformsctl.sh start.

adformsctl.sh: check the logfile /u01/E-BIZ/inst/apps/dmw24rep_slce20cn14/logs/appl/admin/log/adformsctl.txt for more information ...

.end std out.
*** ALL THE FOLLOWING FILES ARE REQUIRED FOR RESOLVING RUNTIME ERRORS
*** Log File = /u01/E-BIZ/inst/apps/dmw24rep_slce20cn14/logs/appl/rgf/TXK/txkChkFormsDeployment_Mon_Feb_2_20_31_21_2015/txkChkFormsDeployment_Mon_Feb_2_20_31_21_2015.log



Error:

On checking the logfile, it is understood that the issue is with PERL Paths in the context file.

Can't load '/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/auto/Sys/Hostname/Hostname.so' for module Sys::Hostname: /usr/lib64/perl5/5.8.8/x86_64-linux-thread
-multi/auto/Sys/Hostname/Hostname.so: wrong ELF class: ELFCLASS64 at /usr/lib64/
perl5/5.8.8/x86_64-linux-thread-multi/XSLoader.pm line 70.
 at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/Sys/Hostname.pm line 23
*** ALL THE FOLLOWING FILES ARE REQUIRED FOR RESOLVING RUNTIME ERRORS
*** Log File = /u01/E-BIZ/inst/apps//r12env_host2/logs/appl
/rgf/TXK/txkChkFormsDeployment_Mon_Feb_2_19_58_53_2015/txkChkFormsDeployment_Mon
_Feb_2_19_58_53_2015.log

Reason:

The environment is created as shared storage multi node. The second node was cloned from the first, but in the context file, the PERL related paths were not identical to that in first node

The paths in failed node

<ADPERLPRG oa_var="s_adperlprg" osd="unix">/usr/bin/perl</ADPERLPRG>

<PERL5LIB oa_var="s_perl5lib" osd="LINUX_X86-64">/usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi:/usr/lib/perl5/site_perl/5.8.8:/usr/lib/perl5/site_perl:/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi:/usr/lib/perl5/vendor_perl/5.8.8:/usr/lib/perl5/vendor_perl:/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi:/usr/lib/perl5/5.8.8:.:/u01/E-BIZ/apps/apps_st/appl/au/12.0.0/perl:/u01/E-BIZ/apps/apps_st/appl/au/12.0.0/perl</PERL5LIB>

Fix:

Edited the perl paths (ADPERLPRG  and PERL5LIB) in the context file and made it identical to that in first node and restarted the services.

Paths after editing:

<ADPERLPRG oa_var="s_adperlprg" osd="unix">/u01/E-BIZ/apps/tech_st/10.1.3/perl/bin/perl</ADPERLPRG>

<PERL5LIB oa_var="s_perl5lib" osd="LINUX_X86-64">/u01/E-BIZ/apps/tech_st/10.1.3/perl/lib/5.8.3:/u01/E-BIZ/apps/tech_st/10.1.3/perl/lib/site_perl/5.8.3:/u01/E-BIZ/apps/apps_st/appl/au/12.0.0/perl:/u01/E-BIZ/apps/tech_st/10.1.3/Apache/Apache/mod_perl/lib/site_perl/5.8.3/i686-linux-thread-multi</PERL5LIB>

Restart service in second node after this.

This can be implemented on solaris as well.

Ref:
http://satishvchandran.blogspot.com/2015/02/cant-load-usrlib64perl5588x8664-linux.html

Sunday, 15 May 2016

Script – Check RMAN Backup Status

Script – Check RMAN Backup Status
===============================
Scripts to check backup status and timings of database backups –

This script will be run in the database, not the catalog database.

Login as sysdba –

This script will report on all backups – full, incremental and archivelog backups –
=============================================================

col STATUS format a9
col hrs format 999.99
select
SESSION_KEY, INPUT_TYPE, STATUS,
to_char(START_TIME,'mm/dd/yy hh24:mi') start_time,
to_char(END_TIME,'mm/dd/yy hh24:mi')   end_time,
elapsed_seconds/3600                   hrs
from V$RMAN_BACKUP_JOB_DETAILS
order by session_key;


This script will report all on full and incremental backups, not archivelog backups –
==============================================================
col STATUS format a9
col hrs format 999.99
select
SESSION_KEY, INPUT_TYPE, STATUS,
to_char(START_TIME,'mm/dd/yy hh24:mi') start_time,
to_char(END_TIME,'mm/dd/yy hh24:mi')   end_time,
elapsed_seconds/3600                   hrs
from V$RMAN_BACKUP_JOB_DETAILS
where input_type='DB INCR'
order by session_key;

Friday, 6 May 2016

Compile Jsp’s in R12 & 11i

Compile Jsp’s in R12 & 11i
=====================

$cd $ADMIN_SCRIPTS_HOME

$adopmnctl.sh stopall — to shutdown opmn managed services viz., opmn, forms, oacore & oc4j

 $ cd $COMMON_TOP/_pages

$ mv _pages _pages_old

$mkdir _pages

 $ cd $FND_TOP/patch/115/bin or export PATH=$FND_TOP/patch/115/bin:$PATH

Compile all jsps.
$perl ojspCompile.pl –compile –flush -p 2 (or) ojspCompile.pl --compile --fast --quiet
(-p represents parallel threads, if you have enough horse power on your server, you can increase it to 8 or 10)

$cd $ADMIN_SCRIPTS_HOME

Another Option
==============
STEP1.

Login as applmgr user and source the environment by running the script:


/oracle/apps/apps_st/appl/APPS[SID]_[host].env

STEP2:  Run the commands

In Linux/Unix

cd $FND_TOP/patch/115/bin
perl ojspCompile.pl --compile --flush -p 2

In Windows

cd %FND_TOP%\patch\115\bin
perl -x ojspCompile.pl –compile –flush

STEP3:

Restart the Apache services or Middleware services.
How to compile individual JSP manually in R12:

STEP1:

cd $COMMON_TOP/_pages

STEP2:

Delete the class files (abcdef.class) for the JSP that you want to compile manually.

Eg. JSP File abcdef_12.jsp
Class File: abcdef_12.class ------------- Delete this file.

STEP3:

Navigate to the OA_HTML (Location for all the Jsp pages). if the JSP pages do not exist, copy the JSP to the location & run the below command.

$FND_TOP/patch/115/bin/ojspCompile.pl --compile -s 'abcdef_12.jsp' --flush

STEP4:

Restart the Apache services or Middle-ware services.

STEP5:

Check whether the respective class files have been created under

cd $COMMON_TOP/_pages

To Compile JSP’s at runtime in Oracle Apps R12
===============================================
To compile the jsp as soon as you access jsp page :

1. Change s_jsp_main_mode in R12 context file (XML file)

  <jsp_debug_parameters oa_var=”s_jsp_main_mode”>justrun</jsp_debug_parameters>

change it to

  <jsp_debug_parameters oa_var=”s_jsp_main_mode”>recompile</jsp_debug_parameters>

2.Run Autoconfig (adautocfg.sh)

Autoconfig will update file
$INST_TOP/ora/10.1.3/j2ee/oacore/application-deployments/oacore/html/orion-web.xml

        <param-name>main_mode</param-name>
         <param-value>justrun</param-value>

.

How to compile JSP manually

perl ojspCompile.pl –compile –flush  (Unix)
or
perl ojspCompile.pl –compile –flush -p 2 (Unix where -p means parallel execution)

perl -x ojspCompile.pl –compile –flush (Windows)

ojspCompile.pl is under $FND_TOP/patch/115/bin/

Note* JSP’s are compiled automatically after patching (whenever patch updates one or more jsp it calls ojspCompile.pl to compile JSP)

.

JSP Compilation logs

In 11i, all jsp compilation errors are logged in $IAS_ORACLE_HOME/ Apache/ Jserv/ logs/ mod_jserv.log

In R12, all jsp compilation errors are logged in $LOG_HOME/ ora/ 10.1.3/ j2ee/ oacore/ oacore_default_group_1/ application.log

458338.1  How to Enable Automatic Compilation of JSP pages in R12 Environment

433386.1  JSP Pages Hanging in R12 After Removing Cached Class Files in _pages

783094.1  Compile jsp files at Application R12 at Windows