Showing posts with label Step By Step Guides. Show all posts
Showing posts with label Step By Step Guides. Show all posts

Thursday, April 14, 2016

Audit Trail for Custom Table in Oracle Apps - Step By Step


Hi All ...

Here the step by step for Audit Trail for Custom Table in Oracle Apps

1. Register Custom Schema 
Navigate to System Administrator Menu/Security/ORACLE/Register

2. Ensure that Audit on the Application is Enabled
Navigate to System Administrator Menu Security/AuditTrail/Install

The owner of table XX_TABLE  is XX_SCHEMA. Hence query on 
XX_SCHEMA to ensure that Audit is enabled for this Application.


3. Register table,columns and primary key
Here the procedure to register the custom able,columns and primary key in Oracle Applications. Install the procedure on your DB and run the following:

begin
register_table('XX_TABLE','XX_SCHEMA'); /* (table name, table owner) */
commit;
end;

Procedure "register_table":

CREATE OR REPLACE PROCEDURE register_table (
table_name VARCHAR2,
application_short_name VARCHAR2
)
AS
status VARCHAR2 (10);

CURSOR c_columns ( p_table_name all_tab_columns.table_name%TYPE )
IS
SELECT column_name,
data_type,
data_length,
nullable,
ROWNUM,
data_precision,
data_scale
FROM all_tab_columns
WHERE table_name = p_table_name;

CURSOR c_constraints (p_table_name all_tab_columns.table_name%TYPE,
p_application_short_name all_tab_columns.owner%TYPE )
IS
SELECT constraint_name,
table_name,
status
FROM all_constraints
WHERE table_name = p_table_name AND owner = p_application_short_name AND constraint_type = 'P';

CURSOR c_constraint_columns (
p_table_name all_tab_columns.table_name%TYPE,
p_application_short_name all_tab_columns.owner%TYPE
)
IS
SELECT acc.constraint_name,
acc.column_name,
acc.POSITION
FROM all_cons_columns acc, all_constraints ac
WHERE ac.constraint_name = acc.constraint_name
AND ac.table_name = p_table_name
AND ac.constraint_type = 'P'
AND ac.owner = p_application_short_name;
BEGIN

DBMS_OUTPUT.put_line ('Registering Table '|| table_name ||'in application ' || application_short_name);

ad_dd.register_table (p_appl_short_name => application_short_name,
p_tab_name => table_name,
p_tab_type => 'T'
);

FOR r_columns IN c_columns (table_name)
LOOP

DBMS_OUTPUT.put_line ('Registering Column '|| r_columns.column_name);

ad_dd.register_column (p_appl_short_name => application_short_name,
p_tab_name => table_name,
p_col_name => r_columns.column_name,
p_col_seq => r_columns.ROWNUM,
p_col_type => r_columns.data_type,
p_col_width => r_columns.data_length,
p_nullable => r_columns.nullable,
p_translate => 'N',
p_precision => r_columns.data_precision,
p_scale => r_columns.data_scale
);

END LOOP;

FOR r_constraints IN c_constraints (table_name, application_short_name)
LOOP

DBMS_OUTPUT.put_line ('Creating Primary Key Constraint ' || r_constraints.constraint_name);

SELECT DECODE (r_constraints.status,
'ENABLED', 'Y',
'N'
)
INTO status
FROM DUAL;

ad_dd.register_primary_key (p_appl_short_name => application_short_name,
p_key_name => r_constraints.constraint_name,
p_tab_name => table_name,
p_description => 'Primary Key for Table '|| table_name,
p_key_type => 'D',
p_audit_flag => 'Y',
p_enabled_flag => status
);
END LOOP;

FOR r_constraint_columns IN c_constraint_columns (table_name, application_short_name)
LOOP

DBMS_OUTPUT.put_line ( 'Registering Primary Key Column '||
r_constraint_columns.column_name||
' for Constraint '||
r_constraint_columns.constraint_name);

