Wednesday, January 14, 2015

The Java.lang.OutOfMemoryError: Java Heap Space Error which means that the JVM ran out of memory

The Java.lang.OutOfMemoryError: Java Heap Space Error which means that the JVM ran out of memory and so we need to increase the value of the -Xmx to a higher value.

The recommended number of JVM's and memory will depend on how many CPU's you have on your system.

Please follow the following :

Take a backup of the file $INST_TOP/apps/SID_HOSTNAME/ora/10.1.3/opmn/conf/opmn.xml

A) Increase nprocs(JVM's) =”half of the number of CPU's you have”

It depends on the number of cpu's you have.

If you have 6 cpus in server you can increase this JVM upto “3”.

B) Now we have to increase the memory for JVM.

Here nproc is number oc4j instance.

So to find out how much memory we need to increase multiply Xms with nproc :

Xms x nproc = max memory

Note :Make sure that your application tier memory has that much free memory available.

For example if you have 6 nproc and 256 for Xms,

That means we need 256x6 which is 1536 So we need to increase Xmx to Xmx1536

Meaning :

In $INST_TOP/apps/SID_HOSTNAME/ora/10.1.3/opmn/conf/opmn.xml

server -verbose:gc –Xmx1536M -Xms256M -XX:MaxPermSize=256M -XX:NewRatio=2-XX:+PrintGC TimeStamps

Do not run autoconfig just yet just bounce all application tiers.

After you test and you are happy with the outcome you can make these changes in the context file then ran autoconfig to make the changes permanent
.

JVM: Guidelines to setup the Java Virtual Machine in Apps Ebusiness Suite 11i and R12 (Doc ID 362851.1)

Number of JVMs:
1) For OACoreGroup:
Assumption: eBusiness Suite  is running in a 2-tier environment (middle tier in a separate machine)
- Start witn no more than 100 active users per JVM/OC4J instance.
- Start with 1 active JVM/OC4J instance per CPU core, though newer/faster chip families may support more than 1 JVM/OC4J instance per CPU core, depending upon threading, memory, I/O capabilities, etc.  Confirm with appropriate hardware vendor for best results. 
- Watch out for available memory (make sure that you have enough memory to run all the configured JVMs/OC4J instances without swapping)
Note: Each 'core' in a multi-core system is considered to be a separate CPU. For example, a dual quad-core chip would be the same as stating 2 x 4 x CPU  or 8 CPUs.
In regards to hyper-threading cores, “virtual CPUs,” etc., in theory the same thing applies, but in some cases it may not equate to the exact same as a separate core.  One could tune greater then a single CPU, but not treating the same as two CPUs, four CPUs, etc., depending upon the chip architecture.  Confirm with appropriate hardware vendor for best results. 
2) For  FormsGroup:
For the forms servlet, the actual JVM/servlet usage is minimal, and a single JVM can normally handle up to 100-250 forms users.
Note: that depends on the type of forms. For more complex forms, those numbers are likely to be substantially lower
Notes: 
a) The number of jvms (oc4j in R12) is configured by the autoconfig variables s_oacore_nprocs, s_disco_nprocs, s_forms_servlet_nprocs (11i), s_forms_nprocs (R12) and s_xmlsvcs_nprocs. 
     (these variable should be updated in the $CONTEXT_FILE using the autoconfig editor from OAM)
b) In 11i, those changes are made in the $IAS_ORACLE_HOME/Apache/Jserv/etc/jserv.conf file, while in R12 in the $ORA_CONFIG_HOME/10.1.3/opmn/conf/opmn.xml

Heap Configuration:
1) For OACore, start with the following configuration:
For R12.0 and 11i:
       -Xmx512M -Xms256M -XX:MaxPermSize=128M 
       -XX:NewRatio=2 -XX:+PrintGCTimeStamps
For R12.1 and higher:
      -Xmx1024M -Xms512M -XX:MaxPermSize=256M
      -XX:NewRatio=2 -XX:+PrintGCTimeStamps

     Also, ensure you add the following parameter to the DBC file:

     JDBC\:oracle.jdbc.maxCachedBufferSize=262144

Ex:

From :-
oacore_jvm_start_options -Xmx1024M -Xms1024M
oacore_jvm_stop_options -Xmx1024M -Xms1024M
<oacore_nprocs oa_var="s_oacore_nprocs">1</oacore_nprocs>
[oracle@ svrprdsa1 admin]$ ps -ef|grep  s_oacore_nprocs $CONTEXT_FILE
                        <oacore_nprocs oa_var="s_oacore_nprocs">1</oacore_nprocs>

TO :-
oacore_jvm_start_options -Xmx1024M -Xms512M
oacore_jvm_stop_options -Xmx1024M -Xms512M
<oacore_nprocs oa_var="s_oacore_nprocs">2</oacore_nprocs>
[oracle@svrprdsa1 admin]$ ps -ef|grep  s_oacore_nprocs $CONTEXT_FILE
                        <oacore_nprocs oa_var="s_oacore_nprocs">2</oacore_nprocs>

Adjust the heap sizes accordingly to minimize garbage collection frequency and user pause times due to full garbage collections.
In JDK 1.6, the JVM detects that you have a server class machine (2 or more CPUs with 2GB or more memory), and will automatically enable Parallel Throughput Garbage Collector. The number of GC threads defaults to the number of CPUs on the machine. If you are running multiple JVMs on the same machine, or if your machine has more than 2 CPUs, to avoid the GC threads to be overly active you should reduce the number of GC threads by using:

      -XX:+UseParallelGC -XX:ParallelGCThreads=2

In most cases, using 2 GC threads should be sufficient. If you are using heap size of over 1GB, you can experiment with 4 GC threads and see if it gives you better performance. 
2) If using Forms in Servlet mode, the following configuration for FormsGroup should be enough for most of the cases:
      -Xmx256M -Xms128M -XX:MaxPermSize=128M -XX:NewRatio=2
Notes: 
a) The heap is configured by the following autoconfig variables:
    11i: s_jvm_options, s_forms_jvm_options
    R12: s_oacore_jvm_start_option, s_forms_jvm_start_options, 
    (these variable should be updated in the $CONTEXT_FILE using the autoconfig editor from OAM)
b) In 11i, those changes are made in the $IAS_ORACLE_HOME/Apache/Jserv/etc/jserv.properties file, while in R12 in the $ORA_CONFIG_HOME/10.1.3/opmn/conf/opmn.xml
Additional Recommendations:

1) R12 comes with Forms configured in servlet mode by default, because it is easier to setup if you need features like SSL. However, Forms in servlet mode may have some performance degradation, depending on the network capacity. For this reason, if performance is a concern, you may consider run Forms in socket mode, as it is more efficient than servlet mode.

2) Although the setup of those parameters can be temporarily done manually changing (jserv.conf and jserv.properties in 11i; opmn.xml in R12), the correct way to update those parameters is using the context editor, update the variables s_oacore_nprocs and s_forms_servlet_nprocs, and then run autoconfig.

3) Oracle Development recommends to be on the last ATG rollup patch, which is currently ATG-rollup7 (Note.783600.1).

