Friday 12 June 2015

Script to prevent a user from changing his password - Oracle EBS

Script:

-- Create function which prevents a user from changing his password
-- Use of a specific USER PROFILE to activate the function
-- GM/ELN - 02/03/01
-- must be connected internal or sys
--
set term on
set echo on
CREATE OR REPLACE FUNCTION verify_function_fix_pwd (username VARCHAR2,
password VARCHAR2, old_password VARCHAR2) RETURN boolean IS
BEGIN
raise_application_error(-20009, 'SORRY, PASSWORD CANNOT BE CHANGED') ;
END ;
/
--
-- Create a profile which has a limit PASSWORD_VERIFY_FUNCTION
-- associated to the previously cretaed function.
-- This profile must be given to all users who are not allowed to change
-- their password
--

DROP PROFILE FIXPWD CASCADE;
CREATE PROFILE FIXPWD LIMIT PASSWORD_VERIFY_FUNCTION verify_function_fix_pwd;

Sample Output:

DROP USER test_pwd;

CREATE USER test_pwd IDENTIFIED by test_pwd DEFAULT TABLESPACE USERS TEMPORARY TABLESPACE TEMP ACCOUNT UNLOCK;

GRANT CONNECT TO test_pwd;

ALTER USER test_pwd PROFILE fixpwd;

The piece of code below shows an example of implementation. A user TEST_PWD
was created and granted the profile FIXPWD as above. Now he cannot change his
password, neither with command ALTER USER nor with command PASSWORD (note
that REPLACE keyword is required in 9.2 to prevent getting ORA-28221).

SQL> connect test_pwd/test_pwd@adm
Connected.

SQL> ALTER USER test_pwd IDENTIFIED BY test REPLACE test_pwd;
ALTER USER test_pwd IDENTIFIED BY test REPLACE test_pwd
*ERROR at line 1:
ORA-28003: password verification for the specified password failed
ORA-20009: SORRY, PASSWORD CANNOT BE CHANGED

SQL> password
Changing password for TEST_PWD
ERROR:
ORA-28003: password verification for the specified password failed
ORA-20009: SORRY, PASSWORD CANNOT BE CHANGED
Password unchanged

Disclaimer
EXCEPT WHERE EXPRESSLY PROVIDED OTHERWISE, THE INFORMATION, SOFTWARE,
PROVIDED ON AN "AS IS" AND "AS AVAILABLE" BASIS. ORACLE EXPRESSLY DISCLAIMS ALL WARRANTIES OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF ERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ORACLE MAKES NO WARRANTY THAT: (A) THE RESULTS THAT MAY BE OBTAINED FROM THE USE OF THE SOFTWARE WILL BE ACCURATE OR RELIABLE; OR (B) THE INFORMATION, OR OTHER MATERIAL OBTAINED WILL MEET YOUR EXPECTATIONS. ANY CONTENT, MATERIALS, INFORMATION OR SOFTWARE DOWNLOADED OR OTHERWISE OBTAINED IS DONE AT YOUR OWN DISCRETION AND RISK. ORACLE SHALL HAVE
NO RESPONSIBILITY FOR ANY DAMAGE TO YOUR COMPUTER SYSTEM OR LOSS OF DATA THAT RESULTS FROM THE DOWNLOAD OF ANY CONTENT, MATERIALS, INFORMATION OR SOFTWARE. ORACLE RESERVES THE RIGHT TO MAKE CHANGES OR UPDATES TO THE SOFTWARE AT ANY TIME WITHOUT NOTICE.

Limitation of Liability
IN NO EVENT SHALL ORACLE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL OR CONSEQUENTIAL DAMAGES, OR DAMAGES FOR LOSS OF PROFITS, REVENUE, DATA OR USE, INCURRED BY YOU OR ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT, ARISING FROM YOUR ACCESS TO, OR USE OF, THE SOFTWARE. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OR EXCLUSION OF LIABILITY. ACCORDINGLY, SOME OF THE ABOVE LIMITATIONS MAY NOT APPLY TO YOU.

How To Calculate The Required Network Bandwidth Transfer Of Redo In Data Guard Environments

APPLIES TO - Oracle Database - Enterprise Edition - Version 9.0.1.0 and later

