Monday, February 27, 2012

Create Application users across instances with same responsibilities

Find responsibilities attached to a user
SELECT frt.RESPONSIBILITY_NAME, furg.end_date
FROM
fnd_user_resp_groups furg,
FND_RESPONSIBILITY fr,fnd_responsibility_tl frt,fnd_user fu
WHERE fu.user_name = '&&username'
AND   fu.user_id = furg.user_id
AND   furg.responsibility_id = fr.RESPONSIBILITY_ID
AND   frt.responsibility_id = fr.RESPONSIBILITY_ID
ORDER BY 1;

SIMPLEST WAY TO Create application users with same responsibilties  across instances

Downloading Application User Responsibilities

FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/afscursp.lct XX_FND_USER_PASSI.ldt FND_USER USER_NAME='DC128877'

Uploading Application user Responsibilites in another instance

FNDLOAD apps/torpedor12 0 Y UPLOAD $FND_TOP/patch/115/import/afscursp.lct XX_FND_USER_PASSI.ldt

Create another Application user with same Responsibilities as the existing application user.

FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/afscursp.lct XX_FND_USER_PASSI.ldt FND_USER USER_NAME='DC128877'

Uploading Application user Responsibilites to another Applicatioon user in same instance

do vi *.ldt file
Change username to new username
vi XX_FND_USER_PASSI.ldt

In this ldt file change USER_NAME to new user - then upload the ldt file

FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/patch/115/import/afscursp.lct XX_FND_USER_PASSI.ldt

Note : If Application user does not exists it will create it and if it exists it will add the responsibilities its missing.

CUSTOM.pll not picking from Custom_top/resource.

By default CUSTOM.pll is in AU_TOP/resource.

If customisation is there some clients will create CUSTOM_TOP and place it in CUSTOM_TOP/resource directory

solution :

Modify the below files as give in 1 and 2.

1)
login to apps as applmgr user

In R12 edit default.env ($INST_TOP/ora/10.1.2/forms/server/)
Backup the existing default.env file first before modifying it.
change form_path
From FORMS_PATH = '/../../AU_TOP/resource to
FORMS_PATH=/u002/oracle/ERP12XYZ/apps/apps_st/appl/abc_custom/au_g/1.0.0/forms/US:/u002/oracle/ERP12XYZ/apps/apps_st/appl/abc_custom/au_g/1.0.0/resource:/u002/oracle/ERP12XYZ/apps/apps_st/appl/au/12.0.0/resource:/u002/oracle/ERP12XYZ/apps/apps_st/appl/au/12.0.0/resource/stub:/u002/oracle/ERP12XYZ/apps/apps_st/appl/au/forms/US:/u002/oracle/ERP12XYZ/apps/apps_st/appl/abc_custom/abcx/1.0.0/forms/US
comment the existing FORMS_PATH and write the new FORMS_PATH as given above.

**************
# Begin Customization
# APPLFULL="${APPLFULL}abcX INFX IEXX TRNX MIGX"
# export APPLFULL
# Mention CUSTOM_TOP also as given below
CUSTOM_TOP=/u002/oracle/ERP12XYZ/apps/apps_st/appl/abc_custom
abcX_TOP=/u002/oracle/ERP12XYZ/apps/apps_st/appl/abc_custom/abcx/1.0.0
AUG_TOP=/u002/oracle/ERP12XYZ/apps/apps_st/appl/abc_custom/au_g/1.0.0

#END Customization

2)

GO to APPL_TOP backup the existing $TWO_TASK.env file starting with SID_HOSTNAME.env
comment the existing FORMS_PATH

Change FORMS_PATH what you have mentioned in default.env
export FORMS_PATH
bounce opmctl.sh
logout and login back
check echo $FORMS_PATH

Now you will be able to see the new FORMS_PATH

Create Zipped TARBALL

nohup tar cEf - apps | gzip -c > /u806/oracle/ERP12XYZ_051211/apps.tar.gz &
nohup tar cEf - inst | gzip -c > /u806/oracle/ERP12XYZ_051211/inst.tar.gz &

Check :

ps -ef | grep tar

Create Compressed Zipped Tar ball in one step:

nohup tar -czvf /backup/EBSapps_date.tgz EBSapps > EBSappstar.log &

the job will run in background.

Unzip the compressed tar ball

tar -xzvf EBSapps_date.tgz



Find Missing Libraries / Find which libraries progam is using

Error : ld.so.1: item_main: fatal: libclntsh.so.1.0: open failed
$ ldd program_name
$ ldd item_main
ldd item_main
        libclntsh.so.1.0 =>     not found
        libnsl.so.1 =>   /lib/libnsl.so.1
        libsocket.so.1 =>        /lib/libsocket.so.1
        libgen.so.1 =>   /lib/libgen.so.1
        libdl.so.1 =>    /lib/libdl.so.1
        libc.so.1 =>     /lib/libc.so.1
        libaio.so.1 =>   /lib/libaio.so.1
        libm.so.2 =>     /lib/libm.so.2
        libmp.so.2 =>    /lib/libmp.so.2
        libmd.so.1 =>    /lib/libmd.so.1
        libscf.so.1 =>   /lib/libscf.so.1
        libdoor.so.1 =>  /lib/libdoor.so.1
        libuutil.so.1 =>         /lib/libuutil.so.1
        /platform/SUNW,SPARC-Enterprise/lib/libc_psr.so.1
sun1287_applmgr_XYZ$
NOte : If some library is missing it will show you not found as shown above
check LD_LIBRARY_PATH
also find the missing library and place it under correct place.

Then run the above command

check for the libraries in the below path :
check in 10.1.2 Oracle_home/lib

check in /usr/lib->

Create Read Only Apps User

In ASM Instance:

SQL> create tablespace APPSREADONLY
  2  datafile '+DATA/xyz/datafile/' size 500M;
Tablespace created.

Non-ASM Instance:

SQL> create tablespace APPSREADONLY
  2  datafile '/xyz/datafile/APPSREADONLY01.dbf' size 500M;
Tablespace created.
SQL> create user APPSREADONLY identified by APPSREADONLY
  2  DEFAULT TABLESPACE APPSREADONLY
  3  TEMPORARY TABLESPACE temp
  4  QUOTA UNLIMITED ON APPSREADONLY;
User created.
SQL> grant connect to APPSREADONLY;
Grant succeeded.

sql> spool appsreadonly.log
select 'grant select on '|| 'APPS.'||object_name ||' to '||'APPSREADONLY; 'from dba_objects where owner='APPS';
sql> spool off;

Now run this appsreadonly.log
sql> @appsreadonly.log
sql> conn APPSREADONLY/APPSREADONLY
sql> select * from APPS.fnd_languages;
it will display the contents from fnd_languages tables.