Showing posts with label CLONING. Show all posts
Showing posts with label CLONING. Show all posts

Sunday, 25 May 2014

Post Clone Steps In Oracle Applications

Post Clone Steps In Oracle Applications

The cloning process has traditionally been a manual process performed by DBAs. This process involves copying over the database files – preferably using RMAN DB duplicate, the tech stack, and the application tier to the non-production servers, converting them to DEV or TEST, and then performing a number of post clone steps such as disabling workflow emails from going to end users, scrambling financial information, updating the clone date and the instance name within the apps heading, editing the custom top, changing passwords, and others.  Depending upon the size and configuration the cloning process can take from 12 hours to 48 hours on average.

The number of post clone steps can get to be quite numerous and even with the best of documented procedures; one or two steps can easily be missed.

Note:-  the following is a list of steps in one particular cloning environment, It may vary based on environment.


1. Once the cloned database is renamed, add all the temp datafiles to the TEMP tablespace.

2. All key passwords need to be updated from their production values to the appropriate values for the DEV environment. (ie: sys,system, sysadmin,apps)

3. Custom database directories need to be re-created with the correct paths for the DEV server.

4. Specific Profile options need to be re-defined – like the apps heading naming the instance and the date stamp of the clone.

5. End-dating specific users so that only the desired developers have access to the instance.

6. Removing/scrambling specific private HR data.

7. Nulling out specific email addresses to prevent workflow from emailing end-users from the DEV instance.

8. Putting a hold on all regularly scheduled production concurrent requests in the DEV instance.

9. Updating all profile option values, swapping out the prod instance name for the DEV instance name. Additional updates for the server names also run.

10. Updates for all custom environment code paths and settings.


11. Updates for any and all printer setting changes.

Sunday, 7 July 2013

What happens during RMAN active duplicate cloning in oracle


In an active duplication process, target database online image copies and archived redo log files were copied through the auxiliary instance service name. So we no need the target database backup.
Target database must be in archive log mode.
Database duplication process RMAN does the following things
1.Generate the unique DBID for auxiliary database.
2.Copy the data files & archived log files from target database to auxiliary database.
3.Recreate the new control files for auxiliary database.
4.Recreates the online redo log files.
5.Restart the auxiliary instance.
6.Open the database with RESETLOGS.

Thursday, 20 June 2013

Cloning SSO-Enabled Environments in E-Business Suite


This is already discussed in Steven Chan's Blog article http://blogs.oracle.com/stevenChan/2006/05/11/ and much of this note is a straight copy from this article.  Please review this blog article in it's entirety before proceeding.

If you're willing to experiment a bit, the following are general guidelines to point you in the right direction.  Some customers and Oracle Consultants have used the following approaches to get the job done but have reported that there was some trial-and-error involved.

These are neither detailed nor comprehensive instructions.  The following should be attempted only by system administrators who have a solid understanding of the principles outlined in Metalink Note 261914.1.

If you're going to experiment with these approaches, I strongly recommend that you take all sensible precautions, including backing up your environments at multiple stages, taking careful notes, and doing things in small, incremental steps to control your risk.

There is no single stop, supported or documented method to create a clone of your eBiz instance when integrated with SSO.   Please use this note with caution and make sure you thoroughly test any procedure you decide to use to ensure it fits with all aspects of your specific setup.

1- Use Rapid Clone to create a clone of your E-Business Suite, including the application-tier and database-tier.
   For 11i, please use:
     Note 230672.1 Cloning Oracle Applications Release 11i with Rapid Clone
 
   For R12 ,please use:
     Note 406982.1   Cloning Oracle Applications Release 12 with Rapid Clone

2- In the  newly-cloned E-Business Suite instance, set the APPS_SSO_LDAP_SYNC profile option to "Disabled" at the site level (since there's no new Oracle Internet Directory instance to synchronize with yet).

3 -  In your newly-cloned E-Business Suite instance, unlink all E-Business Suite users that were linked to the original Oracle Internet Directory 10g users (i.e. where FND_USER.USER_GUID is populated), since the those old links are no longer valid. Those E-Business Suite users will need to be linked to their corresponding accounts in the as-yet non-existent new Oracle Internet Directory instance.

To Unlink EBS users, you should execute the following Command for each individual user (For both 11i and R12):

$FND_TOP/patch/115/sql/fndssouu.sql

See Note 429375.1 for more information on this utility

4 -  In your newly-cloned E-Business Suite instance, remove all reference to the original OID/SSO instance

Use the “removereferences” to cleanup the previous registration information of SSO & OID

For R12 this is described in Note 376811.1 "Section 3: Remove References"

For 11i :  Note 233436.1  "Appendix D:  Advanced Configuration - Manual SSO/OID Registration" - Option 6

5 -  Create a fresh install of Single Sign-On and Oracle Internet Directory 10g on your new server.

6 - Assuming that you enabled bidirectional provisioning between the E-Business Suite and Oracle Internet Directory, do one of the following (but not all three):

a) Redo your bulkload from the E-Business Suite into Oracle Internet Directory.
   On Release 12, please refer to "System Administrator's Guide - Security" on Section 6 (Oracle Single Sign-On Integration )