The formula used (assuming a conservative TCP/IP network overhead of 30%) for calculating the network bandwidth is :

Required bandwidth = ((Redo rate bytes per sec. / 0.7) * 8) / 1,000,000 = bandwidth in Mbps

Measuring the Peak Redo Rate

Use the Oracle Statspack utility for an accurate measurement of the redo rate.
Based on your business you should have a good idea as to what your peak periods of normal
business activity are. For example, you may be running an online store which historically
sees the peak activity for 4 hours every Monday between 10:00 am - 2:00 pm. Or, you may be
running a merchandising database which batch-loads a new catalog every Thursday for 2 hours
between 1 am - 3 am. Note that we say "normal" business activity - this means that in
certain days of the year you may witness much heavier business volume than usual, e.g. the
2-3 days before Mother's Day or Valentine's Day for an online florist business. Just for
those days, perhaps you may allocate higher bandwidth than usual, and you may not consider
those as "normal" business activity.However, if such periodic surges of traffic are
regularly expected as part of your business operations, you must consider them in your redo
rate calculation.
During the peak duration of your business, run a Statspack snapshot at periodic intervals.
For example, you may run it three times during your peak hours, each time for a five-minute
duration. The Statspack snapshot report will include a "Redo size" line under the "Load
Profile" section near the beginning of the report. This line includes the "Per Second" and
"Per Transaction" measurements for the redo size in bytes during the snapshot interval. Make

a note of the "Per Second" value. Take the highest "Redo size" "Per Second" value of these
three snapshots, and that is your peak redo generation rate.
Note that if your primary database is a RAC database, you must run the Statspack snapshot on
every RAC instance. Then, for each Statspack snapshot, sum the "Redo Size Per Second" value
of each instance, to obtain the net peak redo generation rate for the primary database.
Remember that for
a RAC primary database, each node generates its own redo and independently sends that redo
to the standby database - hence the reason to sum up the redo rates for each RAC node, to
obtain the net peak redo rate for the database.
As an Alternative you can also get the 'Redo rate bytes per sec.' from V$SYSMETRIC_HISTORY,

eg.
SQL> select * from v$sysmetric_history where metric_name = 'Redo Generated Per Sec';
or in a RDA-Output:
Performance - AWR Report - Statistic: "redo size"

Example:

Let us assume the redo rate is a 500 KB/sec.

Required bandwidth = ((Redo rate bytes per sec. / 0.7) * 8) / 1,000,000 = bandwidth in Mbps
Required bandwidth = ((512000/0.7) * 8) /1,000,000
Required bandwidth = 4.85 Mbps
========================================================================

spfile Vs pfile

Until Oracle 8i DBAs have been using a text file called the pfile (parameter file) to store the database initialization parameters.

The pfile is read at instance startup time to get specific instance characteristics. Any changes made the pfile would only take effect when the database is restarted.

However, parameters that were dynamically alterable could be changed using the appropriate ALTER SYSTEM or ALTER SESSION statement, which would take effect immediately.

As of Oracle9i, new feature called the spfile (server parameter file). The spfile is a binary file that contains the same information as the old pfile.

The spfile is a server-side initialization parameter file; parameters stored in this file are persistent across database startups.

This makes all the changes made to the instance using the ALTER SYSTEM statement persistent. Oracle requires that you start an instance for the first time using the pfile and then create the spfile.

The server parameter file (also called SPFILE) is in a single location where all the necessary parameters are defined and stored. The defined parameter values are applicable for all the instances in the cluster.

The SPFILE permits dynamic changes without requiring you to bring down the instance.
You can still use the client side parameter file to manage parameter settings in Real Application Clusters, however, administrative convenience is sacrificed and the advantage of dynamic change is lost.

By default, if you do not specify PFILE in your STARTUP command, Oracle will use a server parameter file.

SERVER PARAMETER FILE ( SPFILE )
================================
A server parameter file is basically a repository for initialization parameters.

Initialization parameters stored in a SPFILE are persistent, meaning any parameter changes made while an instance is running can persist across instance shutdown and startup.

In this way, all the initialization parameters manually updated by ALTER SYSTEM SET commands become persistent.

It also provides a basis for the Oracle database server to self-tune.

