oracle database duplication using rman

15
ORACLE DATABASE DUPLICATION USING RMAN D4715 - Hendro Nindito S.Si, MMSI Jurusan Sistem Informasi, School of Information Systems BINUS UNIVERSITY

Upload: others

Post on 08-Feb-2022

12 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: ORACLE DATABASE DUPLICATION USING RMAN

ORACLE DATABASE DUPLICATION USING RMAN

D4715 - Hendro Nindito S.Si, MMSI

Jurusan Sistem Informasi, School of Information Systems BINUS UNIVERSITY

Page 2: ORACLE DATABASE DUPLICATION USING RMAN

ORACLE DATABASE DATABASE DUPLICATION USING RMAN

Hendro Nindito

School of Computer Science, Bina Nusantara University, Jakarta, Indonesia

ABSTRACT

In this century, computer database technology has been growing very rapidly. This is

because each company - a large enterprise IT, which implements the IT world. The data is

stored in a container called a database. The database is a place to store data - data in a company.

data is very important and must be protected or guarded to the process of running a company.

So in order to do that, it is necessary to carry out cloning or duplicate the database, in order to

avoid loss of data or any damage that occurs either intentional or unintentional. The purpose

of this research is to find the most efficient way to duplicate one database. The research method

will be the functionality of one database after being duplicated into the new system. The results

of this research is that RMAN feature in Oracle 11g can duplicate one database successfully

that retain all the data and functionality.

Page 3: ORACLE DATABASE DUPLICATION USING RMAN

1. Introduction

In this century, computer database technology has been growing very rapidly. This is

because each company - a large enterprise IT, which implements the IT world. The data is

stored in a container called a database. The database is a place to store data - data in a company.

In the company , data is very important and must be protected or guarded to the process

of running a company. Loss of data in the company can be caused by system failure or faulty

computer equipment such as a disk crash, power outage, software error, human error, and even

sabotage will affect operations. Once the importance of going to a the data for the company, it

is necessary to carry out cloning or duplicate the database, in order to avoid loss of data or any

damage that occurs either intentional or unintentional.

Oracle is a database that for awhile this is a storage system that can cope with various

problems that exist in the database. Oracle provides a solution to solving loss of data. One is

by using RMAN. By using RMAN functionality, we can create a clone or duplicate of a

database, in addition to create a clone or duplicate reduces downtime or server downtime when

the main database experiences a failure.

2 Literature

2. RMAN

RMAN has the ability to duplicate, or clone, a database from a backup or from the active

database.It is possible to create a duplicate database on a remote server with the same file

structure, the remote server will be a different file structure or a local server with a different

file structure.

Database duplication is the use of the DUPLICATE command to copy all or a subset of the

data in a source database. The duplicate database (the copied database) functions entirely

independently from the source database (the database being copied).

A duplicate database is useful for a variety of purposes, most of which involve testing. You

can perform the following tasks in a duplicate database:

Test backup and recovery procedures

Test an upgrade to a new release of Oracle Database

Test the effect of applications on database performance

Page 4: ORACLE DATABASE DUPLICATION USING RMAN

Create a standby database

Generate reports

Following are the basic concepts of database duplication:

The source host is the computer that hosts the source database. The source database

instance is the instance associated with the source database.

The destination host is the computer that hosts the duplicate database. The source host

and destination host can be the same or different computers. The database instance

associated with the duplicate database is called the auxiliary instance.

Following are the database duplication techniques using RMAN:

RMAN supports two basic types of duplication: active database duplication and backup-

based duplication. RMAN can perform backup-based duplication with or without either of

the following connections:

Target

Recovery catalog

1. active database duplication

In active database duplication, RMAN connects as TARGET to the source database

instance and as AUXILIARY to the auxiliary instance. RMAN copies the live source

database over the network to the auxiliary instance, thereby creating the duplicate

database.

2. backup-based duplication.

Source

Database

Duplicate

database

RMAN

Gambar 2.1 duplikasi database aktif

Page 5: ORACLE DATABASE DUPLICATION USING RMAN

in backup-based duplication, RMAN creates the duplicate database by using pre-

existing RMAN backups and copies.

3. Research Problem

From the above it can be formulated main problems are:

downtime on the primary database is very long

There is some loss of data

To give this solution we found that Oracle RMAN database provides a feature that has

