31
The Challenges of Oracle Cloning Safa Alak Consulting System Engineer [email protected]

The Challenges of Oracle Cloning - · PDF fileThe Challenges of Oracle Cloning ... Oracle Database 10g Release 2 added Transportable Database ... Oracle MetaLink Note 230672.1

Embed Size (px)

Citation preview

Page 1: The Challenges of Oracle Cloning -  · PDF fileThe Challenges of Oracle Cloning ... Oracle Database 10g Release 2 added Transportable Database ... Oracle MetaLink Note 230672.1

The Challenges of

Oracle Cloning

Safa Alak

Consulting System Engineer

[email protected]

Page 2: The Challenges of Oracle Cloning -  · PDF fileThe Challenges of Oracle Cloning ... Oracle Database 10g Release 2 added Transportable Database ... Oracle MetaLink Note 230672.1

Agenda

– Challenges

– Traditional Approach for Cloning

� The command Line Way

� Using RMAN

– 10G R2 Transportable Database Option

© 2008 NetApp. All rights reserved.

– Storage Replication

– Using FLexClone to Replicate Oracle

– Oracle 11g Real Application Testing

– Oracle E Business Suite Replication

– On line Demo

2

Page 3: The Challenges of Oracle Cloning -  · PDF fileThe Challenges of Oracle Cloning ... Oracle Database 10g Release 2 added Transportable Database ... Oracle MetaLink Note 230672.1

DBA Chalenges

Install

Re-organize

UpgradePain Points

Plan

Configure

systems,

forecast

storage

accurately

Testing requires

duplicate data,Create several

Need

reliable backup

restore, and DR

solution

© 2008 NetApp. All rights reserved. 3

Need reliable

backup and

recovery

solution

Implement

PatchDeployDeploy

Pain Points

Tune &

Maintain

duplicate data,

lengthy and

expensive

process

Mirror prod.

data

to test and dev

system,

lengthy

process

Create several

clones,

lengthy process,

expensive

Need

reliable backup

and

recovery solution

Page 4: The Challenges of Oracle Cloning -  · PDF fileThe Challenges of Oracle Cloning ... Oracle Database 10g Release 2 added Transportable Database ... Oracle MetaLink Note 230672.1

Cloning Oracle Database

Database cloning is a procedure by which you can create an exact copy of an Oracle database without doing a full export/import. This method is used frequently by DBAs to update test or development environments from production.

© 2008 NetApp. All rights reserved. 4

production.

Page 5: The Challenges of Oracle Cloning -  · PDF fileThe Challenges of Oracle Cloning ... Oracle Database 10g Release 2 added Transportable Database ... Oracle MetaLink Note 230672.1

Cloning of Oracle Business Suite

Cloning is the process of creating an identical copy of an already existing Oracle Applications system, including both the application-tier and database-tier.

Oracle Business Suite clones are more complex than database clone. Key application information , including configuration files and patches residing both in the database and application layers, must all be copied to gain a fully useable application

© 2008 NetApp. All rights reserved. 5

layers, must all be copied to gain a fully useable application environment clone. To perform this copying manually requires editing more than 360 commands.

To simplify the challenges, Oracle created a cloning utility called RapidClone, which aids in the reconfiguration of oracle 11i environment, but does not usually perform the physical copying steps required to create a clone. Copying typically, requires running time-consuming, copying utilities, usually when the system is offline.

Page 6: The Challenges of Oracle Cloning -  · PDF fileThe Challenges of Oracle Cloning ... Oracle Database 10g Release 2 added Transportable Database ... Oracle MetaLink Note 230672.1

The Command Line Way

1. On SQL*Plus, sign on as SYSDBA and issue: “alter database backup controlfile to trace The command will generate a SQL script in user_dump_dest that can be used to regenerate the database

2. Shutdown the old database or put it in hotbackup mode

© 2008 NetApp. All rights reserved. 6

mode

3. Copy all data files into the new directories on the new server

4. Copy and Edit the Control file – Using the output syntax from step 1 to point to the new database

5. Remove the “recover database” and “alter database open” from script created in 1

Page 7: The Challenges of Oracle Cloning -  · PDF fileThe Challenges of Oracle Cloning ... Oracle Database 10g Release 2 added Transportable Database ... Oracle MetaLink Note 230672.1

6. Re-names of the data files names that have changed.

