Saturday, June 28, 2008

Creating a Duplicate Database on a New Host Using RMAN

For Oracle Server Enterprise Edition: 9.X,10.X

Goal:

How To Create A Production Duplicate On a New Host using RMAN

Solution:



Primary Database SID: ORCL

Duplicate Database SID: AUX

RMAN Catalog SID: RMAN




Backup of the primary database.


Host A (Target)


# export ORACLE_SID=ORCL


# rman target=/ catalog=rman/rman@ORCL


RMAN> run {
allocate channel d1 type disk;
backup format '/backups/PROD/df_t%t_s%s_p%p' database;
sql 'alter system archive log current';
backup format '/backups/PROD/al_t%t_s%s_p%p' archivelog all;
release channel d1;
}


This command will perform a full database backup including archivelogs and the current controlfile.



Host B (Aux)


Making the backup available for the duplicate process.


If your backup resides on disk you will need to copy this back up from host A to host B.

Ensure you place it in the same directory as where it was created.

RMAN> list backup;


Create same directory of host b and give appropriate permissions for the oracle user



Create the pfile [initAUX.ora] parameter file in the $ORACLE_HOME/dbs directory for

the auxiliary database.
---------------------------------------------------------------

db_name = aux
db_block_size = 8192
compatible = 10.2.0.1.0
remote_login_passwordfile = exclusive
control_files = ('/d02/oradata/aux/control01.ctl')
db_file_name_convert = ('/newpart/oradata/orcl',
'/d02/oradata/aux')
log_file_name_convert = ('/newpart/oradata/orcl',
'/d02/oradata/aux')
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
------------------------------------------------------------------------------

Following the creation of the initAUX.ora startup nomount the auxiliary instance.

export ORACLE_SID=AUX

sqlplus '/as sysdba'

startup nomount;


Ensuring SQL*NET connections to primary database and RMAN catalog are working.



Host B(AUX)


sqlplus ‘sys/oracle@PROD as sysdba’


sqlplus rman/rman@PROD (not mandatory)

Add tnsnames.ora entry


Eg:
ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = test.oneapps.com)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = ORCL)
)
)
Prepare RMAN duplicate script.


run {
allocate auxiliary channel C1 device type disk;
duplicate target database to AUX;
}
Save it as dup.sql


Execute the RMAN script


Start RMAN, connect to the production target, the catalog instance and also the auxiliary clone. Run the RMAN duplicate script as shown below. Before doing this ensure that the Oracle SID environment variable is set to the duplicate clone database.


# export ORACLE_SID=AUX


# rman target sys/pwd@ORCL catalog rman/rman@ORCL auxiliary /


RMAN> @dup.sql

After this, login to aux database and alter database open with resetlogs option.

Create A Production (Full or Partial) Duplicate On The Same Host

For Oracle Server Enterprise Edition: 9.X,10.X

Goal:

How To Create A Production (Full or Partial) Duplicate On The Same Host using RMAN


Solution:


Primary DB : ORCL

Clone DB : AUX


Production Database should be archive enabled.

Startup mount;

alter database archivelog;

alter database open;

archive log list;


Recovery catalog for RMAN

Creating the Recovery Catalog Owner

Start by creating a database schema (usually called rman). Assign an appropriate tablespace to it and grant it the recovery_catalog_owner role.

Look at this example:

% sqlplus '/as sysdba'SQL>CREATE USER rman IDENTIFIED BY rman

DEFAULT TABLESPACE tools

TEMPORARY TABLESPACE temp

QUOTA UNLIMITED ON tools;

SQL> GRANT CONNECT, RECOVERY_CATALOG_OWNER TO rman;




Creating the Recovery Catalog


% rman catalog rman/rman@ORCLRMAN> CREATE CATALOG;


Registering the target database


% rman TARGET / CATALOG rman/rman@ORCLRMAN> REGISTER DATABASE;


Reference : Note:452529.1

Reference : RMAN: How to Query the RMAN Recovery Catalog ( Note:98342.1 )



Note : Make use of netca and netmgr to configure listener and tnsnames


# Find Production Database Files:


SQL> select name from v$datafile;

Create the Auxiliary Database directories needed

cd $ORACLE_HOME/dbs

create parameter file initAUX.ora


db_file_name_convert = ('/old/path1', '/new/path1',/old/path2', '/new/path2',
'/old/path3', '/new/path3')


log_file_name_convert = ('/old/path1', '/new/path1','/old/path2', '/new/path2',
'/old/path3', '/new/path3')



eg:-

db_name = aux

db_block_size = 8192

compatible = 10.2.0.1.0

remote_login_passwordfile = exclusive

control_files = ('/newpart/oradata/aux/control01.ctl',
'/newpart/oradata/aux/control02.ctl')

db_file_name_convert = ('/newpart/oradata/orcl',
'/newpart/oradata/aux')

log_file_name_convert = ('/newpart/oradata/orcl',
'/newpart/oradata/aux')

*.undo_management='AUTO'

*.undo_tablespace='UNDOTBS1'


# create a passwordfile for remote connections as sysdba


% orapwd password= file=orapwAUX


% sqlplus /nolog

SQL> connect / as sysdba

SQL> startup nomount pfile=$ORACLE_HOME/dbs/initAUX.ora

SQL> exit

Start the Duplication

ORACLE_SID=AUX; export ORACLE_SID # ksh

sqlplus /nolog

SQL> connect / as sysdba

Connected to an idle instance

SQL> startup nomount pfile=$ORACLE_HOME/dbs/initAUX.ora

SQL> exit


# Set your SID back to the TARGET for duplication.

> rman trace.log

Recovery Manager: Release 10.2.0.1.0 - Production

Copyright (c) Oracle. All rights reserved.

RMAN> connect target

connected to target database: V10GREL4 (DBID=2510891965)

RMAN>backup database;

RMAN>sql 'alter system switch logfile';

RMAN> connect auxiliary sys/pwd@AUX

connected to auxiliary database: AUX (not mounted)

RMAN> duplicate target database to AUX device type disk;

Once this is done, login to duplicate database with alter database open resetlogs.

Creating a recovery catalog for RMAN

For Oracle Server Enterprise Edition 9x-10x

Creating a recovery catalog for RMAN


Server A - Target database (PROD)

Server B - Recovery Catalog database (catdb)

General settings:


1. RDBMS version and OS version should be same in Server A and Server B.

2. Server A and B should ping each other. Check each other entries in /etc/hosts file.

3. Copy the tnsname.ora entry (server A) add it in server B tnsname.ora entry and vice versa.


Step -1: Create password file on target DB (server A)


$orapwd file=orapwORACLE_SID (filename) password=password

