sap hana dba’s guide to actifio copy data managementdocs.actifio.com/8.1/pdfs/dbasap.pdf ·...

44
Actifio Sky and CDS 8.0.4+ SAP HANA DBA’s Guide to Actifio Copy Data Management

Upload: others

Post on 16-Apr-2020

19 views

Category:

Documents


0 download

TRANSCRIPT

SAP HANA DBA’s Guide to Actifio Copy Data Management

Actifio Sky and CDS 8.0.4+

Copyright, Trademarks, and other Legal Matter

Copyright © 2009 - 2018 Actifio, Inc. All rights reserved.

Actifio®, AnyIT®, Dedup Async®, OnVault®, Enterprise Data-as-a-Service®, FlashScan®, AppFlash DEVOPS Platform®, Copy Data Cloud®, and VDP® are registered trademarks of Actifio, Inc.

Actifio Sky™, Actifio One™, and Virtual Data Pipeline™ are trademarks of Actifio, Inc.

All other brands, product names, goods and/or services mentioned herein are trademarks or property of their respective owners.

Actifio, Inc., is a provider of data protection and availability products. Actifio’s technology is used in products sold by the company and products and services sold and offered by its commercial partners. The current list of Actifio patents is available online at: http://www.actifio.com/patents/

Actifio believes the information in this publication is accurate as of its publication date. Actifio reserves the right to make changes to information published in this document, including without limitation specifications and product descriptions, at any time and without notice. This document supersedes and replaces all information supplied prior to the publication hereof.

THE INFORMATION IN THIS PUBLICATION IS PROVIDED “AS IS.” ACTIFIO, INC. MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WITH RESPECT TO THE INFORMATION IN THIS PUBLICATION, AND SPECIFICALLY DISCLAIMS IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

This software and the associated documentation are proprietary and confidential to Actifio. Use, copying, and distribution of any Actifio software described in this publication requires an applicable software license. Any unauthorized use or reproduction of this software and the documentation may be subject to civil and/or criminal liability.

Actifio strives to produce quality documentation and welcomes your feedback. Please send comments and suggestions to [email protected].

ii | actifio.com |SAP HANA DBA’s Guide to Actifio Copy Data Management

Contents

Preface ......................................................................................................................................... v

The ActifioNOW Customer Portal.....................................................................................................................v

Actifio Support Centers ....................................................................................................................................v

Chapter 1 - SAP HANA DBA’s Introduction to Actifio Copy Data Management ................. 1

Actifio Data Virtualization .................................................................................................................................1

Capturing Data...................................................................................................................................................2

Replicating Data ................................................................................................................................................2

Accessing Data ..................................................................................................................................................3

Introduction to Actifio SAP HANA Administration .........................................................................................5

References .........................................................................................................................................................6

Chapter 2 - Preparing a SAP HANA Database for Protection ................................................ 7

Before You Begin ...............................................................................................................................................7

Creating a Key Store User Using hdbuserstore..............................................................................................9

Adding a New User in SAP HANA 1.0 (single container system) ..................................................................................9

Adding a New User in SAP HANA 2.0 (multidb single tenant system) ....................................................................... 11

Create a SAP HANA User Store Key for HANA Database Backup User......................................................12

Chapter 3 - Protecting a SAP HANA Database ...................................................................... 13

Protecting a SAP HANA Database .................................................................................................................13

Protecting SAP HANA Database Logs ...........................................................................................................16

Setting up the Log Mode and Log Backup under HANA Studio .................................................................18

Chapter 4 - Database and Log Backup Catalog Information ................................................ 21

Viewing Backup Catalog Information from SAP HANA Studio ...................................................................21

Viewing Backup Catalog Information from the Actifio Desktop ..................................................................22

Chapter 5 - Mount and Refresh a Target SAP HANA Database as a Virtual Application .. 23

Stopping the SAP Application and HANA Database to be Recovered........................................................23

Mounting a SAP HANA Database Image.......................................................................................................24

Recovering a SAP HANA Database on a Mounted Image ...........................................................................25

Recovering SAP HANA Database Mounted Image with Log Roll Forward ................................................26

Unmounting and Deleting the SAP HANA Database Data and Log Volume ..............................................28

| actifio.com | SAP HANA DBA’s Guide to Actifio Copy Data Management iii

Chapter 6 - Restoring and Recovering a SAP HANA Database ............................................ 31

Stopping the SAP Application and HANA Database to be Recovered........................................................31

Unmounting the SAP HANA Database Data and Log Volume ....................................................................31

Restoring Data and Log Volume from the Actifio Desktop ..........................................................................32

Mounting the SAP HANA Database Data and Log Volume .........................................................................33

Starting the Recovered SAP HANA Database and the Application Service ...............................................33

Recovering a SAP HANA Database with Log Roll-Forward .........................................................................34

Recovering the SAP HANA Database with Logs Rolled Forward and Starting the Application Service .................. 35

Chapter 7 - HANA Database Log and Trace Files .................................................................. 37

iv | actifio.com |SAP HANA DBA’s Guide to Actifio Copy Data Management

|

Preface

The information presented in this guide is intended for users who are familiar with basic Actifio processes and procedures as described in Getting Started with Actifio Copy Data Management and who are qualified to administer SAP HANA databases.

Your Actifio appliance’s Documentation Library contains detailed, step-by-step, application-specific instructions on how to protect and access your data. Each guide is in PDF format and may be viewed online, downloaded, or printed on demand. The following guides will be of particular interest:

• Connecting Hosts to Actifio Appliances

• Virtualizing and Protecting Copy Data with the Application Manager

• Accessing and Recovering Copy Data with the Application Manager

• Restoring Copy Data with the Application Manager

The ActifioNOW Customer PortalDuring the configuration and initialization of your Actifio appliance your Actifio representative provided you with a user name and password for the ActifioNOW customer portal.

From the customer portal you can obtain detailed reports about your Actifio appliance as well as search the portal’s knowledge base for answers to specific questions.

