Tuesday, 30 March 2021

Routine AFPESA cannot construct the name of an executable file for your concurrent request

 

Concurrent Processing - Requests Stuck with Inactive No Manager - Routine AFPESA Cannot Construct the Name of an Executable File



SYMPTOMS


All the Concurrent Requests are showing up with Phase Inactive and Status No Manager. The Standard Manager is not able to process any request because each manager process dies immediately after starting up. The log file of the manager process shows the following error:

List of errors encountered:
.............................................................................

_ 1 _
Routine AFPESA cannot construct the name of an executable file for
your concurrent request 2181143.

Check that the file name components are correct and valid on your
system. Check that the environment for the person who started the conc
.............................................................................



SOLUTION



To implement the solution, perform the below steps :-

1- Use the following select statement to identify the concurrent program name using the request ID that appears in the error

select p.* from fnd_concurrent_requests r, fnd_concurrent_programs_tl p where p.concurrent_program_id = r.concurrent_program_id and request_id=673032;

2- Cancel the request id=<Request Id>

3- Exclude the custom program (identified from step 1) from the standard manager specialization rules.

4- Include this custom program to a new custom manager specialization rules.

5- Restart the internal manager and check again if standard manager up or down.

Thursday, 4 March 2021

Query to find Tablespace size and free space - dba tech blog

Tablespace management in an Oracle database is important and something a DBA will need to do quite frequently.  Therefore I wrote a query, which I believe I originally got from the internet and then it evolved by me adding in temp tablespace and few other things 🙂



 Querying Tablespace Usage                                              


Query 1 : 

SELECT b.tsname tablespace_name
, MAX(b.used_size_mb) cur_used_size_mb
, round(AVG(inc_used_size_mb),2)avg_increas_mb 
FROM ( 
SELECT a.days, a.tsname, used_size_mb 
, used_size_mb - LAG (used_size_mb,1)  OVER ( PARTITION BY a.tsname ORDER BY a.tsname,a.days) inc_used_size_mb 
FROM (
SELECT TO_CHAR(sp.begin_interval_time,'MM-DD-YYYY') days 
,ts.tsname
,MAX(round((tsu.tablespace_usedsize* dt.block_size )/(1024*1024),2)) used_size_mb  
 FROM DBA_HIST_TBSPC_SPACE_USAGE tsu, DBA_HIST_TABLESPACE_STAT ts 
 ,DBA_HIST_SNAPSHOT sp, DBA_TABLESPACES dt
 WHERE tsu.tablespace_id= ts.ts# AND tsu.snap_id = sp.snap_id
 AND ts.tsname = dt.tablespace_name  AND sp.begin_interval_time > sysdate-7
 GROUP BY TO_CHAR(sp.begin_interval_time,'MM-DD-YYYY'), ts.tsname 
 ORDER BY ts.tsname, days
 ) A 
) b GROUP BY b.tsname ORDER BY b.tsname


Query 2 : 

SELECT TO_CHAR (sp.begin_interval_time,'DD-MM-YYYY') days
, ts.tsname
, max(round((tsu.tablespace_size* dt.block_size )/(1024*1024),2) ) cur_size_MB
, max(round((tsu.tablespace_usedsize* dt.block_size )/(1024*1024),2)) usedsize_MB
FROM DBA_HIST_TBSPC_SPACE_USAGE tsu
, DBA_HIST_TABLESPACE_STAT ts
, DBA_HIST_SNAPSHOT sp
, DBA_TABLESPACES dt
WHERE tsu.tablespace_id= ts.ts#
AND tsu.snap_id = sp.snap_id
AND ts.tsname = dt.tablespace_name
AND ts.tsname NOT IN ('SYSAUX','SYSTEM')
GROUP BY TO_CHAR (sp.begin_interval_time,'DD-MM-YYYY'), ts.tsname
ORDER BY ts.tsname, days;


Query 3 :

SELECT   a.tablespace_name, (a.BYTES / 1024/1024) || 'MB' AS total,
           (b.BYTES / 1024/1024) || 'MB' AS free,
           ROUND(((a.BYTES-b.BYTES)/1024/1024) ,2) || 'MB' AS used,
           (b.largest / 1024/1024) || 'MB' AS largest_block,
           ROUND (((a.BYTES - b.BYTES) / a.BYTES) * 100, 2) AS percent_used,
           ROUND (100 - ((a.BYTES - b.BYTES) / a.BYTES) * 100, 2) AS percent_free
      FROM (SELECT   tablespace_name, SUM (BYTES) BYTES
                  FROM dba_data_files
              GROUP BY tablespace_name) a,
             (SELECT   tablespace_name, SUM (BYTES) BYTES, MAX (BYTES) largest
                 FROM dba_free_space
             GROUP BY tablespace_name) b
      WHERE a.tablespace_name = b.tablespace_name(+)