ad_dd.register_primary_key_column (p_appl_short_name => application_short_name,
p_key_name => r_constraint_columns.constraint_name,
p_tab_name => table_name,
p_col_name => r_constraint_columns.column_name,
p_col_sequence => r_constraint_columns.POSITION
);
END LOOP;
END register_table;




4. Create Audit Group
Once you table registered,navigate to System Administrator Menu Security/AuditTrail/Groups 

Application Name: XX Custom Schema
Audit Group: XX Audit
Group State: Enabled

Now, add audit tables to this group[you can add as many tables]
User Table Name: XX_TABLE


5. Run Concurrent program “AuditTrail Update Tables”

This process can be run from System Administrator responsibility. It has no parameter. Running this process will create the Audit tables and the triggers that manage Audit data.


6. Ensure that Audit Tables have been created as expected
SELECT object_name, object_type
FROM all_objects
WHERE object_name LIKE 'XX_TABLE_A%'

OBJECT_NAME                            OBJECT_TYPE
--------------------------                      --------------------------
XX_TABLE_A                               TABLE
XX_TABLE_A                               SYNONYM
XX_TABLE_AC                            TRIGGER
XX_TABLE_AC1                          VIEW
XX_TABLE_AD                            TRIGGER
XX_TABLE_ADP                          PROCEDURE
XX_TABLE_AH                            TRIGGER
XX_TABLE_AI                              TRIGGER
XX_TABLE_AIP                            PROCEDURE
XX_TABLE_AT                             TRIGGER
XX_TABLE_AU                            TRIGGER
XX_TABLE_AUP                          PROCEDURE
XX_TABLE_AV1                           VIEW

Fine, this proves that the concurrent program in Step 5 did its job.
Optionally, you may run concurrent process “AuditTrail Report for Audit Group Validation” to validate the success of Audit Table/Trigger creation.

7. Add further columns for Audit Trail
By default Oracle will Audit Trail on all columns that are a part of first available Unique Index on XX_TABLE.
However further columns can be added to the Audit Trail. Lets say you wish to Audit Trail on Column Meaning too.
Navigate to System Administrator Menu Security/AuditTrail/Tables

You can add additional columns to audit trail and re-execute Step 5.
Please note that adding columns for Audit could have been done immediately after Step 4.

You are DONE...

Usefull notes:
How To Enable Auditing On A Table (Doc ID 1359749.1)
Unable to Enable Audit Trail for Custom Objects (Doc ID 433527.1)


Good Luck ...

Thursday, January 14, 2016

Configure Shared Appl Top in EBS R12 - Step by Step


Hi All ...

Here the step by step of configure Shared Appl Top  in EBS R12:

1.   Run adpreclone procedure in DB and APPL (on Main server):

·         On DB Tier:
        cd $ORACLE_HOME/appsutil/scripts/$CONTEXT_NAME
        perl adpreclone.pl dbTier
·         On APPL Tier:
         cd $INST_TOP/admin/scripts

         perl adpreclone.pl appsTier

2.   Stop APPL_TIER (on Main server)
3.   Add the F5 ip hosname.domain hostname to /etc/hosts on all servers.
4.   Connect the mount of the application tier to second appl server. 
5.   Add node (run the commands on second applserver ).
    cd $COMMON_TOP/clone/bin; (take a path from main appl node)
    perl adclonectx.pl addnode contextfile=<echo $CONTEXT_FILE from main node>
    *All servers need to be enabled
    perl <echo $AD_TOP/bin from main node >/adconfig.pl contextfile=<specify the path to the      new context file from previous step>
   Edit .bash_profile to point to new env files.
6.   Run AutoConfig in both nodes (main node need to be run as the last one).
7.   Edit Context file for 2 nodes