Another advantage, particularly for multi-instance RAC systems, is that a single copy of the parameter file can be used by all instances. Even though a single file is used to specify parameters, it has different format styles to support both the common values for all instances, as well as the specific values for an individual instance.

A server parameter file is initially built from the traditional text initialization parameter file, using the create SPFILE statement. It is a binary file that cannot be browsed or edited with a text editor.

Oracle provides other interfaces for viewing and modifying parameter settings. At system startup, the default behavior of the STARTUP command is to read a SPFILE to obtain initialization parameter settings. If the STARTUP command doesn't have a PFILE clause, it reads the SPFILE from a location specified by the operating system.

If you choose to use the traditional text initialization parameter file, you must specify the PFILE clause when issuing the STARTUP command.

SETTING THE SERVER PARAMETER FILE VALUES
=========================================
Use the SID designator to set instance-specific parameter values in the server parameter file.
For settings across the database, use a '*', and for a specific instance, set the prefix with SID as indicated below.

*.OPEN_CURSORS=400 # For database-wide setting
RACDB1.OPEN_CURSORS=800# For RACDB1 instance
Note that even though open_cursors is set at 400 for all instances in the first entry, the value of 800 remains in effect for the SID 'RACDB1'.

Some initialization parameters are dynamic since they can be modified using the ALTER SESSION or ALTER SYSTEM statement while an instance is running.

Use the following syntax to dynamically alter initialization parameters:

ALTER SESSION SET parameter_name = value

ALTER SYSTEM SET parameter_name = value [DEFERRED]

Use the SET clause of the ALTER SYSTEM statement to set or change initialization parameter values. Additionally, the SCOPE clause specifies the scope of a change as described below:

SCOPE = SPFILE
(For both static and dynamic parameters, changes are recorded in the spfile, to be given effect in the next restart.)

SCOPE = MEMORY
(For dynamic parameters, changes are applied in memory only. No static parameter change is allowed.)

SCOPE = BOTH
For dynamic parameters, the change is applied in both the server parameter file and memory. No static parameter change is allowed.)

For dynamic parameters, we can also specify the DEFERRED keyword. When specified, the change is effective only for future sessions.

HERE ARE A FEW EXAMPLES
===========================
The following statement affects all instances. However, the values are only effective for the current instances, they are not written to binary SPFILE.
ALTER SYSTEM SET OPEN_CURSORS=500 SID='*' SCOPE=MEMORY;

The next statement resets the value for the instance 'RACDB1'.
At this point, the database-wide setting becomes effective for SID of RACDB1.
ALTER SYSTEM RESET OPEN_CURSORS SCOPE=SPFILE sid='RACDB1';

To reset a parameter to its default value throughout the cluster database, use the command:
ALTER SYSTEM RESET OPEN_CURSORS SCOPE=SPFILE sid='*';

CREATING A SERVER PARAMETER FILE
===================================
The server parameter file is initially created from a text initialization parameter file (init.ora).

It must be created prior to its use in the STARTUP command.

The create SPFILE statement is used to create a server parameter file.

The following example creates a server parameter file from an initialization parameter file.
CREATE SPFILE FROM PFILE='/u01/oracle/product/920/dbs/initRAC1.ora';

Below is another example that illustrates creating a server parameter file and supplying a name.
CREATE SPFILE='/u01/oracle/product/920/dbs/racdb_spfile.ora'
FROM PFILE='/u01/oracle/product/920/dbs/init.ora';

EXPORTING THE SERVER PARAMETER FILE
===================================
We can export the server parameter file to create a traditional text initialization parameter file.
This would be useful for:

1) Creating backups of the server parameter file.
2) For diagnostic purposes to list all of the parameter values currently used by an instance.
3) Modifying the server parameter file by first exporting it, editing the output file, and then recreating it.

The following example creates a text initialization parameter file from the server parameter file:

CREATE PFILE FROM SPFILE;
The example below creates a text initialization parameter file from a server parameter file, where the names of the files are specified:
CREATE PFILE='/u01/oracle/product/920/dbs/racdb_init.ora'
FROM SPFILE='/u01/oracle/product/dbs/racdb_spfile.ora';

IS MY DATABASE USING SPFILE ?
=============================
Am I using spfile or pfile ?