union
select sh.tablespace_name,
sum(sh.bytes_used + sh.bytes_free)/1048576 || 'MB' total,
sum(sh.bytes_free)/1048576 || 'MB' free,
sum(sh.bytes_used)/1048576 || 'MB' used,
max(BYTES_FREE)/1048576 || 'MB',
ROUND(sum(sh.bytes_used) /sum(sh.bytes_used + sh.bytes_free) *100, 2) percent_used,
ROUND(sum(sh.bytes_free) /sum(sh.bytes_used + sh.bytes_free) *100, 2) percent_free
from v$temp_space_header sh
group by tablespace_name
order by 7;


Query 4:

SELECT 
   A.tablespace_name tablespace, 
   D.mb_total,
   SUM (A.used_blocks * D.block_size) / 1024 / 1024 mb_used,
   D.mb_total - SUM (A.used_blocks * D.block_size) / 1024 / 1024 mb_free
FROM 
   v$sort_segment A,
(SELECT 
   B.name, 
   C.block_size, 
   SUM (C.bytes) / 1024 / 1024 mb_total
FROM 
   v$tablespace B, 
   v$tempfile C
WHERE 
   B.ts#= C.ts#
GROUP BY 
   B.name, 
   C.block_size) D
WHERE 
   A.tablespace_name = D.name
GROUP by 
   A.tablespace_name, 
   D.mb_total;


Temp Tablespace :


          SELECT   s.sid "SID",
         s.username "User",
         s.program "Program",
         u.tablespace "Tablespace",
         u.contents "Contents",
         u.extents "Extents",
         u.blocks * 8 / 1024 "Used Space in MB",
         q.sql_text "SQL TEXT",
         a.object "Object",
         k.bytes / 1024 / 1024 "Temp File Size"
        FROM   v$session s,
         v$sort_usage u,
         v$access a,
         dba_temp_files k,
         v$sql q
        WHERE       s.saddr = u.session_addr
         AND s.sql_address = q.address
         AND s.sid = a.sid
         AND u.tablespace = k.tablespace_name;


I use this query


           SELECT   sl.sid,
           sl.serial#,
           SYSDATE,
           TO_CHAR (sl.start_time, 'DD-MON-YYYY:HH24:MI:SS') start_time,
           ROUND ( (sl.elapsed_seconds / 60), 2) min_elapsed,
           ROUND ( (sl.time_remaining / 60), 2) min_remaining,
           sl.opname,
           sl.MESSAGE
          FROM   v$session_longops sl, v$session s
         WHERE   s.sid = sl.sid AND s.serial# = sl.serial# AND sl.opname like 'Sort%' 
         ORDER BY   sl.start_time DESC, sl.time_remaining ASC;

Tuesday, 23 February 2021

EBS R12.2 Multi Node Cloning Step by step - DBA Tech blog

R12 EBS Multi Node Cloning

 

Prerequisite Preparation in Source Server       

  

 Run adpreclone in DatabaseTier

 

1.       Login to Database server as oracle user

2.       ORACLE_HOME/appsutil/scripts/$CONTEXT_NAME/

3.       $ perl adpreclone.pl dbTier

 

 Take tar backup of ORACLE HOME Database Tier

 

1.       Login to Database server as Root user

2.       $ cd /oracle/PRD

3.       $ tar cvf - 11.2.0| gzip > 11.2.0.tar.gz

4.       scp -r 11.2.0.tar.gz root@192.9.200.56:/oracle/CLN

 

          Run adpreclone in Application Concurrent Tier

 

1.       Login to Application server as apps user

2.       $ cd $ADMIN_SCRIPTS_HOME

3.       $ perl adpreclone.pl appsTier

 

 Take tar backup of Application HOME Concurrent Tier

 

4.       Login to  Application server as Root user

5.       $ cd /concurrent/R12/PRD/

6.       # tar cvf - apps| gzip > /oracle/apps_cmgr.tar.gz

7.       scp -r apps_cmgr.tar.gz root@192.158.2.65:/oracle/CLN/

 

           Run adpreclone in Application Forms Tier

 

1.       Login to Application server as apps user

2.       $ cd $ADMIN_SCRIPTS_HOME

3.       $ perl adpreclone.pl appsTier

 

Take tar backup of Application HOME Forms Tier

 