Eg: - $orapwd file=orapwPROD password=rolta2k
(oracle password file default file location is $ORACLE_HOME/dbs)
Then,
Add parameter remote_login_passwordfile=EXCLUSIVE in server A initSID.ora
And bounce the database once.


After done this settings you should be able to connect the remotely

Eg: - From Server B just execute, and vice versa.
$sqlplus sys/sys@PROD as sysdba


Step - 2: Create tablespace for recovery catalog to store the target (server A) database information.

Connect to catalog DB Server B where you we need to configure the recovery catalog.
$sqlplus “/as sysdba”


sql>CREATE TABLESPACE rmanDATAFILE '/u02/app/oradata/rman/rman01.dbf' size 500m;

Step - 3: Create the Recovery Catalog Owner in the new database (CATDB)

Sql>CREATE USER rman IDENTIFIED BY rmanDEFAULT TABLESPACE rmanQUOTA UNLIMITED ON rman;


Step – 4: Grant the necessary privileges to the schema ownersql> GRANT connect, resource, recovery_catalog_owner TO rman;Here the role \"RECOVERY_CATALOG_OWNER\" provides the user with all privileges required to maintain and query the recovery catalog

Step – 5:Creating the Recovery CatalogConnect to the Server -B which will contain the catalog as the catalog owner. $ rman catalog rman/passwd@catdb

Eg: - $rman catalog rman/rman@UAT04

Recovery Manager: Release 10.2.0.2.0 - Production on Mon Feb 25 16:00:46 2008

Copyright (c) 1982, 2005, Oracle. All rights reserved.

Connected to recovery catalog database

Step – 6: Run the CREATE CATALOG command to create the catalog
RMAN> CREATE CATALOG;recovery catalog created

Step – 7: Registering Target Database in the Recovery CatalogConnect to the target (Server A) database and recovery catalog database (Server B).

$ rman target sys/passwd@prod catalog rman/passwd@catdb

Eg: - $rman target sys/sys@NPROD catalog rman/rman@UAT04

Then, register the target database in recovery catalog

RMAN> REGISTER DATABASE;

Then, to identify whether has registered properly, execute the below command

RMAN> REPORT SCHEMA;

It will show the target database (Server A) datafile paths.

Eg: -
Report of database schema

List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1 1000 SYSTEM YES /uat01/oracle/PROD/db/apps_st/data/system01.dbf
2 1000 SYSTEM YES /uat01/oracle/PROD/db/apps_st/data/system02.dbf
3 1000 SYSTEM YES /uat01/oracle/PROD/db/apps_st/data/system03.dbf
4 1000 SYSTEM YES /uat01/oracle/PROD/db/apps_st/data/system04.dbf
5 1000 SYSTEM YES /uat01/oracle/PROD/db/apps_st/data/system05.dbf
6 200 CTXD NO /uat01/oracle/PROD/db/apps_st/data/ctxd01.dbf
7 10 OWAPUB NO /uat01/oracle/PROD/db/apps_st/data/owad01.dbf
8 1000 APPS_TS_QUEUES NO /uat01/oracle/PROD/db/apps_st/data/a_queue02.dbf
9 100 ODM NO /uat01/oracle/PROD/db/apps_st/data/odm.dbf
10 17 OLAP NO /uat01/oracle/PROD/db/apps_st/data/olap.dbf
11 2000 SYSAUX NO /uat01/oracle/PROD/db/apps_st/data/sysaux01.dbf
12 500 APPS_TS_TOOLS NO /uat01/oracle/PROD/db/apps_st/data/apps_ts_tools01.dbf
13 1615 SYSTEM YES


For additional reference:
http://download.oracle.com/docs/cd/B19306_01/backup.102/b14194/rcmsynta045.htm#sthref722

http://www.dbapool.com/articles/04110701.html
http://www.oracle-base.com/articles/9i/RecoveryManager9i.php

Metalink Doc ID: 360416.1
Subject: Oracle10g - Getting Started with Recovery Manager (RMAN)

Guidelines to setup the JVM in Apps Ebusiness Suite R12

For Oracle Applications 11i and R12.

Goal:

This is the general setup in apps has to be done after the installation. So that we can avoid performance issues in applications during heavy user load.


Solution:


How to increase the number oacore process type(JVM) and required memory:

Name of the file: opmn.xml
Location in R12:$INST_TOP/apps/SID_HOSTNAME/ora/10.1.3/opmn/conf/opmn.xml

Location in 11i:$IAS_ORACLE_HOME/Apache/Jserv/etc/jserv.conf
$IAS_ORACLE_HOME/Apache/Jserv/etc/jserv.properties

In this document i'm telling you how to increase JVM in R12.

Go to $INST_TOP/apps/SID_HOSTNAME/ora/10.1.3/opmn/conf/

Take a backup of opmn.xml file before editing,

A)Open the opmn.xml file and go to line no-128 and increase

numprocs=”4” -- (for 8 cpus)

If you have 6 cpus in server you can increase this JVM upto “3”. So depends on the cpu configuration you increase it.

B)Now we have increased the number of JVM only we need to increase the memory also for
compilation during user requests.

In the same file go to line no-114

FROM: -server -verbose:gc -Xmx512M -Xms128M -XX:MaxPermSize=160M -

XX:NewRatio=2 -XX:+PrintGCTimeStamps

As per the metalink document 362851.1 need to increase

Xms128M to Xms256M

Here nproc is number oc4j instance.

So to know how much memory has to increase multiply Xms with nproc.

Xms X nproc = max memory

And make sure that your application tier memory having that much free size.

Now I have 4 nproc and 256 for Xms, So I need to increase Xmx512 to Xmx1024


TO:

server -verbose:gc –Xmx1024M -Xms256M -XX:MaxPermSize=256M -XX:NewRatio=2 -XX:+PrintGCTimeStamps -XX:+PrintGCDetails

For reference:

Xms x nproc = max memory.

The max allocation of memory to the oc4j memory allocated by the Xmx parameter

Nprocs is the number of ocj4 instances

multiply the two together you will get the max memory given to OC4J support


Note: Don’t run autoconfig bounce the all application tiers.

Tuesday, June 24, 2008

Oracle Applications Important Questions and Answers-II

1) There are lot of dbc file under $FND_SECURE, How its determined that which dbc file to use from $FND_SECURE ?

This value is determined from profile option "Applications Database ID"


2) What is RRA/FNDFS ?

Report Review Agent(RRA) also referred by executable FNDFS is default text viewer in Oracle Applications 11i for viewing output files & log files. As most of apps dba's are not clear about Report Server & RRA, I'll discuss one on my blog and update link here

