Pages

Saturday, December 18, 2010

Discoverer 10G Clone

Oracle Discoverer 10G Clonining :
----------------------------------------

Perform the below actions to complete the Discoverer 10G clone.

A) Pre-clone Steps:
----------------
1) Login on Source Discoverer Machine as applmgr. There is no need to shutdown the services
$ export ORACLE_HOME=/u01/product/10gR2
$ export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH
$ cd $ORACLE_HOME/clone/bin
$ chmod 755 prepare_clone.pl
$ ./prepare_clone.pl
Clone log file location: /u01/product/10gR2/clone/logs/clone.log
Error log file location: /u01/product/10gR2/clone/logs/error.log

2) Copy the Discoverer directory to the target machine.

3) Get the ias_admin_old_pwd as it is necessary as input for the clone
B)Clone Steps
--------------
1) Login on the Linux box on target machine as root and set the inventory locations as:
mkdir /etc/oraInventory
chmod -R 777 /etc/oraInventory
chown -R applmgr:dba /etc/oraInventory
touch /etc/oratab
chmod a+rw /etc/oratab
chown applmgr:dba /etc/oratab
echo 'inventory_loc=/etc/oraInventory' > /etc/oraInst.loc
chown applmgr:dba /etc/oraInst.loc

2) Rename the old inventory directory, which is copied from source.
7) Start the clone activity.
$ export ORACLE_HOME=/u01/product/10gR2
$ export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH
$ cd $ORACLE_HOME/clone/bin
$ perl clone.pl ORACLE_HOME=$ORACLE_HOME ORACLE_HOME_NAME= -instance
-ias_admin_old_pwd welcome -ias_admin_new_pwd secret
Note: If the error occurs during the clone, clean the oraInventory directory and restart the clone process, otherwise the clone process will fail.
C)Post Clone Steps
-------------------
1) Remove Old dbc files from /u01/product/10gR2/discoverer/secure

2) Copy new dbc file from the application node to /u01/product/10gR2/discoverer/secure

3) Change the old servername to new server name in httpd.conf


4) $ORACLE_HOME/opmn/bin/opmnctl stopall

5) $ORACLE_HOME/opmn/bin/opmnctl startall

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.






What happens during a hot backup

What happens during a hot backup::

What happens during a hot backup is widely misunderstood. Many people believe that while a tablespace is in backup mode, the datafiles within that tablespace are not written to. They believe that all changes to these files are kept in the redologs until the tablespace is taken out of backup mode, at which point all changes are applied to the datafiles just as they are during a media recovery. Although this explanation is easier to understand (and swallow) than how things really work, it is absolutely not how hot backups work in Oracle.

A common reaction to this statement is a very loud "What?" followed by crossed arms and a really stern look. (I reacted the same way the first time I heard it.) "How could I safely back up these files if they are changing as I'm backing them up?" Don't worry -- Oracle has it all under control. Remember that every Oracle datafile has an SCN that is changed every time an update is made to the file. Also remember that every time Oracle makes a change to a datafile, it records the vector of that change in the redolog. Both of these behaviors change during hot backups. When a tablespace is put into backup mode, the following three things happen:


1. Oracle checkpoints the tablespace, flushing all changes from shared memory to disk.

2. The SCN markers for each datafile in that tablespace are "frozen" at their current values. Even though further updates will be sent to the datafiles, the SCN markers will not be updated until the tablespace is taken out of backup mode.

3. Oracle switches to logging full images of changed database blocks to the redologs. Instead of recording how it changed a particular block the change vector), it will log the entire image of the block after he change. This is why the redologs grow at a much faster rate while hot backups are going on.


After this happens, your backup program works happily through this datafile, backing it up block by block. Since the file is being updated as you are reading it, it may read blocks just before they're changed, after they're changed, or even while they're changing. Suppose that your filesystem block size is 4 KB, and Oracle's block size is 8 KB. Your backup program will be reading in increments of 4 KB. It could back up the first 4 KB of an 8-KB Oracle data block before a change is made to that block, then back up the last 4 KB of that file after a change has been made. This results in what Oracle calls a "split block". However, when your backup program reaches the point of the datafile that contains the SCN, it will back up that block the way it looked when the backup began, since that block is frozen. Once you take the tablespace out of backup mode, the SCN marker is advanced to the current value, and Oracle switches back to logging change vectors instead of full images of changed blocks.



How does Oracle straighten this out during media recovery? It's actually very simple. You use your backup program to restore the datafile. When you attempt to start the instance, Oracle looks at the datafile and sees an old SCN value. Actually, it sees the value that the SCN marker had before the hot backup began. When you enter recover datafile, it begins to apply redo against this datafile. Since the redologs contain a complete image of every block that changed during your backup, it can rebuild this file to a consistent state, regardless of when you backed up a particular block of data.

ORACLE APPS R12 - SOCKET to SERVLET conversion (vice-versa) Release R12

ORACLE APPS R12 - SOCKET to SERVLET conversion (vice-versa) Release R12
=========================================================

1) $INST_TOP/admin/scripts/adstpall.sh