To log into the ActifioNOW customer portal:

1. Go to: https://now.actifio.com

2. When prompted, enter the user name and password provided by your Actifio representative.

Actifio Support CentersTo contact an Actifio support representative, you can:

• Send email to: [email protected]

• Call:

From anywhere: +1.315.261.7501

US Toll-Free: +1.855.392.6810

Australia: 0011 800-16165656

Germany: 00 800-16165656

New Zealand: 00 800-16165656

UK: 0 800-0155019

actifio.com | SAP HANA DBA’s Guide to Actifio Copy Data Management v

vi

| actifio.com |SAP HANA DBA’s Guide to Actifio Copy Data Management

1

|

SAP HANA DBA’s Introduction to Actifio Copy Data Management

This chapter introduces Actifio concepts and the procedures used to capture and access databases. It includes:

Actifio Data Virtualization on page 1

Capturing Data on page 2

Replicating Data on page 2

Accessing Data on page 3

Introduction to Actifio SAP HANA Administration on page 5

References on page 6

Actifio Data VirtualizationAn Actifio appliance is a highly scalable copy data management platform that virtualizes application data to improve the resiliency, agility, and cloud mobility of your business. It works by virtualizing data in much the same way other technologies have virtualized servers and networks. This enables you to capture data from production systems, manage it in the most efficient way possible, and use virtual copies of the data however they are needed.

SAP HANA for LVM with Linux Change Block Tracking

Application data is captured at the block level, in application native format, according to a specified SLA. A Golden copy of that data is created and stored once, and is then updated incrementally with only the changed blocks of data in an “incremental forever” model. Unlimited virtual copies of the data can be made available instantly for use, without proliferating physical copies and taking up additional storage infrastructure.

actifio.com | SAP HANA DBA’s Guide to Actifio Copy Data Management 1

2

Capturing DataCapturing data consists of four simple steps:

1. Add servers that host databases.

2. Create a generic application.

3. Define Actifio Policy Templates and Resource Profiles according to your RPOs and RTOs.

4. Assign Actifio Policy Templates and Resource Profiles to discovered databases.

The Actifio Connector

The Actifio Connector is used to capture selected databases. The Actifio Connector is a small-footprint, lightweight service that can be installed on either virtual or physical servers.

Specifically, the Actifio Connector:

• Creates a generic application to which data and log volumes will be added.

• Uses Linux changed block tracking to capture data at block level in incremental forever fashion.

• Identifies changes to database data for Actifio’s incremental forever capture strategy.

Replicating DataData can be replicated to a second Actifio appliance or to the cloud for recovery, disaster recovery, or test/development purposes.

Data replication has traditionally been an inhibitor to efficient data management in a geographically distributed environment. Actifio replication addresses these issues with a global deduplication and compression approach that:

• Drives down overall network usage.

• Eliminates the need for a dedicated WAN accelerator/optimizer.

• Does not require storage array vendor licenses as data is sent from one Actifio appliance to another.

• Is heterogeneous from any supported array to any supported array: Tier 1 to Tier 2 and/or Vendor A to Vendor B.

• Preserves write-order, even across multiple LUNs.

• Is fully integrated with VMware Site Recovery Manager (SRM) and Actifio Resiliency Director.

• Encrypts data using the AES-256 encryption standard. Authentication between Actifio appliances is performed using 1024-bit certificates.

Replication is controlled by Actifio Policy Template policies:

• Production to Mirror policies have several options to replicate data to a second Actifio appliance.

• Dedup Backup to Dedup DR policies use a fixed, Actifio proprietary replication engine to replicate data to a second Actifio appliance. In addition, Dedup Backup to Dedup DR policies allow you to replicate data to two locations.

• Production to Vault policies use a fixed, Actifio proprietary replication engine to replicate data to the cloud.

| actifio.com |SAP HANA DBA’s Guide to Actifio Copy Data Management

Accessing DataThe Actifio appliance can instantly present a copy of the database rolled forward to a specific point of time. The roll forward operation is performed from the Actifio Desktop (user interface).

Access options include:

Mounts

LiveClones

Restores

Workflows

Mounts

The Actifio mount function provides instant access to data without moving data. Captured copies of databases can be rolled forward via the Actifio user interface and mounted on any database server. Application Aware mounts are described in Chapter 5, Mount and Refresh a Target SAP HANA Database as a Virtual Application.

LiveClones

The LiveClone is an independent copy of data that can be refreshed when the source data changes. The advantage of LiveClones is that they are independent copies of data that can be incrementally refreshed and masked before being made available to users. This allows teams such as development and test to ensure they are working on the latest set of data without having to manually manage the data and not access or interfere with the production environment.

Restores

The restore function reverts the production data to a specified point in time. Restore operations actually move data. Typically restore operations are performed to restore a database to a valid state after a massive data corruption or storage array failure. The amount of time required to complete a restore operation depends on the amount of data involved. Restores are described in Chapter 6, Restoring and Recovering a SAP HANA Database.

Workflows

While SLAs govern the automated capture of a production database, Workflows automate access to the captured database.

Workflows are built with captured data. Workflows can present data as either a direct mount or as a LiveClone:

• Direct mounts (standard or application aware) work well for data that does not need to be masked prior to being presented. A mounted copy of data can be refreshed manually or on automatically on a schedule. Direct mounts allow you to instantly access captured data without actually moving the data.

• A LiveClone is a copy of your production data that can be updated manually or on a scheduled basis. You can mask sensitive data in a LiveClone prior to making it available to users.

Combining Actifio’s automated data capture and access control with Workflows and their optional data masking capabilities allows you to create self-provisioning environments. Now, instead of having to wait for DBAs to update test and development environments, users can provision their own environments almost instantly.

For example, an Actifio administrator can create an SLA Template Policy that captures data according to a specified schedule. Optionally, the administrator can mark the captured production data as sensitive and only accessible by users with the proper access rights.

After access rights have been defined and data has been captured, the administrator can create a Workflow that:

• Makes the captured data available as a LiveClone or as a direct mount

• Updates the LiveClone or mountable data on a scheduled or on-demand basis

• (Optional) Automatically applies scripts to the LiveClone’s data after each update. This is useful for masking sensitive data.

| actifio.com | SAP HANA DBA’s Guide to Actifio Copy Data Management 3

4

Once the Workflow completes, users with proper access can provision their environments with the LiveClone or mountable data via the Actifio Desktop.

Workflow With Masked Social Security Data

| actifio.com |SAP HANA DBA’s Guide to Actifio Copy Data Management

Introduction to Actifio SAP HANA Administration

SAP HANA for LVM Linux Change Block Tracking

Refer to Using the Actifio Linux CBT for more on incremental data capture of SAP HANA Data and Log volume.

SAP HANA DB Snapshots

A storage snapshot is created by first creating an SAP HANA internal database snapshot using SAP HANA API. This creates an SAP HANA internal database snapshot that provides a view of the database at the point in time that it was created.

Database Image Creation and Confirmation

Note: SAP HANA multitenant database container system configuration is only supported for single tenant database. SAP HANA storage snapshots API support is not available for multi tenant database system.

| actifio.com | SAP HANA DBA’s Guide to Actifio Copy Data Management 5

6

References1. Category > Administration Guide: http://help.sap.com/hana_platform

2. Storage Snapshots: https://help.sap.com/saphelp_hanaplatform/helpdata/en/ac/114d4b34d542b99bc390b34f8ef375/content.htm

3. 1642148 - FAQ: SAP HANA Database Backup & Recovery: https://launchpad.support.sap.com/#/notes/1642148/E

4. Create a homogeneous copy of an SAP HANA database by recovering an existing database to a different database:

https://help.sap.com/saphelp_hanaplatform/helpdata/en/ea/70213a0e114ec29724e4a10b6bb176/content.htm?frameset=/en/ca/c903c28b0e4301b39814ef41dbf568/frameset.htm&current_toc=/en/00/0ca1e3486640ef8b884cdf1a050fbb/plain.htm&node_id=773&show_children=false

Actifio Benefits: SAP HANA Platform

Backup Manual and/or scheduled online backups (incremental forever full database backups, log backups).

Test/Dev Copy Multiple point in time copies and instant Test/Dev refresh.

Accelerate and automate Test/Dev provisioning.

Migration of SAP HANA from a physical to a virtualized environment.

Recovery Recovery of a database to its most recent state.

Recovery of a database to a specific point in time of data backup, or log backup.

Recovery to the original host or an alternate host.

Backup Catalog view SAP HANA Studio and Actifio Desktop.

| actifio.com |SAP HANA DBA’s Guide to Actifio Copy Data Management

2

|

Preparing a SAP HANA Database for Protection

This section details the steps involved in preparing a SAP HANA database for Actifio protection and management:

Before You Begin on page 7

Creating a Key Store User Using hdbuserstore on page 9

Create a SAP HANA User Store Key for HANA Database Backup User on page 12

Before You BeginBefore you begin, on the SAP HANA server:

• All the configured services (see SAP Note 1697613 and SAP Note 1649519) such as indexserver, statisticsserver, etc. must be running. You can check this in the Overview of SAP HANA studio > Operational State: All Services are started.

• Make sure HANA database data and log volumes (ex: /hana/data, /hana/log) are managed by LVM.(Check the data and log path under /usr/sap/<SID>/SYS/global/hdb/custom/config/global.ini for basepath_datavolumes and basepath_logvolumes).

• Make sure log_mode for database is set to normal (check under HANA Studio configuration tab.)

• Install the Actifio Connector on the HANA database server (see Connecting Hosts to Actifio Appliances).

Learning the instance and SQL port numbers

The instance number is two of the inner digits of the port number: X<Instance>XX.

For a HANA 1.0 single container system, get the SQL PORT from HANA Studio. At System > Landscape, get the value of SQL Port for indexserver. In the example below, 32015 is the SQL port, and the instance number here is 20.

HANA 1.0: Getting the SQL Port from indexserver in the Landscape Tab

For a HANA 2.0 multi-container single-tenant database, from SYSTEMDB go to System > Landscape and get the value of SQL port for the nameserver. In the example below, 30013 is the SQL port, and the instance number is 00.

HANA 2.0: Getting the SQL Port from the Nameserver in the Landscape Tab

actifio.com | SAP HANA DBA’s Guide to Actifio Copy Data Management 7

8

Enabling Linux Change Block Tracking

Before you begin, from the Actifio Desktop, enable Linux change block tracking on the database server from Actifio Desktop > Domain Manager > Host > Details:

Refer to the Linux CBT Guide for details.

| actifio.com |SAP HANA DBA’s Guide to Actifio Copy Data Management

Creating a Key Store User Using hdbuserstoreThis section includes:

Adding a New User in SAP HANA 1.0 (single container system) on page 9

Adding a New User in SAP HANA 2.0 (multidb single tenant system) on page 11

Adding a New User in SAP HANA 1.0 (single container system)

Actifio recommends configuring a dedicated database user under HANA database for Actifio Backup operation. Create a HANA database user from the SAP HANA Studio and assign the BACKUP ADMIN and CATALOG READ privileges.

Note: For SAP HANA 1.0 (single container system), the backup user must be created under <sid>(SYSTEM) user.

1. From SAP HANA Studio go to System > Security > Users > New User.

Adding a New User in SAP HANA 1.0 (single container system)

2. Assign a User Name and a Password.

3. Select Force password change on next logon to No.

4. Click on the System Privilege tab and assign privilege by selecting BACKUP ADMIN and CATALOG READ.

SAP HANA Studio

5. Deploy the newly created user by clicking the green arrow in the top right corner:

| actifio.com | SAP HANA DBA’s Guide to Actifio Copy Data Management 9

10

To Deploy the New User, Click the Green Arrow

6. You will get a User Created message and the System Privileges will show the user has been granted “BACKUP ADMIN” and “CATALOG READ” privileges.