4.       Login to  Application server as Root user

5.       $ cd /forms/R12/PRD/

6.       tar cvf - apps| gzip > /oracle/apps_forms.tar.gz

7.       scp -r apps_forms.tar.gz root@192.158.2.65:/oracle/CLN

 

·         Take RMAN Backup in database 

 

1.       Login to Database server as database user

2.       Source Envirenment file

3.       $ vi backup.sql

4.       Paste below command

RUN {

ALLOCATE CHANNEL disk1;

ALLOCATE CHANNEL disk2;

ALLOCATE CHANNEL disk3;

ALLOCATE CHANNEL disk4;

ALLOCATE CHANNEL disk5;

backup as compressed backupset database include current controlfile plus archivelog FORMAT '/oracle/PRD/RMAN/FullData_%s_%p_%t';

RELEASE CHANNEL disk1;

RELEASE CHANNEL disk2;

RELEASE CHANNEL disk3;

RELEASE CHANNEL disk4;

RELEASE CHANNEL disk5;

}

 

5.       $ rman target /

6.       Rman > @backup.sql

7.       Backup completed

 

          Copy RMAN Backup from Source to Destination

 

8.       Login to Database server as Root user

9.       $ cd /ora_bkp/RMAN/

10.   scp -r CURBKP root@192.158.2.65:/oracle/CLN/RMAN/

 

          Drop Database in target system Database Tier( if there is any old Database)

1.       Login to Target Database server as oracle user

2.       $ sqlplus / as sysdba

3.       select name from v$database;   à Check whether it is a Clone

4.       sql > shu immediate;

5.       sql > startup mount restrict;

6.       Sql> drop database;

7.       Sql > exit

 

          Delete the existing Oracle Home 

 

1.       Login to Target Database server as Root user

2.       rm –R 11.2.0

 

          Create new DB Oracle Home (untar the tar file taken from Production)

 

1.       Login to Target Database server as Root user

2.       gunzip < 11.2.0.tar.gz | tar -xvf -

3.       $ chown –R dbmgrprd:dba 11.2.0

4.       $ chmod –R 777 11.2.0

 

          Check the oraInventory

 

1.       Login to Target Database server as Oracle user

2.       $ cat /etc/oraInst.loc

3.       inventory_loc=/oracle/DEV/oraInventory  inst_group=dba  à Check this entry available

4.       $ cd /oracle/CLN/oraInventory

5.       cp oraInventory oraInventory_old

6.       cd oraInventory

7.       remove all folder inside oraInventory

 

 

Database Cloning

 

 

          Run adcfgclone in Target DB Tier to create Oracle Home

 

1.       Login to Target Database server as Oracle user

2.       Source New environment file

3.       $ . $ORACLE_HOME/dbs/CLN_develop.env

4.       $ cd $ORACLE_HOME/appsutil/clone/bin

5.       $ perl adcfgclone.pl dbTechStack

6.       Give all parameter as required

 

          Edit Pfile for database creation

 

1.       Login to Target Database server as Oracle user

2.       $ cd $ORACLE_HOME/dbs

3.       $ vi initCLONE.ora

4.       Add the below parameter in pfile

db_file_name_convert='+DATA4/PRD/datafile/','+DATA5/CLN/datafile/' 

log_file_name_convert='+DATA4/PRD/logfile/','+DATA5/CLN/logfile/'

5.       Save

 

          Startup instance in nomount

 

1.       Login to Target Database server as Oracle user

2.       $cd $ORACLE_HOME/dbs

3.       $ sqlplus / as sysdba

4.       Sql > startup nomount pfile=initCLN.ora

5.       exit

 

          Create Target database using RMAN backup

 

1.       Login to Target Database server as Oracle user

2.       $rman

3.       Rman > connect auxiliary /

4.       Rman > duplicate database to 'CLN' backup location '/oracle/CLN/RMAN' nofilenamecheck;

5.       Wait for RMAN to complete with below message.

 

database opened

Finished Duplicate Db at 05-FEB-16

RMAN> exit

Recovery Manager complete.

 

          Post database creation steps

 

1.       Login to Target Database server as Oracle user

2.       $ sqlplus  apps/apps123

3.       SQL> select name,open_mode from v$database;

 

NAME      OPEN_MODE

--------- --------------------

DEV       READ WRITE

 

4.       SQL> select node_name from fnd_nodes;

5.       SQL> EXEC FND_CONC_CLONE.SETUP_CLEAN;

PL/SQL procedure successfully completed.

6.       SQL> commit;

7.       SQL> select node_name from fnd_nodes;

no rows selected

 