4) Make sure to have the following setting in the jserv.properties (11i) or oc4j.properties file (R12) file:
wrapper.bin.parameters=-DLONG_RUNNING_JVM=true

If there is any entry in jserv.properties setting -DCACHEMODE, either comment it out or remove that entry:
#wrapper.bin.parameters=-DCACHEMODE=LOCAL

5) Check also recommended patches for Performance issues in:
Note 244040.1  - Oracle E-Business Suite Recommended Performance Patches
6) AIX accepts only the parameters "-Xmx" -Xms". The reminder of the parameters should not be used on those platforms. More 
More info about JDK parameters on AIX can be found at 
http://publib.boulder.ibm.com/infocenter/javasdk/v6r0/index.jsp?topic=%2Fcom.ibm.java.doc.60_26%2Fvm626%2FJ9%2FGC%2Fxmxoption.html

++++++++++++++++
Increasing Number of JVMs Allocated to oacore Process Causes Login Problems (Doc ID 731115.1)
monitor_jdbc_conn.sql - Script to monitor JDBC connections in Apps eBusiness Suite (Doc ID 557194.1)


1454792.1 & 1061482.1

Friday, January 9, 2015

APP-PAY-06882 and APP-FND-01388 Errors When Executing Quickpay

CHANGES

Cloned Production Instance. This is working in Production, but not in the new Test instance
  
CAUSE

The pay_action_parameter TAX_LIBRARIES is not correct. It should point to the same directory as
the LD_LIBRARY_PATH.

1.- SQL> select * from pay_action_parameters where parameter_name like 'TAX%';

PARAMETER_NAME PARAMETER_VALUE
--------------- --------------------------------------------------
TAX_LIBRARIES /Prod/applmgr/1159/pay/11.5.0/vendor/quantum/lib

 2.- echo $LD_LIBRARY_PATH
/usr/lib:/Test/applmgr/1159/pay/11.5.0/vendor/quantum/lib:/Test/product/806/network/jre11/lib/i
86/native_threads:/Test/product/806/network/jre11/lib/linux/native_threads:/Test/product/806/li
:/usr/X11R6/lib:/usr/openwin/lib:/Test/product/iAS/Apache/jdk/lib


SOLUTION

Please update path for TAX_LIBRARIES to include the fully qualified path in Test instead of Production. This
path should be the same as the $LD_LIBRARY_PATH.

Conn apps/<appspwd>

SQL> update pay_action_parameters
set PARAMETER_VALUE = '/Test/applmgr/1159/pay/11.5.0/vendor/quantum/lib'
where PARAMETER_NAME = TAX_LIBRARIES;


SQL> commit;

++++++++1186805.1++++++++

Friday, September 5, 2014

adoacorectl.sh: exiting with status 150

Error:

[oracle@svrebsal2 scripts]$ ./adoacorectl.sh stop
You are running adoacorectl.sh version 120.13
Stopping OPMN managed OACORE OC4J instance ...

adoacorectl.sh: exiting with status 206

(OR)

adoacorectl.sh: exiting with status 150

Solution :

stop all R12 procs
 