The New User Has the Required Privileges

| actifio.com |SAP HANA DBA’s Guide to Actifio Copy Data Management

Adding a New User in SAP HANA 2.0 (multidb single tenant system)

For SAP HANA 2.0, assign the BACKUP ADMIN, CATALOG READ and DATABASE ADMIN privileges.

Note: For SAP HANA 2.0 (multidb single tenant system), the backup user must be created under the SYSTEMDB (SYSTEM) user.

1. From SAP HANA Studio SYSTEMDB, go to System > Security > Users > New User.

Adding a New User in SAP HANA 2.0 (multidb single tenant system)

2. Assign a User Name and a Password.

3. Select Force password change on next logon to No.

4. Click on the System Privilege tab and assign privileges by selecting BACKUP ADMIN, CATALOG READ, and DATABASE ADMIN.

5. Deploy the newly created user by clicking the green arrow in the top right corner:

| actifio.com | SAP HANA DBA’s Guide to Actifio Copy Data Management 11

12

To Deploy the New User, Click the Green Arrow

6. You will get a User Created message and the System Privileges will show the user has been granted “BACKUP ADMIN”, “CATALOG READ”, and “DATABASE ADMIN” privileges.

The New User Has the Required Privileges

Create a SAP HANA User Store Key for HANA Database Backup User1. Open the putty window to the HANA database server and login to <sid>adm by

su to <sid>admcd exe

2. Create entries in hdbuserstore by calling:

# ./hdbuserstore SET <key_name> <server>:<port> <DB_user_name> <DB_user_password>

The <port> is the SQL port of the instance number, i.e. 3<instance>13.

Use the port number from Learning the instance and SQL port numbers on page 7 depending on your version of HANA.

Make a note of key_name. You will need it to update the genlvm.sh script.

3. Confirm that the key file exists by running:

hdbuserstore list

Look for entry that says "Key". If all you get is a 'DATA FILE' then you do not have a key file.

| actifio.com |SAP HANA DBA’s Guide to Actifio Copy Data Management

3

|

Protecting a SAP HANA Database

This section includes:

Protecting a SAP HANA Database on page 13

Protecting SAP HANA Database Logs on page 16

Protecting a SAP HANA DatabaseTo protect a SAP HANA database:

1. From Actifio Desktop > Application Manager Service Menu > New Application, create a new application to protect data and log volumes of SAP HANA database. This will open the Add an Application window.

2. From Add an Application:

a. Select Out-of-Band as an application type and enter an Application Name to identify this database in the Actifio Desktop.

b. From Select Host drop down, select the SAP HANA database server.

c. Under Select logical volume, use the green + to add the data and log volume to Selected volumes on the right.

d. Put "genlvmscript.sh" under "Generic LVM Script Name".

e. Click Add to add this application as generic application.

f. To check this, look at Actifio Desktop > Application Manager > Generic > OUT OF BAND.

actifio.com | SAP HANA DBA’s Guide to Actifio Copy Data Management 13

14

3. Set up the scripts

a. Login to database server as root

b. cd to /act (cd /act)

c. Create /act/scripts directory if not there

mkdir scriptscd /act/scripts

d. Copy Actifio provided script /act/act_scripts/saphana/outofband to /act/scripts

e. This contains 7 scripts

• genlvmscript.sh

• freeze.xxx

• thaw.xxx

• abort.xxx

• act_saphana_pre.sh

• act_saphana_post.sh

• act_saphana_abort.sh

f. provide 755 permission

chmod 755 *

4. Get the applicationid for the created generic application. From application manager mouse over and get the application id:

5. Modify the freeze, thaw, abort script extension from "xxx" to appid from Step 7 (for example: 4069291)

From the command line

mv freeze.xxx freeze.4069291mv thaw.xxx thaw.4069291mv abort.xxx abort.4069291

6. Edit and modify the genlvmscript.sh script to set the DBSID, KEYNAME, INSTANCENUM, and HANAVERSION:

vi genlvmscript.sh

Replace the line:

DBSID='<HANA DB name>'KEYNAME='<key_name created using hdbuserstore>HANAVERSION=<HANA DATABASE VERSION (1.0 or 2.0)>INSTANCENUM=<SQL Port from Learning the instance and SQL port numbers on page 7>

| actifio.com |SAP HANA DBA’s Guide to Actifio Copy Data Management

For example:

DBSID='PRD'KEYNAME='ACTHANA'HANAVERSION='1.0'INSTANCENUM='20'

Where:

o HANA database SID = "PRD"

o KEY NAME = ACTHANA created using hdbuserstore from Creating a Key Store User Using hdbuserstore on page 9.

o INSTANCENUM = '20' from Learning the instance and SQL port numbers on page 7.

7. Save the file.

8. To protect the database, open the Actifio Desktop to the Application Manager, Protect tab. Select the database, then under Protection select an SLA template from Template drop-down list, and a resource profile from the Profile drop-down list and click Protect.

You can run the snapshot job immediately as an on-demand job, or wait for the scheduler to run the job during the time period specified in the template.

| actifio.com | SAP HANA DBA’s Guide to Actifio Copy Data Management 15

16

Protecting SAP HANA Database LogsPre-Requisites for HANA 2.0: Key Store User

Note: For HANA 1.0 skip to Setting up the Log Mode and Log Backup under HANA Studio on page 18.

Creating a Key Store User Using hdbuserstore to purge the log backup of tenant database

1. Add a new user in the SAP HANA 2.0 tenant database:

2. Assign the BACKUP ADMIN and CATALOG READ privileges.

| actifio.com |SAP HANA DBA’s Guide to Actifio Copy Data Management

3. For a HANA 2.0 tenant database, get the SQL PORT from HANA Studio. At tenantdb-System > Landscape, get the value of SQL Port for indexserver. In the example below, 30015 is the SQL port, and the instance number here is 00.

Create a SAP HANA User Store Key for HANA Tenant Database User

