The Challenges of Oracle Cloning Safa Alak Consulting System Engineer safa@netapp.com
Agenda Challenges Traditional Approach for Cloning The command Line Way Using RMAN 10G R2 Transportable Database Option Storage Replication Using FLexClone to Replicate Oracle Oracle 11g Real Application Testing Oracle E Business Suite Replication On line Demo 2008 NetApp. All rights reserved. 2
DBA Chalenges Need reliable backup restore, and DR solution Re-organize Plan Install Configure systems, forecast storage accurately Create several clones, lengthy process, expensive Upgrade Pain Points Implement Testing requires duplicate data, lengthy and expensive process Patch Deploy Need reliable backup and recovery solution Tune & Maintain Mirror prod. data to test and dev system, lengthy process 2008 NetApp. All rights reserved. 3 Need reliable backup and recovery solution
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
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 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. 2008 NetApp. All rights reserved. 5
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 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 2008 NetApp. All rights reserved. 6
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
STARTUP NOMOUNT CREATE CONTROLFILE SET DATABASE "MYCLONE" RESETLOGS NOARCHIVELOG MAXLOGFILES 16 MAXLOGMEMBERS 3 MAXDATAFILES 100 MAXINSTANCES 8 MAXLOGHISTORY 292 LOGFILE 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 10M DATAFILE '/oracle/oradata/myclone/system01.dbf', '/oracle/oradata/myclone/undotbs01.dbf', '/oracle/oradata/myclone/sysaux01.dbf', '/oracle/oradata/myclone/users01.dbf' CHARACTER SET WE8ISO8859P1 ; 2008 NetApp. All rights reserved. 8
Cloning using RMAN backup 1. Backup the source DB using RMAN 2. Create new instance of Oracle called auxiliary instance 3. Insure that networking is configured properly so that you can connect to source DB and auxiliary DB 4. Create or copy init.ora, spfile and password file as needed. You can borrow the files from the source DB. 5. Set the following parameters using alter system background_dump_dest ; user_dump_dest ; core_dump_dest ; control_files ; db_name ; instance_name (remove any reference to the source DB) 2008 NetApp. All rights reserved. 9
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 8. Use a script like: 2008 NetApp. All rights reserved. 10
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 ; duplicate target database to clonedb logfile group 1 ('C:\CLONE\log01.rdo') size 10m reuse, group 2 ('C:\CLONE\log02.rdo') size 10m reuse; } 2008 NetApp. All rights reserved. 11
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 create scripts to facilitate in the migration process. 2008 NetApp. All rights reserved. 12
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 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 2008 NetApp. All rights reserved. 13
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 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. 2008 NetApp. All rights reserved. 14
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 Disaster Recovery With Oracle E Business Suite, you can run the RapidClone utility after doing storage replication for the whole Apps DB environment. 2008 NetApp. All rights reserved. 15
Database Cloning and the Application Development Process PROD DEV MAINT SECONDARY (DR) TEST/QA RPT/ETL Full or partial database copies required for: App and DB Development Maintenance (OS, DB upgrade) Test and QA Training and Demos Reporting and DW ETL Ability to do this quickly, correctly, and efficiently directly impacts Application Development and Deployment 2008 NetApp. All rights reserved. 16
Traditional Approaches to Cloning Copy Offline Online (using a mirror or standby database, snapshots, and log-based consistent recovery) Redirected restore From disk- or tape-based backups Production Mirrored Copy Dev 1 Dev 2 Dev N Test 1 Test 2 Test N 2008 NetApp. All rights reserved. 17
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 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 2008 NetApp. All rights reserved. 18 Apps./Biz. Network Systems Database Storage
Database Maintenance with FlexClones Production Productio n DB Clones Mirrored Copy Dev 1 Dev 2 Dev N Test 1 Test 2 Test N Benefits Instantaneous copies Low resource overhead Inexpensive 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 2008 NetApp. All rights reserved. 19
Application Development and Testing Example: Traditional Approach Production Mirrored Copy Dev 1 Dev 2 Dev 3 Test 1 Test 2 Test 3 Production database 100GB Mirror copy 100GB Development copies 300GB Testing copies 300GB Total: 800GB 8x actual storage requirement Time consuming Resource overhead 2008 NetApp. All rights reserved. 20
Application Development and Testing Example: NetApp Approach Production Mirrored Copy Dev 1 Dev 2 Dev 3 Test 1 Test 2 Test 3 Production database 100GB Mirror copy 100GB Development copies 30GB Testing copies 30GB Total: 260GB Over 67% reduction in storage required Near instantaneous copies Negligible overhead Ability to have many more test and dev copies more clones = higher productivity Assumption: up to 10% change in data in the test and dev environments 2008 NetApp. All rights reserved. 21
Real Application Testing Option PRODUCTION Challenge : How to create a point in time snapshot 22 1 Snapshot 2008 NetApp. All rights reserved. Capture 2 Workload 3 Replay SnapMirror /SyncMirror 4 FlexClone Transactio ns and timing only No clients or middle tier TEST Maximiz required e testing efforts with multiple FlexClo ne volumes
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 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 2008 NetApp. All rights reserved. 23
E-Business Suite: Cloning scenarios Singlenode to Singlenode Single-node to Multi-node Multi-nodes to Multi-nodes Multi-nodes to Single-node Cloning is a complex and resource intensive task. 2008 NetApp. All rights reserved. 24
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 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) 2008 NetApp. All rights reserved. 25
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) Mount the newly created cloned volume Perform configuration (adcfgclone.pl) and post clone tasks Oracle MetaLink Note 230672.1 2008 NetApp. All rights reserved. 26
Cloning Oracle E Business Suite 1. Run system configuration on the Application tier: <COMMON_TOP>/admin/scripts/<SID>/adautocfg.sh Use the APPS password when prompted. Run system configuration on the database tier: <RDBMS ORACLE_HOME>/appsutil/<SID>/scripts/adautocfg.sh Use 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 3. Generate the database context file: cd <RDBMS ORACLE_HOME>/appsutil/bin adbldxml.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/bin adconfig.sh contextfile=<context> appspass=<appspwd> 2008 NetApp. All rights reserved. 27
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 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. 2008 NetApp. All rights reserved. 28
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
Online Demo 2008 NetApp. All rights reserved. 30
Thank you 2008 NetApp. All rights reserved. 31