Saturday, June 25, 2011

Servlets and Sockets in oracle APPS

Default Forms connection mode in Oracle Applications R12 is “SERVLET” where as in Oracle Apps 11i default form connect mode is “SOCKET” So

What is difference between socket and servlet mode in Forms ?
What are advantages and disadvantages of each ?
Can we change default R12 forms mode from servlet to Socket ?

Oracle Form Servlet Overview in apps R12
——————————————

i) In this mode, Java servlet handles communication between forms client(java based) and Oracle Forms Service (10g).

ii) All connection is via HTTP Server so there is no need to start form server and no need to open form server port on firewall between client machine and application tier.

iii) More secure as compared to Forms Socket Mode.

iv) Network traffic is more as HTTP protocol is more chatty so little bit network bandwidth hungry when compared with SOCKET mode

v) No additional certificate requirement during SSL implementation for application tier, single certificate will handle both forms & web connection.

How to change from default Servlet mode (in apps R12) to Socket mode ?
———————————————————————

Refer to Oracle Metalink Note # 384241.1 Using Forms Socket Mode with Oracle E-Business Suite Release 12

Are there any network overheads of using Forms in Servlet Mode ?
—————————————————————-

Affected module by a application patch

Query to find out modules which will be affected by a specific patch.

select distinct aprb.application_short_name as "Affected Modules"
from ad_applied_patches aap,
ad_patch_drivers apd,
ad_patch_runs apr,
ad_patch_run_bugs aprb
where aap.applied_patch_id = apd.applied_patch_id
and apd.patch_driver_id = apr.patch_driver_id
and apr.patch_run_id = aprb.patch_run_id
and aprb.applied_flag = 'Y'
and aap.patch_name in ('7654736','9440370','7666111','9466179')

Query to find out patches nodewise.

select aap.patch_name, aat.name, apr.end_date,apr.SUCCESS_FLAG
from ad_applied_patches aap, ad_patch_drivers apd,
ad_patch_runs apr,
ad_appl_tops aat
where aap.applied_patch_id = apd.applied_patch_id
and apd.patch_driver_id = apr.patch_driver_id
and aat.appl_top_id = apr.appl_top_id
and aap.patch_name like '%4562325%'

Missing log records in receiving log queue for subscriber SUB_BILLPLAN_QUEUE errorcode = 416

Solution ( Below scripts needs to be run against each subscriber id having error)

begin
DBMS_MGWADM.CLEANUP_GATEWAY (action => DBMS_MGWADM.RESET_SUB_MISSING_LOG_REC,sarg => '<SUBSCRIBER_ID>');
end;

begin
dbms_mgwadm.reset_subscriber('<SUBSCRIBER_ID>');
end;

Refer mgw_subscibers for subscriber_id


Thursday, April 28, 2011

Create a temporary tablespace

Hi

     I am giving the script to create a temporary tablespace. One temporary tablespace should be default temporary tablespace. If you want create a new temporary tablespace then you have to make default temporary  tablespace new one. and you can drop older one.


create temporary tablesapce temp1 tempfile '/a01m/oradata/ilproddata/temp1_01.dbf' size 5000m;

alter database  default temporary tablespace temp1;

Drop tablespace temp including contents and datafiles;


 

Example fo create database script.

Hi

        Find the example of create a database in oracle.

             create database shiva
             logfile group 1 ('D:\log\log1a.log','D:\log\log1b') size 10m,
             group 2 ('D:\log\log2a.log','D:\log\log2b') size 10m
             maxlogfiles 3
             maxlogmembers 3
             maxinstances 1
             maxdatafiles 100
             maxloghistory 100
             datafile 'D:\dat\sysdata.dbf' size 200m
             undo tablespace undo1 datafile 'D:\dat\undo1.dbf'size 100m
             default temporary tablespace temp1 tempfile 'D:\dat\temp1.dbf'size 100m;

How to compile FMB in oracle apps.(use of f60gen)

Hi

      To compile the FMB in oracle apps we user f60gen command. I am giving the example of f60gen script.

f60gen Module=VERP_RMC_UPLOAD_DPC.fmb Userid=apps/h34b1bb4 Module_Type=FORM Module_Access=FILE Output_File=$XXONT_TOP/forms/US/VERP_RMC_UPLOAD_DPC.fmx Compile_All=special

Detail about how schedule DBMS_JOBS

Hi

       If you want to schedule different dbms_job here are some example to solve your problem regarding scheduling dbms jobs.

        
DBMS_JOB


Path: {ORACLE_HOME}/rdbms/admin/dbmsjob.sql
===========================================================
Important Views:
job$      dba_jobs      all_jobs      user_jobs
dba_jobs_running        all_jobs_running  
user_jobs_running

=======================================================================

Error which are commonly generated while operating jobs
Error Code Reason:      ORA-00001 Unique constraint (SYS.I_JOB_JOB) violated
                                    ORA-23420 Interval must evaluate to a time in the future
=========================================================================
Interval Definations:     Execute daily 'SYSDATE + 1'
              Execute once per week 'SYSDATE + 7'
              Execute hourly 'SYSDATE + 1/24'
              Execute every 10 min. 'SYSDATE + 10/1440'
              Execute every 30 sec. 'SYSDATE + 30/86400'
              Do not re-execute NULL