1. Open the putty window to the HANA database server and login to <sid>adm by su to <sid>adm.

2. cd exe

3. Create entries in hdbuserstore by calling:

# ./hdbuserstore SET <key_name> <server>:<port> <DB_user_name> <DB_user_password>

The <port> is the SQL port of the single tenant database, i.e. 3<instance>15.

Use the port number, dbusername and password from above created for the tenant database, for example, ./hdbuseratore SET ACTBACKUPHA3 saphana3:30015 ACTBACKUP password ********************

Check the keystore:

./hdbuserstore listDATA FILE : /usr/sap/HA3/home/.hdb/saphana3/SSFS_HDB.DATKEY FILE : /usr/sap/HA3/home/.hdb/saphana3/SSFS_HDB.KEY

KEY ACTBACKUP ENV : saphana3:30013 USER: ACTBACKUPKEY ACTBACKUPHA3 ENV : saphana3:30015 USER: ACTBACKUPhdbuserstore listDATA FILE : /usr/sap/HA3/home/.hdb/saphana3/SSFS_HDB.DATKEY FILE : /usr/sap/HA3/home/.hdb/saphana3/SSFS_HDB.KEY

KEY ACTBACKUP ENV : saphana3:30013 USER: ACTBACKUPKEY ACTBACKUPHA3 ENV : saphana3:30015 USER: ACTBACKUP

Make note of Key name (ACTBACKUPHA3) to update the TENANTKEYNAME under appid.xxx.

| actifio.com | SAP HANA DBA’s Guide to Actifio Copy Data Management 17

18

Setting up the Log Mode and Log Backup under HANA Studio1. From HANA Studio, make sure log_mode is set to normal under HANA Studio > Configuration > log_mode:

2. Configure the Log Backup Settings:

o Set the log backup path from HANA Studio > Backup > Configuration to a file system on the database server.

o Enable automatic log backup setting from HANA Studio > Backup > Configuration, by selecting the check box

o Set the log backup interval based on application RPO.

3. Discover the file system (log backup path from step 2 above) by running Discover Applications from the Actifio Desktop (if not discovered already).

4. The log backup mount path will appear in the Actifio Desktop under App > Filesystem.

| actifio.com |SAP HANA DBA’s Guide to Actifio Copy Data Management

5. Set up the scripts to purge the log backup. Login to database server as root:

a. cd to /act (cd /act)

b. Create /act/scripts directory if not there:

mkdir scriptscd /act/scripts

c. Copy Actifio-provided script from /act/act_scripts/saphana/log to /act/scripts.

This contains 3 scripts:

appid.xxxthaw.xxxact_saphana_logdelete.sh

d. Provide 755 permission

chmod 755 *

6. From the Application Manager, mouse over the discovered log backup mount path to get the application id.

| actifio.com | SAP HANA DBA’s Guide to Actifio Copy Data Management 19

2

7. Modify appid, and thaw script extension from "xxx" to appid from Step 7 (ex: 4052591). From the command line:

mv appid.xxx appid.4052591mv thaw.xxx thaw.4052591

8. Edit and modify the appid.4069291 script to set the DBSID, KEYNAME, and INSTANCENUM.

vi appid.4069291

Replace the line below:

DBSID='<HANA DB name>'KEYNAME='<key_name from Creating a Key Store User Using hdbuserstore>'INSTANCENUM='<SQL Port for SYSTEM database from Learning the instance and SQL port numbers>'DELLOG='3'

For HANA 2.0: Make sure to create the hdbuserstore key for tenant database to provide the value below.

#TENANTKEYNAME=<key_name created using hdbuserstore on page 16 for tenant database>

With:

DBSID='PRD'KEYNAME='ACTHANA'INSTANCENUM='20'

For HANA 2.0: Uncomment and provide the key_name value created for tenant database:

TENANTKEYNAME='ACTBACKUPHA3'

Where:

For example: HANA database

o SID: "PRD"

o KEY NAME = ACTHANA created using hdbuserstore from Learning the instance and SQL port numbers on page 7.

o INSTANCENUM = '20' from Learning the instance and SQL port numbers on page 7.

o TENANTKEYNAME='ACTBACKUPHA3' created using Creating a Key Store User Using hdbuserstore to purge the log backup of tenant database on page 16.

The DELLOG variable is use to delete all the log backups older than the current date - DELLOG from the log backup path. Configure the setting to retain the log backup for the # of day's on local disk.

Save the file.

9. To protect the database log, open the Actifio Desktop to the Application Manager, Protect tab. Select the database, then under Protection select an SLA template from Template drop-down list, and a resource profile from the Profile drop-down list and click Protect.

You can run the snapshot job immediately as an on-demand job, or wait for the scheduler to run the job during the time period specified in the template.

0 | actifio.com |SAP HANA DBA’s Guide to Actifio Copy Data Management

4

|

Database and Log Backup Catalog Information

You have two ways of viewing database and log backup catalog information:

Viewing Backup Catalog Information from SAP HANA Studio on page 21

Viewing Backup Catalog Information from the Actifio Desktop on page 22

Viewing Backup Catalog Information from SAP HANA Studio1. Start the SAP HANA studio. Go to HANA database instance and double click the backup tab.

2. On the right hand pane under backup catalog you will see the Actifio database backup and log backups.

actifio.com | SAP HANA DBA’s Guide to Actifio Copy Data Management 21

2

Viewing Backup Catalog Information from the Actifio DesktopFrom Application Manager > APP > Generic > Out of Band > Application name > Restore tab, you will see the list of snapshots.

2 | actifio.com |SAP HANA DBA’s Guide to Actifio Copy Data Management

5

|

Mount and Refresh a Target SAP HANA Database as a Virtual Application

Use this procedure to present and refresh as a virtual copy the HANA database from source to any target for devops. This presentation of virtual copy is not dependent on source SID or Instance number or database server name; the virtual copy can be presented from a source with SID: PRD, instance#00, database server, HANADB1 to target database server with SID: NRD, instance#01, database server, HANADB2.