The following query will let you know..
1) SQL> SELECT name,value FROM v$parameter WHERE name = 'spfile';
NAME VALUE
---------- --------------------------------------------------
spfile /fsys1/oracle/product/9.2.0/spfileTEST.ora

2) SQL> show parameter spfile;

The v$spparameter view

The contents of the SPFILE can be obtained from the V$SPPARAMETER view:

SQL> ALTER SYSTEM SET timed_statistics=FALSE SCOPE=SPFILE;
System altered.

SQL> SELECT name,value FROM v$parameter WHERE name='timed_statistics';
NAME VALUE
-------------------- ---------------------
timed_statistics TRUE

SQL> SELECT name,value FROM v$spparameter WHERE name='timed_statistics';
NAME VALUE
-------------------- ---------------------
timed_statistics FALSE
========================================================================

ORA-15183: ASMLIB initialization error [driver/agent not installed]

Workaround:
         
as root user:
# cd $ORACLE_HOME/bin
# chgrp asmadmin oracle
# chmod 6751 oracle
# ls -l oracle

 
$ su - grid
[grid@vm11 ]$ /usr/sbin/oracleasm configure
ORACLEASM_ENABLED=true
ORACLEASM_UID=grid
ORACLEASM_GID=asmadmin
ORACLEASM_SCANBOOT=true
ORACLEASM_SCANORDER=""
ORACLEASM_SCANEXCLUDE=""
[grid@vm11 ]$ cd /u01/app/11.2.0.3/bin/
[grid@vm11 bin]$ ./setasmgidwrap o=/u01/app/oracle/product/10.2.0/bin/oracle

How to check tablespace with sysdate - Oracle database

select substr(A.tablespace_name,1,16) "Tablespace",
MAX(A.contents) "Type",
MAX(A.status) "Status",
(SUM(B.BYTES)*COUNT(DISTINCT B.FILE_ID)/COUNT(B.FILE_ID)/1024/1024)-
(ROUND(SUM(C.BYTES)/1024/1024/COUNT(DISTINCT B.FILE_ID))) "USED SIZE(Mb)",
TO_CHAR(100-(SUM(C.BLOCKS)*100*COUNT(B.FILE_ID)/(SUM(B.BLOCKS)*COUNT
(DISTINCT B.FILE_ID)))/COUNT(DISTINCT B.FILE_ID),'999.99')||'%' "USED USAGE",
ROUND(SUM(C.BYTES)/1024/1024/COUNT(DISTINCT B.FILE_ID)) "FREE SIZE(MB)",
TO_CHAR((SUM(C.BLOCKS)*100*COUNT(B.FILE_ID)/(SUM(B.BLOCKS)*COUNT
(DISTINCT B.FILE_ID)))/COUNT(DISTINCT B.FILE_ID),'999.99')||'%' "FREE USAGE",
SUM(B.BYTES)*COUNT(DISTINCT B.FILE_ID)/COUNT(B.FILE_ID)/1024/1024 "TOTAL SIZE(Mb)",
sysdate
from dba_tablespaces A,
DBA_DATA_FILES B,
DBA_FREE_SPACE C
WHERE A.TABLESPACE_NAME=B.TABLESPACE_NAME
AND A.TABLESPACE_NAME=C.TABLESPACE_NAME
GROUP BY A.TABLESPACE_NAME
order by 1;

How To Rename A Diskgroup On ASM 11gR2

SOLUTION:

1) First of all, the desired diskgroup needs to be dismounted (from each node if this is a RAC configuration):

# asmcmd umount DATA

2) Verify that the desired diskgroup was dismounted:

# asmcmd lsdg

State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB
Offline_disks Voting_files Name
MOUNTED NORMAL N 512 4096 1048576 32756 31828 244 15792 0 N DATA_OCR/
MOUNTED EXTERN N 512 4096 1048576 16378 10134 0 10134 0 N LOBDATA/

3) Then execute the rename statement:

# renamedg phase=both dgname=DATA newdgname=DG_PROD_DATA verbose=true
Parsing parameters..
Parameters in effect:
Old DG name : DATA
New DG name : DG_PROD_DATA
Phases :
Phase 1
Phase 2
Discovery str : (null)
Clean : TRUE
Raw only : TRUE
renamedg operation: phase=both dgname=DATA newdgname=DG_PROD_DATA verbose=true
Executing phase 1
Discovering the group
Performing discovery with string:
Identified disk ASM:/opt/oracle/extapi/64/asm/orcl/1/libasm.so:ORCL:DATA1 with disk
number:0 and timestamp (32925601 972709888)
Identified disk ASM:/opt/oracle/extapi/64/asm/orcl/1/libasm.so:ORCL:DATA2 with disk
number:1 and timestamp (32925601 972709888)
Identified disk ASM:/opt/oracle/extapi/64/asm/orcl/1/libasm.so:ORCL:DATA3 with disk
number:2 and timestamp (32925601 972709888)
Checking for hearbeat...
Rediscovering
the group
Performing discovery with string:
Identified disk ASM:/opt/oracle/extapi/64/asm/orcl/1/libasm.so:ORCL:DATA1 with disk
number:0 and timestamp (32925601 972709888)
Identified disk ASM:/opt/oracle/extapi/64/asm/orcl/1/libasm.so:ORCL:DATA2 with disk
number:1 and timestamp (32925601 972709888)
Identified disk ASM:/opt/oracle/extapi/64/asm/orcl/1/libasm.so:ORCL:DATA3 with disk
number:2 and timestamp (32925601 972709888)
Checking if the diskgroup is mounted
Checking disk number:0
Checking disk number:1
Checking disk number:2
Checking if diskgroup is used by CSS
Generating configuration file..
Completed phase 1
Executing phase 2
Looking for ORCL:DATA1
Modifying the header
Looking for ORCL:DATA2
Modifying the header
Looking for ORCL:DATA3
Modifying the header
Completed phase 2
Terminating kgfd context 0x2af21517e0a0


4) Finally, mount the renamed diskgroup and validate that it was mounted (on each node if this is a RAC configuration):

# asmcmd mount DG_PROD_DATA

# asmcmd lsdg
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB
Offline_disks Voting_files Name
MOUNTED NORMAL N 512 4096 1048576 32756 31828 244 15792 0 N DATA_OCR/
MOUNTED EXTERN N 512 4096 1048576 24567 14267 0 14267 0 N DG_PROD_DATA/
MOUNTED EXTERN N 512 4096 1048576 16378 10134 0 10134 0 N LOBDATA/

<renamedg tool cannot rename the associated ASM disk(s) name(s). >>>
IMPORTANT : With renamedg the diskgroup name changes. As the ASM File names ( like datafiles / controlfiles etc
), include the diskgroups name, you need to take care ( update pfile or rename datafiles ) from the RDBMS
instance, after renamedg.

How to change time in Solaris Operating System

root@testapp1:~# date 051514412015

Friday, May 15, 2015 02:41:00 PM CAT

How to Retrieve deleted rows in table Oracle Database

You can use FLASHBACK TABLE to retrieve your rows. But before that you must enable row movement by following query

ALTER TABLE hr.employees ENABLE ROW MOVEMENT;
And there after firing the below query for the particular timestamp when your rows were existing at that time.

FLASHBACK TABLE hr.employees TO TIMESTAMP TO_TIMESTAMP('17-10-2011 12:19:00','DD-MM-YYYY HH24:MI:SS');

Example: select * from apps.PER_CONTACT_RELATIONSHIPS as of timestamp to_timestamp('31-05-2015 04:00:00','DD-MM-YYYY HH24:MI:SS');

FLASHBACK is used to retrive the dropped tables.

Use the following to retrieve the deleted and committed rows

select * from table_name as of timestamp to_timestamp(sysdate-(360/1440))
The above sample SQL will fetch the status of data in the table 6 hours earlier.

To check recently changed Profile Options SQL Query Oracle EBS R12