Then  Reregister your E-Business Suite environment using the Bidirectional Provisioning Profile, and enable the APPS_SSO_AUTO_LINK_USER profile option, and set the profile option APPS_SSO_LDAP_SYNC back to Enabled at site level.

b) Export your LDAP namespace from your original Oracle Internet Directory instance into an LDIF file, and then import the LDIF file into the new Oracle Internet Directory instance. Reregister your E-Business Suite environment using the Bidirectional Provisioning Profile, and (assuming that the Oracle Internet Directory accounts are identical to the E-Business Suite accounts) enable the APPS_SSO_AUTO_LINK_USER profile option, and set the profile option APPS_SSO_LDAP_SYNC back to Enabled at site level.

c) Connect the original Oracle Internet Directory instance to your new Oracle Internet Directory instance via a connector, synchronizing the namespaces. Reregister your E-Business Suite environment using the Bidirectional Provisioning Profile, and (assuming that the Oracle Internet Directory accounts are identical to the E-Business Suite accounts) enable the APPS_SSO_AUTO_LINK_USER profile option, and set the profile option APPS_SSO_LDAP_SYNC back to Enabled at site level.

Is it Possible to Clone an SSL Enabled E-Business Suite Middle Tier?



The Rapidclone utility does not support like for like cloning of an SSL enabled E-business suite middle tier.
Note 230672.1 Cloning Oracle Applications Release 11i with Rapid Clone
Note 406982.1 Cloning Oracle Applications Release 12 with Rapid Clone

The problem can be broken down into 3 issues

1:- File system changes.

The location of the SSL files on the clone is different to that from the source. From the bug we can see the following were not the same between source and target.

s_frmWalletDir
s_web_ssl_directory
s_web_ssl_keyfile
s_web_ssl_certfile
s_web_ssl_certchainfile


2:- SSL Port is wrong in the clone.

s_webssl_port - Gets Defaulted to 443, ideally it should take Apache Port given during adcfgclone run.

3:- SSL certificates are the same on the clone as they are on source.

This might be a security issue depending on your security requirements.
 

However
 Rapidclone will create a clone of an SSL enabled middle tier, but the target will require additional configuration to allow it to function correctly. To progress the issue further you must decide if

A:- You want the middle tier clone to be SSL enabled.

Re-implement SSL on the clone following the note below.

Note 123718.1 11i: A Guide to Understanding and Implementing SSL for Oracle Applications

B:- You want the middle tier clone to be HTTP only.

Remove the SSL configuration added in


Note 123718.1 11i: A Guide to Understanding and Implementing SSL for Oracle Applications


Tuesday, 2 April 2013

11G RMAN BACKUP BASED CLONING


Source(TARGET) instance information:
Instance name=DLINK
hostname=mydbt4db2
datafile location=/u03/oradata/DLINK, /u02/oradata/DLINK
Redolog file location=/u03/oradata/DLINK
Archive log file location=/u02/oradata/arch

Auxiliary instance (RLINK) information:

Instance name=RLINK
hostname=mydbt4db4
datafile location=/u03/oradata/RLINK, /u02/oradata/RLINK
Redolog file location=/u03/oradata/RLINK
Archive log file location=/u02/oradata/arch_RLINK

1) Create required directory structure at auxiliary side

[oracle@mydbt4db4 admin]$ mkdir -p /u02/oradata/RLINK
[oracle@mydbt4db4 admin]$ mkdir -p /u03/oradata/RLINK
[oracle@mydbt4db4 admin]$ mkdir -p /u02/oradata/arch_RLINK

2) Define ORACLE_SID and other required settings for auxiliary instance

[oracle@mydbt4db4 ~]$ vi .bash_profile
[oracle@mydbt4db4 ~]$ pwd
/home/oracle
[oracle@mydbt4db4 ~]$ . .bash_profile
[oracle@mydbt4db4 ~]$ echo $ORACLE_SID
RLINK
[oracle@mydbt4db4 ~]$