rm -rf $ORA_CONFIG_HOME/10.1.3/j2ee/oacore/persistence/*
rm -rf $ORA_CONFIG_HOME/10.1.3/j2ee/oafm/persistence/*
rm -rf $ORA_CONFIG_HOME/10.1.3/j2ee/forms/persistence/*
 
start all service again (Start the oc4j using opmnctl startall)


++++++1177323.1, 1313955.1,1557461.1+++++++++

How Does The Batch Size Affect The Number Of Parallel Update Units

While applying a patch, the patch may contain scripts that update data in batches. This prompt allows you to
specify how many rows will be updated at a time. It is recommended that you accept the
default unless you know your system well.

If you enter a negative or an invalid number, adpatch will use the default value (in this case a value of 1000).

(Or)

The Batch Size refers to the number of rows to commit at a time when cerrtain scripts run.If we dno't enter a specific value, Auto Patch takes the default, Which is normall set to a relatively smaller value to accommodate systems with a small rollback segment.


+++++++++++++Doc ID 1311402.1+++++++++++

Monday, August 11, 2014

Applying the DSTv20 update for the Oracle Database

Applying the DSTv20 update for the Oracle Database (Doc ID 1552819.1)

[oracle@pxebssdl1 ~]$ cd 16799735

[oracle@pxebssdl1 ~]$ sqlplus / as sysdba
SQL> SELECT version FROM v$timezone_file;

VERSION
----------
14

[oracle@pxebssdl1 16799735]$ ls -ltr
total 32
-rw-r--r-- 1 oracle oinstall  4583 May 29  2013 README.txt
-rw-r--r-- 1 oracle oinstall 14574 May 29  2013 README.html
drwxr-xr-x 3 oracle oinstall  4096 May 29  2013 files
drwxr-xr-x 4 oracle oinstall  4096 May 29  2013 etc
[oracle@pxebssdl1 16799735]$ $ORACLE_HOME/OPatch/opatch apply
Oracle Interim Patch Installer version 11.2.0.3.6
Copyright (c) 2013, Oracle Corporation.  All rights reserved.

Oracle Home       : /u01/oracle/PROD/db/tech_st/11.2.0.3
Central Inventory : /home/oracle/oraInventory
   from           : /u01/oracle/PROD/db/tech_st/11.2.0.3//oraInst.loc
OPatch version    : 11.2.0.3.6
OUI version       : 11.2.0.3.0
Log file location : /u01/oracle/PROD/db/tech_st/11.2.0.3/cfgtoollogs/opatch/16799735_Jul_28_2014_08_11_00/apply2014-07-28_08-11-00AM_1.log

Applying interim patch '16799735' to OH '/u01/oracle/PROD/db/tech_st/11.2.0.3'
Verifying environment and performing prerequisite checks...
All checks passed.
Provide your email address to be informed of security issues, install and
initiate Oracle Configuration Manager. Easier for you if you use your My
Oracle Support Email address/User Name.
Visit http://www.oracle.com/support/policies.html for details.
Email address/User Name:

You have not provided an email address for notification of security issues.
Do you wish to remain uninformed of security issues ([Y]es, [N]o) [N]:  Y

Backing up files...

Patching component oracle.oracore.rsf, 11.2.0.3.0...

Verifying the update...
Patch 16799735 successfully applied
Log file location: /u01/oracle/PROD/db/tech_st/11.2.0.3/cfgtoollogs/opatch/16799735_Jul_28_2014_08_11_00/apply2014-07-28_08-11-00AM_1.log

OPatch succeeded.

Step 1:

[oracle@pxebssdl1 ~]$ cd 16799735/files/oracore/zoneinfo/big
[oracle@pxebssdl1 big]$ ls -ltr
total 1116
-rwxr-xr-x 1 oracle oinstall 343167 May 29  2013 timezone_20.dat
-rwxr-xr-x 1 oracle oinstall 789973 May 29  2013 timezlrg_20.dat
[oracle@pxebssdl1 big]$ cp -p *  /u01/oracle/PROD/db/tech_st/11.2.0.3/oracore/zoneinfo/big/

[oracle@pxebssdl1 ~]$ cd 16799735/files/oracore/zoneinfo/little
[oracle@pxebssdl1 little]$ ls -ltr
total 1116
-rwxr-xr-x 1 oracle oinstall 343167 May 29  2013 timezone_20.dat
-rwxr-xr-x 1 oracle oinstall 789973 May 29  2013 timezlrg_20.dat
[oracle@pxebssdl1 little]$ cp -p * /u01/oracle/PROD/db/tech_st/11.2.0.3/oracore/zoneinfo/little

Step 2 :
++++++++++++++
Scripts to automatically update the RDBMS DST (timezone) version in an 11gR2 or 12cR1 database . (Doc ID 1585343.1)
+++++++++++++++

[oracle@pxebssdl1 DBMS_DST_scriptsV1.8]$ ls -ltr
total 60
-rw-r--r-- 1 oracle oinstall  4784 Mar 17 18:33 countTSTZdata.sql
-rw-r--r-- 1 oracle oinstall 30772 Jul 10 15:02 upg_tzv_check.sql
-rw-r--r-- 1 oracle oinstall 16931 Jul 10 15:03 upg_tzv_apply.sql
[oracle@pxebssdl1 DBMS_DST_scriptsV1.8]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Mon Jul 28 08:31:22 2014
Copyright (c) 1982, 2011, Oracle.  All rights reserved.

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

SQL> @countTSTZdata.sql

Estimating amount of TSTZ data.
This might take some time....
.
For SYS tables first...
Note: empty tables are not listed.
Owner.Tablename.Columnname - count star of that column
SYS.AQ$_ALERT_QT_S.CREATION_TIME - Count * is : 4
SYS.AQ$_ALERT_QT_S.DELETION_TIME - Count * is : 4
SYS.AQ$_ALERT_QT_S.MODIFICATION_TIME - Count * is : 4
SYS.AQ$_AQ$_MEM_MC_S.CREATION_TIME - Count * is : 3
SYS.AQ$_AQ$_MEM_MC_S.DELETION_TIME - Count * is : 3
SYS.AQ$_AQ$_MEM_MC_S.MODIFICATION_TIME - Count * is : 3
SYS.AQ$_AQ_PROP_TABLE_S.CREATION_TIME - Count * is : 1
SYS.AQ$_AQ_PROP_TABLE_S.DELETION_TIME - Count * is : 1
SYS.AQ$_AQ_PROP_TABLE_S.MODIFICATION_TIME - Count * is : 1
SYS.AQ$_KUPC$DATAPUMP_QUETAB_S.CREATION_TIME - Count * is : 1
SYS.AQ$_KUPC$DATAPUMP_QUETAB_S.DELETION_TIME - Count * is : 1
SYS.AQ$_KUPC$DATAPUMP_QUETAB_S.MODIFICATION_TIME - Count * is : 1
SYS.AQ$_SCHEDULER$_EVENT_QTAB_S.CREATION_TIME - Count * is : 1
SYS.AQ$_SCHEDULER$_EVENT_QTAB_S.DELETION_TIME - Count * is : 1
SYS.AQ$_SCHEDULER$_EVENT_QTAB_S.MODIFICATION_TIME - Count * is : 1
SYS.AQ$_SCHEDULER$_REMDB_JOBQTAB_S.CREATION_TIME - Count * is : 1
SYS.AQ$_SCHEDULER$_REMDB_JOBQTAB_S.DELETION_TIME - Count * is : 1
SYS.AQ$_SCHEDULER$_REMDB_JOBQTAB_S.MODIFICATION_TIME - Count * is : 1
SYS.AQ$_SCHEDULER_FILEWATCHER_QT_S.CREATION_TIME - Count * is : 1
SYS.AQ$_SCHEDULER_FILEWATCHER_QT_S.DELETION_TIME - Count * is : 1
SYS.AQ$_SCHEDULER_FILEWATCHER_QT_S.MODIFICATION_TIME - Count * is : 1
SYS.AQ$_SUBSCRIBER_TABLE.CREATION_TIME - Count * is : 1
SYS.AQ$_SUBSCRIBER_TABLE.DELETION_TIME - Count * is : 1
SYS.AQ$_SUBSCRIBER_TABLE.MODIFICATION_TIME - Count * is : 1
SYS.AQ$_SYS$SERVICE_METRICS_TAB_S.CREATION_TIME - Count * is : 3
SYS.AQ$_SYS$SERVICE_METRICS_TAB_S.DELETION_TIME - Count * is : 3
SYS.AQ$_SYS$SERVICE_METRICS_TAB_S.MODIFICATION_TIME - Count * is : 3
SYS.KET$_AUTOTASK_STATUS.ABA_START_TIME - Count * is : 1
SYS.KET$_AUTOTASK_STATUS.ABA_STATE_TIME - Count * is : 1
SYS.KET$_AUTOTASK_STATUS.MW_RECORD_TIME - Count * is : 1
SYS.KET$_AUTOTASK_STATUS.MW_START_TIME - Count * is : 1
SYS.KET$_AUTOTASK_STATUS.RECONCILE_TIME - Count * is : 1
SYS.KET$_CLIENT_CONFIG.FIELD_2 - Count * is : 7
SYS.KET$_CLIENT_CONFIG.LAST_CHANGE - Count * is : 7
SYS.KET$_CLIENT_TASKS.CURR_WIN_START - Count * is : 2
SYS.KET$_CLIENT_TASKS.LG_DATE - Count * is : 2
SYS.KET$_CLIENT_TASKS.LT_DATE - Count * is : 2
SYS.OPTSTAT_HIST_CONTROL$.SPARE6 - Count * is : 19
SYS.OPTSTAT_HIST_CONTROL$.SVAL2 - Count * is : 19
SYS.SCHEDULER$_EVENT_LOG.LOG_DATE - Count * is : 114
SYS.SCHEDULER$_GLOBAL_ATTRIBUTE.ATTR_TSTAMP - Count * is : 11
SYS.SCHEDULER$_JOB.END_DATE - Count * is : 14
SYS.SCHEDULER$_JOB.LAST_ENABLED_TIME - Count * is : 14
SYS.SCHEDULER$_JOB.LAST_END_DATE - Count * is : 14
SYS.SCHEDULER$_JOB.LAST_START_DATE - Count * is : 14
SYS.SCHEDULER$_JOB.NEXT_RUN_DATE - Count * is : 14
SYS.SCHEDULER$_JOB.START_DATE - Count * is : 14
SYS.SCHEDULER$_JOB_RUN_DETAILS.LOG_DATE - Count * is : 46
SYS.SCHEDULER$_JOB_RUN_DETAILS.REQ_START_DATE - Count * is : 46
SYS.SCHEDULER$_JOB_RUN_DETAILS.START_DATE - Count * is : 46
SYS.SCHEDULER$_SCHEDULE.END_DATE - Count * is : 3
SYS.SCHEDULER$_SCHEDULE.REFERENCE_DATE - Count * is : 3
SYS.SCHEDULER$_WINDOW.ACTUAL_START_DATE - Count * is : 9
SYS.SCHEDULER$_WINDOW.END_DATE - Count * is : 9
SYS.SCHEDULER$_WINDOW.LAST_START_DATE - Count * is : 9
SYS.SCHEDULER$_WINDOW.MANUAL_OPEN_TIME - Count * is : 9
SYS.SCHEDULER$_WINDOW.NEXT_START_DATE - Count * is : 9
SYS.SCHEDULER$_WINDOW.START_DATE - Count * is : 9
SYS.SCHEDULER$_WINDOW_DETAILS.LOG_DATE - Count * is : 3
SYS.SCHEDULER$_WINDOW_DETAILS.REQ_START_DATE - Count * is : 3
SYS.SCHEDULER$_WINDOW_DETAILS.START_DATE - Count * is : 3
SYS.WRI$_ALERT_HISTORY.CREATION_TIME - Count * is : 42
SYS.WRI$_ALERT_HISTORY.TIME_SUGGESTED - Count * is : 42
SYS.WRI$_ALERT_OUTSTANDING.CREATION_TIME - Count * is : 2
SYS.WRI$_ALERT_OUTSTANDING.TIME_SUGGESTED - Count * is : 2
SYS.WRI$_OPTSTAT_HISTGRM_HISTORY.SAVTIME - Count * is : 29840
SYS.WRI$_OPTSTAT_HISTGRM_HISTORY.SPARE6 - Count * is : 29840
SYS.WRI$_OPTSTAT_HISTHEAD_HISTORY.SAVTIME - Count * is : 27006
SYS.WRI$_OPTSTAT_HISTHEAD_HISTORY.SPARE6 - Count * is : 27006
SYS.WRI$_OPTSTAT_IND_HISTORY.SAVTIME - Count * is : 2131
SYS.WRI$_OPTSTAT_IND_HISTORY.SPARE6 - Count * is : 2131
SYS.WRI$_OPTSTAT_OPR.END_TIME - Count * is : 355
SYS.WRI$_OPTSTAT_OPR.SPARE6 - Count * is : 355
SYS.WRI$_OPTSTAT_OPR.START_TIME - Count * is : 355
SYS.WRI$_OPTSTAT_TAB_HISTORY.SAVTIME - Count * is : 1989
SYS.WRI$_OPTSTAT_TAB_HISTORY.SPARE6 - Count * is : 1989
Total count * of SYS TSTZ columns ROWS is : 123612
There are in total 124 SYS TSTZ columns.
.
For non-SYS tables ...
Note: empty tables are not listed.
Owner.Tablename.Columnname - count star of that column
APPLSYS.AQ$_FND_CP_GSM_IPC_AQTBL_S.CREATION_TIME - Count * is : 3
APPLSYS.AQ$_FND_CP_GSM_IPC_AQTBL_S.DELETION_TIME - Count * is : 3
APPLSYS.AQ$_FND_CP_GSM_IPC_AQTBL_S.MODIFICATION_TIME - Count * is : 3
APPLSYS.AQ$_FND_CP_GSM_OPP_AQTBL_S.CREATION_TIME - Count * is : 2
APPLSYS.AQ$_FND_CP_GSM_OPP_AQTBL_S.DELETION_TIME - Count * is : 2
APPLSYS.AQ$_FND_CP_GSM_OPP_AQTBL_S.MODIFICATION_TIME - Count * is : 2
APPLSYS.AQ$_FND_CP_TM_AQTBL_S.CREATION_TIME - Count * is : 1
APPLSYS.AQ$_FND_CP_TM_AQTBL_S.DELETION_TIME - Count * is : 1
APPLSYS.AQ$_FND_CP_TM_AQTBL_S.MODIFICATION_TIME - Count * is : 1
APPLSYS.AQ$_FND_CP_TM_RET_AQTBL_S.CREATION_TIME - Count * is : 1
APPLSYS.AQ$_FND_CP_TM_RET_AQTBL_S.DELETION_TIME - Count * is : 1
APPLSYS.AQ$_FND_CP_TM_RET_AQTBL_S.MODIFICATION_TIME - Count * is : 1
APPLSYS.AQ$_WF_CONTROL_S.CREATION_TIME - Count * is : 3
APPLSYS.AQ$_WF_CONTROL_S.DELETION_TIME - Count * is : 3
APPLSYS.AQ$_WF_CONTROL_S.MODIFICATION_TIME - Count * is : 3
APPLSYS.AQ$_WF_DEFERRED_S.CREATION_TIME - Count * is : 3
APPLSYS.AQ$_WF_DEFERRED_S.DELETION_TIME - Count * is : 3
APPLSYS.AQ$_WF_DEFERRED_S.MODIFICATION_TIME - Count * is : 3
APPLSYS.AQ$_WF_DEFERRED_TABLE_M_S.CREATION_TIME - Count * is : 3
APPLSYS.AQ$_WF_DEFERRED_TABLE_M_S.DELETION_TIME - Count * is : 3
APPLSYS.AQ$_WF_DEFERRED_TABLE_M_S.MODIFICATION_TIME - Count * is : 3
APPLSYS.AQ$_WF_ERROR_S.CREATION_TIME - Count * is : 3
APPLSYS.AQ$_WF_ERROR_S.DELETION_TIME - Count * is : 3
APPLSYS.AQ$_WF_ERROR_S.MODIFICATION_TIME - Count * is : 3
APPLSYS.AQ$_WF_IN_S.CREATION_TIME - Count * is : 3
APPLSYS.AQ$_WF_IN_S.DELETION_TIME - Count * is : 3
APPLSYS.AQ$_WF_IN_S.MODIFICATION_TIME - Count * is : 3
APPLSYS.AQ$_WF_JAVA_DEFERRED_S.CREATION_TIME - Count * is : 3
APPLSYS.AQ$_WF_JAVA_DEFERRED_S.DELETION_TIME - Count * is : 3
APPLSYS.AQ$_WF_JAVA_DEFERRED_S.MODIFICATION_TIME - Count * is : 3
APPLSYS.AQ$_WF_JAVA_ERROR_S.CREATION_TIME - Count * is : 3
APPLSYS.AQ$_WF_JAVA_ERROR_S.DELETION_TIME - Count * is : 3
APPLSYS.AQ$_WF_JAVA_ERROR_S.MODIFICATION_TIME - Count * is : 3
APPLSYS.AQ$_WF_JMS_IN_S.CREATION_TIME - Count * is : 3
APPLSYS.AQ$_WF_JMS_IN_S.DELETION_TIME - Count * is : 3
APPLSYS.AQ$_WF_JMS_IN_S.MODIFICATION_TIME - Count * is : 3
APPLSYS.AQ$_WF_JMS_JMS_OUT_S.CREATION_TIME - Count * is : 3
APPLSYS.AQ$_WF_JMS_JMS_OUT_S.DELETION_TIME - Count * is : 3
APPLSYS.AQ$_WF_JMS_JMS_OUT_S.MODIFICATION_TIME - Count * is : 3
APPLSYS.AQ$_WF_JMS_OUT_S.CREATION_TIME - Count * is : 3
APPLSYS.AQ$_WF_JMS_OUT_S.DELETION_TIME - Count * is : 3
APPLSYS.AQ$_WF_JMS_OUT_S.MODIFICATION_TIME - Count * is : 3
APPLSYS.AQ$_WF_NOTIFICATION_IN_S.CREATION_TIME - Count * is : 3
APPLSYS.AQ$_WF_NOTIFICATION_IN_S.DELETION_TIME - Count * is : 3
APPLSYS.AQ$_WF_NOTIFICATION_IN_S.MODIFICATION_TIME - Count * is : 3
APPLSYS.AQ$_WF_NOTIFICATION_OUT_S.CREATION_TIME - Count * is : 3
APPLSYS.AQ$_WF_NOTIFICATION_OUT_S.DELETION_TIME - Count * is : 3
APPLSYS.AQ$_WF_NOTIFICATION_OUT_S.MODIFICATION_TIME - Count * is : 3
APPLSYS.AQ$_WF_OUT_S.CREATION_TIME - Count * is : 3
APPLSYS.AQ$_WF_OUT_S.DELETION_TIME - Count * is : 3
APPLSYS.AQ$_WF_OUT_S.MODIFICATION_TIME - Count * is : 3
APPLSYS.AQ$_WF_REPLAY_IN_S.CREATION_TIME - Count * is : 1
APPLSYS.AQ$_WF_REPLAY_IN_S.DELETION_TIME - Count * is : 1
APPLSYS.AQ$_WF_REPLAY_IN_S.MODIFICATION_TIME - Count * is : 1
APPLSYS.AQ$_WF_REPLAY_OUT_S.CREATION_TIME - Count * is : 1
APPLSYS.AQ$_WF_REPLAY_OUT_S.DELETION_TIME - Count * is : 1
APPLSYS.AQ$_WF_REPLAY_OUT_S.MODIFICATION_TIME - Count * is : 1
APPLSYS.AQ$_WF_WS_JMS_IN_S.CREATION_TIME - Count * is : 3
APPLSYS.AQ$_WF_WS_JMS_IN_S.DELETION_TIME - Count * is : 3
APPLSYS.AQ$_WF_WS_JMS_IN_S.MODIFICATION_TIME - Count * is : 3
APPLSYS.AQ$_WF_WS_JMS_OUT_S.CREATION_TIME - Count * is : 3
APPLSYS.AQ$_WF_WS_JMS_OUT_S.DELETION_TIME - Count * is : 3
APPLSYS.AQ$_WF_WS_JMS_OUT_S.MODIFICATION_TIME - Count * is : 3
APPLSYS.AQ$_WF_WS_SAMPLE_S.CREATION_TIME - Count * is : 3
APPLSYS.AQ$_WF_WS_SAMPLE_S.DELETION_TIME - Count * is : 3
APPLSYS.AQ$_WF_WS_SAMPLE_S.MODIFICATION_TIME - Count * is : 3
APPS.AQ$_WF_BPEL_QTAB_S.CREATION_TIME - Count * is : 1
APPS.AQ$_WF_BPEL_QTAB_S.DELETION_TIME - Count * is : 1
APPS.AQ$_WF_BPEL_QTAB_S.MODIFICATION_TIME - Count * is : 1
AR.AQ$_AR_REV_REC_QT_S.CREATION_TIME - Count * is : 3
AR.AQ$_AR_REV_REC_QT_S.DELETION_TIME - Count * is : 3
AR.AQ$_AR_REV_REC_QT_S.MODIFICATION_TIME - Count * is : 3
AR.AQ$_HZ_JMS_OUT_S.CREATION_TIME - Count * is : 3
AR.AQ$_HZ_JMS_OUT_S.DELETION_TIME - Count * is : 3
AR.AQ$_HZ_JMS_OUT_S.MODIFICATION_TIME - Count * is : 3
ASO.AQ$_ASO_ORDER_FEEDBACK_T_S.CREATION_TIME - Count * is : 3
ASO.AQ$_ASO_ORDER_FEEDBACK_T_S.DELETION_TIME - Count * is : 3
ASO.AQ$_ASO_ORDER_FEEDBACK_T_S.MODIFICATION_TIME - Count * is : 3
CS.AQ$_CS_SERVICE_REQUEST_IQT_S.CREATION_TIME - Count * is : 1
CS.AQ$_CS_SERVICE_REQUEST_IQT_S.DELETION_TIME - Count * is : 1
CS.AQ$_CS_SERVICE_REQUEST_IQT_S.MODIFICATION_TIME - Count * is : 1
CS.AQ$_CS_SERVICE_REQUEST_OQT_S.CREATION_TIME - Count * is : 1
CS.AQ$_CS_SERVICE_REQUEST_OQT_S.DELETION_TIME - Count * is : 1
CS.AQ$_CS_SERVICE_REQUEST_OQT_S.MODIFICATION_TIME - Count * is : 1
OKC.AQ$_OKC_AQ_EV_TAB_S.CREATION_TIME - Count * is : 6
OKC.AQ$_OKC_AQ_EV_TAB_S.DELETION_TIME - Count * is : 6
OKC.AQ$_OKC_AQ_EV_TAB_S.MODIFICATION_TIME - Count * is : 6
PO.AQ$_PO_OTM_OUT_S.CREATION_TIME - Count * is : 3
PO.AQ$_PO_OTM_OUT_S.DELETION_TIME - Count * is : 3
PO.AQ$_PO_OTM_OUT_S.MODIFICATION_TIME - Count * is : 3
XNP.AQ$_XNP_OUT_MSG_QTAB_S.CREATION_TIME - Count * is : 3
XNP.AQ$_XNP_OUT_MSG_QTAB_S.DELETION_TIME - Count * is : 3
XNP.AQ$_XNP_OUT_MSG_QTAB_S.MODIFICATION_TIME - Count * is : 3
Total count * of non-SYS TSTZ columns ROWS is :  243
There are in total 125 non-SYS TSTZ columns.
Total Minutes elapsed : 2
SQL> @upg_tzv_check.sql
INFO: Starting with RDBMS DST update preparation.
INFO: NO actual RDBMS DST update will be done by this script.
INFO: If an ERROR occurs the script will EXIT sqlplus.
INFO: Doing checks for known issues ...
INFO: Database version is 11.2.0.3 .
INFO: Database RDBMS DST version is DSTv10 .
INFO: No known issues detected.
INFO: Now detecting new RDBMS DST version.
A prepare window has been successfully started.
INFO: Newest RDBMS DST version detected is DSTv20 .
INFO: Next step is checking all TSTZ data.
INFO: It might take a while before any further output is seen ...
A prepare window has been successfully ended.
INFO: A newer RDBMS DST version than the one currently used is found.
INFO: Note that NO DST update was yet done.
INFO: Now run upg_tzv_apply.sql to do the actual RDBMS DST update.
INFO: Note that the upg_tzv_apply.sql script will
INFO: restart the database 2 times WITHOUT any confirmation or prompt.
++++++++++++++++++++++++
SQL> @upg_tzv_apply.sql

INFO: If an ERROR occurs the script will EXIT sqlplus.
INFO: The database RDBMS DST version will be updated to DSTv20 .
WARNING: This script will restart the database 2 times
WARNING: WITHOUT asking ANY confirmation.
WARNING: Hit control-c NOW if this is not intended.
INFO: Restarting the database in UPGRADE mode to start the DST upgrade.
Database closed.
Database dismounted.
ORACLE instance shut down.
ORACLE instance started.

Total System Global Area 1068937216 bytes
Fixed Size                  2235208 bytes
Variable Size             465568952 bytes
Database Buffers          587202560 bytes
Redo Buffers               13930496 bytes
Database mounted.
Database opened.
INFO: Starting the RDBMS DST upgrade.
INFO: Upgrading all SYS owned TSTZ data.
INFO: It might take time before any further output is seen ...
An upgrade window has been successfully started.
INFO: Restarting the database in NORMAL mode to upgrade non-SYS TSTZ data.
Database closed.
Database dismounted.
ORACLE instance shut down.
ORACLE instance started.

Total System Global Area 1068937216 bytes
Fixed Size                  2235208 bytes
Variable Size             465568952 bytes
Database Buffers          587202560 bytes
Redo Buffers               13930496 bytes
Database mounted.
Database opened.
INFO: Upgrading all non-SYS TSTZ data.
INFO: It might take time before any further output is seen ...
INFO: Do NOT start any application yet that uses TSTZ data!
INFO: Next is a list of all upgraded tables:
Table list: "ASO"."AQ$_ASO_ORDER_FEEDBACK_T_S"
Number of failures: 0
Table list: "OKC"."AQ$_OKC_AQ_EV_TAB_S"
Number of failures: 0
Table list: "AR"."AQ$_AR_REV_REC_QT_S"
Number of failures: 0
Table list: "XNP"."AQ$_XNP_OUT_MSG_QTAB_S"
Number of failures: 0
Table list: "CS"."AQ$_CS_SERVICE_REQUEST_OQT_S"
Number of failures: 0
Table list: "CS"."AQ$_CS_SERVICE_REQUEST_IQT_S"
Number of failures: 0
Table list: "APPLSYS"."AQ$_WF_DEFERRED_TABLE_M_S"
Number of failures: 0
Table list: "APPLSYS"."AQ$_WF_DEFERRED_S"
Number of failures: 0
Table list: "APPLSYS"."AQ$_WF_ERROR_S"
Number of failures: 0
Table list: "APPLSYS"."AQ$_WF_REPLAY_OUT_S"
Number of failures: 0
Table list: "APPLSYS"."AQ$_WF_IN_S"
Number of failures: 0
Table list: "APPLSYS"."AQ$_WF_OUT_S"
Number of failures: 0
Table list: "APPLSYS"."AQ$_WF_REPLAY_IN_S"
Number of failures: 0
Table list: "APPLSYS"."AQ$_WF_JMS_IN_S"
Number of failures: 0
Table list: "APPLSYS"."AQ$_WF_JMS_OUT_S"
Number of failures: 0
Table list: "APPLSYS"."AQ$_WF_CONTROL_S"
Number of failures: 0
Table list: "APPLSYS"."AQ$_WF_NOTIFICATION_IN_S"
Number of failures: 0
Table list: "APPLSYS"."AQ$_WF_NOTIFICATION_OUT_S"
Number of failures: 0
Table list: "APPLSYS"."AQ$_WF_WS_JMS_IN_S"
Number of failures: 0
Table list: "APPLSYS"."AQ$_WF_JAVA_DEFERRED_S"
Number of failures: 0
Table list: "APPLSYS"."AQ$_WF_JAVA_ERROR_S"
Number of failures: 0
Table list: "APPLSYS"."AQ$_WF_WS_JMS_OUT_S"
Number of failures: 0
Table list: "APPLSYS"."AQ$_WF_JMS_JMS_OUT_S"
Number of failures: 0
Table list: "APPLSYS"."AQ$_WF_WS_SAMPLE_S"
Number of failures: 0
Table list: "APPLSYS"."AQ$_FND_CP_GSM_OPP_AQTBL_S"
Number of failures: 0
Table list: "APPLSYS"."AQ$_FND_CP_TM_RET_AQTBL_S"
Number of failures: 0
Table list: "APPLSYS"."AQ$_FND_CP_TM_AQTBL_S"
Number of failures: 0
Table list: "AR"."AQ$_HZ_JMS_OUT_S"
Number of failures: 0
Table list: "APPLSYS"."AQ$_FND_CP_GSM_IPC_AQTBL_S"
Number of failures: 0
Table list: "PO"."AQ$_PO_OTM_OUT_S"
Number of failures: 0
Table list: "APPS"."AQ$_WF_BPEL_QTAB_S"
Number of failures: 0
Table list: "AR"."AQ$_AR_REV_REC_QT_L"
Number of failures: 0
Table list: "ASO"."AQ$_ASO_ORDER_FEEDBACK_T_L"
Number of failures: 0
Table list: "PO"."AQ$_PO_OTM_OUT_L"
Number of failures: 0
Table list: "XNP"."AQ$_XNP_OUT_MSG_QTAB_L"
Number of failures: 0
Table list: "APPS"."AQ$_WF_BPEL_QTAB_L"
Number of failures: 0
Table list: "OKC"."AQ$_OKC_AQ_EV_TAB_L"
Number of failures: 0
Table list: "CS"."AQ$_CS_SERVICE_REQUEST_OQT_L"
Number of failures: 0
Table list: "CS"."AQ$_CS_SERVICE_REQUEST_IQT_L"
Number of failures: 0
Table list: "APPLSYS"."AQ$_WF_DEFERRED_TABLE_M_L"
Number of failures: 0
Table list: "APPLSYS"."AQ$_WF_DEFERRED_L"
Number of failures: 0
Table list: "APPLSYS"."AQ$_WF_ERROR_L"
Number of failures: 0
Table list: "APPLSYS"."AQ$_WF_REPLAY_OUT_L"
Number of failures: 0
Table list: "APPLSYS"."AQ$_WF_IN_L"
Number of failures: 0
Table list: "APPLSYS"."AQ$_WF_OUT_L"
Number of failures: 0
Table list: "APPLSYS"."AQ$_WF_REPLAY_IN_L"
Number of failures: 0
Table list: "APPLSYS"."AQ$_WF_JMS_IN_L"
Number of failures: 0
Table list: "APPLSYS"."AQ$_WF_JMS_OUT_L"
Number of failures: 0
Table list: "APPLSYS"."AQ$_WF_CONTROL_L"
Number of failures: 0
Table list: "APPLSYS"."AQ$_WF_NOTIFICATION_IN_L"
Number of failures: 0
Table list: "APPLSYS"."AQ$_WF_NOTIFICATION_OUT_L"
Number of failures: 0
Table list: "APPLSYS"."AQ$_WF_WS_JMS_IN_L"
Number of failures: 0
Table list: "APPLSYS"."AQ$_WF_JAVA_DEFERRED_L"
Number of failures: 0
Table list: "APPLSYS"."AQ$_WF_JAVA_ERROR_L"
Number of failures: 0
Table list: "APPLSYS"."AQ$_WF_WS_JMS_OUT_L"
Number of failures: 0
Table list: "APPLSYS"."AQ$_WF_JMS_JMS_OUT_L"
Number of failures: 0
Table list: "APPLSYS"."AQ$_WF_WS_SAMPLE_L"
Number of failures: 0
Table list: "APPLSYS"."AQ$_FND_CP_GSM_IPC_AQTBL_L"
Number of failures: 0
Table list: "APPLSYS"."AQ$_FND_CP_GSM_OPP_AQTBL_L"
Number of failures: 0
Table list: "APPLSYS"."AQ$_FND_CP_TM_RET_AQTBL_L"
Number of failures: 0
Table list: "APPLSYS"."AQ$_FND_CP_TM_AQTBL_L"
Number of failures: 0
Table list: "AR"."AQ$_HZ_JMS_OUT_L"
Number of failures: 0
INFO: Total failures during update of TSTZ data: 0 .
An upgrade window has been successfully ended.
INFO: Your new Server RDBMS DST version is DSTv20 .
INFO: The RDBMS DST update is successfully finished.
INFO: Make sure to exit this sqlplus session.
INFO: Do not use it for timezone related selects.

SQL> exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

[oracle@pxebssdl1 DBMS_DST_scriptsV1.8]$ cd
[oracle@pxebssdl1 ~]$
[oracle@pxebssdl1 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Mon Jul 28 08:44:16 2014

Copyright (c) 1982, 2011, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>  SELECT version FROM v$timezone_file;
   VERSION
----------
        20

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@pxebssdl1 ~]$

Sunday, August 10, 2014

ORA-00392: log 1 of thread 1 is being cleared, operation not allowed


SQL> alter database open RESETLOGS;
alter database open RESETLOGS
*
ERROR at line 1:
ORA-00392: log 1 of thread 1 is being cleared, operation not allowed
ORA-00312: online log 1 thread 1:
'/u01/oracle/PROD/db/apps_st/data/log01a.dbf'
ORA-00312: online log 1 thread 1:
'/u01/oracle/PROD/db/apps_st/data/log01b.dbf'

SQL> select group#,sequence#,archived,status from v$log;

    GROUP#  SEQUENCE# ARC STATUS
---------- ---------- --- ----------------
         2          0 NO  CLEARING_CURRENT
         1          0 YES CLEARING

SQL> alter database clear logfile group 1;
          Database altered.

SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-00392: log 2 of thread 1 is being cleared, operation not allowed
ORA-00312: online log 2 thread 1:
'/u01/oracle/PROD/db/apps_st/data/log02a.dbf'
ORA-00312: online log 2 thread 1:
'/u01/oracle/PROD/db/apps_st/data/log02b.dbf'

SQL> select group#,sequence#,archived,status from v$log;

    GROUP#  SEQUENCE# ARC STATUS
---------- ---------- --- ----------------
         2          0 NO  CLEARING_CURRENT
         1          0 YES UNUSED

SQL> alter database clear logfile group 2;
          Database altered.

SQL> alter database open resetlogs;

Wednesday, July 16, 2014

Creating Physical Standby using RMAN Duplicate Without Shutting down The Primary


1.Enable force logging.
2.Create SRL(standby redo logs).
3.Make proper changes in the parameter file of primary.
4.Backup the database that includes backup of datafiles, archivelogs and controlfile for standby and copy the backups to standby server.
5.Create the parameter file for standby,
6.Establish the connectivity from primary to standby.
7. Move backup to standby.
8 and 9. Start the standby instance.
10.Use RMAN Duplicate command to create the standby database.

 Verify whether the log are shipped and applied properly @the standby

STEP: 1

Enable Force Logging on primary,

SQL> ALTER DATABASE FORCE LOGGING;

NOTE: Create password file if not present, also check if archiving enabled.

STEP: 2
Configure a Standby Redo Log on primary,

SQL> ALTER DATABASE ADD STANDBY LOGFILE GROUP 3 '/u01/app/oracle/oradata/SVRPRD/log3a.log' size 50m;
SQL> ALTER DATABASE ADD STANDBY LOGFILE GROUP 4 '/u01/app/oracle/oradata/SVRPRD/log4a.log' size 50m;
SQL> ALTER DATABASE ADD STANDBY LOGFILE GROUP 5 '/u01/app/oracle/oradata/SVRPRD/log5a.log' size 50m;
SQL> ALTER DATABASE ADD STANDBY LOGFILE GROUP 6 '/u01/app/oracle/oradata/SVRPRD/log6a.log' size 50m;

NOTE:
1. To check the number of SRL,
(maximum number of logfiles for each thread + 1) * maximum number of threads
2. The SRL size equal to ORL size.

STEP :3 initSVRPRD.ora

Modify the primary initialization parameter for dataguard on primary,

SQL> show parameter LOG_ARCHIVE_CONFIG;
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
log_archive_config                   string      dg_config=("SVRPRD","SVRPRDS")

*.log_archive_config='dg_config=("SVRPRD","SVRPRDS")'
*.log_archive_dest=''
*.log_archive_dest_1='Location=/archivelogs/SVRPRD'
*.log_archive_dest_2='service=SVRPRDS valid_for=(online_logfiles, primary_role) db_unique_name="SVRPRDS"'
*.log_archive_dest_state_2='ENABLE'
*.log_archive_format='SVRPRD_%t_%s_%r.arc'
*.fal_client='SVRPRD'
*.fal_server='SVRPRDS'

Ex : use dynamically
QL>alter system set LOG_ARCHIVE_CONFIG='DG_CONFIG=(prim,stdby)';


STEP:4  // if we use active  Standby Database no need to take backup
Run the backup job at the primary by connecting to target and catalog DB(if any)

run
{
allocate channel c1 type disk;
allocate channel c2 type disk;
backup database format '/u01/app/oracle/databases/stage/%U';
backup archivelog all format '/u01/app/oracle/databases/stage/%U';
backup current controlfile for standby format '/u01/app/oracle/databases/stage/%U';
}

STEP :5

Create parameter file on primary copy it to standby and make the necessary changes,

SQL>create pfile='/u01/app/oracle/databases/prim/stage/initstdby.ora' from spfile;

Step :6 ---tnsnames.ora

Establish the connectivity,
Create net services on both primary and standby,
At prim server,

SVRPRDS =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = svrdrebsd1.singiri.com)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = SVRPRD)
    )
  )

SVRPRD =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = svrprdebsd1.singiri.com)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = SVRPRD)
    )
  )

++++++++At standby server+++++++++
# Generated by Oracle configuration tools.

SVRPRD =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = svrprdebsd1.singiri.com)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = SVRPRD)
    )
  )
SVRPRDS =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = svrdrebsd1.singiri.com)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = SVRPRD)
    )
  )

STEP : 7
Move the files to standby server,

a. Create the same directory on standby server and copy the backups.
os standby,

$mkdir -p /u01/app/oracle/databases/stage/
[oracle@raca prim]$ scp /u01/app/oracle/databases/stage/* core1.idc.oracle.com:/u01/app/oracle/databases/stage/

b. Alternatively we can copy the backups to standby different directory. On standby server connect to RMAN target as primary and auxiliary instance or if

your primary is having catalog database then connect to target as primary, catalog database and auxiliary instance. Catalog those backup pieces to let the

controlfile of primary or catalog database to know the backup information.

STEP: 8

Make the necessary changes on the copied initstdby.ora file on standby.

*.db_name='SVRPRD'
*.db_unique_name='SVRPRDS'
*.diagnostic_dest='/u01/app/oracle'
*.fal_client='SVRPRDS'
*.fal_server='SVRPRD'
*.local_listener='SVRPRD'
*.log_archive_config='dg_config=("SVRPRD","SVRPRDS")'
*.log_archive_dest=''
*.log_archive_dest_1='location=/archivelogs/SVRPRD'
*.log_archive_dest_2='service=SVRPRD valid_for=(online_logfiles, primary_role) db_unique_name="SVRPRD"'
*.log_archive_dest_state_2='ENABLE'
*.log_archive_format='SVRPRD_%t_%s_%r.arc'
*.remote_login_passwordfile='EXCLUSIVE'
*.standby_file_management='AUTO'


STEP: 9

Create standby instance,

create the same password as that of primary. Alternatively we can copy the password file from primary and rename it on standby.

For example from primary copy the password file,

scp /u01/app/oracle/dbs/opapwprim standby.idc.oracle.com:/u01/app/oracle/dbs/
on standby,

$mv orapwprim orapwstdby

Ex:
$export ORACLE_SID
$orapwd file='$ORACLE_HOME/dbs/orapwstdby' password=sys entries=10;


STEP : 10 Use RMAN duplicate for standby on standby,

Make sure listener is running on both Primary/Standby database ,

On Standby :

sqlplus / as sysdba

startup nomount pfile=$ORACLE_HOME/dbs/initSVRPRD.ora

$RMAN target /@prim catalog RMAN/RMAN@catdb auxiliary /

if no catalog database,

$RMAN target sys/<password>@prim auxiliary /

Ex :
rman target sys/svrprdmgr@SVRPRD auxiliary sys/svrprdmgr@SVRPRDS

Recovery Manager: Release 11.2.0.1.0 - Production on Thu Jul 16 01:36:08 2014

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

connected to target database: SVRPRD (DBID=1765422269)

connected to auxiliary database: SVRPRD (not mounted)

RMAN> run {
 duplicate target database for standby dorecover from active database nofilenamecheck;
 }
Starting Duplicate Db at 16-JUL-14
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=474 device type=DISK
allocated channel: ORA_AUX_DISK_2
.......

contents of Memory Script:
{
   backup as copy reuse
   targetfile  '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/orapwSVRPRD' auxiliary format
 '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/orapwSVRPRD'   ;
}
executing Memory Script

Starting backup at 16-JUL-14
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=492 device type=DISK
allocated channel: ORA_DISK_2
............
Finished backup at 16-JUL-14

contents of Memory Script:
{
   backup as copy current controlfile for standby auxiliary format  '/u01/app/oracle/oradata/SVRPRD/control01.dbf';
   restore clone controlfile to  '/u01/app/oracle/oradata/SVRPRD/control02.dbf' from
 '/u01/app/oracle/oradata/SVRPRD/control01.dbf';
}
executing Memory Script

Starting backup at 16-JUL-14
using channel ORA_DISK_1
using channel ORA_DISK_2

channel ORA_DISK_1: starting datafile copy
copying standby control file
output file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/CF_snapshot_PROD_%F.bak tag=TAG20140716T023551 RECID=18 STAMP=853036556
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:16
Finished backup at 16-JUL-14

Starting restore at 16-JUL-14
using channel ORA_AUX_DISK_1
using channel ORA_AUX_DISK_2
................

channel ORA_AUX_DISK_2: skipped, AUTOBACKUP already found
channel ORA_AUX_DISK_3: skipped, AUTOBACKUP already found
......

channel ORA_AUX_DISK_1: copied control file copy
Finished restore at 16-JUL-14

contents of Memory Script:
{
   sql clone 'alter database mount standby database';
}
executing Memory Script

sql statement: alter database mount standby database

contents of Memory Script:
{
   set newname for tempfile  1 to
 "/u01/app/oracle/oradata/SVRPRD/temp03.dbf";
..................
backup as copy reuse
   datafile  1 auxiliary format
 "/u01/app/oracle/oradata/SVRPRD/system01.dbf"   datafile
....................

 sql 'alter system archive log current';
}
executing Memory Script

executing command: SET NEWNAME

........................
.......................
.......................

datafile 11 switched to datafile copy
input datafile copy RECID=28 STAMP=853054683 file name=/u01/app/oracle/oradata/SVRPRD/svrebindx02.dbf

contents of Memory Script:
{
   set until scn  6047214831398;
   recover
   standby
   clone database
    delete archivelog
   ;
}
executing Memory Script

executing command: SET until clause

Starting recover at 16-JUL-14
using channel ORA_AUX_DISK_1
........
using channel ORA_AUX_DISK_6

starting media recovery

archived log for thread 1 with sequence 70837 is already on disk as file /archivelogs/SVRPRD/SVRPRD_1_70837_744780970.arc
archived log for thread 1 with sequence 70838 is already on disk as file /archivelogs/SVRPRD/SVRPRD_1_70838_744780970.arc
archived log file name=/archivelogs/SVRPRD/SVRPRD_1_70837_744780970.arc thread=1 sequence=70837
archived log file name=/archivelogs/SVRPRD/SVRPRD_1_70838_744780970.arc thread=1 sequence=70838
media recovery complete, elapsed time: 00:01:32
Finished recover at 16-JUL-14
Finished Duplicate Db at 16-JUL-14

++++++++++++++++++once Finished Duplicate ++++++++++++

Step 1 :

sql> create spfile from pfile;

sql> shut immediate;

SQL> startup nomount;

SQL> alter database mount;
Database altered.

SQL> ALTER DATABASE CONVERT TO PHYSICAL STANDBY;
Database altered.

SQL> shut immediate;

SQL> startup nomount;

SQL> alter database mount standby database;
Database altered.

SQL> alter database recover managed standby database disconnect from session;
Database altered.

( Or )SQL> alter database recover managed standby database disconnect;

STEP : 2

Enable the log_archive_dest_2 on primary, which is to send the logs to standby server.
SQL> Alter system set log_archive_dest_state_2=enable scope=both;

STEP :3
heck the standby whether it is in SYNC with primary,

SQL> select name,db_unique_name,database_role from v$database;

NAME      DB_UNIQUE_NAME                 DATABASE_ROLE
--------- ------------------------------ ----------------
SVRPRD   SVRPRDS                       PHYSICAL STANDBY

SQL>  SELECT SEQUENCE#, FIRST_TIME, NEXT_TIME FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;
SQL>select sequence#,applied from v$archived_log order by sequence#;

SQL> select ads.dest_id,max(sequence#) "Current Sequence",max(log_sequence) "Last Archived" from v$archived_log al, v$archive_dest ad, v$archive_dest_status ads where ad.dest_id=al.dest_id and al.dest_id=ads.dest_id group by ads.dest_id;

SQL> select max(al.sequence#) "Last Seq Recieved", max(lh.sequence#) "Last Seq Applied" from v$archived_log al, v$log_history lh;

++++++++789370.1++++++++