select p.profile_option_name SHORT_NAME, n.user_profile_option_name "PROFILE NAME",
decode(v.level_id, 10001, 'Site', 10002, 'Application',
10003, 'Responsibility', 10004, 'User', 10005, 'Server',
10007, 'SERVRESP', 'UnDef') LEVEL_SET,
decode(to_char(v.level_id), '10001', '',
'10002', app.application_short_name, '10003', rsp.responsibility_key,
'10005', svr.node_name, '10006', org.name, '10004', usr.user_name,
'10007', 'Serv/resp', 'UnDef') "CONTEXT", v.profile_option_value VALUE, v.LAST_UPDATE_DATE
from fnd_profile_options p,
fnd_profile_option_values v,
fnd_profile_options_tl n,
fnd_user usr,
fnd_application app,
fnd_responsibility rsp,
fnd_nodes svr,
hr_operating_units org
where p.profile_option_id = v.profile_option_id (+)
and p.profile_option_name = n.profile_option_name
--and upper(n.user_profile_option_name) like upper('BNE%')
--and trunc(v.LAST_UPDATE_DATE) > trunc(sysdate-170)
and usr.user_id (+) = v.level_value
and rsp.application_id (+) = v.level_value_application_id
and rsp.responsibility_id (+) = v.level_value
and app.application_id (+) = v.level_value
and svr.node_id (+) = v.level_value
and org.organization_id (+) = v.level_value
and v.LAST_UPDATE_DATE is not null
order by last_update_date desc, short_name, level_set;

WARNING: oradism not set up correctly. Dynamic ISM can not be locked. Please setup oradism, or unset sga_max_size