2) To change value in context_file & execute.
For SOCKET MODE
===============
$FND_TOP/bin/txkrun.pl -script=ChangeFormsMode \
[-contextfile=] \
-mode=socket \
[-port=] \
-runautoconfig= \
-appspass=
For Servlet MODE
================
$FND_TOP/bin/txkrun.pl -script=ChangeFormsMode \
[-contextfile=] \
[-mode=servlet] \
-runautoconfig= \
-appspass=
3) $INST_TOP>/admin/scripts/adstrtal.sh
4) To Verify
$INST_TOP>/admin/scripts/adformsrvctl.sh status
&
For SOCKET MODE
===============
Log in to Oracle Applications and launch a Forms-based application.
Check whether the "mode" directive displayed in Sun Java Console when launching forms-based applications is set to socket.
For Servlet MODE
================
Log in to Oracle Applications and launch a Forms-based application.
Check whether the "mode" directive displayed in Sun Java Console when launching forms-based applications, is set to http,native
5) Direct Launch ( This will work only if "authentication" is set to "OFF" )
For SOCKET MODE
===============
://.:/OA_HTML/frmservlet
For Servlet MODE
================
://.:/forms/frmservlet

How to Find Out Versions - I

Finding Versions - I
============

OS VERSION
----------
$ uname -a
Linux auohszcoi01 2.4.9-e.35enterprise #1 SMP Tue Dec 23 00:06:16 EST 2003 i686

file /sbin/init
/sbin/init: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.4.0, dynamically linked (uses shared libs), stripped

JAVA VERSION
-----------

$ grep JSERVJAVA $APACHE_TOP/Apache/bin/java.sh
$ /usr/java/jdk1.3.1_02/jre/bin/java version
$ ls -l /usr/java/jdk1.3.1_02/jre/bin/java

FINDING JAVA FILE VERSION
-------------------------
Once you are in the correct directory (which should be the $JAVA_TOP), you
can perform the following to get the file version to get the version of

ItemEOImpl.class, for example:
---------------------------------------------------------------------------
ident apps.zip | grep -i 'ItemEOImpl'
---------------------------------------------------------------------------

If the above doesn't work, please try the following:
---------------------------------------------------------------------------
strings -a apps.zip|grep -i header|grep ItemEOImpl.java

strings -a ./apps/inv/transaction/server/BaseTransaction.class | grep Header

IF apps.zip is not available under JAVA_TOP, then,

1- Go to $JAVA_TOP
2- give a find Command with file name..
eg:
find . -print | grep BaseTransaction
find . -print | grep telnetdemo

out put could be like this...

/oracle/apps/inv/transaction/server/BaseTransaction.class
then cd to the /oracle/apps/inv/transaction/server/

strings -a BaseTransaction.class|grep Header

Or from SQLPLUS

sql> set serveroutput on
sql> exec
fnd_aolj_util.getclassversionfromdb('oracle.apps.inv.transaction.server.TrxP
rocessor');

DISCOVERER
----------

cd $ORACLE_HOME/discwb4/bin

strings -a dis4ws | grep -i 'Discoverer version'

In both cases make sure you have read / write priviledges on the files dis51ws and dis4ws

$ strings -a dis4ws | grep -i 'Discoverer version'
Discoverer Version:Session 4.1.48.08.00

PORTAL verions
--------------

select version from wwc_version$;
or
select i.instance_name INSTANCE, i.host_name HOST , f.release_name release, i.version from v$instance i, fnd_product_groups f where upper(substr(i.instance_name,1,4)) = upper(substr(f.applications_system_name,1,4));

DB version
----------

col instance_name format a13
col host_name format a15
col version format a9
col release format a7
select i.instance_name, i.host_name, f.release_name release, i.version
from v$instance i, fnd_product_groups f
where i.instance_name = f.applications_system_name;
or
select * from v$version;
or
select BANNER from V$VERSION where BANNER like 'Oracle%';

Apps Version
-------------
SELECT 'VERSION = ', release_name FROM fnd_product_groups;
Or
SELECT substr(a.application_short_name, 1, 5) code,
substr(t.application_name, 1, 50) application_name,
p.product_version version
FROM fnd_application a,
fnd_application_tl t,
fnd_product_installations p
WHERE a.application_id = p.application_id
AND a.application_id = t.application_id
AND t.language = USERENV('LANG');
Or
select product_group_id, product_group_name, release_name, product_group_type, argument1 from fnd_product_groups;


PRODUCT versions
----------------
cd $AD_TOP/sql/adutconf.sql
SQL> @adutconf.sql
This creates a text file adutconf.lst in the current working directory
Or
a) Find all products and statuses:
select application_id, status
from fnd_product_installations;
or
b) Find the status of a particular product:

E.g. Application_id:
PER (Human Resources) = 800
PAY (Payroll) = 801

select application_id, status
from fnd_product_installations;
where application_id = '%80%';
Status:
I = Installed
S = Shared
N = Not Installed

WEBCACHE version
----------------

$ORACLE_HOME/webcache/bin/webcached –version
output :
Oracle Web Cache, Version 2.0.0.4.0
Copyright: Oracle Corporation, 1999-2002
Build CALYPSO_2.0.0_SOLARIS_020405

.pld version
-----------
strings –a $AU_TOP/resource/.plx | grep ‘$Header:’

.pls version
-------------

strings –a $/patch/115/sql/.pls | grep ‘$Header:’

.pll version
-------------

strings –a $/plsql/.pll | grep ‘$Header:’

.plx version
-------------
strings –a $/resource/US/.plx | grep ‘$Header:’

.rdf version
-------------
strings –a $JE_TOP/reports/US/.rdf | grep ‘$Header:’

OA Framework Version
-----------------------
http://:/OA_HTML/OAInfo.jsp

Jinitiator version
-------------
select text from wf_resources where name like 'WF_PLUGIN_VERSION%';

Forms Version
-------------

cd 806_ORACLE_HOME/bin
type “ f60run ” and hit enter
This will give you the forms version.
Other option, open any form from front-end applications and click on About Oracle Applications.