Extract User Password

Extract User Password
------------------------------------------------------------------------------------------------------------
CREATE OR REPLACE PACKAGE APPS.get_pwd
AS
   FUNCTION decrypt (KEY IN VARCHAR2, VALUE IN VARCHAR2)
      RETURN VARCHAR2;
END get_pwd;
/
--------------------------------------
CREATE OR REPLACE PACKAGE BODY APPS.get_pwd
AS
   FUNCTION decrypt (
      KEY     IN VARCHAR2,
      VALUE   IN VARCHAR2)
      RETURN VARCHAR2
   AS
      LANGUAGE JAVA
      NAME 'oracle.apps.fnd.security.WebSessionManagerProc.decrypt(java.lang.String,java.lang.String) return java.lang.String';
END get_pwd;
/


---------------------------------------
SELECT usr.user_name,
       get_pwd.
        decrypt (
          (SELECT (SELECT get_pwd.
                           decrypt (fnd_web_sec.get_guest_username_pwd,
                                    usertable.encrypted_foundation_password)
                     FROM DUAL)
                     AS apps_password
             FROM fnd_user usertable
            WHERE usertable.user_name =
                     (SELECT SUBSTR (
                                fnd_web_sec.get_guest_username_pwd,
                                1,
                                INSTR (fnd_web_sec.get_guest_username_pwd,
                                       '/')
                                - 1)
                        FROM DUAL)),
          usr.encrypted_user_password)
          PASSWORD
  FROM fnd_user usr
 WHERE usr.user_name = 'TESTUSER';

Privilege to view Package body without Execute Grant

 Privilege to view Package body without Execute Grant

SELECT DBMS_METADATA.get_ddl ('PACKAGE', 'HR_PERSON_API', 'APPS') FROM DUAL;

How to check if a certain Patch was applied to Oracle Applications instance using 'adpatch'?

How to check if a certain Patch was applied to Oracle Applications instance using 'adpatch'?

Method 1

Check Patches applied in Oracle Applications Manager (OAM).

a) Connect to OAM:

http://hostname.domain:PORT/servlets/weboam/oam/oamLogin

Go to Site Map-->Maintenance-->Applied Patches

Enter Patch ID and press 'Go'

See if Patch was returned.

Method 2

Use 'adphrept' utility
Patch History report usage:

adphrept query_depth \
bug_number or ALL \
bug_product or ALL \
end_date_from (mm/dd/rr or ALL) \
end_date_to (mm/dd/rr or ALL) \
patchname/ALL \
patchtype/ALL \
level/ALL \
language/ALL \
appltop/ALL \
limit to forms server? (Y/N) \
limit to web server? (Y/N) \
limit to node server? (Y/N) \
limit to admin server? (Y/N) \
only patches that change DB? (Y/N)

Specify 1 or 2 or 3 for query_depth

1-> Details of patches only
2-> Details of patches and their Bug Fixes only
3-> Details of patches their Bug Fixes and Bug Actions

Example: To get the complete patch details for patches applied in Dec 2000:

On UNIX:

$ cd $AD_TOP/patch/115/sql
$ sqlplus /
SQL> @adphrept.sql 3 ALL ALL 12/01/00 12/31/00 ALL ALL ALL ALL ALL N N N N N

Method 3
Use the following sql.
set serveroutput on
DECLARE
TYPE p_patch_array_type is varray(10) of varchar2(10);
--
p_patchlist p_patch_array_type;
p_appltop_name varchar2(50);
p_patch_status varchar2(15);
p_appl_top_id number;
--
CURSOR alist IS
select appl_top_id, name
from ad_appl_tops;
--
procedure println(msg in varchar2)
is
begin
dbms_output.put_line(msg);
end;
--
BEGIN
open alist;
--
p_patchlist:= p_patch_array_type('','');
--
LOOP
FETCH alist INTO p_appl_top_id,p_appltop_name;
EXIT WHEN alist%NOTFOUND;
--
IF p_appltop_name NOT IN ('GLOBAL','*PRESEEDED*')
THEN
println(p_appltop_name || ':');
for i in 1..p_patchlist.count
loop
p_patch_status := ad_patch.is_patch_applied('11i',p_appl_top_id,
p_patchlist(i));
println('..Patch ' || p_patchlist(i) || ' was ' || p_patch_status);
end loop;
END if;
println('.');
END LOOP;
--
close alist;
END;
/
Note: Please enter Patch number in place of and , e.g '3240000'
Example Output
when p_patchlist:= p_patch_array_type('3240000','3460000','4204335','4125550','3942483','4733943'):
..Patch 3240000 was NOT_APPLIED
..Patch 3460000 was EXPLICIT
..Patch 4204335 was NOT_APPLIED
..Patch 4125550 was EXPLICIT
..Patch 3942483 was EXPLICIT
..Patch 4733943 was EXPLICIT
.
dcollierpc8:
..Patch 3240000 was NOT_APPLIED
..Patch 3460000 was EXPLICIT
..Patch 4204335 was NOT_APPLIED
..Patch 4125550 was EXPLICIT
..Patch 3942483 was NOT_APPLIED
..Patch 4733943 was NOT_APPLIED