7. Create the bdump, udump and cdump directories

8. Copy-over the old init.ora file

9. Start the new database in nomount

10. Put the database in archive log mode if it is not in that mode

© 2008 NetApp. All rights reserved. 7

that mode

Page 8: The Challenges of Oracle Cloning -  · PDF fileThe Challenges of Oracle Cloning ... Oracle Database 10g Release 2 added Transportable Database ... Oracle MetaLink Note 230672.1

STARTUP NOMOUNTCREATE CONTROLFILE SET DATABASE "MYCLONE" RESETLOGS NOARCHIVELOGMAXLOGFILES 16MAXLOGMEMBERS 3MAXDATAFILES 100MAXINSTANCES 8MAXLOGHISTORY 292LOGFILEGROUP 1 '/oracle/oradata/myclone/redo01.log' SIZE 10M,

© 2008 NetApp. All rights reserved. 8

GROUP 1 '/oracle/oradata/myclone/redo01.log' SIZE 10M,GROUP 2 '/oracle/oradata/myclone/redo02.log' SIZE 10M,GROUP 3 '/oracle/oradata/myclone/redo03.log' SIZE 10MDATAFILE'/oracle/oradata/myclone/system01.dbf','/oracle/oradata/myclone/undotbs01.dbf','/oracle/oradata/myclone/sysaux01.dbf','/oracle/oradata/myclone/users01.dbf'CHARACTER SET WE8ISO8859P1;

Page 9: The Challenges of Oracle Cloning -  · PDF fileThe Challenges of Oracle Cloning ... Oracle Database 10g Release 2 added Transportable Database ... Oracle MetaLink Note 230672.1

Cloning using RMAN backup

1. Backup the source DB using RMAN2. Create new instance of Oracle called auxiliary

instance3. Insure that networking is configured properly so that

you can connect to source DB and auxiliary DB4. Create or copy init.ora, spfile and password file as

needed. You can borrow the files from the source DB.

© 2008 NetApp. All rights reserved. 9

needed. You can borrow the files from the source DB.

5. Set the following parameters using alter systembackground_dump_dest ; user_dump_dest ;core_dump_dest ; control_files ; db_name ; instance_name(remove any reference to the source DB)

Page 10: The Challenges of Oracle Cloning -  · PDF fileThe Challenges of Oracle Cloning ... Oracle Database 10g Release 2 added Transportable Database ... Oracle MetaLink Note 230672.1

6. Insure that networking is configured properly for the cloned database in listner.ora and tnsnames.ora

7. Connect RMAN to the source DB and the cloned one using the syntax:

rman target user/password@sourceDB auxiliary user/password@cloneDB

© 2008 NetApp. All rights reserved. 10

user/password@cloneDB

8. Use a script like:

Page 11: The Challenges of Oracle Cloning -  · PDF fileThe Challenges of Oracle Cloning ... Oracle Database 10g Release 2 added Transportable Database ... Oracle MetaLink Note 230672.1

run {allocate auxiliary channel d1 type disk;set newname for datafile 1 to ;

set newname for datafile 2 to ;set newname for datafile 3 to ;set newname for datafile 5 to ;

© 2008 NetApp. All rights reserved. 11

set newname for datafile 5 to ;

duplicate target database to clonedb

logfile group 1 ('C:\CLONE\log01.rdo') size 10m reuse,group 2 ('C:\CLONE\log02.rdo') size 10m reuse;}

Page 12: The Challenges of Oracle Cloning -  · PDF fileThe Challenges of Oracle Cloning ... Oracle Database 10g Release 2 added Transportable Database ... Oracle MetaLink Note 230672.1

Transportable Database Option

Oracle Database 10g Release 2 added Transportable

Database (TDB), which is the capability to transport an entire database (user data and the Oracle dictionary) to other platform with the same endian format. TDB uses Recovery Manager (RMAN) to convert the database files to the new target platform format and

© 2008 NetApp. All rights reserved. 12

create scripts to facilitate in the migration process.

Page 13: The Challenges of Oracle Cloning -  · PDF fileThe Challenges of Oracle Cloning ... Oracle Database 10g Release 2 added Transportable Database ... Oracle MetaLink Note 230672.1

Using TDB to migrate a database to a new platform of the same endian format consists of the following high-level steps:

1. Check prerequisites

