Thursday, 30 November 2017

adgendbc.sh INSTE8_SETUP 1 ( R12 12.1.3 Cloning Issue )

---------------------------------------------------------------
                   ADX Database Utility
---------------------------------------------------------------

getConnectionUsingAppsJDBCConnector() -->
    APPS_JDBC_URL=''
    Trying to get connection using SID based connect descriptor
getConnection() -->
    sDbHost    : devc
    sDbDomain  : hinopak.com
    sDbPort    : 1522
    sDbSid     : DEVC
    sDbUser    : APPS
    Trying to connect using SID...
getConnectionUsingSID() -->
    JDBC URL: jdbc:oracle:thin:@devc.hinopak.com:1522:DEVC
    Exception occurred: java.sql.SQLException: ORA-00604: error occurred at recursive SQL level 1
ORA-01882: timezone region not found

    Trying to connect using SID as ServiceName
getConnectionUsingServiceName() -->
    JDBC URL: jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=devc.hinopak.com)(PORT=1522))(CONNECT_DATA=(SERVICE_NAME=DEVC)))
    Exception occurred: java.sql.SQLException: ORA-00604: error occurred at recursive SQL level 1
ORA-01882: timezone region not found

    Trying to connect using SID as ServiceName.DomainName
getConnectionUsingServiceName() -->
    JDBC URL: jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=devc.hinopak.com)(PORT=1522))(CONNECT_DATA=(SERVICE_NAME=DEVC.hinopak.com)))
    Exception occurred: java.sql.SQLException: Listener refused the connection with the following error:
ORA-12514, TNS:listener does not currently know of service requested in connect descriptor

    Connection could not be obtained; returning null
-------------------ADX Database Utility Finished---------------

        Verifying connection to the Database   : Could not be stablished
        No Restore Profile file created.


Restore Profile utility ran successfully

===========================================================================


adcvmlog.xml renamed to /u01/applmgr/prodappl/inst/apps/DEVC_devc/admin/log/04051526/adcvmlog.xml.04051530


[AutoConfig Error Report]
The following report lists errors AutoConfig encountered during each
phase of its execution.  Errors are grouped by directory and phase.
The report format is:
      <filename>  <phase>  <return code where appropriate>

  [SETUP PHASE]
  AutoConfig could not successfully execute the following scripts:
    Directory: /u01/applmgr/prodappl/inst/apps/DEVC_devc/admin/install
      adgendbc.sh             INSTE8_SETUP       1


AutoConfig is exiting with status 1

AutoConfig execution completed on Wed Apr  5 15:30:27 2017

Time taken for AutoConfig execution to complete : 4 mins  4 secs

Solution:

0   1-   Set the time zone parameter in user .bash_profile
 [oracle@devc bin]$ cat /home/oracle/.bash_profile
 # .bash_profile

 # Get the aliases and functions
 if [ -f ~/.bashrc ]; then
 . ~/.bashrc
 fi
 # User specific environment and startup programs

 PATH=$PATH:$HOME/bin


 export TZ=/usr/share/zoneinfo/Asia/Karachi
 export PATH

 [oracle@devc bin]$

02-   Run Adconfig.sh on both first Database and second Application

 For Database:

 [oracle@devc bin]$ cd /u02/oracle/proddb/11.2.0/appsutil/bin/
 [oracle@devc bin]$ pwd
 /u02/oracle/proddb/11.2.0/appsutil/bin
 [oracle@devc bin]$
 [oracle@devc bin]$ ./adconfig.sh
 Enter the full path to the Context file:
 /u02/oracle/proddb/11.2.0/appsutil/DEVC_devc.xml
 Enter the APPS user password:

 For Application:

 [oracle@devc bin]$ pwd
 /u01/applmgr/prodappl/apps/apps_st/appl/ad/12.0.0/bin
 [oracle@devc bin]$
 [oracle@devc bin]$ ./adconfig.sh 
 Enter the full path to the Context file:   /u01/applmgr/prodappl/inst/apps/DEVC_devc/appl/admin/DEVC_devc.xml
 Enter the APPS user password:







How to Change the Default Logo for R12 (12.1.x) ?


Step – 1: Create custom image gif/jpeg
Step – 2: Copy custom logo abc.gif to $OA_MEDIA
Step – 3: Check & update Profile Option name “FND_CORPORATE_BRANDING_IMAGE” to point to aaa.gif

