Monday, February 29, 2016

How to create R12.2.4 Staging area

Download zip file from Oracle E delivery Portal. All the zip file stored in place, so that easy to create Stage area(R12.2.4) using 
Always we need to download latest StartCD  buildStage.sh.

$ cd /apps/StageR122/StartCD/Disk1/rapidwiz/bin

$ls -l  buildStage.sh.
$./buildStage.sh

Copyright (c) 2002, 2013 Oracle Corporation
                        Redwood Shores, California, USA

                       Oracle E-Business Suite Rapid Install

                                 Version 12.2.0
Press Enter to continue...


                      Build Stage Menu

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

   1.     Create new stage area

   2.     Copy patches to existing stage area

   3.     List files in TechPatches directory

   4.     Exit menu


   Enter your choice [4]: 1

            Rapid Install Platform Menu

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

   1.    Oracle Solaris SPARC (64-bit)

   2.    Linux x86 (64-bit)

   3.    IBM AIX on Power Systems (64-bit)

   4.    HP-UX Itanium

   5.    Exit Menu


   Enter your choice [5]: 1

Running command:

/apps2/scratch/Stage122/startCD/Disk1/rapidwiz/bin/../jre/Solaris/1.6.0/bin/java -classpath /apps2/scratch//Stage122/startCD/Disk1/rapidwiz/bin/../jlib/emocmutl.jar:/apps2/scratch/PRs


Specify the directory containing the zipped installation media: specify what location you want to unback

Eg : /apps2/scratch/Stage122
you can see the following directory 
1. EBSInstallMedia
2.TechInstallMedia.

Eg: EBSIntallMedia you can see the following directory
  • APPDB
  • AS10.1.2
  • Apps
  TechIntallMedia.
  • database
  • Wls1036_generic
  • ogs11116




Friday, February 26, 2016

How to refresh oracle(dev/tst/trn) Database from Production using RMAN

Simple Clone from Production SID to non Prod SID

Please make sure RMAN completed without any error in Production.


This is my directory structure on Prod_SID side.



/orafra/Prod_SID
drwxr-x---. 2 uid dba 4096 Dec 29  2014 onlinelog
drwxr-x---. 2 uid dba 4096 Jul  9  2015 autobackup
drwxr-x---. 3 uid dba 4096 Feb  9 12:43 backupset
drwxr-x---. 2  uid dba 4096 Feb  9 13:54 flashback


drwxr-x---. 5 uid dba 4096 Feb 11 01:36 archivelog

/orafara/Nprod_SID
drwxr-x---. 2 uid dba 4096 Dec 29  2014 onlinelog
drwxr-x---. 2 uid dba 4096 Jul  9  2015 autobackup
drwxr-x---. 3 uid dba 4096 Feb  9 12:43 backupset
drwxr-x---. 2 uid dba 4096 Feb  9 13:54 flashback


drwxr-x---. 5 uid dba 4096 Feb 11 01:36 archivelog