2. Identify external files and directories

© 2008 NetApp. All rights reserved. 13

3. Start the database in READ ONLY mode

4. Verify the database is ready for migration

5. Run RMAN CONVERT DATABASE

6. Move necessary files to the target system

7. Complete the migration

Page 14: The Challenges of Oracle Cloning -  · PDF fileThe Challenges of Oracle Cloning ... Oracle Database 10g Release 2 added Transportable Database ... Oracle MetaLink Note 230672.1

Storage Replication

The Storage vendors provide with host tools to create clone of the Oracle DB or Oracle Apps.

The main function of these tools are:

1. Interact with Oracle and get data files, logs and configuration files information

2. Identify storage components.

3. Creates clone of those storage components on the

© 2008 NetApp. All rights reserved. 14

3. Creates clone of those storage components on the luns or volume levels

4. Use storage clone or snaps to create the clone copy.

Once the Storage system provides storage replica, the Oracle admin can do house keeping to rename the database to ‘clone DB”.

Page 15: The Challenges of Oracle Cloning -  · PDF fileThe Challenges of Oracle Cloning ... Oracle Database 10g Release 2 added Transportable Database ... Oracle MetaLink Note 230672.1

The Storage vendors provides different capabilities to rename the database and do house keeping work.

The same technique, provides the Oracle admin with options to implement the following:

� Backup and restore operations

© 2008 NetApp. All rights reserved. 15

� Backup and restore operations

� Disaster Recovery

� With Oracle E Business Suite, you can run the RapidClone utility after doing storage replication for the whole Apps – DB environment.

Page 16: The Challenges of Oracle Cloning -  · PDF fileThe Challenges of Oracle Cloning ... Oracle Database 10g Release 2 added Transportable Database ... Oracle MetaLink Note 230672.1

Database Cloning and the Application

Development Process

� Full or partial database copies required for:– App and DB Development

– Maintenance (OS, DB upgrade)

– Test and QA

PROD SECONDARY (DR)

© 2008 NetApp. All rights reserved. 16

– Test and QA

– Training and Demos

– Reporting and DW ETL

� Ability to do this quickly, correctly, and efficiently directly impacts Application Development and DeploymentDEV

MAINT

TEST/QA RPT/ETL

Page 17: The Challenges of Oracle Cloning -  · PDF fileThe Challenges of Oracle Cloning ... Oracle Database 10g Release 2 added Transportable Database ... Oracle MetaLink Note 230672.1

Traditional Approaches to

Cloning

� Copy

– Offline

– Online (using a mirror or standby database, snapshots, and log-based consistent recovery)

� Redirected restore

© 2008 NetApp. All rights reserved. 17

� Redirected restore

– From disk- or tape-based backups

Test 1 Test 2 Test N

Production Mirrored Copy

Dev 1 Dev NDev 2

Page 18: The Challenges of Oracle Cloning -  · PDF fileThe Challenges of Oracle Cloning ... Oracle Database 10g Release 2 added Transportable Database ... Oracle MetaLink Note 230672.1

Traditional Approaches to

Cloning (cont)

� Challenges and pain points

– Limited storage resources� 100% storage capacity overhead per instance, or custom partial extraction scripts

– Long lead-time requirements

Apps./Biz.

Network

Systems

© 2008 NetApp. All rights reserved. 18

� Process heavy (I.e., Many “approvals” required.)

� Storage resource allocation

� Manual or scripted operations subject to human error

– Downtime (offline) or degraded production system performance (online) during copy

– Restoring the baseline requires repeat of this process

Systems

Database

Storage

Page 19: The Challenges of Oracle Cloning -  · PDF fileThe Challenges of Oracle Cloning ... Oracle Database 10g Release 2 added Transportable Database ... Oracle MetaLink Note 230672.1

Database Maintenance with

FlexClones

Benefits

� Instantaneous copies

� Low resource overhead

� Inexpensive

� Easy and relatively inexpensive

Production Mirrored Copy

Dev 1 Dev NDev 2

© 2008 NetApp. All rights reserved. 19

� Easy and relatively inexpensive way to make copies of a production database without impacting the database

� Use database clones to test migrations, apply bug fixes, upgrades, and patches

� Easily reallocate storage for a database and its transaction log files

Test 1 Test 2 Test N

Dev 1 Dev NDev 2