To restore and recover the source HANA database, see Chapter 6, Restoring and Recovering a SAP HANA Database.

Overview of the Process

Overview to mount SAP HANA database as virtual copy:

1. Stopping the SAP Application and HANA Database to be Recovered on page 23

2. Mounting a SAP HANA Database Image on page 24

3. Recovering a SAP HANA Database on a Mounted Image on page 25 or Recovering SAP HANA Database Mounted Image with Log Roll Forward on page 26

4. Start the SAP HANA database and the SAP application running on the target HANA database

5. Unmounting and Deleting the SAP HANA Database Data and Log Volume on page 28

Stopping the SAP Application and HANA Database to be RecoveredTo stop the SAP HANA database and application:

1. From the target SAP Application server command line, login as application OS user <sid>adm (for example: on Linux "actadm" OS user)

#su - actadm# stopsap r3

This will stop SAP application services based on target HANA database.

2. From the target SAP HANA Database server command line, login as database <sid>adm OS user (for example: with HANA database SID PRD OS user will be "prdadm").

#su - prdadm#HDB stop

This will stop SAP HANA database services

actifio.com | SAP HANA DBA’s Guide to Actifio Copy Data Management 23

2

Mounting a SAP HANA Database Image1. Open the Actifio Desktop to the Application Manager and select the snapshot image

2. From the gear icon dropdown menu, select Mount. The Mount window opens.

Provide a label as needed. This is optional.

3. In the Select Host drop down list, select the target SAP HANA database node.

4. Add a mount point to mount the data and log volume, for example /acthanadb.

5. Click Mount. This will map the data and log volume to the target server. The source data volume /hana/data will be mounted as /acthana/hana/data and the source /hana/log volume will be mounted as /acthana/hana/log.

4 | actifio.com |SAP HANA DBA’s Guide to Actifio Copy Data Management

Recovering a SAP HANA Database on a Mounted Image1. Check the owner and group for the Actifio mounted data and log volume. For example, for database

instance PRD, owner "prdadm" and group sapsys.

2. If needed change the owner and group of the mounted volume as:

chown -R prdadm:sapsys /acthana/chown -R prdadm:sapsys /acthana/

a. Open the global.ini file and set the data and log volume path to the mounted data and log backup image: vi /usr/sap/<HANA SID>/SYS/global/hdb/custom/config/global.ini

o Change basepath_datavolumes to /acthana/hana/data/<sid name>

o Change basepath_logvolumes to /acthana/hana/log/<sid name>

b. Save the global ini file.

c. Run recovery of mounted image by running the command below:

Note: For point in time recovery using log roll-forward, skip to Recovering SAP HANA Database Mounted Image with Log Roll Forward.

3. From the SAP HANA database server command line, login as database <sid>adm OS user )for example: With HANA database SID -- PRD, OS user -- "prdadm").

#su - prdadm#HDBSettings.sh /hana/shared/<HANA SID>/exe/linuxx86_64/<HANA database version>/python_support/recoverSys.py --command="RECOVER DATA USING SNAPSHOT CLEAR LOG"

4. Replace <HANA database version> with the version, for example HDB_1.00.112.00.1457525470_2771635

This will start SAP HANA database services. If you are using SAP HANA 2.0, proceed to Starting the Tenant Database Services (SAP HANA 2.0 only).If you are using SAP HANA 1.0, then skip to Starting the SAP Application Services (both versions), below.

Starting the Tenant Database Services (SAP HANA 2.0 only)

For SAP HANA 2.0, when the SAP HANA database services have started, you must also start the SYSTEMDB database services. To start the tenant database, use the backupuser account created in Adding a New User in SAP HANA 2.0 (multidb single tenant system) on page 11 to start the tenant database.

1. (First time only) Run the HDBUSERSTORE command to create the user store key as detailed in Create a SAP HANA User Store Key for HANA Database Backup User on page 12.

2. When you have the user store key, then run:

o hdbsql -U ACTBACKUP

o hdbsql SYSTEMDB > alter system start database <sid name>

This will start SAP HANA SYSTEMDB database services.

Starting the SAP Application Services (both versions)

3. From the SAP application server command line, login as application <sid>adm OS user, for example "actadm" OS user.

#su - actadm# startsap

This will start the SAP application services.

| actifio.com | SAP HANA DBA’s Guide to Actifio Copy Data Management 25

2

Recovering SAP HANA Database Mounted Image with Log Roll Forward1. Mount SAP HANA database log backup volume

a. Open the Actifio Desktop to the Application Manager and select the snapshot image of the protected log backup file system

b. From the gear icon dropdown menu, select Mount. The Mount window opens.

6 | actifio.com |SAP HANA DBA’s Guide to Actifio Copy Data Management

c. Provide a label as needed. This is optional.

d. In the Select Host drop down list, select the target SAP HANA database node.

e. Under Mount Point, enter a path to mount the backup log.

f. Click Mount. This will mount the data and log volume to the target server under provided mount point.

2. Recover SAP HANA database and start the application. From the SAP HANA database server command line, login as database <sid>adm OS user (for example: With HANA database SID -- PRD and OS user -- "prdadm").

#su - prdadm

3. Get the roll forward time from the mounted backup image.

For example: a mounted backup image under /hanalog and backup log path: /hanalog/PRD/HDB00/backup/log do "ls -ltr"

4. The time above is in EST. Convert it to UTC time zone for the SAP HANA roll forward recovery command.

For example: for recovery time of Jan 4 17:32 the recovery command will be Jan 4 22:32 in the format of 'yyyy-mm-dd hh24:mi:ss' i.e. '2017-01-04 22:32:00'

5. Open the global.ini file and set the log backup path to the mounted log backup image:

vi /usr/sap/<HANA SID>/SYS/global/hdb/custom/config/global.ini

o Change basepath_logbackup to /hanalog/PRD/HDB00/backup/log, i.e. basepath_logbackup = /hanalog/PRD/HDB00/backup/log

o Save it.

