Tuesday, 9 July 2013

how to add customization to apache configuration file.

Overview

As we know AutoConfig is a tool that simplifies and standardizes configuration management tasks in an Oracle Applications environment.
The configuration generated by AutoConfig may not always meet your specific requirements and it may be necessary to customize AutoConfig to get your environment up and running.

Steps to preserve autoconfig:


First find template file for apache configuration file using adtmplreport.sh script located in $AD_TOP/bin



[applmgr3@fed01 ~]$ cd $AD_TOP/bin
[applmgr3@fed01 bin]$ ls adtmplreport.sh
adtmplreport.sh
[applmgr3@fed01 bin]$ adtmplreport.sh
Usage:
        adtmplreport.sh [help]
        adtmplreport.sh contextfile=<contextfilepath> [log=<logfilepath>]
                [[listcustom] | [product=<product>[listcustom] ]]|
                [target=<targetfilepath>|template=<templatefilepath>]
                [verbose]

Valid arguments for adtmplreport.sh:
        help            : prints usage information
        contextfile     : Complete path to Applications context file.
        log             : Complete path to the Log file to log the
                          information. If not specified, the file will
                          be created automatically in
                          [apps tier]
                          $INST_TOP/admin/log directory
                          [db tier]
                          $ORACLE_HOME/appsutil/log/<s_contextname> directory
        product        : Product to be reported
        template       : Location of template file to be reported on
        target         : Location of target file to be reported on
        verbose        : Displays the output on the screen.
        listcustom     : Lists customizations.

[applmgr3@fed01 bin]$ adtmplreport.sh contextfile=$CONTEXT_FILE target=/u03/applmgr3/inst/apps/PROD_fed01/ora/10.1.3/Apache/Apache/conf/httpd.conf

#########################################################################
          Generating Report .....
#########################################################################
For details check log file: /u03/applmgr3/inst/apps/PROD_fed01/admin/log/07102203.log

[applmgr3@fed01 bin]$ cat /u03/applmgr3/inst/apps/PROD_fed01/admin/log/07102203.log
=================================================================
Starting Utility to Report on Templates and their  Targets  at Wed Jul 10 22:03:28 IST 2013
Using ATTemplateReport.java version 120.0


[ INFO_REPORT ]

[FND_TOP]
TEMPLATE FILE   : /u03/applmgr3/apps/apps_st/appl/fnd/12.0.0/admin/template/httpd_conf_1013.tmp
TARGET FILE     : /u03/applmgr3/inst/apps/PROD_fed01/ora/10.1.3/Apache/Apache/conf/httpd.conf



Modify the configuration file(target file - httpd.conf) as per requirement.For xample add some lines to conf file
“RedShore Technologies---Ameerpet”

Now change the customisation in template file


Key points:-
 Sometimes patch brings new version of template files. Template files will be copied to Standard
template file location rather than Custom template file location. So, in these conditions AutoConfig
fails with conflicts error.

 Whenever we are getting AutoConfig version conflicts, we need to take a backup of existing custom
directory template file and we have to copy new Standard template file to custom directory and we
can add customizations to the file.

 You cannot customize all AutoConfig template files. The AutoConfig templatefile cannot be customized if the “LOCK” keyword appears in the template file’s entry in the

product driver file.

 AutoConfig ignores custom template files that are marked with “LOCK”.


Sunday, 7 July 2013

What happens during RMAN active duplicate cloning in oracle


In an active duplication process, target database online image copies and archived redo log files were copied through the auxiliary instance service name. So we no need the target database backup.
Target database must be in archive log mode.
Database duplication process RMAN does the following things
1.Generate the unique DBID for auxiliary database.
2.Copy the data files & archived log files from target database to auxiliary database.
3.Recreate the new control files for auxiliary database.
4.Recreates the online redo log files.
5.Restart the auxiliary instance.
6.Open the database with RESETLOGS.

Monday, 1 July 2013

How to find out Apps password when we dont know the old password.

How to find out Apps password when we dont know the old password.