Step – 4: Backup existing image files under $OA_MEDIA
mv FNDSSCORP.gif FNDSSCORP.gif.old

Step – 5: Replace the default logo with custom image
cd $OA_MEDIA
cp abc.gif FNDSSCORP.gif

Step – 6: Access the login page, you should be able to see the custom image on top left.

After Copy of Custom Logo through Backend


UPDATE FND_PROFILE_OPTION_VALUES set profile_option_value='abc.gif'
where profile_option_id=9532 and level_id=10001;

Wednesday, 29 November 2017

How to find Oracle EBS R12 file version in Linux/Unix

[applmgr@drapp sql]$ pwd
/u01/applmgr/prodappl/apps/apps_st/appl/mrp/12.0.0/sql
[applmgr@drapp sql]$ ls
MRPAUREL.sql  MRPNLINS.sql  mrppgupd.sql  MRPSPMRP.sql
[applmgr@drapp sql]$ strings -a mrppgupd.sql | grep '$Header'
REM $Header: mrppgupd.sql 120.0 2005/05/25 03:39:47 appldev noship $
[applmgr@drapp sql]$

Tuesday, 28 November 2017

Getting The DDL in Oracle EBS R12 through Query

SQL> select object_type,count(*) from dba_objects group by object_type;

OBJECT_TYPE           COUNT(*)
------------------- ----------
CONSUMER GROUP              25
INDEX PARTITION           2343
TABLE SUBPARTITION         956
EDITION                      1
SEQUENCE                 10882
QUEUE                      180
TABLE PARTITION           2983
JAVA DATA                  323
RULE                        26
SCHEDULE                     3
PROCEDURE                  161
OPERATOR                    46
LOB PARTITION               52
WINDOW                       9
SCHEDULER GROUP              4
DESTINATION                  2
DATABASE LINK                6
LOB                       2345
PACKAGE                  47758
PACKAGE BODY             46664
LIBRARY                    204
RULE SET                   110
PROGRAM                     28
INDEX SUBPARTITION         924
JAVA RESOURCE             1019
TYPE BODY                  321
CONTEXT                     34
XML SCHEMA                  97
TRIGGER                   4186
MATERIALIZED VIEW          723
DIRECTORY                   12
JOB CLASS                   15
UNDEFINED                   11
INDEX                    51197
TABLE                    29661
SYNONYM                  78008
VIEW                     31007
FUNCTION                   364
JAVA CLASS               30005
INDEXTYPE                    9
JAVA SOURCE                  2
CLUSTER                     10
TYPE                      4713
RESOURCE PLAN               11
EVALUATION CONTEXT          44
JOB                         14
LOB SUBPARTITION            96

47 rows selected.

Step-01 ( Script for Procedure )

PROCEDURE
--------------------
select 'select dbms_metadata.get_ddl('||''''||object_type||''''||','||''''||object_name||''''||','||''''||owner||''''||')'||' from dual ;'
from dba_objects where object_type='PROCEDURE'
order by owner;

Step-02 ( Script For Function)

FUNCTION
---------------------
select 'select dbms_metadata.get_ddl('||''''||object_type||''''||','||''''||object_name||''''||','||''''||owner||''''||')'||' from dual ;'
from dba_objects where object_type='FUNCTION'
order by owner;

select 'select dbms_metadata.get_ddl('||''''||object_type||''''||','||''''||object_name||''''||','||''''||owner||''''||')'||' from dual ;'
from dba_objects where object_type='PACKAGE BODY'
order by owner;

Step-03 ( Script For Package)

PACKAGE
---------------------
select 'select dbms_metadata.get_ddl('||''''||object_type||''''||','||''''||object_name||''''||','||''''||owner||''''||')'||' from dual ;'
from dba_objects where object_type='PACKAGE'
order by owner;

Step-04 ( Script For Package Body)

PACKAGE BODY
---------------------
select 'select dbms_metadata.get_ddl('||''''||object_type||''''||','||''''||object_name||''''||','||''''||owner||''''||')'||' from dual ;'
from dba_objects where object_type='PACKAGE BODY'
order by owner;

Step-04 ( Script For Trigger)

TRIGGER
---------------------
select 'select dbms_metadata.get_ddl('||''''||object_type||''''||','||''''||object_name||''''||','||''''||owner||''''||')'||' from dual ;'
from dba_objects where object_type='TRIGGER'
order by owner;