8.       Exit

 

 

Application Cloning

   

         Untar backup of Application HOME in Target Application Tier

 

1.       Login to Target Application server as Root user 

2.       gunzip < apps_cmgr.tar.gz | tar -xvf –

3.       gunzip < apps_forms.tar.gz | tar -xvf –

4.       $ chown –R applmgr:dba apps

5.       $ chmod –R 777 apps

 

          Run adcfgclone in APPS Tier to create Target Application Tier

 

1.       Login to Target Application server as apps user

2.       Source New environment file

3.       $ . $APPL_TOP/APPSCLN_clndatabase.env

4.       export PATH=/usr/vacpp/bin:$PATH   à give this command

5.       $ cd $COMN_TOP/cln/bin

6.       $ perl adcfgclone.pl appsTier

7.       Give all parameter as below

 

Target System Hostname (virtual or normal) [clndatabase] :

 

Target System Database SID : CLN

 

Target System Database Server Node [clndatabase] :

 

Target System Database Domain Name [company.com] :

 

Target System Base Directory : /oracle/CLN/R12

 

Target System Tools ORACLE_HOME Directory [/oracle/CLN/R12/apps/tech_st/10.1.2] :

 

Target System Web ORACLE_HOME Directory [/oracle/CLN/R12/apps/tech_st/10.1.3] :

 

Target System APPL_TOP Directory [/oracle/CLN/R12/apps/apps_st/appl] :

 

Target System COMMON_TOP Directory [/oracle/CLN/R12/apps/apps_st/comn] :

 

Target System Instance Home Directory [/oracle/CLN/R12/inst] :

 

Target System Root Service [enabled] :

 

Target System Web Entry Point Services [enabled] :

 

Target System Web Application Services [enabled] :

 

Target System Batch Processing Services [enabled] :

 

Target System Other Services [disabled] : enabled

 

Do you want to preserve the Display [crp1:0.0] (y/n)  : n

 

Target System Display [clndatabase:0.0] :

 

Do you want the the target system to have the same port values as the source system (y/n)[y] ? : n

 

Target System Port Pool [0-99] : 8  à same as database port

 

 

 

              UTL_FILE_DIR on database tier consists of the following directories.

 

1. /usr/tmp

2. /usr/tmp

3. /oracle/DEV/db/11.2.0/appsutil/outbound/DEV_databasesec

4. /usr/tmp

 

Choose a value which will be set as APPLPTMP value on the target node [1] : 1

 

    /     71% completed      

 

Completed Apply...

Sat Feb  6 00:10:32 2016

 

Do you want to startup the Application Services for CLN? (y/n) [y] : n

 

Services not started

 

          Post Clone Steps in Application Tier.

 

1.       Login to Application server as apps user

2.       Source New environment file

3.       $ sqlplus  apps/apps123

4.       SQL> update WF_NOTIFICATIONS set mail_status = 'SENT' where mail_status = 'MAIL';

 

132619 rows updated.

 

5.       SQL> commit;

 

Commit complete.

 

6.       SQL> set lines 150

7.       SQL> select CONCURRENT_QUEUE_NAME,NODE_NAME,NODE_NAME2 from fnd_concurrent_queues  where node_name='PRODUCTION';

8.       SQL> update fnd_concurrent_queues set node_name='CLNDATABASE' where node_name='CLNDATABASE';

 

22 rows updated.

 

9.       SQL> commit;

 

10.   Commit complete.

 

11.   SQL> exit

 

          Run autoconfig in Database Tier

 

1.       Login to Database server as oracle user

 

2.       cd $ORACLE_HOME/appsutil/scripts

 

3.       ./adautoconfig.sh

 

          Run autoconfig in Application Tier

 

4.       Login to Application server as application user

 

5.       cd $ADMIN_SCRIPTS_HOME

 

6.       ./adautoconfig.sh

 

7.       ./adstrtal.sh apps/apps123

 

8.       Open the application as sysadmin( if there is no error) submit “ active user” request from system administrator responsibility. Else do below.

 

          FRM-92101: There was a failure in the Forms

 

1.  Source the Apps environment

 

2.  Bring down the application

 

3.  Cd $ORACLE_HOME/lib32

 

4.  ls –lrt ldflags  -Would be pointing to production location

 

5.  unlink  ldflags

 

6.  ln –s /oracle/cln/apps/tech_st/10.1.2/lib/ldflags ldflags (link to the right path)

 

7.  cd $ORACLE_HOME/forms/lib32/

 

8.  make -f ins_forms.mk install

 

9.  Now restart the application and check for the same.