Oracle Restore for APM

Version 0.2 June 2nd 2012

Hallett German

Sr. Support Engineer

CA Technologies, Inc.

Table of Contents

1.  Introduction

2.  Guiding Principles

3.  Restore Procedure

4.  Etcetera

Introduction

This document covers how to do a successful Oracle Restore since it is not covered in the APM Configuration and Administration Guide.

Guiding Principles

1.  Successful restores includes knowing the answer to these questions:

a.  The Oracle version

b.  The name of tablespace used to store APM information

c.  The CEM administrators account.

d.  The command used to export the database (exp or expdb)

e.  The type of dump (complete, incremental, or incremental)

f.  Size of database being restored.

2.  Check the Oracle manuals for more details and if there are any changes to the arguments listed below.

Restore Procedure

Pre-work:

Step 1: Create tablespace

Run the following in SQL Plus. This creates the needed tablespace used to store the APM export. Use an appropriate size if 20 Gigabytes is too much.

create tablespace CA_APP_DAT datafile ‘D:\emd_data_file\DATA_FILE1.DBF’ size 20g;

Alter tablespace CA_APP_DAT add datafile ‘D:\emd_data_file\DATA_FILE2.DBF’ size 20g; (create as many additional tablespaces as needed.)

Step 2: Create CEM User Account

Again in SQL Plus, create the CEM User account along with password (identified by) and associate it with the tablespace that you just created. Set the correct permissions on the account.

create user cemuser_2 identified by Quality123 default tablespace CA_APP_DAT;

grant connect,resource,create view to cemuser_2;

Step 3: Create Directory Alias and permissions (impds only)

Create the directory alias and needed permissions to do the import

CREATE OR REPLACE DIRECTORY ex_dir AS 'D:\oracle11.2.0.2\directoryname\my_import';

GRANT READ, WRITE ON DIRECTORY ex_dir TO cemuser_2;

Step 4: Run the import

Run the appropriate command from the command line:

The command remaps the schema to use apm_adm tablespace and exportuser account associated with the export.

impdp cemuser_2/Quality123 directory=ex_dir dumpfile=exp_APMP1_full_20120515.dmp' REMAP_SCHEMA=apm_adm:exportuser logfile=db_imp.log

OR

imp sys/syspword@sid fromuser=apm_adm touser=exportuser file='C:\Documents and Settings\Administrator\Desktop\exp_APMP1_full_20120515.dmp' log=imp.log;

Note if the wrong command is used, the output may complain about the dump file format.

Etcetera

Credits and Acknowledgements

My thanks to Michal Lehotsky, Vijay Shankar Venkatachalam, and David Lewis for their assistance and input that became this tech note.