Productio

n DB

Clones

Page 20: The Challenges of Oracle Cloning -  · PDF fileThe Challenges of Oracle Cloning ... Oracle Database 10g Release 2 added Transportable Database ... Oracle MetaLink Note 230672.1

Application Development and Testing

Example: Traditional Approach

Production database 100GB

Mirror copy 100GB

Development copies 300GB

Testing copies 300GB

Total: 800GB

Production Mirrored Copy

Dev 1 Dev 3Dev 2

© 2008 NetApp. All rights reserved. 20

� 8x actual storage requirement

� Time consuming

� Resource overhead

Test 1 Test 2 Test 3

Dev 1 Dev 3Dev 2

Page 21: The Challenges of Oracle Cloning -  · PDF fileThe Challenges of Oracle Cloning ... Oracle Database 10g Release 2 added Transportable Database ... Oracle MetaLink Note 230672.1

Application Development and Testing

Example: NetApp Approach

Production database 100GB

Mirror copy 100GB

Development copies 30GB

Testing copies 30GB

Total: 260GB

Production Mirrored Copy

Dev 1 Dev 3Dev 2

© 2008 NetApp. All rights reserved. 21

� Over 67% reduction in storage required

� Near instantaneous copies

� Negligible overhead

� Ability to have many more test and dev copies

Test 1 Test 2 Test 3

Dev 1 Dev 3Dev 2

Assumption: up to 10% change in data in the test and dev environments

more clones = higher productivity

Page 22: The Challenges of Oracle Cloning -  · PDF fileThe Challenges of Oracle Cloning ... Oracle Database 10g Release 2 added Transportable Database ... Oracle MetaLink Note 230672.1

Real Application

Testing Option

Transactions and timing only

© 2008 NetApp. All rights reserved.22

FlexClone®

4

PRODUCTION TEST

Workload

ReplayCapture

21Snapshot™

3SnapMirror® /SyncMirror®

only

No clients or middle tier requiredMaximize testing efforts with multiple FlexClone volumes

Challenge: How to create a point in time snapshot…

Page 23: The Challenges of Oracle Cloning -  · PDF fileThe Challenges of Oracle Cloning ... Oracle Database 10g Release 2 added Transportable Database ... Oracle MetaLink Note 230672.1

Oracle Austin Data Center

Austin Data Center Stats

• More than 20,000+ servers

• Largest Dell/Linux installation on earth

• Scaling at over 100 servers/week

• 6,400+ terabytes of NetApp storage

• Scaling at over 60TBs of storage each month

© 2008 NetApp. All rights reserved. 23

• Scaling at over 60TBs of storage each month

• Over 500 mission-critical customers' apps hosted on the premises

• Primary data center for 50,000+ Oracle employees

• 2 acre of data center raised floor space

• Using storage replication for cloning

Sources: Oracle Magazine Mar/Apr 2005 and Oracle ADC Executives

Page 24: The Challenges of Oracle Cloning -  · PDF fileThe Challenges of Oracle Cloning ... Oracle Database 10g Release 2 added Transportable Database ... Oracle MetaLink Note 230672.1

E-Business Suite: Cloning

scenarios

© 2008 NetApp. All rights reserved. 24

Single-node

to

Multi-node

Single-

node to

Single-

node Multi-nodes

to

Multi-nodes

Multi-nodes

to

Single-node

Cloning is a complex and resource intensive task.Cloning is a complex and resource intensive task.

Page 25: The Challenges of Oracle Cloning -  · PDF fileThe Challenges of Oracle Cloning ... Oracle Database 10g Release 2 added Transportable Database ... Oracle MetaLink Note 230672.1

Oracle Recommends (Oracle

MetaLink :230672.1)

- Cloning mechanism

Cloning Scenarios: (Many physical copies – high cost)� Cloning Single System with Rapid Clone– Copy the Application Tier File System– Copy the Database Tier File System & Database

� Cloning a single node system to a multi-node system– Copy the Application Tier File System

© 2008 NetApp. All rights reserved. 25

– Repeat above copy for every middle tier node– Copy the Database Tier File System & Database

� Adding a new node to an existing System– Copy the Application Tier File System to new node

� Run Oracle Rapid clone utility to complete configuration– cd <COMMON_TOP>/clone/bin – perl adclone.pl (if cloning) adaddnode.pl (if adding a node)