===============================================================
Why any job Failed:
Oracle has failed to successfully execute the job after 16 attempts.

OR
You have marked the job as broken, using the procedure DBMS_JOB.BROKEN

Once a job has been marked as broken, Oracle will not attempt to execute the job until it is either marked not broken, or forced to be execute by calling the DBMS_JOB.RUN.
=======================================================================
If you want to make any job forcefully broken then:

Use : exec dbms_job.broken(42, TRUE)

The following example marks job 14144 as not broken and sets its next execution date to - - the following Monday:
exec dbms_job.broken(14144, FALSE, NEXT_DAY(SYSDATE, 'MONDAY'));
===========================================================
Change any attribute of JOB:
exec dbms_job.change(14144, NULL, NULL, 'SYSDATE + 3');

=======================================================================
Assign a specific instance to run a job:

To do so, First get the instance information by:
SELECT instance_number FROM gv$instance;
then run the job :
exec dbms_job.instance(42, 1);
===========================================================
Reset the job Interval:
exec dbms_job.interval(179, 'TRUNC(SYSDATE) + 24/24');
Submit a Job:
exec dbms_job.isubmit(4242, 'MYPROC', SYSDATE);
Reset next Execution:
exec dbms_job.next_date(134, SYSDATE + 1/24);
To remove a job from job queue: First find the job to remove thorugh:
SELECT job FROM user_job;
then
exec dbms_job.remove(23);
To run a job immediatly:
exec dbms_job.run(job_no);
Various method to schedule a job to run with different timing:
-- To run everynight at midnight starting tonight
exec dbms_job.submit(:v_JobNo, 'proc1;', TRUNC(SYSDATE)+1, 'TRUNC(SYSDATE)+1');

-- To run every hour, on the hour, starting at the top of the hour
exec dbms_job.submit(:v_JobNo, 'proc2;', TRUNC(SYSDATE+(1/24), 'HH'),
'TRUNC(SYSDATE+(1/24),''HH'')');

-- To run every hour, starting now
exec dbms_job.submit(:v_JobNo, 'proc3;', INTERVAL => 'SYSDATE+(1/24)');

-- To run every ten minutes at 0,10,20,etc. minutes past the hour,
-- starting at the top of the hour

exec dbms_job.submit(:v_JobNo, 'proc4;', TRUNC(SYSDATE+(1/24), 'HH'),
'TRUNC(SYSDATE+(10/24/60),''MI'')');

-- To run every 2 min., on the minute, starting at the top of the
-- minute

exec dbms_job.submit(:v_JobNo, 'proc5;', TRUNC(SYSDATE+(1/24/60), 'MI'),
'TRUNC(SYSDATE+(2/24/60),''MI'')');

-- To run every two minutes, starting now
exec dbms_job.submit(:v_JobNo, 'proc6;', INTERVAL => 'SYSDATE+(2/24/60)');

-- To run every half hour, starting at the top of the hour
exec dbms_job.submit(:v_JobNo, 'proc7;', TRUNC(SYSDATE+(1/24), 'HH'),
'TRUNC(SYSDATE+(30/24/60),''MI'')');
execute dbms_lock.sleep(300);

===========================================================

Online Acitivity Performed on LGSOUTH DATABASE 10.100.201.12

select distinct job,log_user from dba_jobs where log_user='CSN';

job=62,122,149,185

BEGIN   DBMS_JOB.ISUBMIT(JOB=>62,WHAT=>'SP_CALLSUM_REPORT;',
NEXT_DATE=>TO_DATE('2009-01-25:06:00:00','YYYY-MM-DD:HH24:MI:SS'),
INTERVAL=>'TRUNC(SYSDATE)+1+(6/24)',NO_PARSE=>TRUE); END;

PL/SQL procedure successfully completed.

EXEC DBMS_JOB.NEXT_DATE(723,NEXT_DATE=>TO_DATE('2009-04-08:10:00:00','YYYY-MM-DD:HH24:MI:SS'));


BEGIN   DBMS_JOB.ISUBMIT(JOB=>122,WHAT=>'SP_REPAIRLIST_REPORT_CENTRAL;',
NEXT_DATE=>TO_DATE('4000-01-01:00:00:00','YYYY-MM-DD:HH24:MI:SS'),INTERVAL=>'TRUNC(SYSDATE)+1+(1/24)',
NO_PARSE=>TRUE); END;

PL/SQL procedure successfully completed.

BEGIN  DBMS_JOB.ISUBMIT(JOB=>149,WHAT=>'SP_PDP_LIVE_REPORT;',
NEXT_DATE=>TO_DATE('4000-01-01:00:00:00','YYYY-MM-DD:HH24:MI:SS'),
INTERVAL=>'FNC_DYNAMIC_SCHEDULE(8,18,90)',NO_PARSE=>TRUE); END;

PL/SQL procedure successfully completed.


BEGIN DBMS_JOB.ISUBMIT(JOB=>185,WHAT=>'SYNC_PO_RECEIPT;',
NEXT_DATE=>TO_DATE('2009-01-25:08:15:00','YYYY-MM-DD:HH24:MI:SS'),
INTERVAL=>'FNC_DYNAMIC_SCHEDULE (8.25, 15, 465)',NO_PARSE=>TRUE); END;

PL/SQL procedure successfully completed.