s_applcsf                            
Same on all nodes
s_fndreviverpiddir         
Same on all nodes
APPLDCP
ON
s_appltmp
Same on all nodes
s_temp
Same on all nodes
s_custom_file
Same is in main node
s_webentryhost 
F5 host
s_login_page 
F5 host
s_external_url
F5 host
8.   Run AutoConfig in both nodes (main node need to be run as the last one).
9.   Start APPL tier in both nodes (main and after that secondary).
10. Enable Internal Monitor Managers for both nodes:

Go to Concurrent manager > Define > Look for Internal Monitor% > Work Shiftes

 Work Shift:Standard
  Processes: 1 > Save
 Do the same for the second one

Activate both managers.

Query which user session is on which application servers:
 select nodes.node_name,usr.user_name,usr.user_id,ses.function_type
from icx_sessions ses,
     fnd_nodes nodes,
     fnd_user usr
where ses.node_id=nodes.node_id
and ses.guest='N'
and ses.user_id=usr.user_id
order by usr.user_id,nodes.node_name

You are done.
Good luck ...

Useful documents:
Sharing The Application Tier File System in Oracle E-Business Suite Release 12 (Doc ID 384248.1)
Using Load-Balancers with Oracle E-Business Suite Release 12 (Doc ID 380489.1).

Tuesday, July 21, 2015

How to download Oracle Software from Edelivery or Oracle Metalink by script


Hi All ...

Here the step by step guide how to download Oracle software with script.
Many of you already tried to do it from Oracle Edelivery site and know that you need to download one by one and it can take a lot of time. Also there are some scripts that can do it for you , but need to install some plug-ins to google chrome or Mozilla to collect the cookies.

This is the guide that I got from Oracle Support (thanks guys) and hope will make you life a little bit easy.

1. Log-in to http://support.oracle.com 
2. Go to Certifications tab

3. Choose the software,release and platform that  you want to download  and press Search
In my I want to download EBS 12.2.4 installation release for Oracle Linux 5

4. Click on Version on  Number of Releases / Versions column
 5. Choose the release. At this time you can re-choose another release
 6. Select the Product and press Download
 7. Accept the Agreement and press Next
8. Now you will get the all zips that you can download. You can download it one by one or just press on WGET options 
 9. Press on Download.sh to get the scripts and save it. Please pay attention, the script will work only for 8 hours after the creation
10. That's it. Just enter you oracle account password and you can start downloading.


TIP: the release can include alot of file that you will not use, so just remove or remark the WGET line form the script (for example all NLS packages) 

Good Luck ...

Thursday, July 16, 2015

How to collect Discoverer Plus and Viewer statistics


Hi All .

Here the step by step How to collect Discoverer Plus and Viewer statistics.

1.Navigate to the 'util' directory and edit the pref.txt file:

-- For 4i, it is $ORACLE_HOME/discwb4/util
-- For 10g, it is $ORACLE_HOME/discoverer/util
-- For 11g, it is:  $ORACLE_HOME/discoverer/config/pref.txt
 
$ORACLE_HOME refers to the top level AS home (Linux/Unix Example - /do2/Oracle/Middleware/as_1).  Your actual ORACLE_HOME name may differ, but should follow similar directory/path.
2.Navigate to the [Application] section:
3. Set the parameters

QPPEnable = 1
QPPCreateNewStats = 1 

(Although QPPCreateNewStats is not available by default in 11g, it still applies to 11g as well)

4. Save the pref.txt file.
5. Now we need to update the preference registry file:

-- For 4i and 10g, Unix/Linux, run: ./applypreferences.sh
-- For 4i and 10g, Windows run: applypreferences.bat
-- For 11g, Unix/Linux, run: $ORACLE_INSTANCE/Discoverer/Discoverer_asinst_1/util/applypreferences.sh
-- For 11g, Windows, run: $ORACLE_INSTANCE\Discoverer\Discoverer_asinst_1\util\applypreferences.bat