Step-04 ( Script For Table)

TABLE
---------------------
select 'select dbms_metadata.get_ddl('||''''||object_type||''''||','||''''||object_name||''''||','||''''||owner||''''||')'||' from dual ;'
from dba_objects where object_type='TABLE'
order by owner;

Step-04 ( Script For TABLE SUBPARTITION)

TABLE SUBPARTITION
---------------------
select 'select dbms_metadata.get_ddl('||''''||object_type||''''||','||''''||object_name||''''||','||''''||owner||''''||')'||' from dual ;'
from dba_objects where object_type='TABLE SUBPARTITION'
order by owner;


-----------------------------------------------------------------------------------
          ================= :Example: ===============
-----------------------------------------------------------------------------------

set heading off;
set echo off;
Set pages 999;
set long 90000;

spool ddl_list.sql
select dbms_metadata.get_ddl('TABLE','DEPT','SCOTT') from dual;
select dbms_metadata.get_ddl('INDEX','DEPT_IDX','SCOTT') from dual;
spool off;

How to Get Oracle EBS R12 Release


SQL> select release_name from apps.fnd_product_groups;

RELEASE_NAME
--------------------------------------------------
12.1.3


SQL>

Oracle EBS R12 Password decryption Query


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 = '&USER_NAME';

Indexes Rebuild in 10g/11g/12C

SQL> select index_name from dba_indexes where owner=upper('hr');

INDEX_NAME
------------------------------
LOC_CITY_IX
LOC_ID_PK
REG_ID_PK
COUNTRY_C_ID_PK
LOC_STATE_PROVINCE_IX
LOC_COUNTRY_IX
DEPT_ID_PK
DEPT_LOCATION_IX
JOB_ID_PK
EMP_EMAIL_UK
EMP_EMP_ID_PK
EMP_DEPARTMENT_IX
EMP_JOB_IX
EMP_MANAGER_IX
EMP_NAME_IX
JHIST_EMP_ID_ST_DATE_PK
JHIST_JOB_IX
JHIST_EMPLOYEE_IX
JHIST_DEPARTMENT_IX

19 rows selected.


Use this following script to generate Index Rebuild script for your Schema.


SQL> select 'alter index '||owner||'.'||index_name ||' rebuild online nologging;'||chr(10)||
from dba_indexes where owner=upper('hr');

---- user_indexes
----  dba_indexes
----  all_indexes
---- set autotrace on explain ( Execution plan )

'ALTERINDEX'||OWNER||'.'||INDEX_NAME||'REBUILDONLINENOLOGGING;'
---------------------------------------------------------------------------------------------------
alter index HR.LOC_CITY_IX rebuild online nologging;
alter index HR.LOC_ID_PK rebuild online nologging;
alter index HR.REG_ID_PK rebuild online nologging;
alter index HR.COUNTRY_C_ID_PK rebuild online nologging;
alter index HR.LOC_STATE_PROVINCE_IX rebuild online nologging;
alter index HR.LOC_COUNTRY_IX rebuild online nologging;
alter index HR.DEPT_ID_PK rebuild online nologging;
alter index HR.DEPT_LOCATION_IX rebuild online nologging;
alter index HR.JOB_ID_PK rebuild online nologging;
alter index HR.EMP_EMAIL_UK rebuild online nologging;
alter index HR.EMP_EMP_ID_PK rebuild online nologging;
alter index HR.EMP_DEPARTMENT_IX rebuild online nologging;
alter index HR.EMP_JOB_IX rebuild online nologging;
alter index HR.EMP_MANAGER_IX rebuild online nologging;
alter index HR.EMP_NAME_IX rebuild online nologging;
alter index HR.JHIST_EMP_ID_ST_DATE_PK rebuild online nologging;
alter index HR.JHIST_JOB_IX rebuild online nologging;
alter index HR.JHIST_EMPLOYEE_IX rebuild online nologging;
alter index HR.JHIST_DEPARTMENT_IX rebuild online nologging;

19 rows selected.

Finally, execute above output to rebuild your all Indexes.


SQL> alter index HR.LOC_CITY_IX rebuild online nologging;

Index altered.

SQL> alter index HR.LOC_ID_PK rebuild online nologging;

Index altered.

SQL> alter index HR.REG_ID_PK rebuild online nologging;

Index altered.