3) What is PCP is Oracle Applications 11i ?


PCP is acronym for Parallel Concurrent processing. Usually you have one Concurrent Manager executing your requests but if you can configure Concurrent Manager running on two machines (Yes you need to do some additional steps in order to configure Parallel Concurrent Processing) . So for some of your requests primary CM Node is on machine1 and secondary CM node on machine2 and for some requests primary CM is on machine2 & secondary CM on machine1


4) Why I need two Concurrent Processing Nodes or in what scenarios PCP is Used ?

Well If you are running GL Month end reports or taxation reports annually these reports might take couple of days. Some of these requests are very resource intensive so you can have one node running long running , resource intensive requests while other processing your day to day short running requests.


Another scenario is when your requests are very critical and you want high resilience for your Concurrent Processing Node , you can configure PCP. So if node1 goes down you still have CM node available processing your requests


5) Output & Logfiles for requests executed on source Instance not working on cloned Instance


Here is exact problem description - You cloned an Oracle Apps Instance from PRODBOX to another box with Instance name say CLONEBOX on 1st of August. You can any CM logs/output files after 1st of August only because these all are generated on CLONEBOX itself, But unable to view the logs/output files which are prior to 1st August. What will you do & where to check ?


Log , Output file path & location is stored in table FND_CONCURRENT_REQUESTS. Check
select logfile_name, logfile_node_name, outfile_name, outfile_node_name from fnd_concurrent_requests where request_id=&requestid ;
where requestid is id of request for which you are not able to see log or out files. You should see output like
/u01/PRODBOX/log/l123456.req, host1,/u01/PRODBOX/out/o123456.out, host1

Update it according to your cloned Instance Variables.


6) How to confirm if Report Server is Up & Running ?

Report Server is started by executable rwmts60 on concurrent manager Node & this file is under $ORACLE_HOME/bin .execute command on your server like
ps -ef | grep rwmts60
You should get output like
applmgr ....... rwmts60 name=REP60_VISION
where VISION is your Instance name.

Else you can submit a request like "Active Users" with display set to PDF, check output & log file to see if report server can display PDF files.


7) What is difference between ICM, Standard Managers & CRM in Concurrent Manager ?


ICM stand for Internal Concurrent Manager, which controls other managers. If it finds other managers down , it checks & try to restart them. You can say it as administrator to other concurrent managers. It has other tasks as well.

Standard Manager These are normal managers which control/action on the requests & does batch or single request processing.

CRM acronym for Conflict Resolution Manager is used to resolve conflicts between managers & request. If a request is submitted whose execution is clashing or it is defined not to run while a particular type of request is running then such requests are actioned/assigned to CRM for Incompatibilities & Conflict resolution.


8) What is use of Apps listener ?


Apps Listener usually running on All Oracle Applications 11i Nodes with listener alias as APPS_$SID is mainly used for listening requests for services like FNDFS & FNDSM.


9) How to start Apps listener ?

In Oracle 11i, you have script adalnctl.sh which will start your apps listener. You can also start it by command

lsnrctl start APPS_$SID (Replace sid by your Instance SID Name)


10) How to confirm if Apps Listener is Up & Running ?


execute below command
lsnrctl status APPS_$SID (replace SID with your Instance Name)
so If your SID is VISION then use lsnrctl status APPS_VISION out put should be like
Services Summary...
FNDFS has 1 service handler(s)
FNDSM has 1 service handler(s)
The command completed successfully


11) What is Web Listener ?


Web Listener is Web Server listener which is listening for web Services(HTTP) request. This listener is started by adapcctl.sh & defined by directive (Listen, Port) in httpd.conf for Web Server. When you initially type request like http://becomeappsdba.blogspot.com:80 to access application here port number 80 is Web Listener port.





12) How will you find Invalid Objects in database ?


using query
SQLPLUS> select count(*) from dba_objects where status like 'INVALID';


13) How to compile Invalid Objects in database ?


You can use adadmin utility to compile or you can use utlrp.sql script shipped with Oracle Database to compile Invalid Database Objects.


14) How to compile JSP in Oracle Apps ?


You can use ojspCompile.pl perl script shipped with Oracle apps to compile JSP files. This script is under $JTF_TOP/admin/scripts. Sample compilation method is
perl ojspCompile.pl --compile --quiet


15) What is difference between adpatch & opatch ?


adpatch is utility to apply oracle apps Patches whereas
opatch is utility to apply database patches


16) Can you use both adpatch & opatch in Apps ?


Yes you have to use both in apps , for apps patches you will use adpatch utility and for applying database patch in apps you will opatch utility.


17) Where will you find forms configuration details apart from xml file ?


Forms configuration at time of startup is in script adfrmctl.sh and appsweb_$CONTEXT_NAME.cfg (defined by environment variable FORMS60_WEB_CONFIG_FILE) for forms client connection used each time a user initiates forms connection.



18) What is forms server executable Name ?


f60srvm


19) What are different modes of forms in which you can start Forms Server and which one is default ?


You can start forms server in SOCKET or SERVLET by defualt Forms are configured to start in socket mode


20) How you will start Discoverer in Oracle Apps 11i ?


In order to start dicoverer you can use script addisctl.sh under $OAD_TOP/admin/scripts/$CONTEXT_NAME or startall.sh under $ORACLE_HOME/discwb4/util (under Middle/Application Tier)


21) How many ORACLE HOME are Oracle Apps and whats significance of each ?


There are three $ORACLE_HOME in Oracle Apps, Two for Application Tier (Middle Tier) and One in Database Tier.

ORACLE_HOME 1 : On Application Tier used to store 8.0.6 techstack software. This is used by forms, reports & discoverer. ORACLE_HOME should point to this ORACLE_HOME which applying Apps Patch.

ORACLE_HOME 2: On Application Tier used by iAS (Web Server) techstack software. This is used by Web Listener & contains Apache.

ORACLE_HOME 3: On Database Tier used by Database Software usually 8i,9i or 10g database.


22) Where is HTML Cache stored in Oracle Apps Server ?

Oracle HTML Cache is available at $COMMON_TOP/_pages for some previous versions you might find it in $OA_HTML/_pages




23) Where is pl/sql cache stored in Oracle Apps ?


Usually two type of cache session & plssql stored under $IAS_ORACLE_HOME/Apache/modplsql/cache


24) What happens if you don't give cache size while defining Concurrent Manager ?


Lets first understand what is cache size in Concurrent Manager. When Manager picks request from FND CONCURRENT REQUESTS Queues, it will pick up number of requests defined by cache size in one shot & will work on them before going to sleep. So in my views if you don't define cache size while defining CM then it will take default value 1, i.e. picking up one request per cycle