The below methog helps us to find out when we lost the Apps password, Please note you need have system password to perform the below actions.The below method is not suggested for Production or Critical systems.

Login to Middle Tier as ap user.
-------------------------------

$cd $FND_TOP/patch/115/sql

$cp AFSCJAVS.pls AFSCJAVS.pls.orig

Add following lines to the AFSCJAVS.pls file

CREATE OR REPLACE PACKAGE apps.fnd_web_sec AS

/*--------------------------------------------------------------*/

function decrypt(key in varchar2, value in varchar2)
return varchar2;

/*--------------------------------------------------------------*/

$sqlplus system/ @AFSCJAVS.pls

Package created.

Commit complete.

as system excute the following to find out if anything marked as invalid.

SQL> show user
USER is "SYSTEM"

SQL>col OBJECT_NAME for a30;
set line 200;
select object_name,object_type,status,owner from dba_objects where object_name='FND_WEB_SEC';


SQL>col OBJECT_NAME for a30;
set line 200;
select object_name,object_type,status,owner from dba_objects where object_name='FND_WEB_SEC';

OBJECT_NAME OBJECT_TYPE STATUS OWNER
------------------------------ ------------------ ------- ------------------------------
FND_WEB_SEC PACKAGE VALID APPS
FND_WEB_SEC PACKAGE BODY INVALID APPS

SQL> alter PACKAGE apps.FND_WEB_SEC compile body;

Package body altered.

If there are any invalids compile them.

Obtain Guest user ID and password.

as system excute the following.

SQL> show user
USER is "SYSTEM"

SQL> select profile_option_value from apps.fnd_profile_option_values where
profile_option_id = (select profile_option_id from apps.fnd_profile_options where
profile_option_name='GUEST_USER_PWD');
2 3
PROFILE_OPTION_VALUE
----------------------------------------------------------------------------------------------------
GUEST/ORACLE

SQL> show user
USER is "SYSTEM"

SQL>create synonym FND_WEB_SEC_TEST for apps.FND_WEB_SEC;

Synonym created.

SQL> show user
USER is "SYSTEM"
SQL> create synonym FND_WEB_SEC_TEST for apps.FND_WEB_SEC;

Synonym created.

-- Now Obtain Apps password using the below sql :)

SQL> SELECT(
SELECT
fnd_web_sec_test.decrypt('GUEST/ORACLE',encrypted_foundation_password)
FROM dual
)AS APPS_PASSWORD
FROM
apps.fnd_user
WHERE
user_name like 'GUEST'; 2 3 4 5 6 7 8 9


APPS_PASSWORD
----------------------------------------------------------------------------------------------------
APPS

-- WOW we got the Apps password now


SQL> drop synonym FND_WEB_SEC_TEST;

Synonym dropped.

-bash-3.2$ sqlplus apps/ @AFSCJAVS.pls

Package created.

Commit complete.

Please find the below explanation for the above steps:
---------------------------------------------------------------

A)
We know in Oracle Applications passwords are stored in FND_USER and FND_ORACLE_USERID tables,The FND_USER table stores application user account passwords and
the FND_ORACLE_USERID table stores internal Oracle Applications database account passwords,Both tables use the same encryption algorithm to protect the passwords.

The FND_USER table contains all the application accounts.There are two password columns in this table: ENCRYPTED_FOUNDATION_PASSWORD and ENCRYPTED_USER_PASSWORD.

====================================================
Column Value Encryption Key
===================================================
ENCRYPTED_FOUNDATION_PASSWORD APPS username/password
ENCRYPTED_USER_PASSWORD user APPS password


The 2 columns as...

a)If we know the username/password we can get the Apps Password (ENCRYPTED_FOUNDATION_PASSWORD)
b)If we know the Apps password we can get any users password (ENCRYPTED_USER_PASSWORD)

B)

To decrypt and verify user passwords Oracle Apps uses FND_WEB_SEC package in Apps.The DECRYPT function in the FND_WEB_SEC package is a local function and cannot be called from outside the package.

