Sunday, 22 June 2014

EBS r12 Forms are not opening in linux?

Below issue can be easily resolve in windows just by installing oaj2se.exe but in linux it is not an easier one.

In order to access this application, you must install the J2SE Plugin version 1.6.0_07 on your client and NPX_PLUGIN_PATH environment variable is set before starting Netscape. To install this plugin, click here to download the oaj2se.exe executable. Once the download is complete, double-click the oaj2se.exe file to install the plugin. You will be prompted to restart your browser when the installation is complete.

If you get the issue below first try the below :

http://onlineappsdba.com/index.php/2007/10/12/access-oracle-apps-r12-11i-from-linux-client-mozilla-firefox/

But the above one dint work out for me. My mozilla and oel were 64-bit so i did the below :

When you done with the plugin installation, issue about:plugins and check whether your installed jre plugin is showing in mozilla. if it does you can access the forms.


To know the recommended jre plugin version issue the below :

[oracle@dev186 scripts]$ grep plugin $CONTEXT_FILE
         <!-- JDK plugins -->
         <sun_plugin_ver oa_var="s_sun_plugin_ver">1.6.0_07</sun_plugin_ver>
         <sun_plugin_type oa_var="s_sun_plugin_type">jdk</sun_plugin_type>


Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110621 Oracle/3.6-1.0.1.el5_6 Firefox/3.6.18

Download and install the below : (Make sure you os bit version when you download)

install ---> jre-6u33-linux-x64.bin

Since my os were 64 bit we must create soft link to /usr/lib64 folder instead of /usr/lib
go to /usr/lib64/mozilla/plugins

Create softlink as below :
ln -s /oracle/jre1.6.0_33/lib/amd64/libnpjp2.so  .

libnpjp2.so -> /oracle/jre1.6.0_33/lib/amd64/libnpjp2.so

Once you are done, make sure you see your installed plugin in mozilla. to check issue about:plugins in mozilla URL.

If you see it you should be able to access forms now.

Enjoy EBS :)

Apps DBA interview questions

Interview questions

First round :
                                                                                                             
What is local inventory and global inventory?
What is Global Inventory ?
Global Inventory holds information about Oracle Products on a Machine. These products can be various oracle components like database, oracle application server, collaboration suite, soa suite, forms & reports or discoverer server . This global Inventory location will be determined by file oraInst.loc in /etc (on Linux) or /var/opt/oracle (solaris). If you want to see list of oracle products on machine check for file inventory.xml under ContentsXML in oraInventory
What is Local Inventory ?
Inventory inside each Oracle Home is called as local Inventory or oracle_home Inventory. This Inventory holds information to that oracle_home only.
How to enable archivelog?
To turn the database into archivelog mode we have to keep the database in mount state then issue the below :
SQL>alter database archivelog;
How to enable flashback?
Note : To keep your db into flashback mode your db should be running in archivelog mode.
Like archivelog mode keep the db in mount state the issue the below :
SQL>alter database flashback ON;
What is incremental back up in rman?
Level 0 and Level 1 Incremental Backups
Incremental backups can be either level 0 or level 1. A level 0 incremental backup, which is the base for subsequent incremental backups, copies all blocks containing data, backing the datafile up into a backup set just as a full backup would. The only difference between a level 0 incremental backup and a full backup is that a full backup is never included in an incremental strategy.
A level 1 incremental backup can be either of the following types:
A differential backup, which backs up all blocks changed after the most recent incremental backup at level 1 or 0
A cumulative backup, which backs up all blocks changed after the most recent incremental backup at level 0
Incremental backups are differential by default.

Note:
Cumulative backups are preferable to differential backups when recovery time is more important than disk space, because during recovery each differential backup must be applied in succession. Use cumulative incremental backups instead of differential, if enough disk space is available to store cumulative incremental backups.
Package name to clean up fnd_nodes?
Fnd_conc_clone.setup_clean
SQL> EXEC FND_CONC_CLONE.SETUP_CLEAN;
COMMIT;
EXIT;
It will delete all old data from the table. Run AutoConfig on all tiers, firstly on the DB tier and then the APPS tiers to repopulate the required system tables.
Note : When EXEC FND_CONC_CLONE.SETUP_CLEAN is executed various tables are purged.
To know which tables are purged/cleaned we can view $FND_TOP/patch/115/sql/AFCPCLNB.pls