25) Where is HTML Cache stored in Oracle Apps Server ?


Oracle HTML Cache is available at $COMMON_TOP/_pages for some previous versions you might find it in $OA_HTML/_pages


26) What are few profile options which you update after cloning ?


Rapid clone updates profile options specific to site level . If you have any profile option set at other levels like server, responsibility, user....level then reset them.


27) How to retrieve SYSADMIN password ?


If forgot password link is enabled and sysadmin account is configured with mail id user forget password link else you can reset sysadmin password via FNDCPASS.






28) If you have done two node Installation, First machine : Database and concurrent processing server. 2nd machine: form,web Which machine have admin server/node?


Admin Server will be on First machine with concurrent processing server.


29) What is TWO_TASK in Oracle Database ?


TWO_TASK mocks your tns alias which you are going to use to connect to database. Lets assume you have database client with tns alias defined as PROD to connect to Database PROD on machine teachmeoracle.com listening on port 1521. Then usual way to connect is sqlplus username/passwd@PROD ; now if you don't want to use @PROD then you set TWO_TASK=PROD and then can simply use sqlplus username/passwd then sql will check that it has to connect to tnsalias define by value PROD i.e. TWO_TASK



30) What is GWYUID ?


GWYUID , stands for Gateway User ID and password. Usually like APPLSYSPUB/PUB


31) Where GWYUID defined & what is its used in Oracle Applications ?


GWYUID is defined in dbc i.e. Database Connect Descriptor file . It is used to connect to database by think clients.


32) What is difference between GUEST_USER_PWD (GUEST/ORACLE) & GWYUID ?


GUEST_USER_PWD(Guest/Oracle) is used by JDBC Thin Client where as GWYUID is used by Thick Clients like via Forms Connections.


33) How to check number of forms users at any time ?


Forms Connections initiate f60webmx connections so you can use
ps -ef | grep f60webmx | wc -l



34) What is 0 & Y in FNDCPASS, FNDLOAD or WFLOAD ?


0 & Y are flags for FND Executable like FNDCPASS & FNDLOAD where
0 is request id (request ID 0 is assigned to request ID's which are not submitted via Submit Concurrent Request Form.

'Y' indicates the method of invocation. i.e. it is directly invoked from the command-line not from the Submit Request Form.


35) In a Multi Node Installation, How will you find which node is running what Services ?

You can query for table FND_NODES and check for column , SUPPORT_CP ( for Concurrent Manager) SUPPORT_FORMS ( for forms server) , SUPPPORT_WEB (Web Server), SUPPORT_ADMIN( Admin Server), and SUPPORT_DB for database tier.

You can also check same from CONTEXT File (xml file under APPL_TOP/admin)


36) If your system has more than one Jinitiator, how will the system know, which one to pick. ?


When client makes a forms connection in Oracle Applications, forms client session uses configuration file defined by environment variable FORMS60_WEB_CONFIG_FILE also called as appsweb config file. These days this file is of format appsweb_$CONTEXT.cfg The initiator version number defined by parameter jinit_ver_name in this file will be used .

37) While applying Apps patch using adpatch, if you want to hide the apps password, how will that be possible ?

Use adpatch flags=hidepw while applying patches in apps to hide apps or system password being displayed on Users Screen.

38) What is importance of IMAP Server in Java Notification Mailer ?
IMAP stands for Internet Message Access Protocol and Java Notification mailer require IMAP server for Inbound Processing of Notification Mails.


39) What is difference between Socket & Servlet Mode in Apps Forms ?


When forms run SOCKET Mode these are dedicated connection between Client Machine & Form Server (Started by adfrmctl.sh). When Forms run in servlet mode the forms requests are fulfilled by Jserv in Apache . There will be additional JVM for Forms Request in that case and you won't start form via adfrmctl.sh.


40) What is make program in Unix ?


make is utility in Unix/Linux to maintain , update & generate an file mainly executable


41) If by mistake you/someone deleted FNDLIBR can this executable be restored if Yes, How & if no, what will you do ?

Yes, you can restore FNDLIBR executables
run adadmin on concurrent manager node
select option 2. Maintain Applications Files menu
then select 1. Relink Applications programs
when prompts for
Enter list of products to link ('all' for all products) [all]
select FND
when prompt for
Generate specific executables for each selected product [No] ? YES
select YES
& from list of executables select FNDLIBR
This will create new FNDLIBR executables.


42) What is .pls files which you see with apps ?

.pls file stands for plsql files. In apps patch these files contain code to create package spec or package body or both.


43) What are .ldt & .lct files which you see in apps patch or with FNDLOAD ?


.ldt & .lct stands for Loader datafile & Loader configuration files, used frequently in migrating customization, profile options, configuration data, etc.. across Instances.

44) What are .odf file in apps patch ?

odf stands for Object Description Files used to create tables & other database objects.


45) What to find Form Server log files in forms ?


Form Server Start up log file default location is $OAD_TOP/admin/log/$CONTEXT_NAME/f60svrm.txt

Forms Run Time Diagnostics default location is $ORACLE_HOME/forms60/log/$CONTEXT_NAME



46) How to convert pll to pld file or pld file to pll ?

Pll->Pld f60gen module=MSCOSCW3.pll module_type=library userid=apps/ module_access=file output_file=MSCOSCW1.pld script=yes


Pld -> pll f60gen module=MSCOSCW3.pld userid=apps/ module_type=library module_access=file output_file=MSCOSCW1.pll parse=y batch=yes compile_all=special


47) Is APPS_MRC Schema exists for MRC in 11.5.10 and higher ?


No , apps_mrc schema is dropped with 11.5.10 Upgrade & 11.5.10 new Install. This is replaced by more Integrated Architecture.


48) If APPS_MRC schema is not used in 11.5.10 and higher then How MRC is working ?


For products like Payable, Recievables which uses MRC and if MRC is enabled then each transaction table in base schema related to currency now has an assoicated MRC Subtables.



49) When you apply C driver patch does it require database to be Up & Why ?


Yes , database & db listener should be Up when you apply any driver patch in apps. even if driver is not updating any database object connection is required to validate apps & other schema and to upload patch history information in database tables.


50) Can C driver in apps patch create Invalid Object in database ?


No , C driver only copies files in File System. Database Object might be invalidated during D driver when these objects are created/dropped/modified.

Wednesday, June 18, 2008

Oracle Applications Important Questions and Answers

1) Explain Architecture of Oracle Apps 11i.

Terminology which you will encounter here & in most of Oracle Documentation.
Server - is a process or group of processes and provides a particular functionality/service For example, Database Server listen and process database requests, similarly Web Server listens for and processes HTTP requests.

