Sunday 26 November 2017

How to restore FCM Tape Backup?

PLAN OF ACTION for Restoration from FCM Server to UAT Server. 
We are restoring PROD production database from direct FCM Tape backup, as a first step we are restoring latest control file manually from UAT Server, after that we are running the restoration script on UAT Server. When we fired the restoration script, we got the following errors....


















Later, we have tried restoring manually from the catalog in UAT Server.

We tried below steps as well when suggested by IBM team:

RMAN>catalog DEVICE TYPE 'SBT_TAPE' BACKUPPIECE '"pesguqus_1_1"';

After running this command, we are getting following error:
















ORA_19511: Error received from media manager Layer, error text:
ANS1302E (RC2) No objects on server match query.

Basically Our FCM Backup will be happening as follows:
In Production Database, we will take control file backup manually with RMAN, post which we connect Production Database with active IP address i.e. xx.xx.xx.xx.
Once we connect xx.xx.xx.xx, we execute the following two commands to take Backup of Production database through FCM.

Follow the below commands:

bash-4.4$ cd $ORACLE_HOME/acs
bash-4.4$ fcmcli -f unmount 

IBM Tivoli Storage FlashCopy(R) Manager offload agent
- Version 4, Release 1, Level 3.0 for AIX LF 64-bit -
Build: 763 generated on Jul 31 2015
(c) Copyright IBM Corporation, 2000, 2015, All Rights Reserved.
FMM0005I Start of program at: Thu Jul 13 16:47:56 IST 2017.
FMM8800I The command is: unmount
FMM6501I Initializing 'unmount' request.
FMM6502I Executing 'unmount' request.
FMM6503I Terminating 'unmount' request.
FMM6518I No snapshot backup is currently mounted. ----------------->>(this line should be present)
FMM0020I End of program at: Thu Jul 13 16:47:58 IST 2017.
FMM0021I Elapsed time: 02 sec.
FMM0024I Return code is: 0.

bash-4.4$ pwd
/oracle/app/oradata/product/11.2.0/dbhome_1/acs

bash-4.4$ acsora -f backup ------------------------>>>(this is the command to start the backup)

Backup initiating process:
  1. Initially it will take snapshot of the production database.
  2. Then it will connect to FCM Server (XX.XX.XX.XX), in that we have catalog database (catdb).
  3. Once it is connected to catalog database, in cat database we have one script (rman.sh) to take backup, the script consist TSM Tape path ‘ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
  4. Then backup will happen in TAPE.
NOTE:
ISSUE

All the backup that happens through FCM Server (XX.XX.XX.XX), backup information will always be stored in catalog database’s control file only. Hence, while trying restoration direct from UAT server (xx.xx.xx.xx), it’s not happening because of missing backup information.

SOLUTION:
Therefore, we have planned the restoration to happen from XX.XX.XX.XX (PROD FCM server) with the help of CATALOG database and restore it to xx.xx.xx.xx (UAT Server) .

Following Steps: 

STEP 1:
  1. In UAT Server (10.0.2.133), first we will configure LISTNER file:
$ cd $ORACLE_HOME/network/admin
$ vi listener.ora
UATPROD1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = xx.xx.xx.xx)(PORT = 1531))
)
SID_LIST_UATPROD1 =
(SID_LIST =
(SID_DESC =
(SID_NAME = PROD1)
(ORACLE_HOME = /oracle/app/oradata/product/11.2.0/dbhome_1)
(ENVS = 'EPC_DISABLED=TRUE')
)
  1. Then start the listener: UATPROD1.
$ lsnrctl start UATPROD1

STEP 2:
  1. Configure TNSNAMES entry in FCM Server (XX.XX.XX.XX).
$ cd $ORACLE_HOME/network/admin
$vi tnsnames.ora
UATPROD1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = xx.xx.xx.xx)(PORT = 1531))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = PROD1)
)
)

STEP 3: 
In UAT Server (xx.xx.xx.xx),
  1. First we have to export Oracle instance:
$ export ORACLE_SID=PROD1

Then connect RMAN

$ rman target /
  1. set DBID
RMAN> set DBID=1971255728;

RMAN> startup nomount pfile='/oracle/app/oradata/product/11.2.0/dbhome_1/initPROD1.ora';

RMAN> restore controlfile from
'/home/oracle/15OCT2017/bkctrl_dPROD1_ut2sh3osk_s36770_p1_t957473684';

Once we restore control file manually, then connect FCM Server (XX.XX.XX.XX)

STEP 4:

$ export ORACLE_SID=catdb
  1. Then, we will connect catalog database and UAT database through RMAN.
$ rman catalog RCAT/rcat target sys/oracle123@UATPROD1
Recovery Manager: Release 11.2.0.4.0 - Production on Tue Oct 17 14:19:44 2017
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
Connected to target database: PROD1 (not mounted)
Connected to recovery catalog database
RMAN> alter database mount;

RMAN> crosscheck backup;

RMAN> delete noprompt expired backup;

RMAN>@RRB1_Final_Script.sql