Ebs architecture and its components?
In EBS R12, various servers or services are distributed among the following three levels, or tiers.
The Desktop Tier
The Application Tier
The Database Tier

Oracle E-Business Suite Release 12 Architecture
1] The Desktop Tier
The client interface is provided through HTML for HTML-based applications, and via a Java applet in a Web browser for the traditional Forms-based applications.
In Oracle Applications Release 12, each user logs in to Oracle Applications through the E-Business Suite Home Page on a desktop client web browser. The E-Business Suite Home Page provides a single point of access to HTML-based applications, Forms-based applications, andBusiness Intelligence applications.
Oracle JInitiator will no longer be required to run Oracle Forms in E-Business Suite Release 12.  Oracle Forms in Release 12 will run directly in the native Sun Java2 Standard Edition plug-in.
The Forms client applet is a general-purpose presentation applet that supports all Oracle Applications Forms-based products, including those with customizations and extensions. The Forms client applet is packaged as a collection of Java Archive (JAR) files. The JAR files contain all Java classes required to run the presentation layer of Oracle Applications forms.
2] The Application Tier
The application tier has a dual role: hosting the various servers and service groups that process the business logic, and managing communication between the desktop tier and the database tier. This tier is sometimes referred to as the middle tier.
Four servers or service groups comprise the basic application tier for Oracle Applications:

Web services
Forms services
Concurrent Processing server
Admin server
3] The Database Tier
The database tier contains the Oracle database server, which stores all the data maintained by Oracle Applications. The database also stores the Oracle Applications online help information. More specifically, the database tier contains the Oracle data server files and Oracle Applications database executables that physically store the tables, indexes, and other databaseobjects for your system. The database server does not communicate directly with the desktop clients, but rather with the servers on the application tier, which mediate the communications between the database server and the clients.
How to clone using RMAN?
Cloning can be done in two ways :
Active duplication method
Backup and restore method



How to enable autoconfig?
Enable Autoconfig in New Oracle Home
Autoconfig will not be enabled on the database tier when
1.Database tier not created by Rapid Install
2.Cross platform migration of the database tier
3.Upgrading to 11g Database
4.Upgrading the database tier from Applications 11i to E-Business Suite Release 12
Confirm if latest autoconfig patch is applied on apps Tier
If your instance is on 12.0.X and is not upgraded to 10.1.3.3 AS patchset, Patch 4585869 needs to be applied in order to use the adbldxml utility.
Copy AutoConfig to the RDBMS ORACLE_HOME
Log in to the APPL_TOP environment (source the environment file)
Create appsutil.zip file
perl AD_TOP/bin/admkappsutil.pl
This will create appsutil.zip in INST_TOP/admin/out
On the database tier (as the ORACLE user)
Copy or FTP the appsutil.zip file to the RDBMS ORACLE_HOME
cd RDBMS ORACLE_HOME
unzip -o appsutil.zip
Run AutoConfig on the database tier and then on the applications tier
Download Jre from
http://java.sun.com/javase/downloads/index_jdk5.jsp
Install JRE on the Database tier
under ORACLE_HOME/appsutil directory created in above step.
Jre is required by adbldxml.pl to build the context_name.xml for database
cd [ORACLE_HOME]/appsutil/
mkdir jre
cd jre
Install the downloaded latest update of JRE 5.0

./jre_xxx_xxx.bin
As the apps tier jdk is on jdk 5 version ,
I decided to install the same version on db Tier
and later as part of the JDk upgrade I willl upgrade both the tiers to JDK 6 as required for the APPS upgrade.
I have tried copying the jre directory from 10g Oracle_home which worked fine.
Generate the Database Context File
perl RDBMS_ORACLE_HOME/appsutil/bin/adbldxml.pl
Run Autoconfig.
This builds the context_name.env file required by Apps Database under RDBMS_ORACLE_HOME.
$ tnsping SID
from apps tier to confirm the connectivity of database.