Tier - is a logical grouping of services, may be on single machine or spread across more than one physical machine. For Example, Middle Tier in Oracle apps consist Form, Web, Report...Services. Forms & Report can be one machine 1 & Web Server can be on machine 2, still they will be part of same tier called as Application Tier or Middle Tier.

Node - is referred as Machine, Each tier may consist of one or more node and each node can potentially have more than one tier.

Desktop Tier - Oracle Applications/E-Business Suite is built on three tier Architecture with first Desktop Tier ic client machines accessing applications via browser(HTML based Self service applications) or Java Applet(Jinitiator) for Form based interface.

Application/Middle Tier - Second is Application Tier also called as middle tier consists of WebServer Forms, Reports, Concurrent processing, Discoverer and Admin Server. Its known as Middle tier because it lies between our desktop & third tier called database tier.

Database Tier - Third is Database Tier contain Oracle database server which store all your application data.

2) What are various components in Application/Middle Tier

In Application Tier various components are Web Server, Forms Server, Reports Server, Concurrent Manager, Admin Server & Discoverer Server.

3) What's Different Top’s in Application 11i

Oracle Installer Installs Apps 11i in DB Tier & Application Tier:

So lets take Application Tier where you will see three directories under your base Installation directory, these directories are APPL, ORA & COMN
APPL is called as APPL_TOP
This is top appl directory where files & directories related to different Applications (like GL General Ledger, PO Purchase Order) exist.
ORA is called as ORA_TOP (Application Technology Stack)
Here you will see directory related to oracle home, there are two oracle Home’s in Application Tier 8.0.6 for Forms & Reports, iAS oracle home for 9iAS acting as web server
COMN is called as COMN_TOP
It will contain files & directories such as log, output, html, java files which will be used commonly by all components
For Database Tier you will see two directories, DATA and DB
DATA contains Oracle database file used by the oracle applications. (Data files, Control files, redo log files etc.)
DB is the oracle home for the oracle9i RDBMS.

4) What’s US directory in $AD_TOP or under various product Top’s.

US directory is default language directory in Oracle Applications. If you have multiple languages Installed in your Applications then you will see other languages directories besides US, that directory will contain reports, fmx and other code in that respective directory like FR for France, AR for arabic, simplifies chinese or spanish.

5) Where is Concurrent Manager log file and output file location?

By default standard location for log files are in $APPLCSF/$APPLLOG or $COMMON_TOP/admin/log/$CONTEXT_NAME, in some cases it can go to $FND_TOP/log as well.
Standard location for output files are in $APPLCSF/$APPLOUT or $COMMON_TOP/admin/out/$CONTEXT_NAME.

6) What are AD utilities?

AD utilities are tools used by the Applications DBA to install, configure and maintain oracle applications. Eg : adpatch, adadmin, admrgpch, Rapid Clone etc.

7) Where are AD utilities log file and output file location?

Log and output files are in located at
$APPL_TOP/admin/$SID/log/$CONTEXT_NAME
$APPL_TOP/admin/$SID/out/$CONTEXT_NAME

8) Where would you find .rf9 file, and what exactly it does?

These files are used during restart of patch in case of patch failure because of some reason so that you are able to resume the patch session from where you got aborted.

9) Where is appsweb.cfg or appsweb_$CONTEXT.cfg stored & why its used?

This file is defined by the environment variable FORMS60_WEB_CONFIG_FILE. This is usually in directory $OA_HTML/bin on forms tier.
This file is used by any forms client session. When a user tries to access forms, f60webmx picks up this file and based on this configuration file creates a forms session to user/client.

10) What's the difference between a multi user & a single user Apps 11i install? What are advantages/disadvantages of two?

Multi user means there will be more than one user for managing the
Oracle applications. Usually one for the application tier and the other for the database tier. Through this multi user environment security is more. In a single user install, you can go for the express installation of applications, where the installation task is much easier, here the security is less as this user has full access to the whole applications.

11) What is wdbsvr.app file used for? What's full path of this file? What's significance of this file?

You can find this file under $IAS_ORACLE_HOME/Apache/modplsql/cfg
It’s related to mod_pls (mod plsql component of Apache/Oracle 11i Web Server) configuration file. This file is used by mod_plsql component of Apache to connect to database. So when you type url http://hostname:port/pls/SID , whenever Apache(11i Web Server) finds that request is for /pls/ then Apache delegates this request to mod_pls component which in turn pick this file & check if there is any DAD with name SID (in our example its VISION11I) &
Sample entry in wdbsvr.app
[DAD_VISION11I]
connect_string = VISION11I
password = apps
username = APPS
default_page = fnd_web.ping
On typing http://hostname: port/pls/VISION11I, it will connect to database using apps schema & will return you page fnd_web.ping (where fnd_web is package & ping is procedure or vise versa).
URL is quite useful in troubleshooting so you can check if database connection is working fine or not. Another thing you want to check about this file is since it stores APPS password you need to change here whenever you change apps password.

12) Explain steps used in cloning oracle Apps 11i Instance at broad level.

Step1 . Prerequisites Steps you do before start cloning using rapid clone
1.1 Verify source and target nodes software versions
1.2 Apply the latest AutoConfig Template patch
1.3 Apply the latest Rapid Clone patches

Step2 . Clone Source to Target
2.1 Run preclone on DB tier
2.2 Run preclone on Apps or middle tier
2.3 Copy source file system to target file system
2.4 Configure db tier
2.5 Configure apps/middle tier

Step 3 Finishing Task
3.1 Update profile options
3.2 Update printer settings (If printers are not configured or you don't want to use printer you can skip this step)
3.3 Update workflow configuration settings (Important)

13) What is multi node system?

Multi Node System in Oracle Applications 11i means you have Applications 11i Component on more than one system. Typical example is Database, Concurrent Server on one machine and forms, Web Server on second machine is example of Two Node System.

14) Can you clone from multi node system to single node system & vice versa?

Yes, this is now supported via Rapid Clone; Check if your system has all prerequisites patches for Rapid Clone and you are on latest rapid clone patch.

15) Does rapid clone takes care of Updating Global oraInventory or you have to register manually in Global OraInventory after clone?

Rapid Clone will automatically Update Global oraInventory during configuration phase. You don't have to do any thing manually for Global oraInventory.

16) What is .dbc file, where it is stored, what’s the use of .dbc file?

dbc as name says is database connect descriptor file which stores database connection information used by application tier to connect to database. This file is in directory $FND_TOP/secure also called as FND_SECURE

17) What things you do to reduce patch timing?