3) Creating initialization Parameter file for the Auxiliary instance(RLINK)


[oracle@mydbt4db4 dbs]$ vi initTLINK.ora
[oracle@mydbt4db4 dbs]$ cat initTLINK.ora
db_name='RLINK'
memory_target=200M
db_block_size=8192
control_files ='/u02/oradata/RLINK/control1.ctl','/u03/oradata/RLINK/control2.ctl'
compatible ='11.2.0'
log_archive_dest=/u02/oradata/arch_RLINK
log_file_name_convert='/u03/oradata/DLINK','/u03/oradata/RLINK'
db_file_name_convert='/u03/oradata/DLINK','/u03/oradata/RLINK','/u02/oradata/DLINK','/u02/oradata/RLINK'

4) Create password file at auxiliary side(TLINK)

[oracle@mydbt4db4 ~]$ cd $ORACLE_HOME/dbs
[oracle@mydbt4db4 dbs]$ orapwd file=orapw$ORACLE_SID password=sys force=y
[oracle@mydbt4db4 dbs]$ ls -ltr orapwR*
-rw-r----- 1 oracle oinstall 1536 Nov 26 16:55 orapwRLINK
[oracle@mydbt4db4 dbs]$


5) Take a backup of the database Source

RMAN> backup database plus archivelog;


Starting backup at 26-NOV-12
current log archived
configuration for DISK channel 2 is ignored
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=133 device type=DISK
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
.
.
.
.
Starting Control File and SPFILE Autobackup at 26-NOV-12
piece handle=/u02/oradata/rman_bkp/c-2903807241-20121126-00 comment=NONE
Finished Control File and SPFILE Autobackup at 26-NOV-12


6)  Prepare for duplicate by starting the auxiliary instance

[oracle@mydbt4db4 rman_bkp]$  sqlplus '/as sysdba'

SQL*Plus: Release 11.2.0.1.0 Production on Mon Nov 26 08:41:59 2012

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

Connected to an idle instance.

SQL> startup nomount;
.
7) Copy the backupsets from source to your auxiliary server

If the duplicate is going to happen on different server, move the backup pieces to a new server using commands like ftp,scp etc

[oracle@mydbt4db2 rman_bkp]$ scp *  oracle@192.168.3.19:/u02/oradata/RMAN_BKP


8) Connect to the auxiliary instance from RMAN and perform the rman duplicate as follows

rman auxiliary /

Recovery Manager: Release 11.2.0.1.0 - Production on Mon Nov 26 20:41:32 2012

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

connected to auxiliary database: RLINK (not mounted)

RMAN>  DUPLICATE DATABASE TO 'RLINK'
2> BACKUP LOCATION '/u02/oradata/RMAN_BKP';

Starting Duplicate Db at 26-NOV-12

contents of Memory Script:
{
   sql clone "create spfile from memory";
}
.
.
.
.
.
executing Memory Script
contents of Memory Script:
{
   Alter clone database open resetlogs;
}
executing Memory Script

database opened
Finished Duplicate Db at 26-NOV-12

Active duplication cloning using RMAN in 11G


You can create a duplicate database using the RMAN duplicate command. The duplicate database has a different DBID from the source database and functions entirely independently. Starting from 11g you can do duplicate database in 2 ways.
1. Active database duplication
2. Backup-based duplication
Active database duplication copies the live target database over the network to the auxiliary destination and then creates the duplicate database. Only difference is that you don't need to have the pre-existing RMAN backups and copies. The duplication work is performed by an auxiliary channel. This channel corresponds to a server session on the auxiliary instance on the auxiliary host.
As part of the duplicating operation, RMAN automates the following steps: 

1. Creates a control file for the duplicate database 
2. Restarts the auxiliary instance and mounts the duplicate control file 
3. Creates the duplicate datafiles and recovers them with incremental backups and archived redo logs. 
4. Opens the duplicate database with the RESETLOGS option 
For the active database duplication, RMAN does one extra step .i.e. copy the target database datafiles over the network to the auxiliary instance
Source(TARGET) instance information:
Instance name=DLINK
hostname=mydbt4db2
datafile location=/u03/oradata/DLINK, /u02/oradata/DLINK
Redolog file location=/u03/oradata/DLINK
Archive log file location=/u02/oradata/arch

Auxiliary instance information:

Instance name=TLINK
hostname=mydbt4db4
datafile location=/u03/oradata/TLINK, /u02/oradata/TLINK
Redolog file location=/u03/oradata/TLINK
Archive log file location=/u02/oradata/arch_TLINK

Note: Before proceeding with active duplication ,rman should be fully configured on
Source side with or without catalog database.

1 )Define ORACLE_SID and other required settings for auxiliary instnace

[oracle@mydbt4db4 ~]$ vi .bash_profile
[oracle@mydbt4db4 ~]$ . .bash_profile
[oracle@mydbt4db4 ~]$ echo $ORACLE_HOME
/u01/app/oracle/product/11.2.0/dbhome_1
[oracle@mydbt4db4 ~]$ echo $ORACLE_SID
TLINK
[oracle@mydbt4db4 ~]$ echo $TNS_ADMIN
/u01/app/oracle/product/11.2.0/dbhome_1/network/admin
[oracle@mydbt4db4 ~]$

1.b)Create required directory structure at auxiliary side

[oracle@mydbt4db4 admin]$ mkdir -p /u02/oradata/TLINK
[oracle@mydbt4db4 admin]$ mkdir -p /u03/oradata/TLINK
[oracle@mydbt4db4 admin]$ mkdir -p /u02/oradata/arch_TLINK


2)  Creating initialization Parameter file for the Auxiliary instance(TLINK)


[oracle@mydbt4db4 dbs]$ cd $ORACLE_HOME/dbs
[oracle@mydbt4db4 dbs]$ vi initTLINK.ora
[oracle@mydbt4db4 dbs]$ more initTLINK.ora
db_name='TLINK'
memory_target=200M
db_block_size=8192
control_files ='/u02/oradata/TLINK/control1.ctl','/u03/oradata/TLINK/control2.ctl'
compatible ='11.2.0'
log_archive_dest=/u02/oradata/arch_TLINK
log_file_name_convert='/u03/oradata/DLINK','/u03/oradata/TLINK'
db_file_name_convert='/u03/oradata/DLINK','/u03/oradata/TLINK','/u02/oradata/DLINK','/u02/oradata/TLINK'

3) Create password file at auxiliary side(TLINK)
[oracle@mydbt4db4 ~]$ cd $ORACLE_HOME/dbs
[oracle@mydbt4db4 dbs]$ orapwd file=orapw$ORACLE_SID password=sys force=y
[oracle@mydbt4db4 dbs]$ ls -ltr orapw*
-rw-r----- 1 oracle oinstall 1536 Nov 26 13:44 orapwTLINK

4) Start auxiliary instance

 [oracle@mydbt4db4 dbs]$ sqlplus '/as sysdba'
SQL*Plus: Release 11.2.0.1.0 Production on Mon Nov 26 13:50:00 2012
Copyright (c) 1982, 2009, Oracle.  All rights reserved.
Connected to an idle instance.

SQL> startup nomount;
ORACLE instance started.

5) Configure listener at auxiliary side

[oracle@mydbt4db4 dbs]$ cd $TNS_ADMIN
[oracle@mydbt4db4 admin]$ vi listener.ora
[oracle@mydbt4db4 admin]$ more listener.ora
TLINK =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = mydbt4db4.redLINKtech.com)(PORT = 1526))
    )
  )

SID_LIST_TLINK =
  (SID_LIST =
    (SID_DESC =
      (ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1)
      (SID_NAME = TLINK)
    )
  )

[oracle@mydbt4db4 admin]$ lsnrctl start TLINK

6) Configure listener at TARGET(source) side

[oracle@mydbt4db2 admin]$ cd $TNS_ADMIN
[oracle@mydbt4db2 admin]$ vi listener.ora
[oracle@mydbt4db2 admin]$ more listener.ora
DLINK =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = mydbt4db2.redLINKtech.com)(PORT = 1525))
    )
  )

SID_LIST_DLINK =
  (SID_LIST =
    (SID_DESC =
      (ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1)
      (SID_NAME = DLINK)
    )
  )
[oracle@mydbt4db2 admin]$ lsnrctl start DLINK


7)Create password file at TARGET(DLINK) side

[oracle@mydbt4db2 admin]$ cd $ORACLE_HOME/dbs
[oracle@mydbt4db2 dbs]$ orapwd file=orapw$ORACLE_SID password=sys force=y
[oracle@mydbt4db2 dbs]$ ls -ltr orapw*
-rw-r----- 1 oracle oinstall 1536 Nov 26 02:29 orapwDLINK
[oracle@mydbt4db2 dbs]$

