Saturday, March 30, 2013

Duplicating database to a new Host without connecting to the Target database:


To Take backup :

rman target =/                           
  
CONFIGURE CONTROLFILE AUTOBACKUP ON;
run {
set controlfile autobackup format for device type disk to '/nfs/rman_db_backup/PROD/%F';
shutdown immediate
startup mount
allocate channel t1 device type disk;
allocate channel t2 device type disk;
backup as compressed backupset database format '/nfs/rman_db_backup/PROD/%d_%s_%p.dbf';
backup current controlfile format '/nfs/rman_db_backup/PROD/ctrl%d_%s_%p.ctl';
release channel t1;
release channel t2;
}

Scenario 1:

rman msglog=duplicatePROD2UAT.log << END_RMAN
connect target sys/P6d_9@PROD
connect auxiliary /
connect catalog rmn_cat/cat4rman@grid

RUN
{
ALLOCATE AUXILIARY CHANNEL disk1 DEVICE TYPE disk;
ALLOCATE AUXILIARY CHANNEL disk2 DEVICE TYPE disk;
ALLOCATE AUXILIARY CHANNEL disk3 DEVICE TYPE disk;
ALLOCATE AUXILIARY CHANNEL disk4 DEVICE TYPE disk;
ALLOCATE AUXILIARY CHANNEL disk5 DEVICE TYPE disk;
ALLOCATE AUXILIARY CHANNEL disk6 DEVICE TYPE disk;

   set newname for datafile  1 to '/u01/oradata/UAT/system01.dbf';
   set newname for datafile  2 to '/u01/oradata/UAT/system02.dbf';
   set newname for datafile  3 to '/u01/oradata/UAT/taxware01.dbf';
   set newname for datafile  4 to '/u02/oradata/UAT/undo01.dbf';
   set newname for datafile  5 to '/u02/oradata/UAT/undo02.dbf';
   set newname for datafile  6 to '/u02/oradata/UAT/discoverer01.dbf';
   set newname for datafile  7 to '/u01/oradata/UAT/discoverer02.dbf';
   set newname for datafile  8 to '/u02/oradata/UAT/olap.dbf';
   set newname for datafile  9 to '/u02/oradata/UAT/olap.dbf';
   set newname for datafile  10 to '/u02/oradata/UAT/sysaux01.dbf';

set until time "to_date('11-DEC-2010 21:17:00','DD-MON-YYYY HH24:MI:SS')";

DUPLICATE TARGET DATABASE TO UAT NOFILENAMECHECK ;

RELEASE CHANNEL disk1;
RELEASE CHANNEL disk2;
RELEASE CHANNEL disk3;
RELEASE CHANNEL disk4;
RELEASE CHANNEL disk5;
RELEASE CHANNEL disk6;
}
exit
END_RMAN
exit

++++++++++++++++++++++++++++++++++++++++++++

Scenario 2:

rman target /
Recovery Manager: Release 11.2.0.3.0 - Production on Mon Oct 15 06:49:58 2012

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

connected to target database (not started)

RMAN> set dbid=6186969

executing command: SET DBID

RMAN> exit
Recovery Manager complete.

### Backup pieces  location

[oracle@uatebsdl1 ~]$ cd /nfs/rman_db_backup/PROD 
[oracle@uatebsdl1 PROD]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Mon Oct 15 06:57:06 2012

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

Connected to an idle instance.

SQL> startup nomount pfile='/d02/oracle/uatdb/11.2.0.3/dbs

ORA-01506: missing or illegal database name

[oracle@uatebsdl1 PROD]$ export ORACLE_SID=PROD
[oracle@uatebsdl1 PROD]$ export ORACLE_HOME=/d02/oracle/uatdb/11.2.0.3
[oracle@uatebsdl1 PROD]$  sqlplus / as sysdba

SQL>  startup nomount pfile='/d02/oracle/uatdb/11.2.0.3/dbs/initPROD.ora'
QL*Plus: Release 11.2.0.3.0 Production on Mon Oct 15 06:59:00 2012

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

Connected to an idle instance.

ORACLE instance started.

Total System Global Area 5.3447E+10 bytes
Fixed Size                  2240984 bytes
Variable Size            7113543208 bytes
Database Buffers         4.6305E+10 bytes
Redo Buffers               26505216 bytes
SQL> exit
## To verify it will connect the Target database

[oracle@uatebsdl1 PROD]$ rman target /  

Recovery Manager: Release 11.2.0.3.0 - Production on Mon Oct 15 07:08:01 2012

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

connected to target database: PROD (not mounted) 

## Restore Control files from backup pieces..

RMAN> restore controlfile from '/nfs/rman_db_backup/PROD/CF_c-361538929-20121013-03_PROD_20121013.bak';