You can take advantage of following -
Merging patches via admrgpch.
Use various adpatch options like nocompiledb or nocompilejsp.
Make Use defaults file.
Make use of shared APPL_TOP.
Staged APPL_TOP during upgrades.
Use of Distributed AD Environment features.

18) What are various options available with adpatch?

Various options available with adpatch depending on your AD version are
autoconfig, check_exclusive, checkfile, compiledb, compilejsp, copyportion, databaseportion, generateportion, hotpatch, integrity, maintainmrc, parallel, prereq, validate

19) What is the use of adident utility?

adident utility in oracle apps is used to find version of any file. AD Identification.
For eg. "adident Header

20) What is the use of adsplice utility?

adsplice in oracle apps is utility to add a new product.

21) How can you license a product after installation?

You can use ad utility adlicmgr ($AD_TOP/bin) to license product in Oracle Apps or make use of Oracle Application Manager.

22) What is MRC? What you do as Apps DBA for MRC?

MRC also called as Multiple Reporting Currency in oracle Apps. Default you have currency in US Dollars but if your organization operating books are in other currency then you as apps dba need to enable MRC in Apps. You can enable it with the adadmin utility.

23) What is JVM (Java Virtual Machine) and which component uses JVM?

JVM - acronym for Java Virtual Machine that executes instructions generated by Java compiler. So when a user clicks on any Self Service Request or any program that uses Java, then Apache forwards this request to mod_jserv (mod_oc4j in 10g AS) & mod_jserv caters this request with help of JVM.

24) How & where check JVM related configuration in Oracle Apps 11i?

So lets start with CONTEXT file under $APPL_TOP/admin (xml file) which is of pattern $SID_$HOSTNAME.xml
There are two important lines in CONTEXT file that will help you in understanding JVM
jvm_options oa_var="s_jvm_options" osd="Solaris" -verbose:gc -Xmx512M -Xms128M -XX:MaxPermSize=128M -XX:NewRatio=2 -XX:+PrintGCTimeStamps -XX:+UseTLAB /jvm_options
-Verbose:gc means JVM is configured to print output when gc (Garbage Collector) runs.
Xmx is maximum memory allocated to JVM in above example its 512 MB.
Xms is JVM will start with this much memory i.e. 128 MB.
Now check another line in 11i Context file like
oacore_nprocs oa_var="s_oacore_nprocs"1/oacore_nprocs
Which means that there is one JVM for OACore Group.
Change it to 2, to cater huge Self Service users if required.

25) How to increase No. Of JVMs?

Since you know place where number of JVM's are stored in Apps 11i in Context File, so you can change them as per your requirement. There are basically following Groups with their own JVM's.
OACoreGroup, where most of Java request goes
DiscoGroup, which serve your Discoverer related requests
FormsGroup, for Forms (If they are running in Servlet Mode, confirm it again)
XmlSvcsGroup, for XML Services
In Context File
disco_nprocs oa_var="s_disco_nprocs" osd="Solaris" 1 /disco_nprocs Sets 1 JVM Process for Discoverer.
oacore_nprocs oa_var="s_oacore_nprocs" 1 /oacore_nprocs Sets 1 JVM for for OACoreGroup
Similarly, s_forms_servlet_nprocs & s_xmlsvcs_nprocs for Forms & XML Services resp.
These Groups are defined in configuration file for Jserv . jserv.conf under $IAS_ORA/Apache/Jserv/conf ; like
ApJServGroup OACoreGroup
ApJServGroup DiscoGroup
ApJServGroup FormsGroup
ApJServGroup XmlSvcsGrp

26) Where to find Apps 11i JVM logs?

JVM log location is defined in java.sh (found in $IAS_ORACLE_HOME/Apache/Apache/bin). Oracle Apps 11i JVM log file directory is defined by parameter JVMLOGDIR ($IAS_ORACLE_HOME/Apache/Jserv/logs/jvm) and log file are defined by STDOUTLOG & STDERRLOG. Examples of JVM log files are
OACoreGroup.0.stderr ,OACoreGroup.0.stdout, DiscoGroup.0.stdout, DiscoGroup.0.stderr, XmlSvcsGrp.0.stderr, XmlSvcsGrp.0.stdout
where 0 denotes first JVM & 1 denotes second JVM. stderr records error encountered in JVM & stdout records other information like GC.
Analyzing Oracle Apps 11i JVM logs
In order to analyze Oracle apps 11i JVM, lets open stdout file for one of Group, I have selected OACoreGroup here, you know log file location (If not check previous) , open file like OACoreGroup.X.stdout you should see output like below if GC (Garbage Collector) is set in Verbose mode.
48561.624: [GC 325980K->170382K(519168K), 0.2751056 secs]
49307.880: [GC 334862K->179171K(519168K), 0.2660486 secs]
50236.662: [GC 343651K->187797K(519168K), 0.2518720 secs]
50515.494: [Full GC[Unloading class sun. reflect. Generated Method Accessor 143]
[Unloading class sun. reflect. GeneratedMethodAccessor136]
[Unloading class sun. reflect. GeneratedMethodAccessor74]
Here first entry is time since JVM was started so each time you bounce Apache it will be reset to 0. So difference between two entries is seconds after which GC (Garbage Collector) was executed. First entry in bracket [ is Heap Size at start of GC & Second entry is Heap Size after GC was executed. Number mentioned in round bracket () is heap size currently allocated in K. If you see GC running very frequently, you can start thinking of increasing JVM heap size
First three entries were for Minor Garbage Collector & fourth one is FULL GC is for Full Garbage Collector.

27) How to check JDBC Connection?

connect using apps, sys or system & issue
select count(*), module from v$session where program like '%JDBC%' group by module;

28) How to find JDBC thin driver that your iAS 1.0.2.2.2 is using?

Here is a java program & procedure to compile it that will give your jdbc thin driver version.
Create a file with name JDBCVersion.java in your middle tier (Application Tier)
---------
import java.sql.*;
import oracle.jdbc.driver.*;
class JDBCVersion
{
public static void main (String args[])
throws SQLException
{
// Load the Oracle JDBC driver
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
// Get a connection to a database
Connection conn = DriverManager.getConnection
("jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=YES)(FAILOVER=YES) (ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST= ) (PORT= )))(CONNECT_DATA=(SID=)))" ,"apps","");
// Create Oracle DatabaseMetaData object
DatabaseMetaData meta = conn.getMetaData();
// gets driver info:
System.out.println("JDBC driver version is " + meta.getDriverVersion());
}
}
-----------
Replace following parameters
1. with your database hostname or IP address
2. with your database port no.
3. with SID for your database
4. with your apps password
After changing save it with name JDBCVersion.java in your middle tier & execute command
javac JDBCVersion.java
This will create class file in your working directory. Include your current directory into your class path like
export CLASSPATH=$CLASSPATH:/.xml and is in /admin for each node of application tier. It contains configuration information for the application tier of a specific oracle applications system. It is used to configure all the other files necessary to set up and make available particular oracle applications system. Database context file is in the location /appsutil and it contains configuration information for the database tier of a specific oracle application system