So to make the function available outside the package,we have altered the AFSCJAVS.pls above.

11g R2 RAC: CONVERT NON RAC DATABASE TO RAC DATABASE USING RCONFIG


for RAC basics click on below URL

http://learnappsdbaskills.blogspot.in/2013/06/rac-basics.html




Oracle supports the following methods to convert a single-instance database to an RAC database as long as the RAC and the standalone environments are running on the same operating system and using the same oracle release:


• DBCA


• Oracle E

nterprise Manager (grid control)


• RCONFIG


• Manual method


In this post, I will focus on and demonstrate this using the rconfig command-line tool.


During the conversion, rconfig performs the following steps automatically:


• Migrating the database to ASM, if specified


• Creating RAC database instances on all specified nodes in the cluster


• Configuring the Listener and NetService entries


• Registering services with CRS


• Starting up the instances and listener on all nodes


In Oracle 11g R2., a single-instance database can either be converted to an administrator-managed cluster database or a policy-managed cluster database.


When you navigate through the $ORACLE_HOME/assistants/rconfig/sampleXMLS, you will find two sample XML input files.


- ConvertToRAC_AdminManaged.xml


- ConvertToRAC_PolicyManaged.xml


While converting a single-instance database, with filesystem storage, to an RAC database with Automatic Storage Management (ASM), rconfig invokes RMAN internally to back up the database to proceed with converting non-ASM to ASM. Therefore, configuring parallel options to use multiple RMAN channels in the


RMAN on the local node may make backup run faster, which eventually reduces the conversion duration. For example, you may configure the following in the RMAN settings of orcl database on the local node.


RMAN> CONFIGURE DEVICE TYPE DISK PARALLELISM 6;


CURRENT SCENARIO:


- 3 node RAC setup


- Names of nodes : Host01, Host02, Host03


- Name of single instance database with filesystem storage : orcl


- Source Oracle home : /u01/app/oracle/product/11.2.0/dbhome_1


- Target Oracle home : /u01/app/oracle/product/11.2.0/dbhome_1


OBJECTIVE


- convert orcl to a Admin managed RAC database running on two nodes host01 and host02.


- change storage to ASM with


. Datafiles on +DATA diskgroup


. Flash recovery area on +FRA diskgroup


IMPLEMENTATION:


– copy ConvertToRAC_AdminManaged.xml to another file my.xml


host01$cd $ORACLE_HOME/assistants/rconfig/sampleXMLs


host01$cp ConvertToRAC_AdminManaged.xml my.xml


– Edit my.xml and make following changes :


. Specify current OracleHome of non-rac database for SourceDBHome


. Specify OracleHome where the rac database should be configured. It can be same as SourceDBHome


. Specify SID of non-rac database and credential. User with sysdba role is required to perform conversion


. Specify the list of nodes that should have rac instances running for the Admin Managed Cluster Database. LocalNode should be the first node in this nodelist.


. Instance Prefix tag is optional starting with 11.2. If left empty, it is derived from db_unique_name


. Specify the type of storage to be used by rac database. Allowable values are CFS|ASM


. Specify Database Area Location to be configured for rac database.


. Specify Flash Recovery Area to be configured for rac database.


– Run rconfig to convert orcl from single instance database to 2 instance RAC database


host01$rconfig my.xml


– Check the log file for rconfig while conversion is going on