Starting restore at 15-OCT-12
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=6674 device type=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:07
output file name=/u03/oradata/UAT/cntrl01.dbf
output file name=/u03/oradata/UQAT/cntrl02.dbf
output file name=/u03/oradata/UAT/cntrl03.dbf
Finished restore at 15-OCT-12

RMAN> alter database mount;

database mounted
released channel: ORA_DISK_1

## Apply the Backup pieces one by one ...

RMAN> catalog backuppiece '/nfs/rman_db_backup/PROD/DF_796595692_a4nnm5fc_16708_1_TX_DATA_PROD_20121013.bak';

cataloged backup piece
backup piece handle=/nfs/rman_db_backup/PROD/DF_796595692_a4nnm5fc_16708_1_TX_DATA_PROD_20121013.bak RECID=14888 STAMP=796721805

RMAN> catalog backuppiece '/nfs/rman_db_backup/PROD/DF_796596589_a9nnm6bd_16713_1_OWAPUB_PROD_20121013.bak';

cataloged backup piece
backup piece handle=/nfs/rman_db_backup/PROD/DF_796596589_a9nnm6bd_16713_1_OLAP_PROD_20121013.bak RECID=14889 STAMP=796721920

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

RMAN>
run
{
Set newname for datafile '/u03/oradata/PROD/sysaux01.dbf' to '/u03/oradata/UAT/sysaux01.dbf';
Set newname for datafile '/u03/oradata/PROD/system02.dbf' to '/u03/oradata/UAT/system02.dbf';
Set newname for datafile '/u03/oradata/PROD/system01.dbf' to '/u03/oradata/UAT/system01.dbf';
Set newname for datafile '/u03/oradata/PROD/taxware01.dbf' to '/u03/oradata/UAT/taxware01.dbf';
Set newname for datafile '/u03/oradata/PROD/undo02.dbf' to '/u03/oradata/UAT/undo02.dbf';
Set newname for datafile '/u03/oradata/PROD/undo01.dbf'' to '/u03/oradata/UAT/undo01.dbf';
Set newname for datafile '/u03/oradata/PROD/olap.dbf' to '/u03/oradata/UAT/olap.dbf';
Set newname for datafile '/u03/oradata/PROD/user01.dbf' to '/u03/oradata/UAT/user01.dbf';
Set newname for datafile '/u03/oradata/PROD/TX_DATA01.dbf' to '/u03/oradata/UAT/TX_DATA01.dbf';
Set newname for datafile '/u03/oradata/PROD/TX_DATA2.dbf' to '/u03/oradata/UAT/TX_DATA2.dbf';
restore database;
switch datafile all;
recover database;
}

++++++++++++++++++++++++++++++++++++++++++++++
orauat> rman target =/          

Recovery Manager: Release 11.2.0.2.0 - Production on Fri Mar 8 23:19:18 2013

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

connected to target database: PBW (DBID=164864990, not open)

RMAN> recover database ;