Note: Reset the basepath_logbackup to original log backup path after recovery.

6. Run recovery command as below

# HDBSettings.sh /hana/shared/<HANA SID>/exe/linuxx86_64/<HANA database version>/python_support/recoverSys.py --command="RECOVER DATABASE UNTIL TIMESTAMP '2017-01-04 22:32:00' CLEAR LOG USING DATA PATH ('/usr/sap/PRD/HDB00/backup/data') USING LOG PATH ('/hanalog/PRD/HDB00/backup/log') USING SNAPSHOT CHECK ACCESS USING FILE"

o Replace <HANA database SID> with HANA database SID name, for example: PRD

o Replace <HANA database version> with version, for example: HDB_1.00.112.00.1457525470_2771635

This will start SAP HANA database services. If you are using SAP HANA 2.0, proceed to Starting the Tenant Database Services (SAP HANA 2.0 only).If you are using SAP HANA 1.0, then skip to Starting the SAP Application Services (both versions), below.

| actifio.com | SAP HANA DBA’s Guide to Actifio Copy Data Management 27

2

Starting the Tenant Database Services (SAP HANA 2.0 only)

For SAP HANA 2.0, when the SAP HANA database services have started, you must also start the SYSTEMDB database services. To start the tenant database, use the backupuser account created in Adding a New User in SAP HANA 2.0 (multidb single tenant system) on page 11 to start the tenant database.

1. (First time only) Run the HDBUSERSTORE command to create the user store key as detailed in Create a SAP HANA User Store Key for HANA Database Backup User on page 12.

2. When you have the user store key, then run:

o hdbsql -U ACTBACKUP

o hdbsql SYSTEMDB > alter system start database <sid name>

This will start SAP HANA SYSTEMDB database services.

Starting the SAP Application Services (both versions)

3. From the SAP application server command line, login as application <sid>adm OS user, for example "actadm" OS user.

#su - actadm# startsap

This will start the SAP application services.

Unmounting and Deleting the SAP HANA Database Data and Log Volume

After the database and application services have been stopped (detailed in Stopping the SAP Application and HANA Database to be Recovered on page 23), unmount the previously mounted image from the Actifio Desktop:

1. Open the Actifio Desktop to the Application Manager and select the mounted Image under Active Image pane at the bottom.

2. From the gear icon dropdown menu, select Unmount and Delete. The Unmount window opens.

8 | actifio.com |SAP HANA DBA’s Guide to Actifio Copy Data Management

3. Click Submit to submit the job.

| actifio.com | SAP HANA DBA’s Guide to Actifio Copy Data Management 29

3

0 | actifio.com |SAP HANA DBA’s Guide to Actifio Copy Data Management

6

|

Restoring and Recovering a SAP HANA Database

Use this procedure to restore and recover the source HANA database. This procedure overwrites the source data; you can also present and refresh the HANA database as a virtual copy from source to any target for Dev/Ops, see Chapter 5, Mount and Refresh a Target SAP HANA Database as a Virtual Application.

To recover a SAP HANA database to a scheduled database backup point in time:

1. Stopping the SAP Application and HANA Database to be Recovered on page 31

2. Unmounting the SAP HANA Database Data and Log Volume on page 31

3. Restoring Data and Log Volume from the Actifio Desktop on page 32

4. Mounting the SAP HANA Database Data and Log Volume on page 33

5. Starting the Recovered SAP HANA Database and the Application Service on page 33

This section also includes Recovering a SAP HANA Database with Log Roll-Forward on page 34.

Stopping the SAP Application and HANA Database to be Recovered1. From the SAP application server command line, login as application OS user <sid>adm. For example, on

Linux OS "actadm" user

#su - actadm# stopsap r3

This will stop SAP application services.

2. From the SAP HANA database server command line, login as database OS user <sid>adm. For example, "prdadm" user:

#su - prdadm#HDB stop

This will stop SAP HANA database services.

Unmounting the SAP HANA Database Data and Log VolumeAfter the database and application services have been stopped (detailed in Stopping the SAP Application and HANA Database to be Recovered on page 31), unmount the previously mounted image from the Actifio Desktop:

From the SAP HANA database server command line as root, get the data log volume lvm details. For example:#df -th/dev/mapper/cdshanavg-cdshanalv ext3 542G 52G 462G 11% /hana/data/dev/mapper/cdslogvg-cdsloglvext3 246G 9.7G 224G 5% /hana/log

Unmount the database and log volume before restoring the volume:#umount /hana/data#umount /hana/log

actifio.com | SAP HANA DBA’s Guide to Actifio Copy Data Management 31

3

Restoring Data and Log Volume from the Actifio Desktop1. From Application Manager > Protected Application, from the latest snapshot to recover, choose Restore:

2. On the Restore tab, click Submit:

3. Type DATA LOSS and click Continue:

This will restore the data and log volume.

2 | actifio.com |SAP HANA DBA’s Guide to Actifio Copy Data Management

Mounting the SAP HANA Database Data and Log VolumeUsing the volume information from Unmounting the SAP HANA Database Data and Log Volume on page 31:

#mount /dev/mapper/cdshanavg-cdshanalv /hana/data#mount /dev/mapper/cdslogvg-cdsloglv /hana/log

Starting the Recovered SAP HANA Database and the Application Service

Note: For a point in time recovery using log roll-forward, skip to Recovering a SAP HANA Database with Log Roll-Forward on page 34.

1. From the SAP HANA database server command line, login as database OS user. For example, with HANA database SID PRD and OS user will be prdadm.

#su - prdadm# HDBSettings.sh /hana/shared/<HANA database SID>/exe/linuxx86_64/HDB_1.00.<HANA database version>/python_support/recoverSys.py --command="RECOVER DATA USING SNAPSHOT CLEAR LOG"

Replace <HANA database SID> with HANA database SID name ex: PRD

Replace <HANA database version> with version for ex: HDB_1.00.112.00.1457525470_2771635