29) How to size Apps 11i JVM?

Sizing Apps JVM
There are four JVM Groups, OACoreGroup, DiscoGroup, FormsGroup & XMLsvcsGrp (FormsGroup JVM's disabled by default as forms run on Socket rather servlets)
So thumb rule in Apps is
1 JVM with default settings per 100 Users for OACoreGroup
So if you have 1000 users with five middle tiers you can configure 2 JVM on each middle tier i.e. 2X5X100=1000 Users.

30) What is access_log in apache, what entries are recorded in access_log? Where is default location of this file?

access_log in Oracle Application Server records all users accessing oracle applications 11i. This file location is defined in httpd.conf with default location at $IAS_ORACLE_HOME/Apache/Apache/logs.
Entries in this file are defined by directive LogFormat in httpd.conf . Typical entry in access_log is
198.0.0.1 - - [10/Sep/2006:18:37:17 +0100] "POST /OA_HTML/OA.jsp?.... HTTP/1.1" 200 28035
where 200 is HTTP status code & last digits 28035 is bytes dowloaded as this page (Size of page)

31) Where are Jserv configuration files stored?

Jserv configuration files are stored in $IAS_ORACLE_HOME/Apache/Jserv/etc

32) If someone ask Apps DBA to change Session Idle Time out value how & where will you change?

In order to answer first you have to understand what kind of sessions are in Apps 11i and what is idle timeout?
In Apps there are two broad categories of session
- Self Service Application Session (Server by Web Server iAS Apache & Jserv, like iRecruitment, iProcurement)
-Forms session (served by your form session, like system Administrator)
What is Session Idle time?
If Oracle Apps client is not doing any activity for some time (when application user goes for coffee or talks over phone) session during that time is called as Idle Session & because of security reason, performance issues and to free up system resource Oracle Applications terminates client session (both forms & self service) after idle time value is reached to the one mentioned in configuration file.

From FND.G or 11.5.9 or with introduction of AppsLocalLogin.jsp to enter into application, profile option "ICX Session Timeout" is used only to determine Forms Session Idle timeout value. This might be confusing as earlier this profile option used to control forms as well as self service application (with session.timeout) session.timeout is used to control Idle session timeout for Self Service Applications (Served by Jserv via JVM)

From where ICX: Session Timeout & session.timeout get values?
Autoconfig determines value for profile option "ICX: Session Timeout" and "session.timeout" from entry in context file ($APPL_TOP/admin/SID_hostname.xml) with parameter s_sesstimeout where value mentioned is in milliseconds so profile option ICX: Session Timeout value should be s_sesstimeout/ (1000 * 60) which means here its 10 Minutes. This value is also set in zone.properties in $IAS_ORACLE_HOME/Apache/Jserv where number mentioned is in milli second i.e. 600000 (equal to 10 Minutes) session.timeout = 600000
session.timeout mentioned in zone.properties is in milli seconds, ICX Session Time out mentioned in profile option ICX: Session Timeout is in minutes so ICX session timeout=30 & session.timeout= 1800,000 are same 30 minutes
P.S. ICX Session time out was introduced in FND.D so if your FND version is below D you might not see this variable.

Important Things Apps DBA should consider while setting session timeout value ?

1. If you keep session.timeout value too high, when some oracle application user accessing Self-service application terminates his session, so longer idle session will drain JVM resource & can result in Java.Lang No Memory available issues.

2. If you keep it too low, users going out for tea or sitting idle for some time have to login again into application & can be annoying.
Thumb rule is session time out usually set to 30 minutes.

33) Where are applications start/stop scripts stored?

Applications start/stop scripts are in directory $COMMON_TOP/admin/scripts/$CONTEXT_NAME

34) What are main configuration files in Web Server (Apache)?

Main configuration files in Oracle Apps Web Server are
httpd.conf, apps.conf, oracle_apache.conf, httpd_pls.conf
jserv.conf, ssp_init.txt, jserv.properties, zone.properties
plsql.conf, wdbsvr.app, plsql.conf

35) What is Autoconfig ?

AutoConfig is a configuration tool that automates the configuration of an Oracle Applications system. The information required for configuring an Applications system is collected into a repository, called the Applications Context; there is one Applications Context for each application tier, and one for the database tier. When AutoConfig runs, it uses information from the Applications Context file to generate all configuration files and update database profiles.

36) What is context file ?

Context file is called .xml and is in /admin for each node of application tier. It contains configuration information for the application tier of a specific oracle applications system. It is used to configure all the other files necessary to set up and make available particular oracle applications system. Database context file is in the location /appsutil and it contains configuration information for the database tier of a specific oracle application system

37) How to create User in Oracle Applications 11i ? Can you delete a User ?

You can create a user in oracle applications through OAM, you cannot delete a user that is created, instead you can make him expire so that you wont be able to login again.

38) What is Single Sign On ? ( If you are using portal 3.0.9 or 10G )?

As name says Single-Sign On Server is set of services (Software) which enables login to Application once which will allow you to login to partner Applications with no need to login again. Lets assume I have configured single SSO Server for Portal , E-Business Suite, Collaboration Suite plus some other other applications, Now if I login to any one of them & after that if I wish to login to other applications I should be able to login without supplying passwords again.

39) How to check if Apps 11i System is Autoconfig enabled ?

Under $AD_TOP/bin check for file adcfginfo.sh & if this exists use
adcfginfo.sh contextfile= show=enabled
If this file is not there , look for any configuration file under APPL_TOP if system is Autoconfig enabled then you will see entry like
# AutoConfig automatically generates this file. It will be read and .......

40) How to check if Oracle Apps 11i System is Rapid Clone enabled ?

For syetem to be Rapid Clone enabled , it should be Autoconfig enabled (Check above How to confirm if Apps 11i is Autoconfig enabled). You should have Rapid Clone Patches applied , Rapid Clone is part of Rapid Install Product whose Family Pack Name is ADX. By default all Apps 11i Instances 11.5.9 and above are Autoconfig & Rapid Clone enabled.

41) Whats is difference between two env files in .env and APPS.env under $APPL_TOP ?

APPS.env is main environment file which inturn calls other environment files like .env under $APPL_TOP, .env under 806 ORACLE_HOME and custom.env for any Customized environment files