benefits for:

Making data BACKUP

Creating a clone or duplicate of a database

4 Result and Dicussion

Active Database Duplication

1. Basic pre-check before deploying Active Standby database server.

(i) Primary Server, Instance, Database Details

source

Database

Duplicate

database

RMAN RMAN

Backup

Figure 2.2-based backup Duplication

Page 6: ORACLE DATABASE DUPLICATION USING RMAN

(ii) Archive log should be enable & Flash Recovery Area Details.

(iii) Check whether standby server pinging from primary and vice versa

Primary Site :

Step: 1 Enable Database Force Logging (@Primary Site).

This step is necessary because the FORCE LOGGING option is the safest

method to ensure that all the changes made in the database will be captured and

available for recovery in the redo logs.

Step: 2 Setting up up Log_Archive_Config Parameter (@Primary Site).

Page 7: ORACLE DATABASE DUPLICATION USING RMAN

Step: 3 Setting up up Log_Archive_Dest_1 (To store Local Archive log ) &

Log_Archive_Dest_2 ( To Send local archive to remote server 'Standby' )

Parameter ( @Primary Site).

Step: 4 Setting up up following parameters (@Primary Site)

Page 8: ORACLE DATABASE DUPLICATION USING RMAN

Step: 5 Setting up listener file to add static entry of Primary (@Primary Site)

First we need to change the listener that run in the database from dynamic listener

to static listener but first we need to make sure that dynamic listener that is running

doesn’t support any service

Page 9: ORACLE DATABASE DUPLICATION USING RMAN

If your listener doesn’t support any service, we cant stop the listener by command

lsnrctl stop and start making the static listener by modify listener.ora

Page 10: ORACLE DATABASE DUPLICATION USING RMAN

After modifying the listener.ora but we also need to modify tnsnames.ora

After that you have to reload the listener by command lsnrctl start

LISTENER_INFY and check listener status.

Dynamic Listener

Static Listener

Page 11: ORACLE DATABASE DUPLICATION USING RMAN

Step: 6 Transfer password file to standby dbs location via scp command (

@Primary Site).

Target Site :

Step: 7 Edit Listener file to add static entry of standby database (@Target Site )

The same with the primary site, we have to modify the tnsnames.ora and

listener.ora

Page 12: ORACLE DATABASE DUPLICATION USING RMAN

Step: 8 Create directory adump via oracle user (@Target Site)

Step: 9 Make a copy of password file “orapwdell” of with the name of standby

db_unique_name of ”orapwdell.ora” (@Target Site)

Page 13: ORACLE DATABASE DUPLICATION USING RMAN

Step: 10 Make a dummy inidell_dr.ora pfile with only to parameter (@Target Site)

First we need to create pfile that stored into the dbs with two parameter

Step: 11 Set the environment for standby server like SID & ORACLE_HOME

(@Target Site)

Additionaly we can create oratab file for for the database so it can easy to set the

environment.

Then we can set the environmentinto infy_sty then reload the listener and check

listener status.

Page 14: ORACLE DATABASE DUPLICATION USING RMAN

Step: 12 Connect with sqlplus as sysdba & startup instance in “NOMOUNT” state

with dummy pfile (@Target Site)

Step: 13 Open duplicate session and connect with rman (@Target Site)

Step: 14 Run the following script at rman prompt

Page 15: ORACLE DATABASE DUPLICATION USING RMAN

5 Conclussiom

The conclusion that we can attain from this research are :

1. RMAN feature can be the major solution or at least countermeasure to any

data lost or hardware damage.

2. High network traffic on the connection between the source and the target

database.

3. Because you didn’t to make a backup first to duplicate and only have to run an

specified script in RMAN. Active database backup can be considered an

instant database clones which is used to create test database environment.

Refferences

1. (Wibowo, Astianto; Darmantoro, Dhinta; Kusumo, Dana Sulistyo; 2007)

2. https://docs.oracle.com/cd/E29597_01/backup.1111/e10642/rcmdupdb.html

3. https://drive.google.com/file/d/0B1Vyp5-9fissS21aUWxISDYyQWc/view

4. https://blog.pythian.com/duplicate-from-active-database-using-rman-step-by-step/

5. http://blog.dbauniversity.com/2010/02/oracle-11g-new-feature-active-database.html