8) Configure tns alias at auxiliary(TLINK) to connect TARGET database(DLINK).

[oracle@mydbt4db4 admin]$ cd $TNS_ADMIN
[oracle@mydbt4db4 admin]$ vi tnsnames.ora
[oracle@mydbt4db4 admin]$ more tnsnames.ora
to_dLINK=
        (DESCRIPTION=
                (ADDRESS=(PROTOCOL=tcp)(HOST=mydbt4db2.redLINKtech.com)(PORT=1525))
            (CONNECT_DATA=
                (SID=DLINK)
            )
        )

to_tLINK=
        (DESCRIPTION=
                (ADDRESS=(PROTOCOL=tcp)(HOST=mydbt4db4.redLINKtech.com)(PORT=1526))
            (CONNECT_DATA=
                (SID=TLINK)
            )
        )
[oracle@mydbt4db4 admin]$ tnsping to_dLINK
TNS Ping Utility for Linux: Version 11.2.0.1.0 - Production on 26-NOV-2012 14:15:40
Copyright (c) 1997, 2009, Oracle.  All rights reserved.
Used parameter files:

Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION= (ADDRESS=(PROTOCOL=tcp)(HOST=mydbt4db2.redLINKtech.com)(PORT=1525)) (CONNECT_DATA= (SID=DLINK)))
OK (70 msec)

[oracle@mydbt4db4 admin]$ tnsping to_tLINK

TNS Ping Utility for Linux: Version 11.2.0.1.0 - Production on 26-NOV-2012 14:15:51
Copyright (c) 1997, 2009, Oracle.  All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION= (ADDRESS=(PROTOCOL=tcp)(HOST=mydbt4db4.redLINKtech.com)(PORT=1526)) (CONNECT_DATA= (SID=TLINK)))
OK (50 msec)

9) Configure tns alias at Target(DLINK) to connect auxiliary  instance (TLINK).

[oracle@mydbt4db2 admin]$ cd $TNS_ADMIN
[oracle@mydbt4db2 admin]$
[oracle@mydbt4db2 admin]$ vi tnsnames.ora
[oracle@mydbt4db2 admin]$ more tnsnames.ora
to_tLINK=
        (DESCRIPTION=
                (ADDRESS=(PROTOCOL=tcp)(HOST=mydbt4db4.redLINKtech.com)(PORT=1526))
            (CONNECT_DATA=
                (SID=TLINK)
            )
        )
[oracle@mydbt4db2 admin]$ tnsping to_tLINK

TNS Ping Utility for Linux: Version 11.2.0.1.0 - Production on 26-NOV-2012 02:27:09

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

Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION= (ADDRESS=(PROTOCOL=tcp)(HOST=mydbt4db4.redLINKtech.com)(PORT=1526)) (CONNECT_DATA= (SID=TLINK)))
OK (180 msec)
[oracle@mydbt4db2 admin]$
10. Start RMAN and Connect to the Database Instances
Start RMAN and connect to the source database as TARGET, the duplicate database instance as AUXILIARY, and, if applicable, the recovery catalog database. You can start the RMAN client on any host so long as it can connect to all of the database instances. If the auxiliary instance requires a text-based initialization parameter file, then this file must exist on the same host that runs the RMAN client application.
In this bulletin we are doing duplicate database from the auxiliary server. Look at the example :

[oracle@mydbt4db4 admin]$ rman

Recovery Manager: Release 11.2.0.1.0 - Production on Mon Nov 26 14:53:24 2012

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

RMAN> connect target sys/sys@to_dLINK

connected to target database: DLINK (DBID=2903807241)

RMAN> connect auxiliary sys/sys@to_tLINK

connected to auxiliary database: TLINK (not mounted)

11)  Run the DUPLICATE database command
The simplest case is to use active database duplication to duplicate the database to a different host and use the different directory structure. Look at the example :

RMAN> DUPLICATE TARGET DATABASE
2> to 'TLINK'
3> FROM ACTIVE DATABASE;

Starting Duplicate Db at 26-NOV-12
using target database control file instead of recovery catalog
configuration for DISK channel 2 is ignored
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=96 device type=DISK

contents of Memory Script:
{
   sql clone "create spfile from memory";
}
executing Memory Script
.
.
.
.
contents of Memory Script:
{
   Alter clone database open resetlogs;
}
executing Memory Script

database opened
Finished Duplicate Db at 26-NOV-12

RMAN>