MK-92ADPTR076-02
Hitachi Storage Adapter for Oracle Enterprise Manager - Database
Cloning User’s Guide
V02.0.0
Hardware and Software Support
Troubleshooting
Contents
Getting Help
FASTFIND LINKS
©2015-2016 Hitachi, Ltd. All rights reserved.
No part of this publication may be reproduced or transmitted in any form or by any means, electronic or mechanical, including copying and recording, or stored in a database or retrieval system for commercial purposes without the express written permission of Hitachi, Ltd., or
Hitachi Data Systems Corporation (collectively “Hitachi”). Licensee may make copies of the Materials provided that any such copy is: (i) created as an essential step in utilization of the Software as licensed and is used in no other manner; or (ii) used for archival purposes. Licensee may not make any other copies of the Materials. “Materials” mean text, data, photographs, graphics, audio, video and documents.
Hitachi reserves the right to make changes to this Material at any time without notice and assumes no responsibility for its use. The Materials contain the most current information
available at the time of publication.
Some of the features described in the Materials might not be currently available. Refer to the most recent product announcement for information about feature and product availability, or contact Hitachi Data Systems Corporation at https://portal.hds.com.
Notice: Hitachi products and services can be ordered only under the terms and conditions of the applicable Hitachi agreements. The use of Hitachi products is governed by the terms of your agreements with Hitachi Data Systems Corporation.
By using this software, you agree that you are responsible for:
1) Acquiring the relevant consents as may be required under local privacy laws or otherwise fromauthorized employees and other individuals to access relevant data; and 2) Verifying that data continues to be held, retrieved, deleted, or otherwise processed inaccordance with relevant laws.
Notice on Export Controls. The technical data and technology inherent in this Document may
be subject to U.S. export control laws, including the U.S. Export Administration Act and its associated regulations, and may be subject to export or import regulations in other countries. Reader agrees to comply strictly with all such regulations and acknowledges that Reader has the responsibility to obtain licenses to export, re-export, or import the Document and any Compliant
Products.
Hitachi is a registered trademark of Hitachi, Ltd., in the United States and other countries.
AIX, AS/400e, DB2, Domino, DS6000, DS8000, Enterprise Storage Server, eServer, FICON,
FlashCopy, IBM, Lotus, MVS, OS/390, PowerPC, RS/6000, S/390, System z9, System z10, Tivoli, z/OS, z9, z10, z13, z/VM, and z/VSE are registered trademarks or trademarks of International Business Machines Corporation.
Active Directory, ActiveX, Bing, Excel, Hyper-V, Internet Explorer, the Internet Explorer logo, Microsoft, the Microsoft Corporate Logo, MS-DOS, Outlook, PowerPoint, SharePoint, Silverlight, SmartScreen, SQL Server, Visual Basic, Visual C++, Visual Studio, Windows, the Windows logo, Windows Azure, Windows PowerShell, Windows Server, the Windows start button, and Windows
Vista are registered trademarks or trademarks of Microsoft Corporation. Microsoft product screen shots are reprinted with permission from Microsoft Corporation.
All other trademarks, service marks, and company names in this document or website are
properties of their respective owners.
Contents 3
Hitachi Storage Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Contents
Preface .......................................................................................... 7
Intended Audience ..................................................................................... 8
Software Version ....................................................................................... 8
Release Notes ........................................................................................... 8
Document Conventions .............................................................................. 8
Getting Help ............................................................................................ 10
Comments .............................................................................................. 10
1 Overview ..................................................................................... 11
Introduction ............................................................................................ 12
Real-World Activities ....................................................................................... 13
How It Works .......................................................................................... 15
2 Hardware and Software Environments ........................................ 17
Hardware Requirements ........................................................................... 18
Storage Models .............................................................................................. 18
Host Interface ................................................................................................ 18
Device Type ................................................................................................... 19
Volume Type.................................................................................................. 19
4 Contents
Hitachi Storage Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Software Requirements ............................................................................ 19
Oracle Grid Software ...................................................................................... 20
Oracle Database ............................................................................................. 20
Server OS ...................................................................................................... 20
Replication Software and Supported Configuration ........................................... 21
Product Licensing ..................................................................................... 21
Creating the Hitachi Adapter Product License File ............................................. 21
Rules for Entering a License Key ..................................................................... 21
3 Required Pre-installation ............................................................. 23
Pre-installation Setup Requirements .......................................................... 24
HUS Environment Configurations ..................................................................... 24
Configuring RAID Manager for VSP, VSP G1000, VSP Gx00, and HUS-VM ..... 24
Command Device Configuration ...................................................................... 24
RAID Manager Configuration ........................................................................... 25
4 Required Pre-operation ............................................................... 27
Initial Configuration ................................................................................. 28
Storage Subsystem Latency ...................................................................... 28
Adapter Prerequisites (Block Storage) ........................................................ 28
Setting up the Database ........................................................................... 30
Setting up the Source and Target Servers ........................................................ 30
Account Privileges .......................................................................................... 30
Configuring the Underlying Oracle Data Storage Manager for the Production (Primary) Database ........................................................................................ 30
5 Installation and Setup ................................................................. 33
Pre-installation Steps ............................................................................... 34
Install Java .................................................................................................... 34
Configure Any Required Proxy Settings ............................................................ 34
Packages Required ......................................................................................... 34
Installing the Hitachi Storage Adapter RPM ................................................ 34
Contents 5
5
Hitachi Storage Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Adapter User Account Configuration ................................................................ 35
Post-installation Steps .............................................................................. 35
Uninstalling Hitachi Adapter RPM .............................................................. 36
Configuring the Virtual Environment .......................................................... 36
Summary ................................................................................................ 37
Inventory Hosts File ................................................................................. 38
Set up Connectivity to the Servers ................................................................... 38
Database Installation ............................................................................... 39
Cold Cloning ............................................................................................ 39
Hot Cloning ............................................................................................. 39
Discovery ................................................................................................ 40
6 Configuring the Adapter .............................................................. 41
Configuring the Storage ........................................................................... 42
Configuring Common Information ............................................................. 43
Checking Inventory Files .......................................................................... 43
Configuring the Source Database System ................................................... 44
Configuring the Target Database System ................................................... 46
7 Database Cloning ........................................................................ 49
Installation Checklist ................................................................................ 50
Installing for Discovery ............................................................................. 51
Installing for Single-Instance/RAC Database Cloning ................................... 51
Performing Cold and Hot Cloning .............................................................. 51
Verifying and Validating the OEM-Database Clone ...................................... 52
Adapter Limitations .................................................................................. 54
6 Contents
Hitachi Storage Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
8 Logging and Messages ................................................................. 55
Logging .................................................................................................. 56
Specifying the Log Levels in the Configuration File ........................................... 56
Log Generation and Rotation .......................................................................... 56
Messages ................................................................................................ 57
9 Troubleshooting .......................................................................... 59
Troubleshooting Tips ................................................................................ 60
Oracle Error ................................................................................................... 60
Cloning Tips ................................................................................................... 60
Cloning RAC Tips ............................................................................................ 60
Naming Tips .................................................................................................. 60
Directory Structure .................................................................................. 61
Abbreviations, Terms, and Acronyms .......................................... 63
Preface 7
Hitachi Adapter for Oracle Database Cloning User’s Guide User’s Guide
Preface
Intended Audience
Software Version
Release Notes
Document Conventions
Getting Help
Comments
8 Preface
Hitachi Storage Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Note The use of Hitachi Storage Adapter for Oracle Enterprise Manager - Database Cloning and all other Hitachi Data
Systems products is governed by the terms of your agreement(s) with Hitachi Data Systems.
Intended Audience
This document is intended for customers of the Hitachi Adapter for Oracle Enterprise Manager - Database Cloning: Oracle database administrators,
storage administrators, and architects implementing a backup, recovery, and cloning solution for Oracle databases. Ideally, readers should have a solid understanding of the architecture, administration, and backup and recovery
concepts of Oracle databases.
Software Version
This document revision applies to Hitachi Storage Adapter for Oracle Enterprise
Manager - Database Cloning version 02.0.0.
Release Notes
You can find release notes on the documentation CD. Release notes contain requirements and more recent product information that this manual may not fully describe. Be sure to review the release notes before installation.
Document Conventions
This document uses the following typographic conventions:
Convention Description
Bold Indicates text on a window, other than the window title, including menus, menu options, buttons, fields, and labels. Example: Click OK.
Italic Indicates a variable, which is a placeholder for actual text provided by the user or system.
Example: copy source-file target-file
Note: Angled brackets (<>) also indicate variables.
screen/code Indicates text on the screen or that you enter. Example: # pairdisplay -g oradb
Overview 9
Hitachi Storage Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Convention Description
<> angled brackets
Indicates a variable, which is a placeholder for actual text provided by the user or system.
Example: # pairdisplay -g <group>
Note: Italic font also indicates variables.
[ ] square brackets
Indicates optional values. Example: [a | b] indicates that you can select a, b, or nothing.
{ } braces Indicates required or expected values. Example: { a | b } indicates that you must select either a or
b.
| vertical bar Indicates that you have a choice between two or more options or arguments. Examples:
[a | b] indicates that you can select a, b, or nothing.
{ a | b } indicates that you must select either a or b.
This document uses the following icons to draw attention to information:
Icon Label Description
Note Calls attention to important and/or additional information.
Tip Provides helpful information, guidelines, or suggestions for performing tasks more effectively.
Caution Warns the user of adverse conditions and/or consequences (for example, disruptive
operations).
WARNING Warns the user of severe conditions and/or consequences (for example, destructive
operations).
10 Preface
Hitachi Storage Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Getting Help
The Hitachi Data Systems Support Center staff is available 24 hours a day, seven days a week. Provisions for patches and fixes are restricted to normal
business hours, 8 a.m. to 5 p.m. PST.
To reach us, please visit the support Web site for current telephone numbers
and other contact information: http://www.hds.com/services/support/. If you purchased this product from an authorized HDS reseller, contact that reseller for support.
Before calling the Hitachi Data Systems Support Center, please provide as much information about the problem as possible, including:
The circumstances surrounding the error or failure.
The exact content of any error message(s) displayed on the host system(s).
Comments
Please send us your comments on this document: [email protected]. Include the document title, number, and revision, and refer to specific section(s) and paragraph(s) if possible. Thank you! (All comments become the
property of Hitachi Data Systems Corporation.)
Overview 11
Hitachi Adapter for Oracle Database Cloning User’s Guide User’s Guide
Overview
Introduction
How It Works
12 Overview
Hitachi Storage Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Introduction
This guide describes version 02.0.0 of the Hitachi Adapter for Oracle Enterprise Manager – Database Cloning, software that lets you clone an Oracle database,
working with a Hitachi storage system and Hitachi replication features.
Without stopping I/O operations at the primary server, you can create a hot
clone of an Oracle database on the clone system. Cold and hot database cloning are supported.
Each developer or QA engineer can control his or her own personal copy of the
database. Developers and QA engineers can make modifications to these copies and even destroy them, if needed, without affecting other users. This includes both standalone database and RAC database configurations. Both these configurations
can be used with ASM for managing database storage.
Once the database is set up for cloning operations, redo services are suspended. Then the adapter clones the LUNs/disks that it is handling, yielding a copy of the
Oracle database at a given point in time. Redo services resume and the cloned Oracle database is activated and converted.
In order to create a writable cloned database, the adapter uses the Hitachi
ShadowImage technology and Hitachi Copy-on-Write Snapshot technology, which
creates a storage-based volume copy of the database. The ShadowImage
replication function runs without stopping I/O operations on the primary server. Hitachi ShadowImage replication software is a non-disruptive, host-independent, data-replication solution for creating copies of any database accessible database
within a single Hitachi storage system. The Copy-On-Write Snapshot function helps in taking periodic point-in-time disk copies by not using much space
Without stopping I/O operations at the primary server, you can create a hot clone
of an Oracle database on the target system. Cold and hot database cloning are supported.
Clone the standby Oracle database by putting the production database into backup mode. Then perform ShadowImage cloning on each of the
LUNs that you use for hot cloning and cold cloning. This creates a new standby Oracle database, dedicated to supporting cloning operations, on
the Hitachi storage system. Once established, redo services are stop temporarily.
A clone of the LUNs/Oracle Automatic Storage Management (ASM) disks
managed by ASM is created, yielding a copy of the database at that point in time.
When this standby Oracle database is created, redo services resume and a snapshot of the database LUNS is created on Hitachi Storage and
mapped to target system. The snapshot of the Oracle database is activated and converted, ready to use for testing, development, or QA.
Overview 13
Hitachi Storage Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
The Hitachi storage system can support the primary Oracle database (source), standby database, and the target database (target). If you use this method, deploy the Oracle instance on a server that is separate from
the existing source Oracle database(s).
Real-World Activities
Features in the scenario
Scenarios
Cloned databases for
QA or development
Feature: Create Oracle cloned databases for testing and development.
Scenario. Merwan, the Oracle administrator, must fulfill two requests for clones of the current database that QA and development groups can use. Fortunately,
he has just replicated the database with Hitachi ShadowImage. Now he can create two clones on two
teams’ clone servers, one named for QA and the other for development.
Hot Cloning Feature: Hot Cloning of the Oracle database operation means making the backup when transactions are
actively running on the database.
Scenario: Hot backups are useful for Pierre’s three-shift warehouse business requirements, to allow cloning operations on a database even though it is
actively accessible by workers and may be in a state so that active users’ transactions are being updated in
the database.
Cold Cloning Feature: Cold cloning of the Oracle database occurs when there are no transactions on the production database.
Scenario: Cold backups are useful, because Marilyn’s small pet business requirements allow for a shut-down
window (Monday) to clone the database. A novice at database administration, Marilyn finds the cloning adapter easy to use.
Discovery Feature: The discovery script provides information
about the primary database and disk.
Scenario: Talleyrand wants to analyze the LUNs connected to the primary server. He needs to know the disk size, ASM info, SCSI ID, and so on. He takes
advantage of the discovery script to collect all the information that he needs in order to make sure space
is used optimally.
14 Overview
Hitachi Storage Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Features in the scenario
Scenarios
Space-efficient clones
Feature: A snapshot of the database is available.
Scenario: Samantha, the Oracle administrator, must
fulfill four requests for clones of the current database that QA and development groups can use. The
database size is 24TB. Normally a clone would require 96 TB of storage space By using this adapter Sam’s storage is only 34TB of space. Snapshots of the target
database reduced the space usage.
Performance load on the production
database
Feature: Standalone database storage between the source and target database.
Scenario: Mick, the Oracle administrator, must fulfill
several requests for clones of the current database so that QA and development groups need every week/month. If we had created direct clones of the
database, it would have taken a long time. By using the adapter, Mick now clones only once and then
resync the standalone storage every time there is a new request for clones of the database.
Overview 15
Hitachi Storage Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
How It Works
The adapter control flow appears in the diagram below.
Figure 1. Cloning Control Flow
e
16 Overview
Hitachi Storage Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
The cloning process follows this sequence:
1. Acquires information about the clone database.
2. Obtains storage configuration information.
3. Gathers Hostgroup information about the secondary server.
4. Gets all the storage information pertaining to the primary selected
database.
5. Clones the specified database ASM disks to Staging Storage by using Hitachi Shadow Image Technology
6. Creates a snapshot of the ShadowImage Secondary LUNs
7. Present these snapshot LUNs to the target system.
8. Renames the disks, disk groups, renames the database
9. Once cloning is complete, the clone database is available in the clone
server.
Hardware and Software Environments 17
Hitachi Storage Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Hardware and Software Environments
Hardware Requirements
Software Requirements
Product Licensing
18 Hardware and Software Environments
Hitachi Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Note This release supports only the software and hardware listed here. Please refer to the release notes for the latest information.
Hardware Requirements
Item Minimum Requirements Note
Servers Two servers: production and backup
CPU (for Linux)
1.2GHz or faster Intel/AMD processor
Recommended: Four CPUs at
500MHz each
Memory 4 GB or more
Graphics 1024x768, 24-bit color or more
HDD Capacity
1 GB >=400MB on the drive that has the
${TMP} directory
Network Gigabit connection recommended
Storage Models
Model Micro Version Supported
Hitachi Unified Storage VM 73-02-03-00/00 or newer X
Virtual Storage Platform 70-06-21/00 or newer X
Virtual Storage Platform-G1000
80-01-42-00/00 or newer X
VSP-Gx00 83-01-01-40/00 X
Hitachi Unified Storage 0980/A-S or newer X
Host Interface
Interface Supported
FC X
ISCSI X
Hardware and Software Environmentss 19
Hitachi Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Device Type
Device Type Supported
Disk X
Volume Type
Volume Type Supported
Normal X
HDP/HDT X
HTI X
Software Requirements
Category Software Requirements
General Install this Oracle and grid software on primary and secondary servers.
Red Hat Enterprise Linux version 6.6.
Make sure that the following packages are present on the machine where the adapter is to be
installed.
jdk-7u71-linux-x64.rpm, python-devel, python-setuptools, libstdc++, openssl,
openssl-devel, libgcc, glibc, libxslt-devel,
and /lib/ld-linux.so.2.
Command Control Interface (CCI) See Hitachi Command Control Interface Installation and Configuration Guide for instructions.
Oracle Database 11g and 12c (Single
Instance or RAC)
Oracle Database 11.2.0.3,11.2.0.4 and 12cR1 Single Instance
Oracle Real Application Cluster Support Version 11.2.0.3, 11.2.0.4 and 12cR1
Oracle Real Application Cluster Support Version
11.2.0.3,11.2.0.4 and 12cR1
20 Hardware and Software Environments
Hitachi Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Note We recommend that you install your Linux operating system with the default software packages (RPMs), unless you specifically intend to perform a minimal installation and follow
the directions for performing such an installation to ensure that you have all required packages for adapter.
We recommend that you do not customize RPMs during a
default operating system installation. A default installation includes most required packages and helps you to limit manual verification of package dependencies.
You must install the packages (or later versions) listed above,
and ensure that the list of RPMs and all of the prerequisites for these RPMs are installed.
Oracle Grid Software
Oracle Database Software Supported in
Linux
Oracle 11g Release 2 (11.2.0.3) X
Oracle 11g Release 2 (11.2.0.4) X
Oracle 12c Release 1 (12.1.0.2) X
Oracle Database
Oracle Database Software Supported in
Linux
Oracle 11g Release 2 (11.2.0.3) X
Oracle 11g Release 2 (11.2.0.4) X
Oracle 12c (non CDB/non PDB) X
Note The adapter only supports ASM Disk Group-based database for cloning. In Oracle 12c, CDB and PDB
databases are not supported. Container and pluggable databases are not supported.
Server OS
OS version Supported
Redhat 6.5 64-bit X
Redhat 6.6 64-bit X
OEL 6.5 64-bit X
OEL 6.6 64-bit X
Hardware and Software Environmentss 21
Hitachi Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Replication Software and Supported Configuration
Replication
Software
Category Supported
Thin Clone VSP, HUS, HUS-VM, VSP-G1000, VSP Gx00
X
Supported Configuration
Configuration Supported
1-to-N X
Product Licensing
Hitachi Storage Adapter for Oracle Enterprise Manager for Database Cloning requires the purchase of a license for use.
The licensing policy depends on the capacity (in TB) that is mapped to the production database that the Hitachi adapter manages.
The license file exists at this path in the adapter:
/opt/hitachi/storage/odc/config/license
Creating the Hitachi Adapter Product License File
Create a text file called hilicense.txt in this directory:
/opt/hitachi/storage/odc/config/license
Rules for Entering a License Key
Enter each 75-character license key with a license start date, separated by
one space.
Enter each license key and license start date on a separate line.
If you do not enter the license key line in this format, the license key does not work.
The license start date must be in the format MM-DD-YYYY. Example: 04-29-
2015.
This is the license key format (no spaces except before the date):
ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABC MM-DD-YYYY
22 Hardware and Software Environments
Hitachi Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Tips about hilicense.txt File
Lines beginning with a pound sign symbol (#) are comment lines and are ignored. You can add comments
to help keep track of your license keys or add other notes.
Do not move or delete this file. You may make a copy of
this file as a backup.
Do not change the ownership of the file.
Do not change the file's permissions.
Required Pre-installation 23
Hitachi Storage Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Required Pre-installation
Pre-installation Setup Requirements
Configuring RAID Manager for VSP, VSP G1000, VSP Gx00, and HUS-VM
24 Required Pre-installation
Hitachi Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Pre-installation Setup Requirements
Configure the storage subsystem as shown below.
No. Item Configuration
1 Licenses for Program
Product
The required licenses for Program Products are:
LUN Manager
ShadowImage
Thin Image
2 Host Ports When FC is used:
Host group Security is enabled on all the ports.
LU Mapping mode is enabled.
HUS Environment Configurations
Configuring RAID Manager for VSP, VSP G1000, VSP Gx00,
and HUS-VM
To use the Hitachi Adapter with any RAID subsystem, you must configure the
Command Device (CMD) and RAID Manager.
Software requirements include RAID Manager: Manager, version 01-33-03/06
Command Device Configuration
Use the Hitachi Storage Navigator to configure the Command Device (CMD). Refer to the screenshot below for an example of how to set the CMD attributes.
Item Description
Account Authentication If using the Account Authentication function, select Storage Administrator (View and
Modify) from the role check box in the Storage Management Software account addition
window.
For permissible characters and lengths allowed for usernames
and passwords, refer to the Account Authentication User’s Guide.
Required Pre-installations 25
Hitachi Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Note Set user Authentication to Enable in order to use the Hitachi Adapter.
RAID Manager Configuration
Confirm the RAID Manager version:
# raidqry -h
Model : RAID-Manager/Linux
Ver&Rev: 01-33-03/06
In the folder /etc, create or link to an instance configuration file for a
subsystem. Name the configuration file with horcm<instance number>.conf.
For example, the configuration file /etc/horcm0.conf is for the instance 0.
Edit the configuration file as shown below:
HORCM_CMD
#dev_name dev_name dev_name
/dev/sdf #VSP 66033
/dev/sde #VSP 66034
Start an instance by executing horcmstart.sh <horcm instance number>:
>horcmstart.sh 0
26 Required Pre-installation
Hitachi Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Confirm that the instance is working:
#raidcom get command_status -I0 –s 66033 -login <uid> <password>
HANDLE SSB1 SSB2 ERR_CNT Serial# Description 00c9 - - 0 66033 -
#raidcom get command_status -I0 –s 66034 -login <uid> <password>
HANDLE SSB1 SSB2 ERR_CNT Serial# Description
00c4 - - 0 66034
On the ansible server (explained in the note below), configure the RAID
Manager HORCM instance. Keep in mind that Hitachi Adapter for Oracle Database cloning requires a HORCM instance for all subsystems on which the adapter operates.
Note Ansible is open-source software designed to configure and
manage computers. It combines multi-node software deployment, ad hoc task execution, and configuration management. It
manages nodes over SSH or PowerShell and requires Python (2.4 or later) to be installed on those nodes. The
system uses YAML to express reusable descriptions of systems. Ansible is commercially supported and sponsored by Ansible, Inc.
For brief instructions on configuring RAID Manager on a Linux server, see the Hitachi Command Control Interface Installation and Configuration Guide.
Required Pre-operation 27
Hitachi Storage Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Required Pre-operation
Initial Configuration
Storage Subsystem Latency
Adapter Prerequisites (Block Storage)
Setting up the Database
Verifying and Validating the OEM-Database Cloning
28 Required Pre-operation
Hitachi Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Initial Configuration
Perform the following operations before using the Hitachi Storage Adapter for OEM-Database Cloning. The adapter uses block storage.
Item Configuration
License P.P. ShadowImage
ThinImage
Set up RAID Manager
See RAID Manager documentation for installation and setting up of the RAID Manager01-29-03/05 or higher.
Configure ASM disks (ASM on
Linux)
Follow Oracle Grid Infrastructure Installation Guide and Oracle ASM Administrator’s Guide.
These are available on the Oracle web site.
Storage Subsystem Latency
Any modification that changes the state of the subsystem requires 20 seconds
or more after the API call is returned. The storage subsystem microcode behavior causes the delay.
Adapter Prerequisites (Block Storage)
The following sections address the prerequisites for using block storage to store the database-related files.
Set the primary database to ARCHIVELOG mode
Create a host group/iSCSI target for staging storage. The adapter creates secondary LUNs and maps them to a host group/iSCSI-target if one is available. Ensure that a valid available host group/iSCSI-target
exists on the secondary machine. If a host group is not available, create one, so that the cloning operation can be performed. Provide the host group/iSCSI-target information in the adapter storage configuration file.
This host group/iSCSI-target is a dummy, so do not map it to any target system (odc.yaml).
Create a host group on the secondary machines. The adapter creates secondary LUNs and maps them to a host group if one is available. Ensure that a valid available host group exists on the secondary machine. If a host group is not available, create one, so that
the connection to the storage and secondary server exists.
Make primary, secondary, and ansible machines network-reachable. The primary server, secondary server, and ansible server
should be network-reachable and should have password-free authentication enabled.
Required Pre-operation 29
Hitachi Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Configure the ansible server. We recommend you have a dedicated ansible server for the adapter RPM and HORCM are installation and configuration (you also can use the primary or secondary server as an
ansible machine). Adapter-specific scripts can be run on this server.
Configure the underlying Oracle Data Storage Manager as a secondary machine.
Set the primary database to ARCHIVELOG mode
Settng the Primary Database to ARCHIVELOG Mode
The database must be in ARCHIVELOG mode for the Hitachi ODC Storage
Adapter to perform the cloning. This assures the recoverability of the database as an exact duplicate when mounted and started on a different system. Follow
these steps:
1. Verify that the database is in ARCHIVELOG mode and correct as needed using the following commands to enter the SQL shell:
-$ source /usr/local/bin/oraenv
2. Specify the database name (SID).
-$ sqlplus / as sysdba
3. Verify the ARCHIVELOG mode setting:
SQL> archive log list;
When the database log mode is not set to archive log mode, the following commands place the database in archive log mode:
SQL> shutdown immediate;
SQL> startup mount;
SQL> alter database archivelog;
SQL> alter system set
log_archive_dest_1=’location=+ARCHDG/<SID>’
scope=spfile;
SQL> shutdown immediate;
SQL> startup;
4. For Oracle RACs running Linux, perform the following on one of the cluster nodes.
SQL> select name, log_mode from v$database;
5. If the database log mode is not in archive log mode, the following
commands place the RAC database in archive log mode:
SQL> alter system set cluster_database=false scope=spfile sid='<SID>’;
30 Required Pre-operation
Hitachi Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
-$ srvctl stop database -d <SID>
-$ sqlplus / as sysdba
SQL> startup mount;
SQL> alter system set log_archive_dest_1='location=+ARCHDG/<SID>’;
SQL> alter database archivelog;
SQL> alter system set cluster_database=true scope=spfile sid='<SID>';
SQL> shutdown immediate;
-$ srvctl start database -d <SID>
Setting up the Database
Setting up the Source and Target Servers
This is a one-time setup process, and the procedure is the same for both servers:
1. Install Redhat Linux 6.x/OEL 6.x on host server. Update any packages that are out of date.
2. Prepare the operating system for the Oracle Automatic Storage Management (ASM) and database installation. Consult:
Oracle Grid Infrastructure Installation Guide
Oracle Database Installation Guide
3. Create a user/group for the Oracle and ansible user.
4. Install all the patches for the 11g and RAC databases.
Account Privileges
To execute the sqlplus commands, Oracle sysdba privileges are required.
To execute ASM commands, Oracle sysasm privileges are required.
CCI commands must be set up to run with operating system “root” privileges.
Configuring the Underlying Oracle Data Storage Manager for the
Production (Primary) Database
The Adapter cannot clone if the configuration of the underlying Oracle data storage is not performed as specified in the diagram below.
Required Pre-operation 31
Hitachi Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Note Configure the Listeners. They should be up and running for the production and the secondary databases.
32 Required Pre-operation
Hitachi Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Installation and Setup 33
Hitachi Storage Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Installation and Setup
Pre-installation Steps
Installing the Hitachi Storage ODC Adapter RPM
Post-installation Steps
Uninstalling Hitachi Adapter RPM
Configuring the Virtual Environment
Summary
34 Installation and Setup
Hitachi Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Pre-installation Steps
Install Java
Download JDK or Java from the Oracle site and install the package. Set the
Java home (JAVA_HOME) to the new installation of Java.
yum localinstall jdk-7u71-linux-x64.rpm
Configure Any Required Proxy Settings
Configure proxy settings as needed.
Packages Required
Make sure that the following packages are present on the machine before
installing the adapter. If any are missing, install them.
python-devel, python-setuptools, libstdc++, openssl, openssl-devel, libgcc, glibc, libxslt-devel, and /lib/ld-linux.so.2.
Installing the Hitachi Storage Adapter RPM
We distribute the Oracle database cloning storage adapter as a single Linux RPM package. Install the Hitachi Adapter RPM on a single Linux server where
Hitachi CCI is configured, that is, on the ansible server. The top-level installation directory for the adapter is:
/opt/hitachi/storage
To install the Hitachi storage adapter, use the following procedure as the root user:
1. Run the rpm -ivh odc-hitachi-storage-02.0.0-0.el6.x86_64.rpm command from the Linux server to install the adapter.
The /opt/hitachi folder is installed in the local file system of the Linux server.
2. From the Linux server, run the rpm -qpl odc-hitachi-storage-02.0.0-0.el6.x86_64.rpm command to view the content of the installed
folder. The adapter is installed by default to /opt/hitachi/storage path, which is the installation_path for the ODC adapter
(PROJECT_ROOT=/opt/hitachi/storage).
3. Run rpm – qa | grep odc to view ODC adapters installed on the
physical host.
Installation and Setups 35
Hitachi Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Adapter User Account Configuration
1. Install the adapter as root user.
2. Create the user “ansible” and group “ansible” on all the systems:
Where adapter is installed (Ansible server)
Source database server (Primary server)
Target database server (Secondary Server)
3. Give “ansible” and “oracle” users sudo permission.
4. Open the /etc/sudoers, file and add the below lines:
oracle ALL=(ALL) NOPASSWD: ALL
ansible ALL=(ALL) NOPASSWD: ALL
5. The adapter uses SSH no-password authentication to connect to different systems, so the adapter is designed for the user to configure the SSH no-
password authentication from the adapter-installed system to the source and target systems.
Post-installation Steps
A post-installation script installs the required RPMs and Python packages. This
file resides in the /opt/hitachi/storage/script directory. Run the post-
installation script as the root user, and adjust proxy settings as needed.
source script/postinstall.sh
This script installs the following required packages:
python-devel
libxslt-devel
libstdc++
openssl
glibc
Python packages include:
pycrypto
python-crypto
paramiko=1.10
fabric
virtualenv
argparse
supervisor
36 Installation and Setup
Hitachi Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
If the script fails to run, please install the packages manually.
The script also sets environment variables for the ansible user in the <ansible home directory>/.bashrc file:
PROJECT_ROOT
ANSIBLE_LOG_PATH
Uninstalling Hitachi Adapter RPM
To uninstall the Hitachi Adapter, use the following procedure:
Run rpm –e odc-hitachi-storage-02.0.0-0.el6.x86_64 to uninstall the
adapter from the server.
Configuring the Virtual Environment
The adapter uses the Python virtual environment, so any new packages
required for the adapter to run are installed in the virtual environment, rather than on the base Python installation directory. This makes uninstallation
simple.
Steps to install the virtual environment are as follows.
1. Switch user to ansible:
su - ansible
2. Go to the installation directory:
cd /opt/hitachi/storage
3. Set up HTTP proxy if required and then run the following command, which installs all the required Python packages:
fab setup
4. The following command activates the virtual environment of the ansible
machine.
source <installation_path>/env/bin/activate
Installation and Setups 37
Hitachi Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Summary
1. Install ODC RPM:
rpm -ivh odc-hitachi-storage-02.0.0-0.el6.x86_64.rpm
Preparing... ########################################### [100%]
ansible:x:500:ansible
ansible:x:500:500::/home/ansible:/bin/bash
1:odc-hitachi-storage ########################################### [100%]
2. Go to the /opt/hitachi/storage/script.
[root@rh63-239-97 ~]# cd /opt/hitachi/storage/script
3. Set the proxy settings if required and run the postinstall.sh script as
a root user.
[root@rh63-239-97 ~]# cd /opt/hitachi/storage/
4. Switch to ansible user: su - ansible
5. Go to the folder /opt/hitachi/storage
[ansible@rh63-239-97 ~]$ cd /opt/hitachi/storage/
6. Set the proxy settings if required.
7. Run fab setup:
[ansible@rh63-239-97 storage]$ fab setup
8. Edit the config files odc.yaml, <target-system-ip>, <source-system-ip>, hosts, and all config files.
9. Enable the virtual environment.
[ansible@rh63-239-97 ~]$ cd /opt/hitachi/storage/
[ansible@rh63-239-97 storage]$ source env/bin/activate
(env)[ansible@rh63-239-97 storage]$
10. Run the ODC script.
(env)[ansible@rh63-239-97 storage]$ cd odc/ansible_oracle/
(env)[ansible@rh63-239-97 ansible_oracle]$ ansible-playbook odc-clone database.yml -i inventory/hosts –vvvv
38 Installation and Setup
Hitachi Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Inventory Hosts File
After completing adapter installation, set up passwordless authentication to source and target systems.
The Ansible inventory hosts file lists and groups your servers. Its default
location is /opt/hitachi/storage/odc/oracle-ansible/inventory/hosts.
If you want to have your Ansible hosts file in another location, then you can set
this environment variable:
> export ANSIBLE_HOSTS=/etc/ansible/hosts
Alternatively, you can specify the ansible host location when running
commands with the --inventory-file= (or -i) flag:
> ansible all --inventory-file=/root/ansible_hosts -m ping
For more on the inventory hosts file, see:
http://docs.ansible.com/intro_inventory.html
Set up Connectivity to the Servers
For this example, let us assume that you have servers with the
hostnames 192.168.0.1 and 192.168.0.2. When doing your own install, replace those hostnames with your own.
Your /opt/hitachi/storage/odc/oracle-ansible/inventory/hosts file
looks like this:
192.168.0.1
192.168.0.2
To avoid entering a password to access a server, start by setting up SSH key
authentication to the children nodes. Then follow the steps below:
1. Generate the SSH key on the master node:
ansible@ansihost:~# ssh-keygen -t rsa -C "ansible@ansihost"
2. Then copy your public key to the servers with ssh-copy-id:
ansible@ansihost:~# ssh-copy-id [email protected]
ansible@ansihost:~# ssh-copy-id [email protected]
3. Now, test the connectivity:
ansible@ansihost:~# ansible all -m ping
192.168.0.1 | success >> {
Installation and Setups 39
Hitachi Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
"changed": false,
"ping": "pong"
}
192.168.0.2 | success >> {
"changed": false,
"ping": "pong"
}
Database Installation
The adapter supports Redhat guidelines in Oracle database installation for single-instance storage and RAC (real application clusters). For RHEL
installation, follow the steps provided by Redhat. For OEL, follow Oracle instructions for database installation.
Only UDEV rules are followed for ASM storage. Asmlib is not supported in this release.
Cold Cloning
Hitachi Storage Adapter for OEM database cloning supports cold cloning of the Oracle database. Use cold cloning when there are no transactions in progress.
If your schedule is flexible enough to sustain a blackout window, cold cloning is a good choice
In order to perform the cold cloning, change one parameter in config files:
Change the hot_clone parameter to false in all target system config files and
run the ODC ansible playbook.
Hot Cloning
Hitachi Storage Adapter for OEM database cloning supports hot cloning of the Oracle database. Use hot cloning when there are transactions in progress.
In order to perform the hot cloning, change one parameter in config files: Change the hot_clone parameter to true in all target system config files and run the ODC ansible playbook.
40 Installation and Setup
Hitachi Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Discovery
Hitachi Storage Adapter for OEM database cloning provides a feature called discovery where you can find storage and ASM group information about the
primary server. Run the playbook that you use for ODC cloning, without any extra configuration. The discovery operation fetches all the information related
to storage and prints it on the screen.
ansible-playbook odc-discover-database.yml –I inventory/hosts
The above script analyzes the storage connected to the source machine and
reads all the LUN information, iSCSI ID, device name, and ASM disk group for the particular database. Then the script prints the information on the screen.
The same data is in ansible.log so that you can consult it if needed.
If you want to run only the discovery operation, configure the sourceb only and not the clone file.
Configuring the Adapter 41
Hitachi Storage Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Configuring the Adapter
Configuring the Storage
Configuring Common Information
Checking Inventory Files
Configuring the Source Database System
Configuring the Target Database System
42 Configuring the Adapter
Hitachi Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Adapter configuration consists of several procedures that are explained below.
Configuring the Storage
The storage configuration file is at: <installationPath>/odc/config, and the
filename is odc.yaml
Modifying odc.yaml is a one-time operation. The parameters are listed below.
Object Name
Field name Type Example Description
storage:
- id:
management_ips:
hrcm_instance:
type:
username:
password:
san_type:
storage_pool_id:
storage_pool_type:
String - id: 10076
management_ips:
- 172.17.47.58
hrcm_instance:
12
type: san
username: user
password: xxx
san_type: raid
storage_pool_id: 10
storage_pool_type: HDP
id: Storage Serial Number
management_ips: For HUS, use the two
controller IP addresses; for RAID systems, fill in the management IP
address.
hrcm_instance: HORCM ID, refer to RAID
Manager documentation for setting for HORCM.
type: Type of storage.
username: Username
for the storage.
password: Password for the storage.
san_type: Modular or
other storage.
storage_pool_id: Pool ID where the secondary LUNs can be created.
storage_pool_type: Pool Type (Parity/HDP/ HDT/RG).
access_group Object access_type: iSCSI or fc
port_name: storage port name
group_name:
hostgroup/iSCSI-target name
Host Group or ISCSI target information that the adapter uses to present cloned LUNs for
staging database
Configuring the Adapter 43
Hitachi Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Object Name
snapshot_pool_type Storage pool type used
for target database
snapshot_pool_id Storage pool number
used for snapshot database
Configuring Common Information
This information is common across the source database system, the target database system, and where the adapter is installed.
Path: <installationPath>/odc/ansible_oracle/groupvars
Filename: all
Please check the all file for configuration details. For example, the all file
includes the parameters listed in the table below.
Object Name
Field Name Type Example Description
ansible_config_dir string /tmp/odc Temporary path where all temporary files are
be created.
ansible_backup_dir String /tmp/odc_backup This is the place where the adapter takes a backup of
target database configuration information, so that
it can be used for deleting the
database.
Checking Inventory Files
The adapter works against multiple systems in your infrastructure at the same time. It does this by selecting portions of systems listed in the ansible
inventory file, which defaults this location
/opt/hitachi/storage/odc/ansible_oracle/hosts.
Example
[clonedb]
44 Configuring the Adapter
Hitachi Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
172.17.239.193
[sourcedb]
172.17.58.95
The group names appear in brackets and are used in classifying systems and deciding what systems you are controlling at what times and for what purpose.
Configuring the Source Database System
You specify the configurations for the data production layout:
List of ASM diskgroups for the source system
Asm_storage-layout, which determines the list of asmlabel, device name, and
the logical unit number of the disk associated with each diskgroup.
Configuration of the database home, grid home paths , RAC, and single-
instance node specifications, along with the database name and database instance.
Path: <installationPath>/odc/ansible_oracle/ host_vars
Filename: <source database host ip>
Check the sourcedb file for configuration details. For example, the <source database host ip> file includes the parameters listed in the table below.
Field name Type Example Description
ss_record_id Integer 10076 Storage system serial number
asm_diskgroups
List of String - REDODG
- DATADG
- FRADG
List of all the ASM diskgroup headers of the production database.
asm_storage_layout
List of Objects type asm_storage_layout
REDODG:
- asmlabel: redo1p1
device: /dev/mapper/redo1
se_record_id: 518- DATADG:
- asmlabel: data1p1
device: /dev/mapper/data1
se_record_id: 520
FRADG:
Disk group header:
asmlabel: The device
name at source.
device: The ASM disk path at source
se_record_id: The scsi_id
of the LUN used, in decimal form.
Configuring the Adapter 45
Hitachi Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Field name Type Example Description
- asmlabel: Configuring the
Adapterfra1p1
device: /dev/mapper/fra1
se_record_id: 522
- asmlabel: fra2p1
device: /dev/mapper/fra2
se_record_id: 523
oracle_asm_disk_path
String /dev/mapper Path where the ASM disk resides
role_separation Boolean (true, false)
True Are the Oracle and grid users different?
oracle_home_db
String /u01/app/oracle/product/11.2.0/dbhome_1
Oracle home path
oracle_home_gi String /u01/app/11.2.0/grid/ Oracle grid path
oracle_db_name
String source Oracle database name
device_persistence
String udev If the database uses a multipath disk, it is set to “multipath.”
Otherwise, the database is
set to “udev.”
oracle_instance_name
String source Oracle database instance name on the server.
master_node Boolean (true, false)
true Is this a master node (for a single database instance it
is always true. For a RAC database this should be set
to true if the RAC node is 1.
is_racone Boolean (true, false)
false True if it is RAC; otherwise it is false.
oracle_dbf_dir_asm
String DATADG Source DB data diskgroup header
oracle_reco_dir_asm
String FRADG Source DB redo diskgroup header
multipath_enabled
Boolean (true, false)
true Set to true if multipath is enabled; otherwise, set to
false.
configure_clust Boolean true Default true (do not change
46 Configuring the Adapter
Hitachi Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Field name Type Example Description
er (true, false) this)
hot_clone Boolean (true, false)
true If hot cloning set this to true otherwise false.
ASM Layout
Object Name asm_storage_layout
Field Name Type Example Description
asmlabel String REDODG ASM Disk Header label
device String /dev/mapper/redo1 Disk path in Server
se_record Integer 518 Logical Unit Number
Configuring the Target Database System
Configuration information related to target database system should be given in this file.
Path: <installationPath>/odc/ansible_oracle/host_vars
Filename: <target database host ip> (as mentioned in inventory/host
system
Check the <target database host ip> file for configuration details. For
example, the clonedb file includes the parameters listed in the table below.
Field name Type Example Description
hot_clone Boolean (true, false)
true If hot cloning set to true, otherwise false.
access_grp
grp_name :
port_name:
access_type:
String access_grp:
grp_name: ODC-RAC2-239-193
port_name:
CL4-A
access_type: fc
Host group name for the clone system and port number
Access type is “iSCSI” or
“fc.”
oracle_asm_disk_path String /dev/mapper Path where the ASM disk resides
role_separation Boolean (true, false)
true Are grid and Oracle users different?
oracle_home_db String /u01/app/oracle/product/11.2.0/dbhome_1
Oracle home path
Configuring the Adapter 47
Hitachi Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Field name Type Example Description
oracle_home_gi String /u01/app/11.2.0/grid/
Oracle grid path
oracle_base String /u01/app/oracle Oracle base path
oracle_db_name String clone Oracle cloned database name. Currently we do not
support the same name as source database name.
device_persistence String udev If the database uses a multipath disk, set to
“multipath.”
Otherwise, it is “udev.”
oracle_instance_name String clone Oracle database instance name on the server. Currently we do not support
the same instance name as source database instance,
is_racone Boolean (true, false)
false Is this rac server (only for RAC database)
oracle_dbf_dir_asm String DATADG Source data diskgroup header
oracle_reco_dir_asm String FRADG Source redo diskgroup header
multipath_enabled Boolean (true, false)
true Is multipath enabled? if yes, true, else false
oracle_install_version_gi
String 11.2.0.4 Oracle database version
oracle_asm_init_dg String Crs Oracle ASM init diskgroup
target_asmdg_key String CL_ Unique key (up to three characters) for creating ASM
disk groups, so that they are unique across the system.
When the same storage is cloned multiple times, this ensures that the ASM disk
labels are unique on the server.
Example:
Target_asmdg_key: CL_
If the production database is
cloned multiple times on the target system, you must
change this key each time.
48 Configuring the Adapter
Hitachi Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Note For log4cplus configurations, please refer to Logging.
Database Cloning 49
Hitachi Storage Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Database Cloning
Setting Ownership for Hitachi OEM Database Cloning Adapter Scripts
Installation Checklist
Installing for Discovery
Installing for Single-Instance Cloning
Performing Cold and Hot Cloning
Verifying and Validating the OEM-Database Cloning
50 Database Cloning
Hitachi Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
The adapter supports Hitachi storage systems for both the primary Oracle database (source), secondary Oracle database (target)
The adapter creates a new clone of the production database on the secondary
server. By using the Hitachi storage system, the adapter clones the LUNs/disks that Oracle Automatic Storage Management (ASM) is handling, yielding a copy
of the Oracle database. To first create a database clone, the adapter uses the Hitachi ShadowImage or Hitachi Thin Image feature, which create a storage-based volume copy of the database. The ShadowImage replication function
runs without stopping I/O operations on the primary server. During hot cloning, the adapter moves the production database to backup mode and performs
cloning of the disks. Then the software returns the production database to normal mode. After this step, the adapter creates snapshot of the cloned
secondary LUNs and presents these snapshot LUNs to secondary system and later adds services and brings up the cloned Oracle database on the secondary server.
During cold cloning, the adapter shuts down the Oracle production database, clones all ASM disks, creates a snapshot of the LUNs and then starts up the
production database. Later, it adds service and brings up the cloned Oracle database on the secondary server. In this fashion, it provides a production clone helpful for development or QA.
Installation Checklist
Here is a checklist to start the installation process.
1. See earlier chapters and make sure all the prerequisite software and libraries are installed.
2. Ensure that Python 2.6 or above is installed.
3. Make sure that the Python virtual environment is installed.
4. Make a backup copy of the installation package.
5. Create the user ansible on all the systems and add the ansible user to sudoers list (no password required) in the following locations:
a. Where the ODC package will be installed
b. On all the source database systems
c. On all the target database systems
6. The adapter does not manage passwords, so configure SSH keyless authentication on all the systems (source, destination).
Database Cloning 51
Hitachi Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Installing for Discovery
After reviewing the checklist above, run the discovery script.
ansible-playbook odc-discover-database.yml -i inventory/hosts
Installing for Single-Instance/RAC Database Cloning
Review the Installation Checklist and then progress with the following steps.
1. Update all the configuration information:
<InstallationPath>/odc/config/odc.yaml
2. Activate the source environment:
source $(installation_path)/env/bin/activate
3. Update the clonedb and sourcedb file in
group_vars$PROJECT_ROOT/odc/ansible_oracle/host_vars/<source system ip>
$PROJECT_ROOT/odc/ansible_oracle/host_vars/<target system ip>
4. Update the hosts file in the inventory directory:
$PROJECT_ROOT/odc/ansible_oracle/inventory/hosts
Performing Cold and Hot Cloning
Database cloning can be run in two different ways:
Database cloning in one step. Use odc-clone-database cloning:
ansible-playbook odc-clone-database.yml-i inventory/hosts –vvvv
Database cloning in two steps. Using this method, storage cloning is performed first, then database cloning.
a. The odc-clone-source-database-to-staging.yml script clones
storage from the source database to staging, which is the volume group in SAN Storage.
ansible-playbook odc-clone-source-database-to-staging.yml -i inventory/hosts –vvvv
The odc-clone-staging-to-target-database.yml script uses the
cloned storage created by the odc-clone-source-database-to-staging.yml script. It configures the target system and clones the
database on the target system.
ansible-playbook odc-clone-staging-to-target-database.yml -i inventory/hosts –vvvv
52 Database Cloning
Hitachi Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Once the storage cloning is complete, the adapter attempts to discover the newly cloned snapshot LUNs on the target database system. If it is unable to
find them, it can fail at one of these stages:
Discovering the storage
Discovering multipath devices
Discovering udev devices
Renaming of ASM disk groups
In the above failure cases, make sure the target system can discover the newly created storage. A system reboot may be necessary.
Once the discovery of storage is successful, run the odc-clone-staging-to-target-database.yml script
If you want to clone the same database several times on the target system, change the following parameters in the target system configuration file each
time you clone.
oracle_db_name
oracle_instance_name
target_asmdg_key
oracle_db_name is the database name on the target system.
oracle_instance_name is the name of the instance on the target
system. Normally it is the database name with a number one appended
target_asmdg_key is appended to the source database disk group
names while renaming the disk groups on the target system.
Note On the target system, cloned ASM disk groups contain a directory structure reflecting the source database name and not the target database name.
Verifying and Validating the OEM-Database Clone
In RAC systems, the adapter clones the database to only one node. You must
add the instance to rest of the nodes. Please follow the steps provided by Oracle for this purpose.
After making sure the production databases are discovered, follow these steps
to verify and validate cloning.
1. Create a tablespace and data files at the source database.
2. Perform the database cloning operation.
Database Cloning 53
Hitachi Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
3. On the production machine, shut down the database:
SQL> shutdown normal.
Messages read:
Database closed.
Database dismounted.
ORACLE instance shut down.
4. On the secondary machine, start up the cloned database.
export ORACLE_HOME=$ORACLE_HOME
export ORACLE_SID=${CloneDB_SID}
./sqlplus / as sysdba
SQL>Startup;
5. Make sure the earlier tablespace and data files exist in the target server
as well.
6. Also try to create new tablespaces at the cloned database.
SQL>create tablespace TS_Test1 datafile '+SIAMSDATA/ODCAMSSI/test1.dbf' size 50M extent management local autoallocate;
Tablespace created.
7. Create a table called my_test on tablespace TS_Test1.
SQL> create table my_test(x number) tablespace TS_Test1 ;
Table created.
8. Shut down the database.
54 Database Cloning
Hitachi Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Adapter Limitations
1. RAC database cloning is supported only for the ASM 1 node of the target
RAC system. Follow Oracle’s guidelines to clone the rest of the nodes.
2. When performing single-instance database cloning, remember that you
can go only from a non-RAC source to a non-RAC target.
3. We support only ASM disk group-based databases for cloning. No other types are not supported
4. In 12c, PDB/CDB databases are not supported.
5. Before starting the cold cloning script, make sure the source database is
up and running. The adapter shuts down the database and restarts it.
6. If a cloning script fails while newly created logical units are not discoverable, make sure the logical units can be discoverable and then
run odc-clone-staging-to-target-database.yml.
7. The source and target database names should be different. Oracle allows
a maximum of eight characters for database.
8. All the ASM disk groups on the target database are prepended with
target_asmdg_key. This allows the same source ASM disk groups to be
cloned multiple times on the target system
9. Before cloning, the source database should be up and running.
Logging and Messages 55
Hitachi Storage Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Logging and Messages
This chapter includes two sections:
Logging
Messages
56 Logging and Messages
Hitachi Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Logging
Log files reside in the following subfolder:
/opt/hitachi/storage/logs
When you delete the log folder, the application creates a new one.
The Hitachi Storage Adapter for ODC maintains its logs as follows:
/opt/hitachi/storage/logs/ansible.log
/opt/hitachi/storage/logs/hiodc.log
Log File Name Description
ansible.log Adapter log
hiodc.log Storage subsystem API log
Specifying the Log Levels in the Configuration File
The ODC storage configuration is here:
path: /opt/hitachi/storage/odc/config directory
filename: log4cplus.properity
Configure your root-level logger, and append the following descriptors.
log4cplus.rootLogger= STDOUT, LOG, TRACE_LOG
Log Generation and Rotation
Hitachi Storage Adapter for OEM - Database Cloning log files are created when the adapter server process starts. The log file generation and rotation of the
adapter log files have the following features:
Allow multiple processes to log to the same log file.
User-specified, size-based log rotation.
Rotate the current or active log file by incrementing the log file name, by appending consecutive numbers, starting from zero up to a user-specified limit,
or a system default.
Log file names are hiodc.log, hiodc.log.1, hiodc.log.2, and so on.
The active log file name is hiodc.log.
Specify the MaxFileSize config value as, for example, MaxFileSize=10. If you include a value outside this range, the default value of 10 is used.
Logging and Messages 57
Hitachi Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Specify the maximum number of backup files as, for example, MaxBackupIndex=5.
This value can range from 1 to 255. If you include a value outside this range,
the default value of 5 is used.
Messages
Message
ID
Explanation/Recommended Action
E4300025 Internal error. See Getting Help.
E430002D Check to make sure that file has been correctly installed or had its location correctly set up, then see Getting Help if needed.
E430000E Get unit information failed
E430000E Get lu list failed
E4300010 Get lu information failed
E4300012 Create lun failed
E4300013 Add to host group failed
E4300014 Create host group failed
E4300015 Rename hostgroup failed
E4300017 Present to host group failed
E4300018 Unpresent to host group failed
E4300019 Remove lu failed
E430001A Get all info error
E430001B Get pool list failed
E430001C Get host group list failed
E430001D Create Snapshots failed
E430001E Remove snapshots failed
E430001F Split snapshots failed
E4300020 Restore snapshots failed
E4300021 Get current snapshots failed
E4300022 Create clones failed
E4300023 Remove clones failed
E4300024 Split clones failed
E4300025 Restore clones failed
E4300026 Get current clones failed
E4300027 Get vvol list failed
58 Logging and Messages
Hitachi Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Troubleshooting 59
Hitachi Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Troubleshooting
Troubleshooting Tips
Directory Structure
Troubleshooting Tips
Oracle Error
After storage cloning, database cloning fails while starting up the database with
the Oracle error:
ORA-01041: internal error. hostdef extension doesn‘t exist
According to Oracle, this is a known problem. To overcome the problem, just
rerun the script.
Cloning Tips
Set the archive logfile destpath according to your needs.
Back up an entire database before cloning it.
You can clone databases pertaining to same 11g Oracle database versions.
Ensure that the configuration of the database is set correctly, and run the adapter only once, uninterrupted, when creating a clone.
A password file is created on the clone system.
ASM disk groups should be in the same order in the configurations for
clonedb and sourcedb files.
Temporary files located in the default temporary file location are replicated.
An Spfile for the cloned database after cloning is created in
DATADG/<dbname> spfile.
Cloning RAC Tips
If using RAC, make sure that the cluster is up and running.
Also, only node1 is cloned. Add the second instance to node2 and use it as a
RAC database.
Naming Tips
The directory structure in the ASM is retained similarly to the production database. Move files according to your specifications and later rename the corresponding datafiles and log files.
The clonedb and instance name should be the same for single-instance
setup.
There should not be any database instance with same name as that of source database or production database on the target system.
The production database name should less than or equal to eight characters, and the instance name should be less than or equal to nine
characters including the instance number.
Preface 61
Hitachi Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Directory Structure
Note ODC does not support multiple clones of the source database on the same target system. Multiple clones on
different machines are supported.
The control files and the data files for a cloned database remain the same as
that of the source database directory.
The online logs are freshly created on the cloned database.
According to your needs, you can alter the database file location by using an ASM disk group.
If the script fails before storage cloning, delete the /tmp/odc folder from all
the systems (ansible system, clone system and primary system).
1. Recheck the configuration.
2. Run the script.
If the ODC script fails after performing the storage cloning, clean up the LUNs and try again. Follow these steps:
1. Delete the newly-created replication pair.
2. Delete the LUN paths created for secondary volumes.
3. Delete the secondary volumes.
4. Fix the issue or recheck the config.
5. Re-run the script.
Make sure the configurations of the database are set correctly. Complete the cloning process in one session. If there is a failure, delete any created
directories and database-related processes.
For hot cloning, make sure the configurations are set properly and the
production database is up and running.
Abbreviations, Terms, and Acronyms 63
Hitachi Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Abbreviations, Terms, and Acronyms
This glossary defines the special terms, acronyms, and abbreviations used in
this document.
A
Administrator Role
Using the configuration GUI with administrative access to the array.
Alert log
Oracle's alert.log chronologically records messages and errors arising from the daily database operation. Contains pointers to trace files and
dump files when errors occur.
Archived redo logs
When a database is running in archive log mode, Oracle requires that online redo logs be archived before they are overwritten by a log switch. The archiving happens either manually or automatically by the archiver
process.
B
Backup control file
Generate this file by issuing the alter database backup control file to ‘file_name’ command. The backup control file is frequently used in
recovery operations
C
CCI
Command control interface
CKPT Checkpoint
Database event that causes the database to flush blocks from memory and write them to disk. A checkpoint is done when a database is put into
or taken out of online backup mode.
CLPR
64 Abbreviations, Terms, and Acronyms
Hitachi Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Cache logical partition
CM
Command device
Control files
Every Oracle database has a control file. A control file is a small binary
file that records the physical structure of the database and includes: the database name, names and locations of associated datafiles and online
redo log files, the timestamp of the database creation, the current log sequence number and checkpoint information. Without the control file, the database cannot be mounted and recovery is difficult if not
impossible.
Controller
The component in a storage system that manages all storage functions. It is analogous to a computer and contains a processors, I/O devices, RAM, power supplies, cooling fans, and other sub-components as
needed to support the operation of the storage system.
Controller Port
COW
Copy-on-write Snapshot
copy-on-write
Point-in-time snapshot copy of any data volume within a storage system. Copy-on-write snapshots only store changed data blocks,
therefore the amount of storage capacity required for each copy is substantially smaller than the source volume.
D
Data Services
Data services consist of data moving, data replication, data archiving and any other functions where data is involved.
Data Blocks
At the finest level of granularity, an Oracle database's data is stored in data blocks (also called logical blocks, Oracle blocks, or pages). An
Oracle database uses and allocates free database space in Oracle data blocks. DB_BLOCK_SIZE determines the default block size Oracle 10g allows tablespaces to be different size from the default.
Database
Consists of the physical components containing data (tablespaces, redo
logs, control files, and so on)
Abbreviations, Terms, and Acronyms 65
Hitachi Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Database consistency
Implies that each object in the database is consistent to the same point in time.
Database parameter file (pfile or spfile)
Contains instance and database configuration information and may be in
text format as init.ora or spfile.ora, which are mutually exclusive. The spfile allows the dynamic change of some persistent settings by using
the alter system command.
Datafile
Physical entity containing data related to a tablespace. A datafile can be
associated with only 1 tablespace
DKS
Disk controller
DMLU
Differential management logical unit
DNS
Domain name server
E
ESX Host
ESX Host(s) (xxx.xxx.xxx.xxx)
EMT64T
Extended Memory 64 Technology
EV
Enterprise Vault
Extents
The next level of logical database space is an extent. An extent is a specific number of contiguous data blocks that are allocated for storing a specific type of information.
66 Abbreviations, Terms, and Acronyms
Hitachi Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
F
FC
Fibre channel
Flash recovery area
Optional configured area to store various recovery-related files such as RMAN backup files, archived redo logs, and backup control files.
FTP
File Transfer Protocol
H
Hitachi Dynamic Provisioning (HDP)
Advanced thin-provisioning software product that provides “Virtual Storage Capacity” to simplify administration and addition of storage, eliminate application service interruptions, and reduce costs.
Hitachi Universal Volume Manager
HUVM
HCP
Hitachi Content Platform
HCP System
Fully Qualified Name for HCP Server.
HDP
Hitachi dynamic provisioning pool
HDP Pool
Consists of one or more dedicated RAID groups. Up to 50 DP pools in
the AMS 2100, and 64 DP pools in the AMS2300/2500 are allowed. Each pool requires a unique pool ID.
HDP Optimization
An HDP pool can be optimized by rebalancing each HDP-VOL’s allocated
pool capacity evenly across each of the RAID groups. This is particularly effective after adding a RAID group to the HDP pool.
HDP Pool Capacity
Amount of total capacity assigned to a given HDP pool.
Abbreviations, Terms, and Acronyms 67
Hitachi Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
HDP Pool Capacity Threshold
Initial warning levels of high pool utilizations upon early (default 40%) and depletion (50%) conditions.
HDP Pool Consumed Capacity
Amount of pool capacity already consumed.
HDP RAID Group
One or more physical RAID Groups that belong to the same HDP pool.
HDP-VOL
A virtual LU that consumes and maps storage space for areas of the LU that have had data written to them. In HDP, it is required to associate
the HDP-VOL with a HDP pool. The HDP-VOL needs to specify a HDP pool ID, HDP-VOL logical capacity, and HDP-VOL number. Many HDP-
VOLs can be defined for on HDP pool. A given HDP-VOL cannot be defined to multiple DP pools.
HDvM
Hitachi HiCommand Device Manager
Hitachi Tiered Provisioning
New to VSP arrays, allows automated provisioning of HDP pools and volumes based on device performance characteristics.
Host Group
A group of hosts of the same operating system platform.
Host Group Number
Host Name
HTTP
HyperText Transfer Protocol
HUS
Hitachi Unified System
HUVM
Hitachi Universal Volume Manager
68 Abbreviations, Terms, and Acronyms
Hitachi Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
I
IBM
International Business Machines Corporation
Instance
Collection of memory structures and processes. Multiple instances can be tied to 1 database.
For example in Oracle RAC, each node will have an instance and all
instances will use 1 database.
IP
Internet Protocol
IP Address
An Internet Protocol (IP) address is a numerical label that is uniquely
assigned to a device.
IETF
Internet Engineering Task Force
J
JRE
Java Runtime Environment
JVM
Java Virtual Machine
L
LDEV
Logical device
Logical Volume (LV)
LU
Logical unit (LU): A logical volume that is configured for use by open-systems hosts (for example, OPEN-V).
LUN
Logical unit number
LU Path
Logical unit (LU) path: The path between and open-systems host and a logical unit.
LU Size
Logical unit (LU) size: The size of the logical unit.
LVI
Logical volume image
M
Abbreviations, Terms, and Acronyms 69
Hitachi Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Management
Management includes discovery, initialization, configuration, provisioning, health and performance monitoring, alarms and alerts, and
other system management functions.
N
Namespace
Logical grouping of the objects within HCP repository.
O
Online redo logs
A log of redo processes is stored in the online redo logs when the log is full the online redo logs are written to disk as archived redo logs.
Over Provisioning Threshold
Threshold value for DP pool over-provision warning (default 100%) and
limit (default 130%).
P
Parity Group
A parity group, also called an array group, is a group of hard disk drives (HDDs) that form the basic unit of storage for RAID subsystems. All
HDDs in a parity group must have the same physical capacity.
PG
Parity group
P-VOL
Primary volume
Q
R
RAID
Redundant array of inexpensive disks
RAID Group
A redundant array of inexpensive drives (RAID) that have the same
capacity and are treated as one group for data storage and recovery. A RAID group contains both user data and parity information, which allows data access when one or more of the drives within the RAID group are
not available. The RAID level of a RAID group determines the number of data drives and parity drives and how the data is “striped” across the
drives. For RAID1, user data is duplicated within the RAID group, so there is no parity data for RAID1 RAID groups.
RCU
Remote control unit
Redo
70 Abbreviations, Terms, and Acronyms
Hitachi Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Record of all the changes made to a given database.
RG
RAID group
RMI
Remote method invocation
S
SAN
Storage area network
SCN (System Change Number)
Counter representing the current state of the database at any given
SCSI
Small computer system interface
SGA (System Global Area)
Area of shared memory allocated by Oracle when it starts. Shared by all
Oracle processes. The following list shows the required memory processes for an Oracle instance:
• PMON process monitor
• SMON system monitor
• LGWR log writer writes redos to the online redo logs
• DBWR database writer updates the data in the data tables.
• ARC0 writes the redo logs to the archive redo logs
SI
ShadowImage
SIM
Service information message
SMS
Hitachi Simple Modular Storage
SNMP
Simple Network Management Protocol
SN
Serial number
Storage
Storage array or device.
Storage includes both block and file storage and a form factor that
scales from a single node appliance to large scalable multi-node configurations.
Abbreviations, Terms, and Acronyms 71
Hitachi Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
S-VOL
Secondary volume
SVP
Service processor
T
Tablespace
Logical Entity that contains tables and indexes written into datafiles. A
tablespace may contain more than 1 datafile.
Tenant
HCP administrative entity to manage and own namespaces.
TCP/IP
Transmission Control Protocol/Internet Protocol
Total Capacity
The aggregate amount of storage space in a data storage system.
TransID
U
User Account
Uniquely identifies a user for authentication and authorization to the
subsystem.
V
VSP
Virtual Storage Platform
V-VOL
Virtual volume
VOL
Volume
Volume Group
W
WWN
A World Wide Name (WWN) is a unique identifier that identifies a particular Fibre Channel or other target. Each WWN is an 8-byte number
derived from an IEEE OUI and vendor-supplied information.
72 Abbreviations, Terms, and Acronyms
Hitachi Adapter for Oracle Enterprise Manager - Database Cloning User’s Guide
Hitachi Data Systems
Corporate Headquarters 2845 Lafayette Street
Santa Clara, California 95050-2627 U.S.A.
Phone: 1 408 970 1000 www.hds.com
Asia Pacific and Americas 2845 Lafayette Street
Santa Clara, California 95050-2627 U.S.A.
Phone: 1 408 970 1000 [email protected]
Europe Headquarters
Sefton Park Stoke Poges
Buckinghamshire SL2 4HD United Kingdom Phone: + 44 (0)1753 618000