eg: /orafra/P_SID/backupset/2016_02_26/*.bkp
$ scp *.bkp uid@servername.xxx.xxx:/orafra/D_SID/backup_sid/
$ ls  -l  *.bkp 
Make sure all the files are copied in the dev location.
Now you have to edit init.ora file.

In my case all the file are located /oradatra/Prod_SID/logfie, dbf file, ctl file 
the below two lines should in your nonProd_SID init.ora file.
*.db_file_name_convert = (/oradata/Prod_SID/,/oradata/Nprod_SID/)
*.log_file_name_convert = (/oradata/Prod_SID/,/oradata/NPROD_SID/)
  • . Please make sure that your env file set for your Target database.


    sqlplus '/as sysdba'
SQL> startup nomount pfile='/xxxx/xxxx/admin/SID/pfile/Nprod_sid.ora
ORACLE instance started.
 /
Total System Global Area 4275781632 bytes
Fixed Size                  2260088 bytes
Variable Size             704643976 bytes
Database Buffers         3556769792 bytes
Redo Buffers               12107776 bytes
SQL> exit
$rman auxiliary /
RMAN>duplicate database to Nprod_SID backup location 'orafra/nprod_SID/backupset/2016_02_26';

.......

.........

database opened

Reenabling controlfile options for auxiliary database
Executing: alter database flashback on
Finished Duplicate Db at 26-FEB-16 


If you are working in Oracle EBS side. Please execute the following scripts.


Source your db env file.


login as apps user


 sqlplus apps/xxxxxx(production_password)

(if you using  12.2.4 application do not use  FND_CONC_CLONE.SETUP_CLEAN).


 sql# exec FND_CONC_CLONE.SETUP_CLEAN; 


commit;
  select count(*) from fnd_nodes;

now you won't see any value in fnd_nodes.

exit;

Take backup of TNS_ADMIN


execute adconfig.sh

$ORACLE_HOME/appsutil/bin/adconfig.sh

Enter the full path to the Context file: $ORACLE_HOME/appsutil/SID_HOSTname.xml

(display variable)
adconfig. completed.

Make sure tnsname.ora, listner.ora, sqlnet.ora files are correct.


Make sure all your dblinks are working. 


Assume you have apps tier server.....


Run adconfig on apps Tier


After adconfig completed, you can reset APPS  password using fndcpass and make sure you system account is unlocked.


Happy learning and share the world.



oracle Apps DB env file

#!/bin/ksh

export ORACLE_VERSION=11.2.0.4
export ORACLE_BASE=/apps/oracle

export ORACLE_DATABASE=ORACLE_SID
export ORACLE_SID=ORACLE_SID

export ORACLE_HOME=$ORACLE_BASE/product/SID/db11g/11.2.0.4

export ORACLE_ADMIN=/apps/oracle/admin
export ORACLE_PROFILES=/apps/oracle/local/profiles
export ORACLE_BIN=/apps/oracle/local/bin

export ORACLE_DOC=${ORACLE_HOME}/odoc
export ORACLE_TERM=vt220

export ORA_NLS10=$ORACLE_HOME/nls/data/9idata
export PATH=$ORACLE_HOME/jdk/bin:$ORACLE_HOME/appsutil/jre/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/NX/bin:/sbin/:.:$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$ORACLE_PROFILES:$ORACLE_BIN:

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib:/lib
export LIBPATH=$ORACLE_HOME/lib:/usr/lib:/lib
export SHLIB_PATH=$ORACLE_HOME/lib

unset ORA_NLS32
unset TWO_TASK
unset ORA_NLS33

export PFILE=${ORACLE_ADMIN}/${ORACLE_DATABASE}/pfile/init${ORACLE_SID}.ora

export TNS_ADMIN=/apps/PROPERTY/local/network/admin/${ORACLE_SID}_L

echo; env | sort | egrep 'ORA|PFI|TNS'; echo;

Thursday, February 18, 2016

Refresh Database form production for EBS(no RMAN)

copy all  dbf file from production to non prod server 
example  '/oradata/SID/*.dbf based on your init.ora

 1. Source your environment

   sqlplus '/as sysdba'

2.  SQL - startup nomount

[In the nomount stage, Oracle  opens and reads the initialization parameter file (init.ora) to see how the database is configured]


3. execute the below script newdb.sql

Inside newdb.sql


CREATE CONTROLFILE SET DATABASE "SID" RESETLOGS  ARCHIVELOG
    MAXLOGFILES 32
    MAXLOGMEMBERS 5
    MAXDATAFILES 500
    MAXINSTANCES 1
    MAXLOGHISTORY 8180
LOGFILE
  GROUP 1 (
    '/oradata/SID/log10a.log',
    '/orafra/redo/SID/log10b.log'
  ) SIZE 50M,
  GROUP 2 (
    '/oradata/SID/log20a.log',
    '/orafra/redo/SID/log20b.log'
  ) SIZE 50M,
  GROUP 3 (
    '/oradata/SID/log30a.log',
    '/orafra/redo/SID/log30b.log'
  ) SIZE 50M,
  GROUP 4 (
    '/oradata/SID/log40a.log',
    '/orafra/redo/SID/log40b.log'
  ) SIZE 50M,
 GROUP 5 (
    '/oradata/SID/log50a.log',
    '/orafra/redo/SID/log50b.log'
  ) SIZE 50M
-- STANDBY LOGFILE
DATAFILE
  '/oradata/SID/system01.dbf',
  '/oradata/SID/system02.dbf',
  '/oradata/SID/system03.dbf',
  '/oradata/SID/system04.dbf',
  '/oradata/SID/system05.dbf',
  '/oradata/SID/rbs01.dbf',
  '/oradata/SID/ctxd01.dbf',
 ...
...
...
..

'/oradata/SID/interim.dbf',
  '/oradata/SID/izud01.dbf',
  '/oradata/SID/izux01.dbf',
  '/oradata/SID/sysaux01.dbf'
CHARACTER SET US7ASCII
;

ALTER DATABASE OPEN RESETLOGS;
ALTER TABLESPACE TEMP ADD TEMPFILE '/oradata/SID/temp02.dbf'
     SIZE 2000M REUSE AUTOEXTEND ON NEXT 106496  MAXSIZE 32767M;
ALTER TABLESPACE TEMP ADD TEMPFILE '/oradata/SID/temp01.dbf'
     SIZE 2000M REUSE AUTOEXTEND ON NEXT 106496  MAXSIZE 32767M;
-- End of tempfile additions.

once database is created,
4. shutdown 
5. startup 
6  unclock system account,
7. change apps password using fndcpass
8. clean up fnd_nodes.
9. take backup TNS_ADMIN directory
10. run adconfig.sh on db side and apps server side.
11 startup database server, application server and make sure every thing works.