========================================================================
APPLIES TO:
Oracle Database Enterprise
Edition Version
10.1.0.2 to 10.2.0.4 [Release 10.1 to 10.2]
Oracle Solaris on x86 (32bit)
Oracle Solaris on SPARC (64bit)
Oracle Solaris on x8664
(64bit)
z*OBSOLETE: Fujitsu PRIMEPOWER Solaris
Oracle Solaris on SPARC (32bit)
z*OBSOLETE: Sun Trusted Solaris (Secure)
Fujitsu PRIMEPOWER Solaris
Sun Solaris x86 (32bit)
Sun Solaris SPARC (64bit)
Sun Trusted Solaris (Secure)
Sun Solaris x8664
(64bit)
Sun Solaris SPARC (32bit)
========================================================================
The database alert log will show:
Tue Sep 23 21:03:55 2008
SUCCESS: diskgroup DATA1 was dismounted
SUCCESS: diskgroup DATA1 was dismounted
Tue Sep 23 21:03:55 2008
Errors in file /u01/app/oracle/product/10.2.0/db_
dev3/admin/DEV3/bdump/dev3_j000_1012.trc:
ORA01115:
IO error reading block from file 11 (block # 722525)
ORA01110:
data file 11: '+DATA1/dev3/datafile/development.8115.666100645'
ORA15078:
ASM diskgroup was forcibly dismounted
...
...<more of the above for file 1 as well, different blocks>
...
Tue Sep 23 21:03:56 2008
Errors in file /u01/app/oracle/product/10.2.0/db_dev3/admin/DEV3/bdump/dev3_l
gwr_14502.trc:
ORA00340:
IO error processing online log 1 of thread 1
ORA00345:
redo log write error block 11022 count 12
ORA00312:
online log 1 thread 1: '+DATA1/dev3/onlinelog/group_1.8102.666102843'
ORA15078:
ASM diskgroup was forcibly dismounted
Tue Sep 23 21:03:56 2008
LGWR: terminating instance due to error 340

WARNING: WARNING:
oradism not set up correctly.
Dynamic ISM can not be locked. Please
setup oradism, or unset sga_max_size.
[diagnostic 0, 8, 101]
...
WARNING: Detected too many memory locking problems.
WARNING: Performance degradation may occur.
========================================================================

CAUSE:
These errors and were caused by an improper setup for 'oradism'.
The file permissions for the executable '$ORACLE_HOME/bin/oradism' were not properly set possibly
due to
'root.sh' was not executed after Oracle Universal Installer (OUI) installed the Oracle Home, however this could not
be validated.
========================================================================
Solution:
After fixing the file permissions of '$ORACLE_HOME/bin/oradism' the database instance the issue has stopped.
The permissions for 'oradism' must be 6550 with the setid for the group:
e.g. (rsrs1
root oinstall 129 12 Feb 16 2008 oradism)
========================================================================
Reference: ASM Forcibly Dismounts Diskgroups or Causes Disks to be Offlined If 'oradism' is
Improperly Set (Doc ID 744869.1)

AutoConfig could not successfully execute the following scripts: afcpctx.sh INSTE8_PRF 137

======================================================================
[PROFILE PHASE]
  AutoConfig could not successfully execute the following scripts:
    Directory: /data/R12base/inst/apps/PREPROD_devdb/admin/install
      afcpctx.sh              INSTE8_PRF         137
      ibywebprf.sh            INSTE8_PRF         1
======================================================================

This error message is from adcfgclone logfile.  So you're also not able to proceed further ......

adcfgclone.pl is failing on two scripts "afcpctx.sh & ibywebprf.sh".   After long troubleshooting find out the culprits.

 ==> afcpctx.sh this script is failing because of missing library file

- If we run this script manually its calling fnd binary "FNDCPUCF"  from $FND_TOP/bin and find out that this binary has some missing libaries

Solution:

bash-3.00$ cd $FND_TOP/bin

bash-3.00$ ldd -d FNDCPUCF
        libnnz10.so =>   /data/R12base/apps/tech_st/10.1.2/lib32/libnnz10.so
        libkstat.so.1 =>         /lib/libkstat.so.1
        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
        libsched.so.1 =>         /usr/lib/libsched.so.1
        libaio.so.1 =>   /lib/libaio.so.1
        librt.so.1 =>    /lib/librt.so.1
        libm.so.1 =>     /lib/libm.so.1
        libclntsh.so.10.1 =>     /data/R12base/apps/tech_st/10.1.2/lib/libclntsh.so.10.1  - wrong ELF class: ELFCLASS64
        libpthread.so.1 =>       /lib/libpthread.so.1
        libc.so.1 =>     /lib/libc.so.1
        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
        libm.so.2 =>     /lib/libm.so.2
        /platform/SUNW,Sun-Fire-V440/lib/libc_psr.so.1
        /platform/SUNW,Sun-Fire-V440/lib/libmd_psr.so.1
bash-3.00$

- To solve this follow the steps

bash-3.00$ echo $ORACLE_HOME
/appl/R12base/apps/tech_st/10.1.2

bash-3.00$ ln -s $ORACLE_HOME/lib/ldflags $ORACLE_HOME/lib32/ldflags

bash-3.00$ ls -ltr $ORACLE_HOME/lib32/ldflags
lrwxrwxrwx   1 appclone dbaclone      45 Jun 10 13:16 /appl/R12base/apps/tech_st/10.1.2/lib32/ldflags -> /appl/R12base/apps/tech_st/10.1.2/lib/ldflags

bash-3.00$ genclntsh

bash-3.00$ relink all

- After performing all above steps again check :

bash-3.00$ cd $FND_TOP
bash-3.00$ ls
3rdparty    bin         forms       html        java        log         media       out         perl        resource    sql         xml
admin       fndenv.env  help        include     lib         mds         mesg        patch       reports     secure      usrxit
bash-3.00$ cd bin
bash-3.00$ ls
bash-3.00$ ldd -d FNDCPUCF
        libnnz10.so =>   /appl/R12base/apps/tech_st/10.1.2/lib32/libnnz10.so
        libkstat.so.1 =>         /lib/libkstat.so.1
        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
        libsched.so.1 =>         /usr/lib/libsched.so.1
        libaio.so.1 =>   /lib/libaio.so.1
        librt.so.1 =>    /lib/librt.so.1
        libm.so.1 =>     /lib/libm.so.1
        libclntsh.so.10.1 =>     /appl/R12base/apps/tech_st/10.1.2/lib32/libclntsh.so.10.1
        libpthread.so.1 =>       /lib/libpthread.so.1
        libc.so.1 =>     /lib/libc.so.1
        libmp.so.2 =>    /lib/libmp.so.2
        libmd.so.1 =>    /lib/libmd.so.1
        libscf.so.1 =>   /lib/libscf.so.1
        libm.so.2 =>     /lib/libm.so.2
        libdoor.so.1 =>  /lib/libdoor.so.1
        libuutil.so.1 =>         /lib/libuutil.so.1
        /platform/SUNW,Sun-Fire-V440/lib/libc_psr.so.1
        /platform/SUNW,Sun-Fire-V440/lib/libmd_psr.so.1
========================================================================