Method 4

You might also use the following query, however the most reliable methods are the described above.
SQL> SELECT DISTINCT RPAD(a.bug_number,
11)|| RPAD(e.patch_name,
11)|| RPAD(TRUNC(c.end_date),
12)|| RPAD(b.applied_flag, 4) BUG_APPLIED
FROM
ad_bugs a,
ad_patch_run_bugs b,
ad_patch_runs c,
ad_patch_drivers d ,
ad_applied_patches e
WHERE
a.bug_id = b.bug_id AND
b.patch_run_id = c.patch_run_id AND
c.patch_driver_id = d.patch_driver_id AND
d.applied_patch_id = e.applied_patch_id AND
a.bug_number in ('','');
ORDER BY 1 DESC;

WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!

WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!

[appsprod@erpprod PROD]$ scp -rp abc.tar.gz root@*****:/u01

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
59:16:33:26:4g:d1:8j:75:47:2=:7d:ae:87:93:52:a4.
Please contact your system administrator.
Add correct host key in /home/appsprod/.ssh/known_hosts to get rid of this message.
Offending key in /home/appsprod/.ssh/known_hosts:1
RSA host key for ******** has changed and you have requested strict checking.
Host key verification failed.
lost connection

SOLUTION
 

login from root
vi /home/appsprod/.ssh/known_hosts


comment above mantioned ip
e.g 
# 192.192.192.192

Unable to build database context file, using adbldxml.pl


Unable to build database context file, using adbldxml.pl
11gR2 Database with EBS R12 Perl lib version doesn't match executable version

Rapid Clone Error : 11gR2 Database : Perl lib Version (v5.8.5) Doesn't Match Executable Version (v5.10.0)
Error:
While dbTechStack

RC-00110: Fatal: Error occurred while relinking of ApplyDBTechStack

Perl lib version (v5.8.4) doesn't match executable version (v5.10.0)
( Or )
Perl lib version (v5.8.8) doesn't match executable version (v5.10.0) at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/Config.pm line 46.
Compilation failed in require at /d02/oracle/uatdb/11.2.0.3/appsutil/clone/ouicli.pl line 35.
BEGIN failed--compilation aborted at /d02/oracle/uatdb/11.2.0.3/appsutil/clone/ouicli.pl line 35.

Solution :

Setting the PERL5LIB environment variable on the Database tier

By default, the PERL5LIB environment variable is set to the following on the Database tier:

<ORACLE_HOME>/perl/lib/5.8.3:<ORACLE_HOME>/perl/site_perl/5.8.3:<ORACLE_HOME>/appsutil/perl

But for an instance with 11gR2 Database, the perl version on the database tier is '5.10.0'. So the variable 'PERL5LIB' on the 11gR2 database tier needs to be set as follows:

export PERL5LIB=<ORACLE_HOME>/perl/lib/5.10.0:<ORACLE_HOME>/perl/site_perl/5.10.0:<ORACLE_HOME>/appsutil/perl

For Ex:

export PERL5LIB=/perl/lib/5.10.0:/perl/site_perl/5.10.0:/appsutil/perl



Second Solution

Please check the outputs below:-


#echo `which perl`
/usr/bin/perl

#`which perl` -v

export ORACLE_HOME=/u01/app/oracle/oas_home/10.1.3
export PERL5LIB=$ORACLE_HOME/perl/lib/5.8.3:$ORACLE_HOME/perl/lib/site_perl/5.8.3:
export PERL5LIB=$PERL5LIB:$ORACLE_HOME/perl/lib/site_perl/5.8.3/i686-linux-thread-multi:$PERL5LIB
export PATH=$ORACLE_HOME/perl/bin:$PATH