run
{
allocate channel 'c1' type 'sbt_tape' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
set newname for datafile 1 to '/PROD1_dbrestfiles/PROD1/datafile/system_01.dbf';
set newname for datafile 2 to '/PROD1_dbrestfiles/PROD1/datafile/sysaux_01.dbf';
set newname for datafile 3 to '/PROD1_dbrestfiles/PROD1/datafile/users01.dbf';
set newname for datafile 4 to '/PROD1_dbrestfiles/PROD1/datafile/tab_01.dbf';
set newname for datafile 5 to '/PROD1_dbrestfiles/PROD1/datafile/hr_tblsp_01.dbf';
set newname for tempfile 1 to '/PROD1_dbrestfiles/PROD1/tempfile/temp_sort_tblspc_01.dbf';
restore database;
switch datafile all;
switch tempfile all;
recover database;
release channel c1;
}

STEP 5:

Login in to UAT Server:

$ Sqlplus / as sysdba
SQL> select NAME,LOG_MODE,OPEN_MODE,CONTROLFILE_TYPE from v$database;

SQL> recover database until cancel using backup controlfile;
AUTO

SQL> alter database open resetlogs;

SQL> select NAME,LOG_MODE,OPEN_MODE,CONTROLFILE_TYPE from v$database;


Thanks and Comments Please..............!

What is FCM (FlashCopy Manager) backup?

Tivoli FlashCopy Manager (FCM)
Unlike other solutions on the market, FCM offers an application-aware backup and restore function by leveraging advanced snapshot technologies.

  1. FCM performs near-instant application-aware snapshot backups, with little or no impact to the Oracle database.
  2. FCM improves application availability and service levels through high-performance and nearinstant restore capabilities that reduce downtime.
  3. FCM integrates with Storwize V7000.

A snapshot copy of the production data is retained on disk as an application backup and can be later used to restore the production data. FCM allows users to restore on an auxiliary server or to clone the production server for development or testing purposes.

FCM components

The FCM components are divided into three groups: Application Agent, Management daemon and Device Agent (see Figure 1).

Figure 1. Three FCM component groups

Application Agent provides required support to implement snapshot backup and restore. For Oracle native databases (non SAP), the client functions are integrated in the acsora application agent.
Management daemon (acsd) coordinates the backup operation. It controls the backup flow and mediates between the application and device agents. The management agent also provides access to the snapshot-backup repository, which contains information about the valid snapshot backups and their relationship to snapshot -capable storage devices.

Offload Agent (tsm4acs) has the role of providing a single user interface for backing up an existing snapshot to Tivoli Storage Manager. Tivoli FlashCopy Manager includes a licensefile that enables use of the enhanced functions of the offload agent. The offload agent also calls the generic-device agent for mount and unmount operations on the backup systems.

Volume Group Takeover utility (acsvg.sh) is a shell script that is only required in special
high-availability scenarios where enhanced concurrent-capable volume groups are used on
production systems. In these situations, this script exports and reimports the volume groups
on an IBM PowerHA™ (formerly called HACMP™) takeover system after a snapshot restore
is performed. This process is necessary to synchronize the AIX Object Data Manager (ODM) on the production and IBM PowerHA takeover systems.

Device Agent (acsgen) is an OS-independent and storage-device-independent software layer that interacts with OS -specific and storage device-specific adapters. This agent is also used to send and request updates of the progress and usability information stored in the local snapshot repository.

CIM Adapter (fmcima) is used in conjunction with the Generic Device Agent (acsgen) and is the component that invokes a snapshot command on a FlashCopy device (such as IBM
System Storage® DS8000 and SAN Volume Controller) using the CIM interface.

XIV Adapter (XivAdapter.jar) works in conjunction with the Generic Device Agent (acsgen) to communicate with acsgen. It issues commands to the IBM XIV® command-line interface (xcli).

Query Capacity (fmquery) command lists all backups (FlashCopy or snapshots) that are
registered in a particular repository. Use this command to periodically check the amount of
storage space used for backups and to verify compliance with the licensed-capacity amount.

Solution
For this paper, a backup and restore solution is built for a native Oracle database. The solution uses FCM2.2 to backup and restore an Oracle11g database, where the database and log files are located on SAN disks of the Storwize V7000 midrange-storage system in an AIX environment.
This paper also guides the reader through the creation of Storwize V7000 pools and volumes, the creation of LVM and ASM volume groups and file systems, the installation of FCM software and the steps for performing a backup and restore/clone of an Oracle database.

Note: The author assumes the readers have basic knowledge of AIX LVM, Oracle ASM and Oracle RMAN. For technical details on those topics, refer to the respective product documentation sets.

Storwize FlashCopy function
The IBM Storwize FlashCopy function offers an advanced storage technology that you can use to protect critical customer data and maximize data availability. With minimal impact on production during flash copying, it becomes the most favorable solution for backup and restore.

There are multiple types of FlashCopy: copy, incremental and nocopy.

  1. Copy FlashCopy is a point-in-time copy of a volume, followed by a subsequent backgroundcopy operation that creates a physical copy of the source volume.
  2. Incremental FlashCopy is similar to a copy FlashCopy but it reduces how much data is copied between consecutive FlashCopy backups. Only blocks that change after the previous FlashCopy are copied to the target.
  3. Nocopy FlashCopy creates only the image that contains the changes that occur after the original FlashCopy (no background copying).

Storwize V7000 also allows FlashCopy to create snapshots on space-efficient volumes (Note: To avoid the volume size increasing because of background copying, it is recommended that you run the FlashCopy to a space-efficient target with the NOCOPY option.)


Thanks and Comments please................!