# Application of RMAN Backup Technology in the Agricultural Products Wholesale Market System

Ping Yu, Nan Zhou

► To cite this version:

Ping Yu, Nan Zhou. Application of RMAN Backup Technology in the Agricultural Products Wholesale Market System. 7th International Conference on Computer and Computing Technologies in Agriculture (CCTA), Sep 2013, Beijing, China. pp.301-308, 10.1007/978-3-642-54341-8_32. http-01220841

HAL Id: hal-01220841

https://inria.hal.science/hal-01220841

Submitted on 27 Oct 2015

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Application of RMAN Backup Technology in the Agricultural Products Wholesale Market System

Ping Yu<sup>1,2,a</sup>, Nan Zhou<sup>1,b</sup>

<sup>1</sup>Network Center, China Agricultural University, Beijing 100083, China; <sup>2</sup>School of Economics & Management, China Agricultural University, Beijing 100083, China;

<sup>a</sup>yuping@cau.edu.cn, <sup>b</sup>zhnan@cau.edu.cn

**Abstract.** Based on Oracle Database RMAN backup technology, this paper designs and implements a database backup subsystem for the agricultural products wholesale market system. Through full backup, incremental backups and cumulative incremental backup, it ensures the timeliness, integrity and efficiency of data recovery, when data mistake happens in the agricultural products wholesale market system database or the database collapses.

**Keywords:** agricultural products wholesale market system; Oracle database backup; RMAN;

## 1 Introduction

The development of computer technology and network technology makes database technology to be widely applied in enterprise management information systems, e-commerce systems, e-government systems and other application systems. With the continuous propelling of informatization, the amount of data in application systems grows sustainably. Data security issue in database systems have become increasingly important.

RMAN is Oracle tools which is used to backup, restore and restore Oracle database. RMAN can only be used in ORACLE8 or later versions. Researchers have applied Oracle backup technology to different areas. ZHANG Yun-fan discusses the application of backup and recovery technology of Oracle database in oil field exploration project [1]. Feng ke et al. gives a brief summary for database administrators who pay more attentions to the usability of backup data usability and auto-monitoring technique, the technique is applied in database backup of university and proved to be effective [2]. ZHU Youcun et al. realized rapid backup and recovery based on oracle 10 and applied it in the database of hospital [3]. Following the database backup technology of Daqing logging production database wag still in the stage of the logical export manually and has not yet had an effective data backup technology to ensure data security, LIU Yubin uses RMAN backup technology on the features of the production database to deploy a perfect backup program in practice [4].

The agricultural products wholesale market system database has stored the price information and quality testing data of agricultural products. The safe storage of these data plays a crucial role in price management, quality inspection and macro decision-
making of the agricultural products wholesale market. Therefore, when it appears that
data is accidentally deleted or database crashes, the requirement for its data recovery
is zero-loss and to recovery to a designated time point. In addition, as the amount of
data in this database is very large, and the allowed downtime of this system is 10
minutes, it requires the backup and recovery efficiency is as high as possible.
Common logical backup will cause some data cannot be recovered, and the recovery
time is far from the actual needs, therefore it needs to design a real-time, fully
synchronized and strategic reasonable data backup subsystem.

RMAN can back up the entire database or database components, such as table
spaces, data files, control files, archive files, and Spfile parameter file [5]. RMAN
also allows you to conduct block-level incremental backup, incremental RMAN
backups are time and space efficient because they only backup those data blocks
which have changed since the last backup [6]. Therefore, it can well meet the data
recovery needs of the agricultural products wholesale market system, whether from
the respect of real-time or recovery efficiency.

In this paper, we used Oracle Database RMAN backup technology to design and
implement a backup subsystem for the agricultural products wholesale market system.

## 2 Agricultural Products Wholesale Market System

The agricultural products wholesale market system is the first phase of Golden
Agriculture Project, it uses the agricultural products wholesale market as the main
datasource to collect the prices and the quality inspection data of agricultural products,
it goes through data collection segment, the data processing segment, data analysis
and display segment. The technical architecture of the agricultural products wholesale
market system is shown as Fig.1.