What is the new background process introduced in terms of memory management in oracle 11g?
MMON & MMNL – Manageability Monitor and Manageability Monitor Lite
MMON performs tasks related to AWR such as taking snapshots, capturing statistics value for recently modified SQL objects and writes when a metric violates its threshold value.
MMNL writes statistics from the Active Session History (ASH) buffer in the SGA to disk. MMNL writes to disk when the ASH buffer is full.
MMAN – Memory Manager
Responsible for managing instance memory based on the workloads.
Note : above background processes are introduces in 10g itself which still can be used in 11g also.

How clone from multi node to single node?
Two Node to Single Node
Two Node to Single Node is a interesting concept, if the db and application is separate
then Two Node to Single Node is very simple, you copy db first and application second.
In the below example where application tier is present in both the nodes then is becomes
challenging. Most of companies need it, there production environment is very complex
but they cannot give the same in the development for patches and testing purposes. I have
seen a environment where they have 4 node E-business system running on RAC but they
have single node for patching, testing etc.
This configuration is not supported by Oracle but his been tested in our environment,
unless tested properly don’t apply in production; this site is not responsible for any data
loss.


Here are the steps.
1> DB,cps, admin on one node
2> Web and forms on second node
3> Run preclone on second node - WEB/FORMS
4> Update snapshot on both nodes, web first (optional)
5> copy visappl/viscomn/visora to the first node (db node) in new directory
6> Remove viscomn/visora in the first node (db node)
7> Merge appltop
 scp -rp visappl/* /d01/oracle/visappl (no prompt)
8> cp viscomn/visora to /d01/oracle/
9> Run Postclone on the DB node (application tier)
10> Open application xml file and change all parameters "Yes"
 <TIER_DB oa_var="s_isDB">YES</TIER_DB>
 <TIER_ADMIN oa_var="s_isAdmin">YES</TIER_ADMIN>
 <TIER_WEB oa_var="s_isWeb">YES</TIER_WEB>
 <TIER_FORMS oa_var="s_isForms">YES</TIER_FORMS>
 <TIER_NODE oa_var="s_isConc">YES</TIER_NODE>
 <TIER_FORMSDEV oa_var="s_isFormsDev">YES</TIER_FORMSDEV>
 <TIER_NODEDEV oa_var="s_isConcDev">YES</TIER_NODEDEV>
 <TIER_WEBDEV oa_var="s_isWebDev">YES</TIER_WEBDEV>
<TIER_ADADMIN oa_var="s_isAdAdmin">YES</TIER_ADADMIN>
<TIER_ADNODE oa_var="s_isAdConc">YES</TIER_ADNODE>
<TIER_ADNODEDEV oa_var="s_isAdConcDev">YES</TIER_ADNODEDEV>
 <oa_process_status oa_var="s_apcstatus">enabled</oa_process_status>
 <oa_process_status oa_var="s_concstatus">enabled</oa_process_status>
11> Run AutoConfig


For the below I could not get exact answers, so I am just listing out the questions alone.
What is your backup strategies?
What will you do if you get 404 not found error?
Patching naming convention?


Second Round :

What was your role in this implementation project?
what are the issues you faced in installation?
what will you do if an adpatch is taking longer time than usual? (for ex. one hour running patch is taking 2 hrs to rum?
what will you do if form services are not working?
if apps performance is slow what will you do?
what will you do if a system tbls during cfgclone?
when conc requests are hanging what will you do to submit new requests?
what are the issues faced in middle tier during upgrade?
what will you do if conc services are not running?
what is inst top?
tell me steps in ebs r12 installation?
when adpreclone is running should db up?
how will you clone? issues you faced?
diff between fnd_conc_clone.setup_clean and cmclean?
when  you clone what are all directories you copy?
what tools do you use migrate code?

*************************************************************

First round :

Diff between local and global inventory?
Rman cloning?
how to export histograms from one db to another db?
if a concurrent is in peding standby state, will that session will be active in os level?
will adpatch take a backup of existing files?
If you get a slow running query what will you do from your end?
concurrent request name which purges concurrent request? and parameters?
DG modes?
What are three mandatory parameters in goldengate?
what is the disadvantage of applying hotpatch?
backup strategy? what are diff types of incremental backups?
how will you do upgrade from 12.0.4 to 12.1.1?
sleep seconds in cache size in concurrent?
if you installed a new service how will you register in client side?
your faced issues??
what does adpatch do?
adadmin and various options?
what rapidclone does and what is dbtechstack?























Saturday, 7 June 2014

Step by step Oracle EBS R12 installation




Step by step oracle ebs r12 installation. 

 Version : 12.1.1
OS : OEL 5.9 64-bit

Oracle ebs installation contains three phases,
1) Pre-requisites
2) Installation
3) Post installation 

Pre-requisites :




Please check the following in support.oracle.com for detail information,
Oracle E-Business Suite Installation and Upgrade Notes Release 12 (12.1.1) for Linux x86-64 (Doc ID 761566.1)
Let me just briefly explain needed steps.
Make sure you have the following rpm's in your server,
To know whether the rpm is installed or to find version, issue the below :
root@dev 186] rpm -qa | grep openmotif21
To install any rpm,
root@dev 186] rpm -ivh filename
root@dev 186] rpm -ivh filename --nodeps (Force installation)

RPM's needed for oel 5+ :
openmotif21-2.1.30-11.EL5.i3861 (**Note : This rpm version should be same as specified else you will not able to open forms. Replace recommended version eventhough you have higher version)
    xorg-x11-libs-compat-6.8.2-1.EL.33.0.1.i386
    For Update 1 or 2:
        binutils-2.17.50.0.6-6.0.1.x86_642
    For Update 3:
        binutils-2.17.50.0.6-9.0.1.x86_642
    For Update 4 (5.4) or higher, see workaround listed below in the 'After Installing or Upgrading' section.
Additionally, the following rpm needs to be installed from the Oracle Linux 5 or RHEL 5 distribution media on the application tier:
    libXrender-0.9.1-3.1.i386
If not using the pre-install rpm, the following packages must be installed from the Oracle Linux 5 or RHEL 5 distribution media on both application and database tiers:
    gcc-4.1.2-14.el5.x86_64
    gcc-c++-4.1.2-14.el5.x86_64
    glibc-2.5-18.i686 (32-bit)
    glibc-2.5-18.x86_64
    glibc-common-2.5-18.x86_64
    glibc-devel-2.5-18.i386 (32-bit)
    glibc-devel-2.5-18.x86_64
    libgcc-4.1.2-14.el5.i386
    libgcc-4.1.2-14.el5.x86_64
    libstdc++-devel-4.1.2-14.el5.i386
    libstdc++-devel-4.1.2-14.el5.x86_64
    libstdc++-4.1.2-14.el5.i386
    libstdc++-4.1.2-14.el5.x86_64
    libXi-1.0.1-3.1.i386
    libXp-1.0.0-8.1.el5.i386
    libXp-1.0.0-8.1.el5.x86_64
    libaio-0.3.106-3.2.i386
    libaio-0.3.106-3.2.x86_64
    libgomp-4.1.2-14.el5.x86_64
    make-3.81-1.1.x86_64
    gdbm-1.8.0-26.2.1.i386
    gdbm-1.8.0-26.2.1.x86_64
    sysstat-7.0.0-3.el5.x86_64
    util-linux-2.13-0.45.el5.x86_64
    compat-libstdc++-296-2.96-138.i386
    compat-libstdc++-33-3.2.3-61.i386
Additionally, the following RPMs are required for an 11gR1 Database (which is bundled with the 12.1.1 release) on the database tier:
    compat-libstdc++-33-3.2.3-61.x86_64
    elfutils-libelf-devel-0.125-3.el5.x86_64
    elfutils-libelf-devel-static-0.125-3.el5.x86_64
    libaio-devel-0.3.106-3.2.x86_64
    unixODBC-2.2.11-7.1.i386
    unixODBC-devel-2.2.11-7.1.i386
    unixODBC-2.2.11-7.1.x86_64
    unixODBC-devel-2.2.11-7.1.x86_64

Make sure you have all oracle recommended requirements and make an entry in /etc/hosts


ipaddress domainname localhost
192.168.XX.XX dev186.sample.com dev186
Once all prerequisites are done, start the installation.
Installation


$ cd /u01/StageR12/startCD/Disk1/rapidwiz/
$ ./rapidwiz


 It will invoke GUI if you are getting any java exception error, connect as root and issue xhost + in a separate terminal.

Check the snagits below for ebs r12 installation

It will initially displays tech stack components.



select install option
 Decline license agreement.

Select create new configuration option, which will create a new config.txt file which is the input for installation. This file will have the configuration information which you are going to install.
Load new configuration is used for shared or non-shared file system installation. 


select any port pool value.
 Provide SID, hostname, domainname and base directory. --> Details of db node.
 Provide SID, hostname, domainname and base directory. --> Details of db node.









Once installation successfull, click connect button which will launch application.

Please follow post-installation steps as per need.

 

Step by step dataguard configuration (Physical standby database configuration)

Step by step dataguard configuration

In this exercise I have provided steps in detailed manner to build physical standby database in oracle 11g. We will be doing standby setup in the following servers.
DB details :

    SID    DB_Unique_Name    Service Name
Primary    Primary    Primary    PRIMARY
Standby    Primary    Standby    STANDBY

Prerequisites for primary server :

- Primary should be running in archive log mode and Force logging should be enabled as below


Please issue the below to check whether db is running in archive log mode or no archive log mode :

SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST

Please issue the below to check whether db is running in force_logging mode :

SQL> select FORCE_LOGGING from v$database;

FOR
---
YES

In case your db is running in noarchivelog mode and non-force logging mode follow the below :

Before issuing the queries below make sure to keep your db in mount state :

SQL> alter database archivelog enable;

SQL>alter database force logging;

make sure you have  connectivity between primary and standby servers.

From primary :

[oracle@dev186 oracle]$ ping 192.168.55.34

From standby :

[oracle@dev186 oracle]$ ping 192.168.55.42



Primary listener file : (/oracle/11g/11gr2/network/admin/listener.ora)


# listener.ora Network Configuration File: /oracle/11g/11gr2/network/admin/listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER_PRIMARY = (SID_LIST = (SID_DESC =(SID_NAME = primary) (ORACLE_HOME = /oracle/11g/11gr2)))

INBOUND_CONNECT_TIMEOUT_LISTENER = 0


LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = dev186.chainsys.com)(PORT = 1521))
    )
  )

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = primary)
      (ORACLE_HOME = /oracle/11g/11gr2)
     )
  )
ADR_BASE_LISTENER = /oracle/11g









TNS files : (/oracle/11g/11gr2/network/admin/tnsnames.ora)

# tnsnames.ora Network Configuration File: /oracle/11g/11gr2/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

PRIMARY =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = dev186.chainsys.com)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = PRIMARY)
    )
  )

LISTENER_PRIMARY =
  (ADDRESS = (PROTOCOL = TCP)(HOST = dev186.chainsys.com)(PORT = 1521))


STANDBY =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = dev201.chain-sys.com)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = STANDBY)
    )
  )

Once you have updated both the listener and tnsnames files, start the listener in both the servers and check the below :

Primary :

[oracle@dev186 oracle]$  lsnrctl start

to check status,

[oracle@dev186 oracle]$ lsnrctl status

Standby :

[oracle@dev201 oracle]$ lsnrctl start

once listener is up issue the below and check the connectivity

[oracle@dev186 oracle]$tnsping primary
[oracle@dev186 oracle]$tnsping standby





In order to configure dataguard, your primary and standby should use same password file. Create a new password file if you dont remember current sys password else you can move  the current password file to standby as below :


[oracle@dev186 oracle]$ cd $ORACLE_HOME

[oracle@dev186 11gr2]$ cd dbs

[oracle@dev186 dbs]$ ls

hc_clone.dat  hc_primary.dat  initCLONE.ora    initstandby.ora  lkSTANDBY     redo.sql          spfileprimary.ora
hc_DBUA0.dat  hc_standby.dat  init.ora         lkCLONE          orapwprimary  snapcf_primary.f
hc_orcl.dat   initclone.ora   initPRIMARY.ora  lkPRIMARY        primary.ora   spfileclone.ora

[oracle@dev186 dbs]$ scp orapwprimary oracle@192.168.55.34:/oracle/11g/product/11.2.0/dbhome_1/dbs/ orapwstandby

Add standby redo logs  :

SQL>alter database add standby logfile group 4 ‘/oracle/11g/flash_recovery_area/PRIMARY/onlinelog/log4a.log’ size 500M;

Database altered.



Update required parameters in primary pfile. Your primary pfile should be as below :

Primary pfile = $ORACLE_HOME/dbs/initprimary.ora


initPRIMARY.ora :

primary.__db_cache_size=520093696
primary.__java_pool_size=16777216
primary.__large_pool_size=16777216
primary.__oracle_base='/oracle/11g'#ORACLE_BASE set from environment
primary.__pga_aggregate_target=771751936
primary.__sga_target=855638016
primary.__shared_io_pool_size=0
primary.__shared_pool_size=285212672
primary.__streams_pool_size=0
*.audit_file_dest='/oracle/11g/admin/primary/adump'
*.audit_trail='db'
*.compatible='11.2.0.0.0'
*.control_files='/oracle/11g/oradata/PRIMARY/controlfile/o1_mf_9q0v8cyw_.ctl','/oracle/11g/flash_recovery_area/PRIMARY/controlfile/o1_mf_9q0v8d1v_.ctl'
*.db_block_size=8192
*.db_create_file_dest='/oracle/11g/oradata'
*.db_domain=''
*.db_name='primary'
*.db_recovery_file_dest='/oracle/11g/flash_recovery_area'
*.db_recovery_file_dest_size=5242880000
*.DB_UNIQUE_NAME='primary'
*.diagnostic_dest='/oracle/11g'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=primaryXDB)'
*.FAL_SERVER='standby'
*.local_listener='LISTENER_PRIMARY'
*.LOG_ARCHIVE_CONFIG='DG_CONFIG=(primary,standby)'
*.LOG_ARCHIVE_DEST_1='LOCATION=USE_DB_RECOVERY_FILE_DEST VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=primary'
*.LOG_ARCHIVE_DEST_2='SERVICE=standby LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=standby'
*.LOG_ARCHIVE_DEST_STATE_1='ENABLE'
*.LOG_ARCHIVE_DEST_STATE_2='ENABLE'
*.LOG_ARCHIVE_MAX_PROCESSES=30
*.memory_target=1613758464
*.open_cursors=300
*.processes=150
*.REMOTE_LOGIN_PASSWORDFILE='EXCLUSIVE'
*.STANDBY_FILE_MANAGEMENT='AUTO'
*.undo_tablespace='UNDOTBS1'


initstandby.ora :

primary.__db_cache_size=671088640
primary.__java_pool_size=16777216
primary.__large_pool_size=16777216
primary.__oracle_base='/oracle/11g'#ORACLE_BASE set from environment
primary.__pga_aggregate_target=654311424
primary.__sga_target=973078528
primary.__shared_io_pool_size=0
primary.__shared_pool_size=251658240
primary.__streams_pool_size=0
*.audit_file_dest='/oracle/11g/admin/standby/adump'
*.audit_trail='db'
*.compatible='11.2.0.0.0'
*.control_files='/oracle/11g/oradata/standby/control01.ctl','/oracle/11g/flash_recovery_area/standby/control02.ctl'
*.db_block_size=8192
*.db_create_file_dest='/oracle/11g/oradata/standby'
*.db_domain=''
*.db_name='primary'
*.db_recovery_file_dest='/oracle/11g/flash_recovery_area'
*.db_recovery_file_dest_size=5242880000
*.diagnostic_dest='/oracle/11g'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=standbyXDB)'
*.local_listener='LISTENER_STANDBY'
*.memory_target=1613758464
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'
DB_UNIQUE_NAME='standby'
LOG_ARCHIVE_CONFIG='DG_CONFIG=(primary,standby)'
LOG_ARCHIVE_DEST_1='LOCATION=USE_DB_RECOVERY_FILE_DEST VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=standby'
LOG_ARCHIVE_DEST_2='SERVICE=primary LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=primary'
LOG_ARCHIVE_DEST_STATE_1=ENABLE
LOG_ARCHIVE_DEST_STATE_2=ENABLE
REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE
LOG_ARCHIVE_MAX_PROCESSES=30
FAL_SERVER=standby
#db_create_online_log_dest_1='/oracle/11g/oradata/standby'
STANDBY_FILE_MANAGEMENT=AUTO
db_file_name_convert=('/oracle/11g/oradata/PRIMARY','/oracle/11g/oradata/STANDBY')
log_file_name_convert=('/oracle/11g/oradata/PRIMARY','/oracle/11g/oradata/STANDBY')

Once you have updated standby pfile, bring up standby instance to nomount state.

[oracle@dev201 dbs]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sat Jun 7 12:06:04 2014

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

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

Your instance should be started without any error.


Next, we have to clone primary db from primary server to standby server. In order to achieve this, we can use any of the cloing of the method as per our covenience. Here we will use duplicate statement to replicate db. Make sure you have updated the parameters below in standby pfile if your directory structure is different.

db_file_name_convert='/oracle/11g/oradata/STANDBY','/oracle/11g/oradata/PRIMARY'
log_file_name_convert='/oracle/11g/oradata/STANDBY','/oracle/11g/oradata/PRIMARY'







Take backup of primary database and controlfile using RMAN as below :

[oracle@dev186 oracle]$ rman target /

Recovery Manager: Release 11.2.0.1.0 - Production on Sat Jun 7 12:14:37 2014

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

connected to target database: PRIMARY (DBID=1684851363)


RMAN> backup current controlfile for standby;

Starting backup at 07-JUN-14
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=147 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including standby control file in backup set
channel ORA_DISK_1: starting piece 1 at 07-JUN-14
channel ORA_DISK_1: finished piece 1 at 07-JUN-14
piece handle=/oracle/11g/flash_recovery_area/PRIMARY/backupset/2014_06_07/o1_mf_ncnnf_TAG20140607T121717_9s5fcrs3_.bkp tag=TAG20140607T121717 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 07-JUN-14

RMAN> backup database plus archivelog;

Starting backup at 07-JUN-14
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/oracle/11g/oradata/PRIMARY/datafile/o1_mf_system_9q0v6hgo_.dbf
input datafile file number=00002 name=/oracle/11g/oradata/PRIMARY/datafile/o1_mf_sysaux_9q0v6hkx_.dbf
input datafile file number=00005 name=/oracle/11g/oradata/PRIMARY/datafile/o1_mf_example_9q0v8sz0_.dbf
input datafile file number=00003 name=/oracle/11g/oradata/PRIMARY/datafile/o1_mf_undotbs1_9q0v6hl7_.dbf
input datafile file number=00004 name=/oracle/11g/oradata/PRIMARY/datafile/o1_mf_users_9q0v6hm1_.dbf
channel ORA_DISK_1: starting piece 1 at 07-JUN-14

Starting backup at 07-JUN-14
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=71 RECID=87 STAMP=849615566
channel ORA_DISK_1: starting piece 1 at 07-JUN-14
channel ORA_DISK_1: finished piece 1 at 07-JUN-14
piece handle=/oracle/11g/flash_recovery_area/PRIMARY/backupset/2014_06_07/o1_mf_annnn_TAG20140607T121926_9s5fhp63_.bkp tag=TAG20140607T121926 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 07-JUN-14


once backup is finished, Move all your backup including controlfile backup to standby server using scp command. Move all backup pieces to flash_recovery_area in standy server.

FRA ==> /oracle/11g/flash_recovery_area but your backup pieces should be in the below as same as primary server, 

Move backup pieces to the follwing in standby server --> oracle/11g/flash_recovery_area/PRIMARY/backupset/2014_06_06


Before we duplicate standby db we have create following directory structure into standby server.

[oracle@dev201 oracle]$ mkdir -pr oracle/11g/flash_recovery_area/PRIMARY/backupset/2014_06_06

[oracle@dev201 oracle]$ mkdir -pr oracle/11g/flash_recovery_area/PRIMARY/onlinelog


[oracle@dev201 oracle]$ mkdir -pr oracle/11g/oradata/standby

Now connect both target and auxiliary servers using RMAN,


[oracle@dev201 trace]$ rman

Recovery Manager: Release 11.2.0.1.0 - Production on Sat Jun 7 12:27:59 2014

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

RMAN> connect auxiliray /

connected to target database: PRIMARY (DBID=1684851363)

RMAN> connect target sys/sys@primary

connected to auxiliary database: PRIMARY (DBID=1684851363)

RMAN> duplicate target database for standby nofilenamecheck dorecover;

once done.

Start MRP process in standby database,

SQL> alter database recover managed standy database disconnect;

once you issued, mrp bg process will be started in standby, confirm be the below :

[oracle@dev201 STANDBY]$ ps -ef | grep mrp

oracle    9543     1  0 09:28 ?        00:00:01 ora_mrp0_standby

once MRP process have been stared in standby, our standby db is all set receive redo log changes from primary. Now manually switch log file and check archive log sequences to make sure both have same count.

Connect to primary db and issue the below :

SQL>alter system switch logfile;

SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     72
Next log sequence to archive   74
Current log sequence           74

Connect to standy db and issue the below :

SQL>archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     72
Next log sequence to archive   0
 Current log sequence           74




Check both the primary and standby alert logs for any errors. If not we have successfully configured physical standby and we can confirm it by the following queries,

DG Queries  :

Issue the following query to show information about the protection mode, the protection level, the role of the database, and switchover status:

SELECT DATABASE_ROLE, DB_UNIQUE_NAME INSTANCE, OPEN_MODE, PROTECTION_MODE, PROTECTION_LEVEL, SWITCHOVER_STATUS FROM V$DATABASE;

On the standby database, query the V$ARCHIVED_LOG view to identify existing files in the archived redo log.

SELECT SEQUENCE#, FIRST_TIME, NEXT_TIME FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;

Or

SELECT THREAD#, MAX(SEQUENCE#) AS "LAST_APPLIED_LOG" FROM V$LOG_HISTORY GROUP BY THREAD#;

On the standby database, query the V$ARCHIVED_LOG view to verify the archived redo log files were applied.

SELECT SEQUENCE#,APPLIED FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;

Query the physical standby database to monitor Redo Apply and redo transport services activity at the standby site.

SELECT PROCESS, STATUS, THREAD#, SEQUENCE#, BLOCK#, BLOCKS FROM V$MANAGED_STANDBY;

To determine if real-time apply is enabled, query the RECOVERY_MODE column of the V$ARCHIVE_DEST_STATUS view.

SELECT RECOVERY_MODE FROM V$ARCHIVE_DEST_STATUS;

The V$DATAGUARD_STATUS fixed view displays events that would typically be triggered by any message to the alert log or server process trace files.

SELECT MESSAGE FROM V$DATAGUARD_STATUS;

Hope this document helps! :) Happy learning! Cheers!