This will start SAP HANA database services. If you are using SAP HANA 2.0, proceed to Starting the Tenant Database Services (SAP HANA 2.0 only).If you are using SAP HANA 1.0, then skip to Starting the SAP Application Services (both versions), below.

Starting the Tenant Database Services (SAP HANA 2.0 only)

For SAP HANA 2.0, when the SAP HANA database services have started, you must also start the SYSTEMDB database services. To start the tenant database, use the backupuser account created in Adding a New User in SAP HANA 2.0 (multidb single tenant system) on page 11 to start the tenant database.

1. (First time only) Run the HDBUSERSTORE command to create the user store key as detailed in Create a SAP HANA User Store Key for HANA Database Backup User on page 12.

2. When you have the user store key, then run:

hdbsql -U ACTBACKUPhdbsql SYSTEMDB > alter system start database <sid name>

This will start SAP HANA SYSTEMDB database services.

Starting the SAP Application Services (both versions)

3. From the SAP application server command line, login as application <sid>adm OS user, for example "actadm" OS user.

#su - actadm# startsap

This will start the SAP application services.

| actifio.com | SAP HANA DBA’s Guide to Actifio Copy Data Management 33

3

Recovering a SAP HANA Database with Log Roll-ForwardBefore starting here, you must have completed Starting the Recovered SAP HANA Database and the Application Service on page 33 through Step 1.

1. Mount the SAP HANA database log backup volume:

o Open the Actifio Desktop to the Application Manager and select the snapshot image of the protected log backup file system.

o From the gear icon dropdown menu, select Mount. The Mount window opens:

2. Provide a label as needed. This is optional.

3. In the Select Host drop down list, select the target SAP HANA database node.

4 | actifio.com |SAP HANA DBA’s Guide to Actifio Copy Data Management

Recovering the SAP HANA Database with Logs Rolled Forward and Starting the Application Service

To recover the SAP HANA database and start the application:

1. From the SAP HANA Database server command line, login as database OS user. For example, with HANA database SID PRD, the OS user will be prdadm.

#su - prdadm

2. Get the roll forward time from mounted backup image. For example, a mounted backup image under /hanalog and backup log path: /hanalog/PRD/HDB00/backup/log do "ls -ltr"

3. The time above is in EST. Convert it to UTC time zone for SAP HANA database roll forward recovery command. For example, for a recovery time of Jan 4 17:32 above the recovery command will be Jan 4 22:32 in the format of 'yyyy-mm-dd hh24:mi:ss' i.e. '2017-01-04 22:32:00'

4. Open the global.ini file and set the log backup path to the mounted log backup image:

vi /usr/sap/<HANA SID>/SYS/global/hdb/custom/config/global.ini

5. Change basepath_logbackup to /hanalog/PRD/HDB00/backup/log, i.e. basepath_logbackup = /hanalog/PRD/HDB00/backup/log

6. Save the global.ini.file.

Note: Reset the basepath_logbackup to original log backup path after recovery.

7. Run the recovery command:

# HDBSettings.sh /hana/shared/<HANA SID>/exe/linuxx86_64/<HANA database version>/python_support/recoverSys.py --command="RECOVER DATABASE UNTIL TIMESTAMP '2017-01-04 22:32:00' CLEAR LOG USING DATA PATH ('/usr/sap/PRD/HDB00/backup/data') USING LOG PATH ('/hanalog/PRD/HDB00/backup/log') USING SNAPSHOT CHECK ACCESS USING FILE"

Replace <HANA database SID> with the HANA database SID name (for example: PRD).

Replace <HANA database version> with version (for example: HDB_1.00.112.00.1457525470_2771635).

This will start SAP HANA database services. If you are using SAP HANA 2.0, proceed to Starting the Tenant Database Services (SAP HANA 2.0 only).If you are using SAP HANA 1.0, then skip to Starting the SAP Application Services (both versions), below.

Starting the Tenant Database Services (SAP HANA 2.0 only)

For SAP HANA 2.0, when the SAP HANA database services have started, you must also start the SYSTEMDB database services. To start the tenant database, use the backupuser account created in Adding a New User in SAP HANA 2.0 (multidb single tenant system) on page 11 to start the tenant database.

1. (First time only) Run the HDBUSERSTORE command to create the user store key as detailed in Create a SAP HANA User Store Key for HANA Database Backup User on page 12.

2. When you have the user store key, then run:

hdbsql -U ACTBACKUP

| actifio.com | SAP HANA DBA’s Guide to Actifio Copy Data Management 35

3

hdbsql SYSTEMDB > alter system start database <sid name>

This will start SAP HANA SYSTEMDB database services.

Starting the SAP Application Services (both versions)

3. From the SAP application server command line, login as application <sid>adm OS user, for example "actadm" OS user.

#su - actadm# startsap

This will start the SAP application services.

6 | actifio.com |SAP HANA DBA’s Guide to Actifio Copy Data Management

7

|

HANA Database Log and Trace Files

To examine HANA database and log trace files:

1. cd to /usr/sap/<HANA sid>/HDB<system number>/<hostname of the server>/trace.

2. For any backup or recovery check backup.log, run the command: ls -ltr | grep -i backup

3. Any issue with the services will create its own trace and alert file. For example, to check index server trace file:

ls -ltr | grep -i index-rw-r----- 1 nr1adm sapsys 3017056 Dec 12 13:06 indexserver_alert_saphana1.trc-rw-r----- 1 nr1adm sapsys 5868119 Dec 25 13:52 indexserver_saphana1.32003.000.trc

4. For any authentication issue:

ls -ltr | grep -i nameserver-rw-r----- 1 nr1adm sapsys 8 Dec 22 12:13 nameserver_saphana1.32001.stat-rw-r----- 1 nr1adm sapsys 6188301 Dec 25 13:59 nameserver_saphana1.32001.018.trc

actifio.com | SAP HANA DBA’s Guide to Actifio Copy Data Management 37

3

8 | actifio.com |SAP HANA DBA’s Guide to Actifio Copy Data Management