As shown in Figure 1, System database includes portal database, the wholesale
market system database and components database, it is an important support for the
running of the agricultural product wholesale market system, as all of the system's
data changes have been recorded in the database, if these data is lost, it will directly
affect the normal running of the agricultural products wholesale business, so how to
ensure data not to be lost, is essential. So it is important to choose a reasonable
backup mode and develop a reasonable backup strategy to design and implement the
agricultural products wholesale market system backup subsystem, so as to ensure the
data not to be lost.

We choose Oracle10g for windows to meet the system's requirement for the
capacity, response speed, database security, stability and scalability of database.
<figure><img src="image_2.png" /><figcaption>Fig. 1. The technical architecture of the agricultural products wholesale market system</figcaption></figure>

# 3 Database Backup Subsystem Based on RMAN Technology

## 3.1 The Architecture of RMAN Technology

The architecture of RMAN can be expressed in Fig.2 [7].
<figure><img src="image_3.png" /><figcaption>Fig. 2. The architecture of RMAN</figcaption></figure>

Through the above architecture diagram, we can know oracle RMAN is actually
through the queries on the basis table of target database and the system views to
conduct online hot backup for the database data files ,control files and spfile files and
so on, so as to achieve the recovery of target database after a crash [8]. In addition,
in order to avoid bringing the performance loss to the operating system by backing up
all files in each backup, RMAN also provides a backup of the archive logs, so that we
can develop an appropriate strategy, namely conducting incremental archive logs
backup after full backup. When the database crashes, we first restore full backup, and
then apply the incremental backup archive to achieve full recovery or the specified
point in time recovery. At backup time, RMAN will store the backup information of
each time in the recovery catalog database, and establish a connection channel, and
then through media management, transfer the backup sets to the backup media. When
restoring database, RMAN will search in the recovery catalog database according to
our specified conditions, when it finds the corresponding backup piece, it will use the
oracle recovery package to conduct the corresponding recovery.

3.2 The Design of Database Backup Subsystem

By analyzing the characteristics of the agricultural products wholesale market system,
we know that the amount of data in the database will be very large, and every Monday
to Friday is the peak of the business, the data volume has increased significantly more
than on Saturday and Sunday; the importance of its data is very high, it does not allow
missing data and its recovery time should be as short as possible. Therefore, its
backup strategy is as follows: Choose full backups on Sunday to reduce impact of full
backups on the database performance; the data recovery on Monday, Tuesday will be completed through the full backups on Sunday and the incremental backup on the two days; in order to improve the recovery speed, choose to conduct cumulative incremental backups on Wednesday, the recovery on Wednesday will be completed through the full backups on Sunday and the cumulative incremental backups on Wednesday; the recovery on Thursday, Friday and Saturday will be completed by the full backups on Sunday, the cumulative incremental backups on Wednesday and incremental backups on Thursday, Friday and Saturday. The specific backup strategy is shown in Fig.3.

<figure><img src="image_4.png" /><figcaption>Fig. 3. Backup strategy of database backup subsystem</figcaption></figure>

3.3 The Implementation of Database Backup Subsystem

1. Application preparation

Before using RMAN backup for the first time, we need to do some preparatory
work, including set the target database to archive database, because RMAN needs the
archive log file support when doing the time-based recovery or the full recovery or
other recoveries. In addition, we need to create a database and create a table space and
user in the database to store the recovery catalog information. These works can be
broadly described in Fig.4.
<figure><img src="image_5.png" /><figcaption>Fig. 4. Preparation before application</figcaption></figure>

## 2. The design and implementation of backup and recovery program

The full backup program on every Sunday are summarized as below:

```sql
run {
    allocate channel 'dev1' type disk;
    allocate channel 'dev2' type disk;
    allocate channel 'dev3' type disk;
    allocate channel 'dev4' type disk;
    backup incremental level 0 tag 'dbL0' format '<path>\level0_%u_%p_%c' database
        skip readonly;
    sql 'alter system archive log current';
    backup archivelog all delete input;
    release channel dev1;
    release channel dev2;
    release channel dev3;
    release channel dev4;
}
```