$ORACLE_INSTANCE refers to the instance home in the WLS/Discoverer home (Example - /do2/Oracle/Middleware/asinst_1).  Your actual ORACLE_INSTANCE may differ, but should follow similar directory/path.
Your ORACLE_INSTANCE may also differ if your environment includes multiple instances as may occur with clustered environments.

These settings will take effect for new sessions launched, but not existing sessions.
You may optionally, restart the Discoverer to force/kill all existing sessions.

P.S If you are using the Oracle BI Discoverer Plus Version 11.1.1.6.0/11.1.1.4.0 , you need to apply patch 11784475 (DISCO 11G PLUS/VIEWER QUERY STATS NOT WORKING IN APPS 12I EUL/64 BIT OS)

Good Luck ...

Monday, June 29, 2015

How to re-open EXPIRED & LOCKED user with the same password



Hi All ...

Here the fast way to re-open the DB users when it in  EXPIRED & LOCKED status and you don't want to change the password and not remember the old one.

Run the following with "/as sysdba" :

1. Change the FAILED_LOGIN_ATTEMPTS profile to UNLIMITED.
alter profile default limit failed_login_attempts unlimited password_life_time unlimited;

2. Sql to change the status from LOCKED to OPEN  (copy the result and run in sqlplus).

select 'alter user '|| username || ' account unlock;' 
from dba_users where account_status = 'LOCKED'