RMAN-00571: ===========================================
RMAN-00569: ===== ERROR MESSAGE STACK FOLLOWS =======
RMAN-00571: ============================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "identifier": expecting one of: "archivelog, channel, check, controlfile, database, datafile, device, force, from, high, preview, primary,
skip readonly, spfile, standby, tablespace, to restore point, until restore point, until, validate, ("
RMAN-01008: the bad identifirecover
RMAN-01007: at line 1 column 9 file: standard input

RMAN> list backup of archivelog sequence 120662;

using target database control file instead of recovery catalog
List of Backup Sets
===================
BS Key  Size       Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
7       61.93G     DISK        00:00:00     06-MAR-13
        BP Key: 7   Status: AVAILABLE  Compressed: NO  Tag: PBWARCB06MAR2013
        Piece Name: /oraclebackupb/backupset/Lvl0_backup_9eo3ruu7_1_1.arc

  List of Archived Logs in backup set 7
  Thrd Seq     Low SCN    Low Time  Next SCN   Next Time
  ---- ------- ---------- --------- ---------- ---------
  1    120662 36239220127 06-MAR-13 36239467349 06-MAR-13

RMAN> list backup of archivelog sequence 120661;
List of Backup Sets
===================
BS Key  Size       Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
7       61.93G     DISK        00:00:00     06-MAR-13
        BP Key: 7   Status: AVAILABLE  Compressed: NO  Tag: PBWARCB06MAR2013
        Piece Name: /oraclebackupb/backupset/Lvl0_backup_9eo3ruu7_1_1.arc

  List of Archived Logs in backup set 7
  Thrd Seq     Low SCN    Low Time  Next SCN   Next Time
  ---- ------- ---------- --------- ---------- ---------
  1    120661 36240111295 06-MAR-13 36240301600 06-MAR-13

RMAN> run
2> {
3> set until sequence 120662;
4> recover database;
5> }

executing command: SET until clause

Starting recover at 08-MAR-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=6 device type=DISK

starting media recovery

 +++++++++++++++++++++++++++++++++++++++

Wednesday, March 27, 2013

How to avoid a failed duplicate to overwrite the online redologs of the target Database:


How to avoid a failed duplicate to overwrite the online redologs of the target Database[ID 1282984.1]
Error:

Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
cancel
Media recovery cancelled.
SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-19838: Cannot use this control file to open database

Solution :

In 11.2 also 'DUPLICATE' can resume a failed duplicate, thus the need to perform the recover and open manually is alleviated.

If you would decide to still perform the steps manually, then you will need to create a new controlfile and provide the names of the online logs before opening the database.

Once db is open Need to change SID

How to Change the DBID and the DBNAME by using NID

Introduction
============

The NID (New Database ID)is a new utility introduced with Oracle 9.2.  The NID
utility allows you to change only the DBNAME, or only the DBID or both
DBNAME and DBID in the same command.

  1. If you change the DBID you must open the database with the RESETLOGS
     option, which re-creates the online redo logs and resets their sequence to 1.

  2. If you change the DBNAME without changing the DBID then this does not
     require you to open with the RESETLOGS option, so database backups and
     archived logs are not invalidated.  You must change the DB_NAME initialization
     parameter after a database name change to reflect the new name.  Also,
     you may have to re-create the Oracle password file.  If you restore an old
     backup of the control file (before the name change, then you should
     use the initialization parameter file and password file from before the
     database name change.

Change Only the DBID
====================

  1. Backup the database
  2. SHUTDOWN IMMEDIATE of the database
  3. STARTUP MOUNT
  4. Open one session and run NID with sysdba privileges
     % nid TARGET=SYS/password@test_db
  5. Shutdown IMMEDIATE of the database
  6. Set the DB_NAME initialization parameter in the initialization parameter
     file to the new database name
  7. Create a new password file
  8. Startup of the database with open resetlogs

1. set ORACLE_SID=TEST
sqlplus "/as sysdba"
SQL> startup pfile=D:\oracle\admin\TEST1BY\pfile\initTEST.ora
   ORACLE instance started.

2. check the DBID before change
   SQL> select dbid,name,open_mode,activation#,created from v$database;

3. SQL> shutdown immediate;

4. SQL> startup mount pfile=D:\oracle\admin\TEST1BY\pfile\initTEST1BY.ora
   ORACLE instance started.

5. execute NID

   [oracle@svruatebsdl1 ~]$nid target=sys/oracle@TEST1BY
Change database ID of database TEST1BY? (Y/[N]) => y
........
.......
Shut down database and open with RESETLOGS option.
   Succesfully changed database ID.
   DBNEWID - Completed succesfully.

6. SQL> shutdown immediate;

7. create the new passwordfile

8. SQL> startup mount pfile=$ORACLE_HOME/dbs/initTEST.ora
   ORACLE instance started.

9. SQL> alter database open resetlogs;
   Database altered.

10. check the new DBID

    SQL> select dbid,name,open_mode,activation#,created from v$database;

Change Only the DBNAME
======================

  1. Backup the database
  2. SHUTDOWN IMMEDIATE of the database
  3. STARTUP MOUNT
  4. Open one session and run NID with sysdba privileges
     % nid TARGET=SYS/password@test_db DBNAME=test_db2 SETNAME=Y
     - the value of DBNAME is the new dbname of the database
     - SETNAME must be set to Y. The default is N and causes the
       DBID to be changed also.
  5. shutdown IMMEDIATE of the database
  6. Set the DB_NAME initialization parameter in the initialization parameter
     file to the new database name
  7. Create a new password file

Change Both DBID and DBNAME
===========================

  1. Backup of the database.
  2. Shutdown IMMEDIATE of the database
  3. STARTUP MOUNT
  4. Open one session and run NID with sysdba privileges
     % nid TARGET=SYS/password@test_db DBNAME=test_db2
     - the value of DBNAME is the new dbname of the database
  5. After DBNEWID successfully changes the DBID,Shutdown IMMEDIATE of the database
  6. Set the DB_NAME initialization parameter in the
     initialization parameter file to the new database name.
  7. Create a new password file.
  8. Startup of the database with open resetlogs

  8. Startup of the database(without resetlogs)

Note:
 Run NID utility
   [oracle@svruatebsdl1 ~]$nid target=sys/oracle@test1 dbname=test1by logfile=[oracle@svruatebsdl1 ~]$/u01/oracle/base_uat/nid.log
+++++++++++++++++++++++++++++++++
1282984.1, 224266.1 ,360962.1   
+++++++++++++++++++++++++++++++++

Java upgrade from 1.4.2_06 to 1.6_25 for Discoverer:


Java upgrade from 1.4.2_06 to 1.6_25 for discoverer

Section A:
Login as oracle user to production server (prdsoadl1)
cd /d01/oracle/mid/jdk/bin
Java versions information:
$ java -version
java version "1.4.2_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_06-b03)
Java HotSpot(TM) Client VM (build 1.4.2_06-b03, mixed mode)

Stop application processes and database
MidTier
soamidenv
emctl stop iasconsole
opmnctl stopall
InfraTier
soainfenv
emctl stop iasconsole
opmnctl stopall

Shutdown the database and listener
                sqlplus / as sysdba
SQL> shutdown immediate

lsnrctl stop

Kill all other process if there are any running processes

Upgrade the java from 1.4.2_06 to 1.6_25
cd /d01/oracle/infra
mv jdk jdk_1.4.2_06

cp -r /ATG_RUP7/jdk1.6.0_25 jdk

/d01/oracle/mid
mv jdk jdk_1.4.2_06

cp -r /ATG_RUP7/jdk1.6.0_25 jdk

Verify the installed java version

cd jdk/bin

[oracle@tstaebsal1 jdk1.6.0_25]$ java -version
java version "1.6.0_25"
Java(TM) SE Runtime Environment (build 1.6.0_25-b06)
Java HotSpot(TM) Server VM (build 20.0-b11, mixed mode)

Start database and  application processes

Start the listener and database
                lsnrctl start
                sqlplus / as sysdba
SQL> startup

InfraTier
soainfenv
opmnctl startall
emctl start iasconsole
MidTier
soamidenv
opmnctl startall
emctl start iasconsole

Post upgrade steps:

Section B:

1.             Take a backup of oaj2se.exe on Discover side
[oracle@tstsoadl1 bin]$ pwd
/d01/oracle/mid/jpi/bin
[oracle@tstsoadl1 bin]$ ls -tlr
total 31516
-rw-r--r--  1 oracle dba 15691488 Feb 22  2005 j2re.exe
-rw-r--r--  1 oracle dba 16537376 Mar 25 19:07 oaj2se.exe

2.             Scp the java client executable oaj2se.exe from EBS to Discoverer on above location

[oracle@tstaebsal1 ~]$ cd $OA_HTML/
[oracle@tstaebsal1 html]$ ls -ltr *.exe
-rwxrwxrwx 1 oracle dba  8039352 Mar 25 16:14 oajinit.exe
-rw-r--r-- 1 oracle dba 16537376 Mar 25 19:07 oaj2se.exe   - Copy this file, make sure this file is same size of the java executable actually copied at below location during ATG RUP7.

[oracle@tstaebsal1 html]$ ls -tlr $COMMON_TOP/util/jinitiator/*exe
-rwxr-xr-x 1 oracle dba    32768 Mar 30  2002 /d01/oracle/tstacomn/util/jinitiator/oajsetup.exe
-rwxr-xr-x 1 oracle dba  9738552 May  9  2002 /d01/oracle/tstacomn/util/jinitiator/jinit11816.exe
-rwxr-xr-x 1 oracle dba  7986400 Oct 27  2004 /d01/oracle/tstacomn/util/jinitiator/jinit13118.exe
-rwxr-xr-x 1 oracle dba  8039352 Jul 13  2005 /d01/oracle/tstacomn/util/jinitiator/jinit13121.exe
-rw-r--r-- 1 oracle dba 16537376 Mar 25 01:35 /d01/oracle/tstacomn/util/jinitiator/j2se16025.exe

3.             Take a backup of configuration.xml at below location

[oracle@tstsoadl1 config]$ pwd
/d01/oracle/mid/discoverer/config

4.             Edit the configuration.xml to first use Sun JRE plugin searching for  text “plus”

From
<plus laf="browser" lafJar="" lafClass="" logLevel="error" plugin="jinitiator" helpSet="help">
To
<plus laf="browser" lafJar="" lafClass="" logLevel="error" plugin="sun" helpSet="help">

5.             Edit the file to next use http transport protocol searching for text “jrmp”

From
<transport name="jrmp"/><logo rendered="true" src="default" url="" file=""/>
To
<transport name="http"/><logo rendered="true" src="default" url="" file=""/>

6.             Edit the file next to make changes to use right JRE plug-in by replacing values for classid, plugin_setup, version, versionie & plugin_page as below. Replace the correct Discover hostname.

From
<jvm name="sun" classid="clsid:CAFEEFAC-0014-0002-0006-ABCDEFFEDCBA" plugin_setup="http://tstsoadl1.d-rco.com:6669/jpi/j2re.exe" version="1.4.2" versionie="1,4,2,mn" type="application/x-java-applet" plugin_page="http://java.sun.com/products/archive/j2se/1.4.2_06/index.html" disco_archive="disco5i.jarjar" d4o_archive="d4o_double.jarjar"/>
To
<jvm name="sun" classid="clsid:CAFEEFAC-0016-0000-0025-ABCDEFFEDCBA" plugin_setup="http://tstsoadl1.d-rco.com:6669/jpi/oaj2se.exe" version="1.6" versionie="1,6,0,25" type="application/x-java-applet" plugin_page="http://java.sun.com/products/archive/j2se/1.6.0_25/index.html" disco_archive="disco5i.jarjar" d4o_archive="d4o_double.jarjar"/>

7.             Bounce the Discover services

+++++++++++++++++++++++++++++++++++++

Tuesday, March 26, 2013

Oracle E-Business Suite Pre-install Patches Report [Video] [ID 1448102.1]


Oracle E-Business Suite Pre-install Patches Report [Video] [ID 1448102.1] à please refer the MOSID

Q. Can I apply Release 12.1 CUP1 and the other pre-install patches separately?
A. Yes, you can apply Release 12.1 CUP1 independently of the pre-install patches in this report. However, you may find it convenient to merge all the pre-install patches required for the upgrade instance with Release 12.1 CUP1 and apply the merged patch in pre-install mode.

Q. Are these pre-install patches meant for an upgrade from Release 12.0.X to Release 12.1?
A. No. The pre-install patches in this report are meant for an upgrade from Release 11i to Release 12.1. Customers upgrading from Release 11i must apply these patches along with Release 12.1 CUP1 before executing the Release 12.1 upgrade driver. The patches required for an upgrade from Release 12.0.X are delivered from the 12.0 branchline. Release 12.0.X customers can apply those patches (12.0 branchline patches) before applying the Release 12.1 Maintenance Pack.

Q. Some patches in the report appear as Superseded in the patch download screen. Which patch should I download?
A. The report lists pre-install patches irrespective of whether they are superseded. Any patch available in MOS (whether a pre-install patch or not) could be superseded at a later point in the future. It is generally advisable to uptake the most recent replacement patch shown in the patch download screen after reviewing the readme of the patch and instructions to ensure it still applies to you. This also applies to preinstall patches listed in the report that are superseded. In some rare cases, a patch could be marked Defective and replaced by a different patch, in which case it is advisable to uptake the most recent replacement patch shown in the patch download screen after reviewing the readme.

Q. When I'm viewing the report in Google Chrome browser, some of the report contents are not visible. This is not an issue with other browsers. Is there any workaround available to resolve this issue?
A. An additional security feature has been implemented in the new releases of Google Chrome browser for local files access. As per this new update in chrome, in case of local HTML files, the browser prevents users from clicking Internet-based hyperlinks to local web pages and blocks local web pages from reading the contents of arbitrary web sites. To see the content properly in the report, you can use the Chrome switch "--allow-file-access-from-files" as a workaround. Usage of the switch on a windows machine is as follows:
Start >> Run >> chrome.exe --allow-file-access-from-files
(Note: Please close all existing sessions of chrome browser and then try this command line option)

Q. When I'm viewing the report in Internet Explorer, I receive a warning in the information bar asking whether to allow blocked content. Is it safe to allow this content?
A. Yes. Depending on your Internet Explorer settings, while accessing the report you may see this warning in the information bar. However, it is safe to choose 'Allow blocked content' for the specific window or tab in which you are viewing the report.

Q. When I'm viewing the report in Internet Explorer, I receive the error 'To help protect your security, Internet Explorer has restricted this web page from running scripts or Active X controls that could access your computer. Click here for options.' Is it safe to allow this content?
A. Yes. Click as indicated in the message 'Click here for options' and then select 'Allow blocked content'. Finally, in the security warning pop-up window, select 'Yes'.

Q. When I'm viewing the report in Internet Explorer, I receive the error 'Javascript is currently not enabled on your internet browser. To display this page correctly please enable Javascript.' How can I resolve this error?
A. Follow the instructions for Active X controls: Click as indicated in the message 'To help protect your security, Internet Explorer has restricted this web page from running scripts or Active X controls that could access your computer. Click here for options', and then select 'Allow blocked content'. Finally, in the security warning pop-up window, select 'Yes'.

Q. Is there a way to generate a text output or spreadsheet for the report?
A.The report currently does not have a feature to generate an output file. As a workaround, customers can open the file 'EBS.html' to list all the patches in html format and copy/paste the list to a spreadsheet or text format.

To open the EBS.html file:
1. Navigate to the EBS_12.1_Preinstall folder.
2. Open the file 'EBS.html' in a browser.
Q. How and when should I apply any NLS counterparts to the patches in the preinstall report?
A. If you have NLS installed and there are NLS counterparts to the patches listed in your preinstall report, you should do the following:

Do not download or apply any NLS patches in preinstall mode
After the upgrade is complete, the NLS file system will be 100% synchronized as described on page 3-6 of the 12.1.3 Upgrade Guide, therefore accounting for any NLS patches listed by the preinstall patch report
Oracle is aware that some README.txt files will advise you to install these NLS patches in preinstall mode, however that is not recommended at this time
 ++++++++++++++++++++++++++++++++++++++++
1080973.1,437878.1

How to add Multi Node on E-Business Suite Release 12:

Multi Node on E-Business Suite Release 12: 
[oracle@svrprdebsal2 bin]$ perl adclonectx.pl addnode contextfile=/d01/oracle/SVRPRD_svrprdebsal1.xml

                     Copyright (c) 2002 Oracle Corporation
                        Redwood Shores, California, USA
                        Oracle Applications Rapid Clone
                                 Version 12.0.0
                      adclonectx Version 120.23.12010000.1

Running:
/d01/oracle/SVRPRD/apps/apps_st/comn/clone/bin/../jre/bin/java -Xmx600M -classpath /d01/oracle/SVRPRD/apps/apps_st/comn/clone/bin/../jlib/ojdbc14.jar:/d01/oracle/SVRPRD/apps/apps_st/comn/clone/bin/../jlib/xmlparserv2.jar:/d01/oracle/SVRPRD/apps/apps_st/comn/clone/bin/../jlib/java oracle.apps.ad.context.CloneContext  -e /d01/oracle/SVRPRD_svrprdebsal1.xml -addnode
Enter the APPS password : apps

Log file located at /d01/oracle/SVRPRD/apps/apps_st/comn/clone/bin/CloneContext_0219080737.log

Provide the values required for creation of the new APPL_TOP Context file.

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

It is recommended that your inputs are validated by the program.
However you might choose not to validate them under following circumstances:

        -If cloning a context on source system for a remote system.
        -If cloning a context on a machine where the ports are taken and
         you do not want to shutdown the services at this point.
        -If cloning a context but the database it needs to connect is not available.

Do you want the inputs to be validated (y/n) [n] ? : y

Target System Root Service [disabled] : enabled

Target System Web Entry Point Services [disabled] : enabled

Target System Web Application Services [disabled] : enabled

Target System Batch Processing Services [enabled] : disabled

Target System Other Services [disabled] : enabled

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

Target System Display [svrprdebsal2:0.0] :
Database port is 1521

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

Target System Port Pool [0-99] : 0

Checking the port pool 0
done: Port Pool 0 is free
Report file located at /d01/oracle/SVRPRD/inst/apps/SVRPRD_svrprdebsal2/admin/out/portpool.lst
Complete port information available at /d01/oracle/SVRPRD/inst/apps/SVRPRD_svrprdebsal2/admin/out/portpool.lst

UTL_FILE_DIR on database tier consists of the following directories.

1. /usr/tmp
2. /usr/tmp
3. /d02/oracle/svrprddb/db/tech_st/11.2.0.3/appsutil/outbound/SVRPRD_ svrprdebsdl1
4. /usr/tmp
Choose a value which will be set as APPLPTMP value on the target node [1] : 3

Creating the new APPL_TOP Context file from :
  /d01/oracle/SVRPRD/apps/apps_st/appl/ad/12.0.0/admin/template/adxmlctx.tmp

The new APPL_TOP context file has been created :
  /d01/oracle/SVRPRD/inst/apps/SVRPRD_svrprdebsal2/appl/admin/SVRPRD_svrprdebsal2.xml

Log file located at /d01/oracle/SVRPRD/apps/apps_st/comn/clone/bin/CloneContext_0219080737.log
contextfile=/d01/oracle/SVRPRD/inst/apps/SVRPRD_svrprdebsal2/appl/admin/SVRPRD_svrprdebsal2.xml
Check Clone Context logfile /d01/oracle/SVRPRD/apps/apps_st/comn/clone/bin/CloneContext_0219080737.log for details.
[oracle@svrprdebsal2 bin]$

Note:

EBS is n nodes :
Please proceed each node like above, Once complete all nodes , Please change CONTEXT_FILE, As pre client requirement ,
Ex: need to configure soa:
<disco_url oa_var="s_disco_url" customized="yes">http://prodsoadl1.d-rco.com:<PortNo></disco_url>


<login_page oa_var="s_login_page">http://svrprdebsal2.singiri.com:8000/OA_HTML/AppsLogin</login_page>

After Immediate ,Please run auto config as parallel all nodes at same Time:

perl $AD_TOP/bin/adconfig.pl contextfile=$CONTEXT_FILE  –parallel

Note:
For DMZ  node  need to change the parameter values from $CONTEXT_FILE

s_login_pag,s_external_url & s_webentryhost

For Ex:

<login_page oa_var="s_login_page">http://svruat.singiri.com:8000/OA_HTML/AppsLogin</login_page>
<externURL oa_var="s_external_url">http://svruat.singiri.com:8000</externURL>
<webentryhost oa_var="s_webentryhost">svruat</webentryhost>


For DISCO Ex:

The Disco Url Variable Name : “ s_disco_url
 <disco_url oa_var="s_disco_url" customized="yes">http://host.domain.com:<port></disco_url>
         <disco_eul_prefix oa_var="s_disco_eul_prefix">EUL</disco_eul_prefix>



++++++++++++++++++++++++++++
438086.1, 603104.1, 384248.1
++++++++++++++++++++++++++++
Note:  Going into an additional level of detail, the relation between service groups, services, context variables, and control scripts can be depicted in the following way:

<service group>: <context variable>
<service>: <context variable> (<control script>)
Using this format, the Release 12 service groups, services, context variables, and control scripts are:

Root Services: s_root_status
Oracle Process Manager: s_opmnstatus (adopmnctl.sh)

Web Entry Point Services: s_web_entry_status
Oracle HTTP Server: s_oacorestatus (adapcctl.sh)

Web Application Services: s_web_applications_status
OACORE OC4J: s_oacorectrl (adoacorectl.sh)
FORMS OC4J: s_formsstatus (adformsctl.sh)
OAFM OC4J: s_oafmstatus (adoafmctl.sh)

Batch Processing Services: s_batch_status
OracleTNSListenerAPPS: s_tnsstatus (adalnctl.sh)
OracleConcMgr: s_concstatus (adcmctl.sh)
Oracle ICSM: s_icsmctrl (ieoicsm.sh)
Oracle Fulfillment Server: s_jtffsstatus (jtffmctl.sh)

Other Service Group: s_other_service_group_status
OracleFormsServer: s_formsserver_status (adformsrvctl.sh)
Oracle Metrics Client: s_metcstatus (adfmcctl.sh)
Oracle Metrics Server: s_metsstatus (adfmsctl.sh)
Oracle MWA Service: s_mwastatus (mwactlwrpr.sh)

++++++++++++++++++++++++++++++++++

Thursday, March 7, 2013

Cold & Hot Disk Backup as compressed using RMAN:


Rman Disk Backup as compressed

$ rman target /

RMAN> show all;

using target database control file instead of recovery catalog

RMAN configuration parameters for database with db_unique_name HRPROD are:

CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default

CONFIGURE BACKUP OPTIMIZATION OFF; # default

CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default

CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default

CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default

CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default

CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default

CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default

CONFIGURE MAXSETSIZE TO UNLIMITED; # default

CONFIGURE ENCRYPTION FOR DATABASE OFF; # default

CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default

CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default

CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default

CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/oracle/prddb/db/tech_st/11.2.0.3/dbs/snapcf_prod.f'; # default

Steps to Cold Clone

$ rman target /

CONFIGURE CONTROLFILE AUTOBACKUP ON;  // default is off
run {
set controlfile autobackup format for device type 'sbt_tape' to '%F';  //For Tape backup
set controlfile autobackup format for device type disk to '/u01/dbcoldbkp/%F';
shutdown immediate
startup mount
allocate channel t1 device type disk;
backup as compressed backupset database format '/u01/dbcoldbkp /%d_%s_%p.dbf';
backup current controlfile format '/u01/dbcoldbkp /ctrl%d_%s_%p.ctl';
release channel t1;
}

Or

startup mount
$ rman target /
run{
   allocate channel dup1 device type disk;
   allocate channel dup2 device type disk;
   backup as compressed backupset format='/u01/dbcoldbkp /%U';
   release channel dup1;
   release channel dup2;
     }
Steps to Hot Clone

$ rman target /

run {
sql "alter system archive log current";
allocate channel t1 type disk;
allocate channel t2 type disk;
backup as compressed backupset format='/archivelogs/%U' database plus archivelog;
backup format='/archivelogs/Tp_cntl_%Y%M%D_%d_%s_%p.ctl' current controlfile;
release channel t1;
release channel t2;
}
+++++++++++++++++++++++++++++++++++++++

Rman hot backup :
 ++++++++++++++++++++++++++++++++++++++++++++
export NLS_DATE_FORMAT='DD-MON-YYYY HH24:MI:SS'

rman target /   << EOF
spool log to '$RMAN_LOG_FILE' append;
##CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CHANNEL DEVICE TYPE DISK clear;
CONFIGURE DEVICE TYPE DISK clear;

###############
## use these statements when backing up to DISK.
###############
##CONFIGURE DEVICE TYPE DISK PARALLELISM 10;
## If compression is enabled, add the following (not recommended for tape backups)
CONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE' clear;
CONFIGURE DEVICE TYPE 'SBT_TAPE' clear;

CONFIGURE DEFAULT DEVICE TYPE TO DISK;
#CONFIGURE ARCHIVELOG DELETION POLICY TO BACKED UP 2 TIMES TO DEVICE TYPE DISK;
CONFIGURE DEVICE TYPE DISK PARALLELISM 10 BACKUP TYPE TO COMPRESSED BACKUPSET;
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1;
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1;
CONFIGURE MAXSETSIZE TO UNLIMITED;
CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'CF_snapshot_$SID_DT.bak';
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/U01/BACKUP/$ORACLE_SID/CF_%F_$SID_DT.bak';

show all;
##scm#report schema;
sql 'alter system switch logfile';

## uncomment this line if using SPFILE to start DB
##backup FORMAT '/nfs/rman_db_backup/$ORACLE_SID/SPF_%t_%u_%s_%p_%I_$SID_DT.bak' SPFILE ;


sql 'alter system archive log current';
sql 'alter system switch logfile';
##backup FORMAT '/U01/BACKUP /$ORACLE_SID/AF_%e_%t_%u_%s_%p_beforebu_$SID_DT.bak' archivelog all filesperset 5 ;

## If compression is enabled, add the following (not recommended for tape backups)
##BACKUP AS COMPRESSED BACKUPSET ....

backup $BACKUP_TYPE FORMAT  '/U01/BACKUP /$ORACLE_SID/DF_%t_%u_%s_%p_%N_$SID_DT.bak' database filesperset 5 ;

#crosscheck archivelog all;
sql 'alter system archive log current';

backup FORMAT '/U01/BACKUP/$ORACLE_SID/AF_%e_%t_%u_%s_%p_afterbu_$SID_DT.bak' archivelog all filesperset 5 ;

sql 'alter system archive log current';
backup FORMAT '/U01/BACKUP/$ORACLE_SID/AF_%e_%t_%u_%s_%p_afterbu_$SID_DT.bak' archivelog all not backed up filesperset 5 ;
#backup FORMAT '/U01/BACKUP/$ORACLE_SID/Tp_cntrl_%e_%t_%u_%s_%p_afterbu_$SID_DT.bak' current controlfile;

##scm#list backup summary;
##scm#list backup;
sql 'alter database backup controlfile to trace';

spool log off;
quit;
EOF
++++++++++++++++++++++++++++
DB duplicate from Disk backup  :
++++++++++++++++++++++++++++
# shutdown the database
sqlplus / as sysdba << END_SQL1
shutdown abort
END_SQL1

cd $ORACLE_HOME/dbs
 mv * dbs_bak
 mv dbs_bak/initDEV.ora .
 mv dbs_bak/DEV_ebsdl1_ifile.ora .
rm /u01/oradata/DEV/*
rm /u02/oradata/DEV/*
# Get date and time of control file to use for duplicate database

for i in `ls -lt --time-style=+'%d-%b-%Y%H%M' /U01/BACKUP/QAT/CF_c*|awk  '{print $6 }'`
do
until_date=$i
echo 'until_date from the loop:  '${until_date}
done
 sqlplus / as sysdba << END_SQL2
startup nomount
END_SQL2
 export NLS_DATE_FORMAT='DD-MON-YYYY HH24:MI:SS'
# Start the duplicate database using RMAN

#rman 
#connect target sys/maner@QAT
#connect auxiliary /
#connect catalog rman4cata/cat4rman@grid
#RUN
Rman
connect auxiliary /
RUN
{
ALLOCATE AUXILIARY CHANNEL disk1 DEVICE TYPE disk;
ALLOCATE AUXILIARY CHANNEL disk2 DEVICE TYPE disk;
ALLOCATE AUXILIARY CHANNEL disk3 DEVICE TYPE disk;
ALLOCATE AUXILIARY CHANNEL disk4 DEVICE TYPE disk;
ALLOCATE AUXILIARY CHANNEL disk5 DEVICE TYPE disk;

set until time "to_date(upper('$until_date'),'DD-MON-YYYYHH24MI')+(1/24/60)";

DUPLICATE DATABASE TO DRTSTC BACKUP LOCATION '/U01/BACKUP/QAT/' NOFILENAMECHECK
DB_FILE_NAME_CONVERT=('QAT','DEV')
LOGFILE
  GROUP 1 (
    '/u01/oradata/DEV/log01a.redo',
    '/u02/oradata/DEV/log01b.redo'
  ) SIZE 200M ,
  GROUP 2 (
    '/u01/oradata/DEV/log02a.redo',
    '/u02/oradata/DEV/log02b.redo'
  ) SIZE 200M ,
  GROUP 3 (
    '/u01/oradata/DEV/log03a.redo',
    '/u02/oradata/DEV/log03b.redo'
  ) SIZE 200M ;

RELEASE CHANNEL disk1;
RELEASE CHANNEL disk2;
RELEASE CHANNEL disk3;
RELEASE CHANNEL disk4;
RELEASE CHANNEL disk5;
}
exit
END_RMAN
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

221779.1 ,397315.1,1077022.1
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++