The incremental backup program on Monday, Tuesday, Thursday, Friday and Saturday are summarized as below:

```sql
run {
    allocate channel 'dev1' type disk;
    allocate channel 'dev2' type disk;
    allocate channel 'dev3' type disk;
    allocate channel 'dev4' type disk;
    backup incremental level 2 cumulative tag 'dbL2' format '<path>/level2c_%u_%p_%c' database skip readonly;
}
```
sql 'alter system archive log current' ;
backup archivelog all delete input;
release channel dev1;
release channel dev2;
release channel dev3;
release channel dev4;
}

The incremental backup program on Wednesday are summarized as below:
run {

allocate channel 'dev1' type disk ;
allocate channel 'dev2' type disk ;
allocate channel 'dev3' type disk ;
allocate channel 'dev4' type disk ;
backup incremental level 1 tag 'dbL2' format '<path>/level2_%u_%p_%c' database
skip readonly;
sql 'alter system archive log current' ;
backup archivelog all delete input;
release channel dev1;
release channel dev2;
release channel dev3;
release channel dev4;
}

These backup program are set to be executed through the timed job system of
windows.

3. Backup and recovery joint adjusting

After making these preparations, we can officially start using RMAN for data
backup. This includes running RMAN Manager to connect to the target database and
recovery catalog database, register the target database, synchronize the information
between the target database, the directory database, and the backup pieces, distribute
and establish channels to a connection, run the script for backup and recovery, and
finally release the connecting channels and other steps. These steps can be simplified
represented in Fig.5.
<figure><img src="image_6.png" /><figcaption>Fig. 5. The backup and recovery processes of RMAN</figcaption></figure>

## 5 Test and Run

The agricultural products wholesale market system was officially launched in the end of December 2011, its database system was Oracle 10G installed under WINDOWS, and Oracle practical cluster systems was installed to ensure the high availability of the database. The physical structure of its operating environment is shown as Fig.6.
<figure><img src="image_7.png" /><figcaption>Fig. 6. The structure of database backup subsystem</figcaption></figure>

As can be seen from the figure, the database realized Oracle utilities (RAC) via two IBM p690 cluster systems. When there is a data error operation, the data can be restored through the database backup system.

After two weeks of installation and commissioning, the data backup functionality has been achieved, and in 2012 we conducted a backup and recovery test, which successfully implement the full database restore and the recovery based on the specified point in time, and ensured zero data loss and the recovery of accidentally deleted data.

## 6 Conclusion

This paper designed and implemented a database backup subsystem based on the Oracle Database RMAN backup technology, and successfully deployed it into the agricultural products wholesale market system, which ensures the security, reliability and recoverability of the back-end database of the system. It is also able to adapt to the security requirement of the slimly system.

## References

1. Zhang Yun-fan. Backup and Recovery Strategy of Oracle Database [J]. Computer Engineering, 2009, 35(15): 85-87.

2. Feng Ke, Liu Nai-jia, Wang Qian, Li Tie. Research and practice of auto-monitoring for Oracle database backup [J]. Experimental Technology and Management, 2011, 28(4).

3. Zhu You-cun, Luo Dan, Yang Xiao-rong. RMAN Backup, Recovery and optimization Based on oracle 10g [J]. Medical Equipment, 2012, 33(10): 45-46.

4. Liu Yu-bin. The Research and Implementation of Database Backup Program Based on Oracle [J]. Programming Skills&Maintenance, 2009, 14: 025.
5. Freeman R G, Hart M. Oracle9i RMAN backup & recovery [M]. McGraw-Hill/Osborne, 2002.

6. Hart M, Freeman R G. Oracle Database 10g RMAN Backup and Recovery [M]. 2007.

7. Oracle RMAN Pocket Reference [M]. O'Reilly Media, Inc., 2009.

8. Alapati S R, Kuhn D, Nanda A. RMAN recipes for Oracle database 11g: A problem-solution approach [M]. Apress, 2007.