42) What is access_log in Apache ?

access_log file keeps record of users accessing Oracle Apps 11i Webserver.
Typical entry in access_log is like
198.0.0.1 - - [25/Aug/2006 :03:15:13 +0100] "GET /OA_JAVA /oracle /forms /registry/Registry.dat HTTP/1.1" 200 4117
Which means client with IP 198.0.0.1 requested for file mentioned above on 25 Aug 2006 at 03:15 AM , 200 is status code returned by Apache which means page returned successfully (Status Code 302 means page redirected , 404 page not found, 500+ Internal Server error)
last digit 4117 in above entry of access_log means file size which is 4117 bytes. This file is quite useful in monitoring your Web Server.
Please note above format might defer on your system as this is dependent log_format in Apache configuration file ( httpd.conf)

43) Whats is location of access_log file ?

access_log file by default is located in $IAS_ORACLE_HOME/ Apache/Apache/logs. Location of this file is defined in httpd.conf by patameter CustomLog or TransferLog

44) What is your Oracle Apps 11i Webserver Version and how to find it ?

From 11.5.8 to 11.5.10 Webserver version is iAS 1.0.2.2.2, In order to find version under $IAS_ORACLE_HOME/Apache/Apache/bin execute ./httpd -version
./httpd -version
Server version: Oracle HTTP Server Powered by Apache/1.3.19
Server built: Dec 6 2005 14:59:13 (iAS 1.0.2.2.2 rollup 5)
P.S. You can configure 10g Application Server as well with Oracle Apps 11i.

45) What is Location of Jserv configuration files ?

Jserv configuration files are located in $IAS_ORACLE_HOME /Apache/Jserv/etc .

46) What is pl/sql database cache ?

In order to improve performance mod_pls (Apache component) caches some database content to file. This database/plssql cache is usually of type session & plsql cache
session cache is used to store session information.
plsql cache is used to store plsql cache i.e. used by mod_pls

47) Where is database/plsql cache stored ?

plssql & session cache are stored under $IAS_ORACLE_HOME/ Apache/modplsql/cache directory.

48) How to determine Oracle Apps 11i Version ?

select RELEASE_NAME from fnd_product_groups;
You should see output like
RELEASE_NAME
-----------------------
11.5.9 or 11.5.10.2

49) What is *.dbc file & whats is location of dbc file ?

dbc as name stands for is database connect descriptor file used to connect to database. This file by default located in $FND_TOP/secure directory also called as $FND_SECURE directory

50) What is content of dbc file & why its important ?

DBC file is quite important as whenever Java or any other program like forms want to connect to database it uses dbc file. Typical entry in dbc file is
GUEST_USER_PWD
APPS_JDBC_URL
DB_HOST

Tuesday, June 3, 2008

Create A Production (Full or Partial) Duplicate On The Same Host

Applies to:
Oracle Server Enterprise Edition: 9.X,10.X
Goal
How To Create A Production (Full or Partial) Duplicate On The Same Host using RMAN
Solution
Primary DB : ORCL
Clone DB : AUX
Production Database should be archive enabled.
Startup mount;
alter database archivelog;
alter database open;
archive log list;
Recovery catalog for RMAN
Creating the Recovery Catalog Owner
Start by creating a database schema (usually called rman). Assign an appropriate tablespace to it and grant it the recovery_catalog_owner role. Look at this example:
% sqlplus '/ as sysdba'SQL> CREATE USER rman IDENTIFIED BY rman DEFAULT TABLESPACE tools TEMPORARY TABLESPACE temp QUOTA UNLIMITED ON tools; SQL> GRANT CONNECT, RECOVERY_CATALOG_OWNER TO rman;
Creating the Recovery Catalog
% rman catalog rman/rman@ORCLRMAN> CREATE CATALOG;
Registering the target database
% rman TARGET / CATALOG rman/rman@ORCLRMAN> REGISTER DATABASE;
Reference : Note:452529.1
Reference : RMAN: How to Query the RMAN Recovery Catalog ( Note:98342.1 )
Example Source Listener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /newpart//product/10.2.0/)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME = ORCL)
(ORACLE_HOME = /newpart//product/10.2.0)
(SID_NAME = ORCL)
)
(SID_DESC =
(GLOBAL_DBNAME = AUX)
(ORACLE_HOME = /newpart//product/10.2.0)
(SID_NAME = AUX)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = test.oneapps.com)(PORT = 1521))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
)
Example Source tnsnames.ora
AUX =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = test.oneapps.com)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = AUX)(UR=A)
)
)
ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = test.oneapps.com)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = ORCL)
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
Note : Make use of netca and netmgr to configure listener and tnsnames
# Find Production Database Files:
SQL> select name from v$datafile;
Create the Auxiliary Database directories needed
cd $ORACLE_HOME/dbs
create parameter file initAUX.ora
db_file_name_convert = ('/old/path1', '/new/path1',
'/old/path2', '/new/path2',
'/old/path3', '/new/path3')
log_file_name_convert = ('/old/path1', '/new/path1',
'/old/path2', '/new/path2',
'/old/path3', '/new/path3')
eg:-
db_name = aux
db_block_size = 8192
compatible = 10.2.0.1.0
remote_login_passwordfile = exclusive
control_files = ('/newpart/oradata/aux/control01.ctl',
'/newpart/oradata/aux/control02.ctl')
db_file_name_convert = ('/newpart/oradata/orcl',
'/newpart/oradata/aux')
log_file_name_convert = ('/newpart/oradata/orcl',
'/newpart/oradata/aux')
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
# create a passwordfile for remote connections as sysdba
% orapwd password= file=orapwAUX
% sqlplus /nolog
SQL> connect / as sysdba
SQL> startup nomount pfile=$ORACLE_HOME/dbs/initAUX.ora
SQL> exit
Start the Duplication
ORACLE_SID=AUX; export ORACLE_SID # ksh
sqlplus /nolog
SQL> connect / as sysdba
Connected to an idle instance
SQL> startup nomount pfile=$ORACLE_HOME/dbs/initAUX.ora
SQL> exit
# Set your SID back to the TARGET for duplication.
> rman trace.log
Recovery Manager: Release 10.2.0.1.0 - Production
Copyright (c) Oracle. All rights reserved.
RMAN> connect target
connected to target database: V10GREL4 (DBID=2510891965)
RMAN>backup database;
RMAN>sql 'alter system switch logfile';
RMAN> connect auxiliary sys/pwd@AUX
connected to auxiliary database: AUX (not mounted)
RMAN> duplicate target database to AUX device type disk;
Once this is done, login to duplicate database with alter database open resetlogs.