Page 26: The Challenges of Oracle Cloning -  · PDF fileThe Challenges of Oracle Cloning ... Oracle Database 10g Release 2 added Transportable Database ... Oracle MetaLink Note 230672.1

Cloning the Application Tier

System using FlexClone� Verify prerequisites and perform clone preparation steps

� Clone Apps Tier Filesystem– Create a FlexClone™ volume for Application Tier filesystem

� snap create u03 OraAppsBak

� vol clone create AppsClone –b u03 OraAppsBak(FlexClone volume takes seconds compared to physical copy)

© 2008 NetApp. All rights reserved. 26

� Mount the newly created cloned volume

� Perform configuration (adcfgclone.pl) and post clone tasks

Oracle MetaLink Note 230672.1

Page 27: The Challenges of Oracle Cloning -  · PDF fileThe Challenges of Oracle Cloning ... Oracle Database 10g Release 2 added Transportable Database ... Oracle MetaLink Note 230672.1

Cloning Oracle E Business Suite

1. Run system configuration on the Application tier:<COMMON_TOP>/admin/scripts/<SID>/adautocfg.shUse the APPS password when prompted. Run system configuration on the database tier:<RDBMS ORACLE_HOME>/appsutil/<SID>/scripts/adautocfg.shUse the APPS password when prompted.

2. Copy AutoConfig to the RDBMS ORACLE_HOME:Apply patch 2952369 to acquire adchkcfg utility.Create appsutil.zip file by: perl <AD_TOP>/bin/admkappsutil.pl.Copy appsutil.zip file to the <RDBMS ORACLE_HOME>unzip -o appsutil.zip

© 2008 NetApp. All rights reserved. 27

unzip -o appsutil.zip 3. Generate the database context file:

cd <RDBMS ORACLE_HOME>/appsutil/binadbldxml.sh tier=database appsuser=<APPSuser> appspasswd=<APPSpwd>Output log is written to: $ORACLE_HOME/appsuti/out/<SID>/cfgcheck.txt

4. Generate and apply AutoConfig configuration file:cd <RDBMS ORACLE_HOME>/appsutil/binadconfig.sh contextfile=<CONTEXT> appspass=<APPSpwd>

Page 28: The Challenges of Oracle Cloning -  · PDF fileThe Challenges of Oracle Cloning ... Oracle Database 10g Release 2 added Transportable Database ... Oracle MetaLink Note 230672.1

6. Prepare for source database clone:cd <RDBMS ORACLE_HOME>/appsutil/scrips/<SID> ./perl adpreclone.pl dbTier

7. Prepare for source application clone:cd <COMMON_TOP>/admin/scripts/<SID>./perl adpreclone.pl appsTier

8. Copy the application tier file system:Logon to the source system as APPLMGR and shut down the server processes.Copy the following application directories from the source to the target

© 2008 NetApp. All rights reserved. 28

Copy the following application directories from the source to the target node/file system:<APPL_TOP><OA_HTML><OA_JAVA><COMMON_TOP/util><COMMON_TOP/clone><806 ORACLE_HOME><iAS ORACLE_HOME>

Shut down the source database and copy it to the target node/file system.Restart the source database and source application server processes.

Page 29: The Challenges of Oracle Cloning -  · PDF fileThe Challenges of Oracle Cloning ... Oracle Database 10g Release 2 added Transportable Database ... Oracle MetaLink Note 230672.1

9. Configure the target system database sever:cd <RDBMS ORACLE_HOME>/appsutil/clon/bin./perl adcfgclone.pl dbTier

10. Configure the target system application tier:cd <COMMON_TOP>/clone/bin./perl adcfgclone.pl appsTier

© 2008 NetApp. All rights reserved. 29

Page 30: The Challenges of Oracle Cloning -  · PDF fileThe Challenges of Oracle Cloning ... Oracle Database 10g Release 2 added Transportable Database ... Oracle MetaLink Note 230672.1

� Online Demo

© 2008 NetApp. All rights reserved. 30

Page 31: The Challenges of Oracle Cloning -  · PDF fileThe Challenges of Oracle Cloning ... Oracle Database 10g Release 2 added Transportable Database ... Oracle MetaLink Note 230672.1

Thank you

© 2008 NetApp. All rights reserved. 31

Thank you