oracle@host01$ls -lrt $ORACLE_BASE/cfgtoollogs/rconfig/*.log


tailf


– check that the database has been converted successfully


host01$srvctl status database -d orcl


Instance orcl1 is running on node host01


Instance orcl2 is running on node host02


– Note that rconfig adds password file to all the nodes but entry to tnsnames.ora needs to be modified (to reflect scan name instead of host-ip) on the local node and added to rest of the nodes.


– For all other nodes, copy the entry for the database (orcl) from tnsnames.ora on local node to tnsnames.ora on remote node(s).


– Following is the entry I modified on the local node and copied to rest of the nodes :


ORCL =


(DESCRIPTION =


(ADDRESS = (PROTOCOL = TCP)(HOST = cluster01-scan.cluster01.example.com)(PORT = 1521))


(CONNECT_DATA =


(SERVER = DEDICATED)


(SERVICE_NAME = orcl)


)


)


– check that database can be connected remotely from remote node.


host02$sqlplus system/oracle@orcl


– check that datafiles have converted to ASM


SQL>select name from v$datafile;


NAME


——————————————————————————–


+DATA/orcl/datafile/system.326.794838279


+DATA/orcl/datafile/sysaux.325.794838349


+DATA/orcl/datafile/undotbs1.305.794838405


+DATA/orcl/datafile/users.342.794838413


+DATA/orcl/datafile/undotbs2.348.794838


———————————————————————————————————–

Thursday, 20 June 2013

Cloning SSO-Enabled Environments in E-Business Suite


This is already discussed in Steven Chan's Blog article http://blogs.oracle.com/stevenChan/2006/05/11/ and much of this note is a straight copy from this article.  Please review this blog article in it's entirety before proceeding.

If you're willing to experiment a bit, the following are general guidelines to point you in the right direction.  Some customers and Oracle Consultants have used the following approaches to get the job done but have reported that there was some trial-and-error involved.

These are neither detailed nor comprehensive instructions.  The following should be attempted only by system administrators who have a solid understanding of the principles outlined in Metalink Note 261914.1.

If you're going to experiment with these approaches, I strongly recommend that you take all sensible precautions, including backing up your environments at multiple stages, taking careful notes, and doing things in small, incremental steps to control your risk.

There is no single stop, supported or documented method to create a clone of your eBiz instance when integrated with SSO.   Please use this note with caution and make sure you thoroughly test any procedure you decide to use to ensure it fits with all aspects of your specific setup.

1- Use Rapid Clone to create a clone of your E-Business Suite, including the application-tier and database-tier.
   For 11i, please use:
     Note 230672.1 Cloning Oracle Applications Release 11i with Rapid Clone
 
   For R12 ,please use:
     Note 406982.1   Cloning Oracle Applications Release 12 with Rapid Clone

2- In the  newly-cloned E-Business Suite instance, set the APPS_SSO_LDAP_SYNC profile option to "Disabled" at the site level (since there's no new Oracle Internet Directory instance to synchronize with yet).

3 -  In your newly-cloned E-Business Suite instance, unlink all E-Business Suite users that were linked to the original Oracle Internet Directory 10g users (i.e. where FND_USER.USER_GUID is populated), since the those old links are no longer valid. Those E-Business Suite users will need to be linked to their corresponding accounts in the as-yet non-existent new Oracle Internet Directory instance.

To Unlink EBS users, you should execute the following Command for each individual user (For both 11i and R12):

$FND_TOP/patch/115/sql/fndssouu.sql

See Note 429375.1 for more information on this utility

4 -  In your newly-cloned E-Business Suite instance, remove all reference to the original OID/SSO instance

Use the “removereferences” to cleanup the previous registration information of SSO & OID

For R12 this is described in Note 376811.1 "Section 3: Remove References"

For 11i :  Note 233436.1  "Appendix D:  Advanced Configuration - Manual SSO/OID Registration" - Option 6

5 -  Create a fresh install of Single Sign-On and Oracle Internet Directory 10g on your new server.

6 - Assuming that you enabled bidirectional provisioning between the E-Business Suite and Oracle Internet Directory, do one of the following (but not all three):

a) Redo your bulkload from the E-Business Suite into Oracle Internet Directory.
   On Release 12, please refer to "System Administrator's Guide - Security" on Section 6 (Oracle Single Sign-On Integration )

Then  Reregister your E-Business Suite environment using the Bidirectional Provisioning Profile, and enable the APPS_SSO_AUTO_LINK_USER profile option, and set the profile option APPS_SSO_LDAP_SYNC back to Enabled at site level.

b) Export your LDAP namespace from your original Oracle Internet Directory instance into an LDIF file, and then import the LDIF file into the new Oracle Internet Directory instance. Reregister your E-Business Suite environment using the Bidirectional Provisioning Profile, and (assuming that the Oracle Internet Directory accounts are identical to the E-Business Suite accounts) enable the APPS_SSO_AUTO_LINK_USER profile option, and set the profile option APPS_SSO_LDAP_SYNC back to Enabled at site level.

c) Connect the original Oracle Internet Directory instance to your new Oracle Internet Directory instance via a connector, synchronizing the namespaces. Reregister your E-Business Suite environment using the Bidirectional Provisioning Profile, and (assuming that the Oracle Internet Directory accounts are identical to the E-Business Suite accounts) enable the APPS_SSO_AUTO_LINK_USER profile option, and set the profile option APPS_SSO_LDAP_SYNC back to Enabled at site level.

Is it Possible to Clone an SSL Enabled E-Business Suite Middle Tier?



The Rapidclone utility does not support like for like cloning of an SSL enabled E-business suite middle tier.
Note 230672.1 Cloning Oracle Applications Release 11i with Rapid Clone
Note 406982.1 Cloning Oracle Applications Release 12 with Rapid Clone

The problem can be broken down into 3 issues

1:- File system changes.

The location of the SSL files on the clone is different to that from the source. From the bug we can see the following were not the same between source and target.

s_frmWalletDir
s_web_ssl_directory
s_web_ssl_keyfile
s_web_ssl_certfile
s_web_ssl_certchainfile


2:- SSL Port is wrong in the clone.

s_webssl_port - Gets Defaulted to 443, ideally it should take Apache Port given during adcfgclone run.

3:- SSL certificates are the same on the clone as they are on source.

This might be a security issue depending on your security requirements.
 

However
 Rapidclone will create a clone of an SSL enabled middle tier, but the target will require additional configuration to allow it to function correctly. To progress the issue further you must decide if

A:- You want the middle tier clone to be SSL enabled.

Re-implement SSL on the clone following the note below.

Note 123718.1 11i: A Guide to Understanding and Implementing SSL for Oracle Applications

B:- You want the middle tier clone to be HTTP only.

Remove the SSL configuration added in


Note 123718.1 11i: A Guide to Understanding and Implementing SSL for Oracle Applications


Wednesday, 19 June 2013

Where RAC database stores data

Storage Options for RAC

1--CFS (Cluster File System) – Easy to manage but only available on some platforms.  Does not address striping and mirroring.
2--RAW – Available on all platforms but difficult to manage. Does not address striping and mirroring.
3--NFS – Easy to manage but only available on some platforms.  Does not address striping and mirroring.
4--ASM (Automatic Storage Management) – Easy to manage, available on ALL platforms, and DOES address striping and mirroring.

CFS (Cluster Filesystems)

The idea of CFS is to basically share file filesystems between nodes.
Easy to manage since you are dealing with regular files.
CFS is configured on shared storage.  Each node must have access to the storage in which the CFS is mounted.
NOT available on all platforms.  Supported CFS solutions currently:
OCFS on Linux and Windows (Oracle)
DBE/AC CFS (Veritas)
GPFS (AIX)
Tru64 CFS (HP Tru64)
Solaris QFS

RAW (character devices)

Hard to manage since you are dealing with character devices and not regular files.
Adding and resizing datafiles is not trivial.
On some operating systems volume groups need to deactivated before LVs can be manipulated or added.

NFS (Network Filesystem)

NOT available on all platforms.  Supported NFS solutions currently:
Network Appliance
Redhat Linux
Fujitsu Primecluster
Solaris Suncluster

ASM

Stripes files rather than logical volumes.
Enables online disk reconfiguration and dynamic rebalancing.
Provides adjustable re balancing speed.
Provides redundancy on a file basis.
Supports only Oracle files.
Is cluster aware.
Is automatically installed as part of the base code set