3. Sql to remove the expired status (copy the result and run in sqlplus).
select 'alter user ' || su.name || ' identified by values' || ' ''' || spare4 || ';' || su.password || ''';'
from sys.user$ su join dba_users du on ACCOUNT_STATUS like 'EXPIRED%'
and su.name = du.username;


Good Luck ...

Thursday, June 25, 2015

UPK to EBS R12 - Step By Step.

Hi All

Here the step by step guide how to connect the Oracle EBS R12 to use UPK help.

1. Add the UPK to CUSTOM.pll file:
Backup the CUSTOM.plx before installation.
Copy the attached ODPN.pll file to $AU_TOP/resource.
Compile the ODPN.pll using:
frmcmp_batch userid=apps/apps module=ODPN.pll module_type=LIBRARY    
make sure that the ODPN.plx was created.
Convert the CUSTOM.pll to text file (ECM_CUSTOM.pld)
frmcmp_batch userid=apps/apps module= CUSTOM.pll module_type=LIBRARY script=Yes
Open the CUSTOM.pld
Add the fillowing line at the begining of the file:
.attach LIBRARY ODPN END NOCONFIRM
right after the last attached pll
Add the following at the end of the Event procedure (before the line with  "end event;"), save and close the file:
/*************** UPK Module ****************************************/
gkod_event(event_name, 'SPECIAL20');
/*******************************************************************/
Convert the ECM_CUSTOM.pld from text file to pll file (binary) using:
frmcmp_batch userid=apps/apps module= CUSTOM.pld module_type=LIBRARY parse=Yes (make sure that the CUSTOM.pll was created).
Compile the CUSTOM.pll using:
frmcmp_batch userid=apps/apps module= CUSTOM.pll module_type=LIBRARY (make sure that the CUSTOM.plx was created).

2. Copy the content of directory - Create Requisition Publish\Publishing content\PlayerPackage to $INST_TOP/portal/upk (or use windows shared directory so you need to mount directory and create a soft link 
cd $INST_TOP/portal
ln -s <shared directory>  upk ).

3. Login to Oracle Application and update Applications Help Web Agent profile with the following string:

http://<hostname>:<port>/upk/oracle/hemi/oracle_gateway.html

4. Restart Apache service
5. Now you can use the UPK to EBS functionality from EBS help menu.


Good Luck ...

Tuesday, November 25, 2014

Refreshing IQY file from discoverer 11g


Hi All ...

Here the new issue that I have found in Discoverer 11g during the refreshing IQY file.


Open discoverer plus report  -->  export


change format to IQY:

Next.. next…..next

Open file and  run from your computer:
1    Enter your password when required
2    Enter:

 Enter:
Get the error:


 
The application encounters an invalid state. . 
#NAME? 
- Java heap space 
Oracle BI Discoverer Viewer cannot find the data necessary to display the results of this event. Correct any errors, and try again. 

Reason:

It appears that the managed server WLS_DISCO is running out of heap space

Solution:

You need to increase the maximum heap space.
How to increase the maximum java heap memory allowed for the managed server WLS_DISCO ( Doc ID 1592078.1 ) 


 Good Luck ...

Thursday, August 7, 2014

Using GMail's SMTP and IMAP servers in Oracle Notification Mailer (Workflow Mailer )


Hi All ...
Here the step by step guide how to use Gmail account  with Oracle Workflow mailer.
Tested it in couple of customer sites and it working perfect...

Overview
GMail offers free, reliable, popular SMTP and IMAP services, because of which many people are interested to use it. GMail can be used when there are no in-house SMTP/IMAP servers for testing or debugging purposes. This blog explains how to install GMail SSL certificate in Concurrent Tier, testing the connection using a standalone program, running Mailer diagnostics and configuring GMail IMAP and SMTP servers for Workflow Notification Mailer Inbound and Outbound connections.

GMail servers configuration

SMTP server 

Host Name smtp.gmail.com
SSL Port 465
TLS/SSL required Yes
User Name Your full email address (including @gmail.com or @your_domain.com)
Password Your gmail password

 IMAP server

 Host Nameimap.gmail.com 
 SSL Port993 
TLS/SSL Required Yes 
 User Name Your full email address (including @gmail.com or @your_domain.com)
 PasswordYour gmail password

GMail SSL Certificate Installation

The following is the procedure to install the GMail SSL certificate
  • Copy the below GMail SSL certificate in to a file eg: gmail.cer
    -----BEGIN CERTIFICATE-----
    MIIDWzCCAsSgAwIBAgIKaNPuGwADAAAisjANBgkqhkiG9w0BAQUFADBGMQswCQYD
    VQQGEwJVUzETMBEGA1UEChMKR29vZ2xlIEluYzEiMCAGA1UEAxMZR29vZ2xlIElu
    dGVybmV0IEF1dGhvcml0eTAeFw0xMTAyMTYwNDQzMDRaFw0xMjAyMTYwNDUzMDRa
    MGgxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1N
    b3VudGFpbiBWaWV3MRMwEQYDVQQKEwpHb29nbGUgSW5jMRcwFQYDVQQDEw5pbWFw
    LmdtYWlsLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAqfPyPSEHpfzv
    Xx+9zGUxoxcOXFrGKCbZ8bfUd8JonC7rfId32t0gyAoLCgM6eU4lN05VenNZUoCh
    L/nrX+ApdMQv9UFV58aYSBMU/pMmK5GXansbXlpHao09Mc8eur2xV+4cnEtxUvzp
    co/OaG15HDXcr46c6hN6P4EEFRcb0ccCAwEAAaOCASwwggEoMB0GA1UdDgQWBBQj
    27IIOfeIMyk1hDRzfALz4WpRtzAfBgNVHSMEGDAWgBS/wDDr9UMRPme6npH7/Gra
    42sSJDBbBgNVHR8EVDBSMFCgTqBMhkpodHRwOi8vd3d3LmdzdGF0aWMuY29tL0dv
    b2dsZUludGVybmV0QXV0aG9yaXR5L0dvb2dsZUludGVybmV0QXV0aG9yaXR5LmNy
    bDBmBggrBgEFBQcBAQRaMFgwVgYIKwYBBQUHMAKGSmh0dHA6Ly93d3cuZ3N0YXRp
    Yy5jb20vR29vZ2xlSW50ZXJuZXRBdXRob3JpdHkvR29vZ2xlSW50ZXJuZXRBdXRo
    b3JpdHkuY3J0MCEGCSsGAQQBgjcUAgQUHhIAVwBlAGIAUwBlAHIAdgBlAHIwDQYJ
    KoZIhvcNAQEFBQADgYEAxHVhW4aII3BPrKQGUdhOLMmdUyyr3TVmhJM9tPKhcKQ/
    IcBYUev6gLsB7FH/n2bIJkkIilwZWIsj9jVJaQyJWP84Hjs3kus4fTpAOHKkLqrb
    IZDYjwVueLmbOqr1U1bNe4E/LTyEf37+Y5hcveWBQduIZnHn1sDE2gA7LnUxvAU=
    -----END CERTIFICATE-----
    • Install the SSL certificate into the default JRE location or any other location using below command
    • Installing into a dfeault JRE location in EBS instance
            # keytool -import -trustcacerts -keystore $AF_JRE_TOP/lib/security/cacerts  -storepass changeit -alias gmail-lnx_chainnedcert -file gmail.cer
    • Install into a custom location
            # keytool -import -trustcacerts -keystore <customLocation>  -storepass changeit -alias gmail-lnx_chainnedcert -file gmail.cer
           <customLocation> -- directory in instance where the certificate need to be installed
    • After running the above command you can see the following response
            Trust this certificate? [no]:  yes
            Certificate was added to keystore 

    Running Mailer Command Line Diagnostics

    • Run Mailer command line diagnostics from conccurrent tier where Mailer is running, to check the IMAP connection using the below command
    $AFJVAPRG -classpath $AF_CLASSPATH -Dprotocol=imap -Ddbcfile=$FND_SECURE/$TWO_TASK.dbc -Dserver=imap.gmail.com -Dport=993 -Dssl=Y -Dtruststore=$AF_JRE_TOP/lib/security/cacerts -Daccount=<gmail username> -Dpassword=<password> -Dconnect_timeout=120 -Ddebug=Y -Dlogfile=GmailImapTest.log -DdebugMailSession=Y oracle.apps.fnd.wf.mailer.Mailer
    • Run Mailer command line diagnostics from concurrent tier where Mailer is running, to check the SMTP connection using the below command  
     $AFJVAPRG -classpath $AF_CLASSPATH -Dprotocol=smtp -Ddbcfile=$FND_SECURE/$TWO_TASK.dbc -Dserver=smtp.gmail.com -Dport=465 -Dssl=Y -Dtruststore=$AF_JRE_TOP/lib/security/cacerts -Daccount=<gmail username> -Dpassword=<password> -Dconnect_timeout=120 -Ddebug=Y -Dlogfile=GmailSmtpTest.log -DdebugMailSession=Y oracle.apps.fnd.wf.mailer.Mailer 

    Standalone program to verify the IMAP connection

    Run the below standalone program from the concurrent tier node where Mailer is running to verify the connection with GMail IMAP server. It connects to the GMail IMAP server with the given GMail user name and password and lists all the folders that exist in that account. If the GMail IMAP server is not working for the  Mailer check whether the PROCESSED and DISCARD folders exist for the GMail account, if not create manually by logging into GMail account.
    Sample program to test GMail IMAP connection
     The standalone program can be run as below
     $java GmailIMAPTest GMailUsername GMailUserPassword           

    Standalone program to verify the SMTP connection

    Run the below standalone program from the concurrent tier node where Mailer is running to verify the connection with GMail SMTP server. It connects to the GMail SMTP server by authenticating with the given user name and password  and sends a test email message to the give recipient user email address.
    Sample program to test GMail SMTP connection
    The standalone program can be run as below 
     $java GmailSMTPTest GMailUsername GMailPassword recipientEmailAddress   

    Warnings

    • As gmail.com is an external domain, the Mailer concurrent tier should allow the connection with GMail server
    • Please keep in mind when using it for corporate facilities, that the e-mail data would be stored outside the corporate network
    Good Luck ...