Anda di halaman 1dari 31

A

Seminar Report

On

“Backup Techniques Of Oracle Database”

Submitted in Partial fulfillment for the award of the degree of

Bachelor of Technology

In

Computer Engineering

(Session 2018-2019)

Guided By Submitted By
Mr. Manish Sharma Akriti Singh
15EPECS015

Department of Electronics & Communication


Engineering Poornima College of Engineering,
Jaipur Rajasthan Technical University, Kota
March, 2019

1
DECLARATION

I hereby declare that the work which is being presented in the seminar report entitled “ Backup
Techniques in oracle Database“ in partial fulfillment for the award of the Degree of Bachelor
of Technology in Computer Engineering affiliated to Rajasthan Technical University, Kota
and submitted to the Department of Computer Engineering of Poornima College of
Engineering, Jaipur, is an authentic record of my own work carried out under the guidance of
Mr. Manish Sharma during the session 2018-2019.

I have not submitted the matter presented in this report anywhere for the award of any other
degree of this or any other institute / University.

Signature of the Student with Name & Roll NO.


Place: Jaipur
Date:27th March, 2019

2
CERTIFICATE

This is to certify that the seminar report entitled Backup Techniques in Oracle Databasehas
been submitted by Akriti Singh, RTU Roll No.15EPCCS015 student of B. Tech IV Year, VIII
Semester, Computer Engineering branch in the partial fulfillment of Degree of Bachelor of
Technology, Rajasthan Technical University, Kota during the session 2018-2019. The report
has been found satisfactory and approved for submission.

Guide / Supervisor Dr. Ajay Khunteta


Signature : Head, Department of Computer Engineering
Guide Name : Mr. Manish Sharma
Designation : Assistant Professor
Department : Computer Science

3
ACKNOWLEDGMENT

This reportwould not have been completed without the support from our Supervisor, friends and
our family. Thanks to those who devoted their time and shared information with us. Here is a
small tribute to those who were directly or indirectly associated with me and their good wishes
helped to complete this research workrespectfully.

At first, we would like to convey our sincere thanks to our guide, Dr. Mahesh Bundeleand my
Supervisor Mr. Manish Sharma. Their encouragement and support are very much appreciated.
Their guidance, advice, and continuous support have played an irreplaceable role throughout my
entire project.

I would also like to thank Dr.AjayKhuteta, HOD, Department Computer Engineering) and
other mentors from the Poornima College of Engineering for their valuable support & co-
operation during our work.

We are also pleased to thanks all our colleagues of work for sharing the important information
timely.

4
TABLE OF CONTENTS

SR. NO. PARTICULAR PAGE NO.


1 Title Page 1
2 Declaration 2
3 Certificate 3
4 Acknowledgement 4
5 Table Of Content 5
6 List Of Figures 6
7 List Of Abbrevations 7
8 Abstract 8
9 Chapter 1 9
10 Chapter 2 13
11 Chapter 3 15
12 Chapter 4 17
13 Chapter 5 20
14 Reference 21
15 Published Research Paper 22
16 Certificate 25
17 Plagiarism Report 26

5
LIST OF FIGURES

Sr. No Topic Page No.


1 Agile Method 12
2 System Architecture 20
3 Backup 22
4 Database Backup Models 23

6
LIST OF ABBREVIATIONS

Sr. No. TOPIC PAGE NO.


1 DBMS 2
2 RMAN 5
3 PL 10
4 SQL 22

7
ABSTRACT

Backup and recovery of oracle database protect our database from getting lost. There can be
many events where loss of data can occur. There can be many such instance where your
critical data could be lost. Hence backing up your database becomes so important. Some of
the reasons for loss of data and files are:

 Accidently misplacing or deleting data


 Corruption of files due to virus
 Hardware crashing
 Moving your files from one system to another.

One of the mandatory task of every Oracle database administrator is to make backup or
backup oracle database. Even with adequate precautions, important database can be still
destroyed by some user error, hardware or software failure. The only way to prevent this
situation is to perform regular backup operation.

8
CHAPTER 1
INTRODUCTION

1.1 Purpose of Backup

As a backup administrator, your principal duty is to devise, implement, and manage a backup
and recovery strategy. In general, the purpose of a backup and recovery strategy is to protect
the database against data loss and reconstruct the database after data loss. Typically, backup
administration tasks include the following:

 Planning and testing responses to different kinds of failures


 Configuring the database environment for backup and recovery
 Setting up a backup schedule
 Monitoring the backup and recovery environment
 Troubleshooting backup problems
 Recovering from data loss if the need arises

As a backup administrator, you may also be asked to perform other duties that are related to
backup and recovery:

 Data preservation, which involves creating a database copy for long-term storage
 Data transfer, which involves moving data from one database or one host to another

The purpose of this manual is to explain how to perform the preceding tasks.

1.2 Data Protection


1. As a backup administrator, your primary job is making and monitoring backups for data
protection. A backup is a copy of data of a database that you can use to reconstruct data. A
backup can be either a physical backup or a logical backup.
2 Physical backups are copies of the physical files used in storing and recovering a database.
These files include datafiles, control files, and archived redo logs. Ultimately, every physical
backup is a copy of files that store database information to another location, whether on disk
or on offline storage media such as tape.
3 Logical backups contain logical data such as tables and stored procedures. You can
use Oracle Data Pump to export logical data to binary files, which you can later import into
the database. The Data Pump command-line clients expdp and impdp use
the DBMS_DATAPUMP and DBMS_METADATA PL/SQL packages.
4 Physical backups are the foundation of any sound backup and recovery strategy. Logical
backups are a useful supplement to physical backups in many circumstances but are not
sufficient protection against data loss without physical backups.
5 Unless otherwise specified, the term backup as used in the backup and recovery
documentation refers to a physical backup. Backing up a database is the act of making a

9
physical backup. The focus in the backup and recovery documentation set is almost
exclusively on physical backups.
6 While several problems can halt the normal operation of an Oracle database or affect
database I/O operations, only the following typically require DBA intervention and data
recovery: media failure, user errors, and application errors. Other failures may require DBA
intervention without causing data loss or requiring recovery from backup. For example, you
may need to restart the database after an instance failure or allocate more disk space after
statement failure because of a full datafile.

Media Failures

A media failure is a physical problem with a disk that causes a failure of a read or write of a disk
file required to run the database. Any database file can be vulnerable to a media failure. The
appropriate recovery technique following a media failure depends on the files affected and the
types of backup available.

One particularly important aspect of backup and recovery is developing a disaster


recovery strategy to protect against catastrophic data loss, for example, the loss of an entire
database host.

User Errors

User errors occur when, either due to an error in application logic or a manual mistake, data in a
database is changed or deleted incorrectly. User errors are estimated to be the greatest single
cause of database downtime.

Data loss due to user error can be either localized or widespread. An example of localized
damage is deleting the wrong SMITH from the employees table. This type of damage requires
surgical detection and repair. An example of widespread damage is a batch job that deletes the
company orders for the current month. In this case, drastic action is required to avoid a extensive
database downtime.

While user training and careful management of privileges can prevent most user errors, your
backup strategy determines how gracefully you recover the lost data when user error does cause
data loss.

Application Errors

Sometimes a software malfunction can corrupt data blocks. In a physical corruption, which is
also called a media corruption, the database does not recognize the block at all: the checksum is
invalid, the block contains all zeros, or the header and footer of the block do not match. If the
corruption is not extensive, then you can often repair it easily with block media recovery.

Data Preservation

Data preservation is related to data protection, but serves a different purpose. For example, you
may need to preserve a copy of a database as it existed at the end of a business quarter. This
backup is not part of the disaster recovery strategy. The media to which these backups are
10
written are often unavailable after the backup is complete. You may send the tape into fire
storage or ship a portable hard drive to a testing facility. RMAN provides a convenient way to
create a backup and exempt it from your backup retention policy. This type of backup is known
as an archival backup.

Data Transfer

In some situations you may need to take a backup of a database or database component and
move it to another location. For example, you can use Recovery Manager (RMAN) to create a
database copy, create a tablespace copy that can be imported into another database, or move an
entire database from one platform to another. These tasks are not strictly speaking part of a
backup and recovery strategy, but they do require the use of database backups, and so may be
included in the duties of a backup administrator .

1.3 Agile Methodology


1.3.1 What Is Agile?
Agile methodology is an alternative to traditional project management, typically used in
software development. It helps teams respond to unpredictability through incremental,
iterative work cadences, known as sprints. Agile methodologies are an alternative to
waterfall, or traditional sequential development.

1.3.2 Why Agile?

Agile development methodology provides opportunities to assess the direction of a project


throughout the development lifecycle. This is achieved through regular cadences of work, known
as sprints or iterations, at the end of which teams must present a potentially shippable product
increment. By focusing on the repetition of abbreviated work cycles as well as the functional
product they yield, agile methodology is described as “iterative” and “incremental.” In waterfall,
development teams only have one chance to get each aspect of a project right. In an agile
paradigm, every aspect of development — requirements, design, etc. — is continually revisited
throughout the lifecycle. When a team stops and re-evaluates the direction of a project every two
weeks, there’s always time to steer it in another direction.

The results of this “inspect-and-adapt” approach to development greatly reduce both


development costs and time to market. Because teams can develop software at the same time
they’re gathering requirements, the phenomenon known as “analysis paralysis” is less likely to
impede a team from making progress. And because a team’s work cycle is limited to two weeks,
it gives stakeholders recurring opportunities to calibrate releases for success in the real world.
Agile development methodology helps companies build the right product. Instead of committing
to market a piece of software that hasn’t even been written yet, agile empowers teams to
continuously re-plan their release to optimize its value throughout development, allowing them
to be as competitive as possible in the marketplace. Development using an agile methodology
preserves a product’s critical market relevance and ensures a team’s work doesn’t wind up on a
shelf, never released.

11
12
CHAPTER 2
ORACLE BACKUP SOLUTIONS

2.1 Solution

When implementing a backup and recovery strategy, you have the following solutions available:

 Recovery Manager (RMAN)

This tool integrates with sessions running on an Oracle database to perform a range of
backup and recovery activities, including maintaining an RMAN repository of historical
data about backups. You can access RMAN through the command line or through Oracle
Enterprise Manager.

 User-managed backup and recovery

In this solution, you perform backup and recovery with a mixture of host operating
system commands and SQL*Plus recovery commands.

Both of the preceding solutions are supported by Oracle and are fully documented, but RMAN is
the preferred solution for database backup and recovery. RMAN performs the same types of
backup and recovery available through user-managed techniques more easily, provides a
common interface for backup tasks across different host operating systems, and offers a number
of backup techniques not available through user-managed methods.

2.2 RMAN Based Backup

Most of this manual focuses on RMAN-based backup and recovery. User-managed backup and
recovery techniques are covered in Performing User-Managed Backup and Recovery. RMAN
gives you access to several backup and recovery techniques and features not available with user-
managed backup and recovery. The most noteworthy are the following:

 Incremental backups

An incremental backup stores only blocks changed since a previous backup. Thus, they
provide more compact backups and faster recovery, thereby reducing the need to apply
redo during datafile media recovery. If you enable block change tracking, then you
can improve performance by avoiding full scans of every input datafile. You use
the BACKUP INCREMENTAL command to perform incremental backups.

 Block media recovery

You an repair a datafile with only a small number of corrupt data blocks without taking it
offline or restoring it from backup. You use the RECOVERcommand to perform block
media recovery.

13
 Unused block compression

In unused block compression, RMAN can skip data blocks that have never been used
and, in some cases, used blocks that are currently unused.

 Binary compression

A binary compression mechanism integrated into Oracle Database reduces the size of
backups.

 Encrypted backups

RMAN uses backup encryption capabilities integrated into Oracle Database to store
backup sets in an encrypted format. To create encrypted backups on disk, the database
must use the Advanced Security Option. To create encrypted backups directly on tape,
RMAN must use the Oracle Secure Backup SBT interface, but does not require the
Advanced Security Option.

2.3 Conclusion

Whether you use RMAN or user-managed methods, you can supplement physical backups
with logical backups of schema objects made with Data Pump Export utility. You can later
use Data Pump Import to re-create data after restore and recovery. Logical backups are for
the most part beyond the scope of the backup and recovery documentation.

14
CHAPTER 3
PREREQUISTES STEPS OF BACKUP

3.1 Steps to be performed

An SLA defines the level of service that is expected and addresses many service-related issues,
including the availability and performance of the service. RTO is the time by which a business
process must be restored after a disruption in service. RPO defines the strategy for the age of the
files that must be recovered from backup storage for regular operations to resume after a failure.
SLA, RTO, and RPO contribute to the data protection strategy.

Perform the following steps for each of your databases.

Steps

1. Determine the supported database configurations.

2. Decide the type of backup that you require.

3. Decide on which node in a RAC environment you want to create your backup.

4. Determine when you should back up your databases.

5. Decide how to name your backups.

6. Decide if you want to catalog or uncatalog your backups.

7. Determine the retention period for the Snapshot copies on the source storage system and
the SnapMirror destination.

SnapMirror retention is implicitly defined based on the Snapshot copy retention of the
primary storage. SnapVault retention has to be defined explicitly on the ONTAP storage
system.

8. Decide whether you want to verify the backup copies using the primary or secondary
storage volume.

9. Determine the supported prescripts and postscripts.

10. Decide whether you want to use NetApp SnapMirror technology for replication
or NetApp SnapVault technology for long term retention.

15
3.2 Types of Backup

Backup type specifies the type of backup that you want to create. SnapCenter supports online

and offline backup types for Oracle databases.

Online backup

A backup that is created when the database is in the online state is called an online backup. Also
called a hot backup, an online backup enables you to create a backup of the database without
shutting it down.

As part of online backup, you can create a backup of the following files:
 Datafiles and control files only
 Archive log files only (the database is not brought to backup mode in this scenario)
 Full database that includes datafiles, control files, and archive log files

Offline backup

A backup created when the database is either in a mounted or shutdown state is called an offline
backup. An offline backup is also called a cold backup. You can include only datafiles and
control files in offline backups. You can create either an offline mount or offline shutdown
backup.
 When creating an offline mount backup, you must ensure that the database is in a
mounted state.

If the database is in any other state, the backup operation fails.


 When creating an offline shutdown backup, the database can be in any state.

The database state is changed to the required state to create a backup. After creating the
backup, the database state is reverted to the original state.

16
CHAPTER 4
FUNCCTIONAL AND NON-FUNCTIONAL REQUIREMENTS

4. Functional /Non-functional Requirements

4.1 Functional Requirements

The project is made on Oracle Database 11g which is setup on Linux Redhat. There

will be two machines. One machine will be treated as a client and another machine

will be treated as a server. The client and server will be made by NETCA software

where listener.ora file will be made on server side and tnsname.ora will be made on

client side.

1. Oracle Database 11g

2. File tnsname.ora file in client machine

3. IP address of both the client and server.

4. Flelistener.ora in server side machine

5. The server side password should be known

6. TNS name for connectivity

7. Both the machine should have same port number

8. Server side machine should be opened

9. Be sure the load does not adversely affect your primary system

10. RMAN Client and target databse

4.2 Nonfunctional Requirements

Performance Requirements

For the machine to be worked upon the server side machine should be opened by STARTUP

command. In the real time scenario if a client wants to use a server side database, then the

server side database should be already opened. Populating a materialized view adds

load to both servers involved. The source server is queried to capture the data,

17
which is inserted into the destination server. Be sure the additional load does not

adversely affect your primary system.Although materialized view logs improve the

performance of materialized view refreshes, they do increase the work needed to

perform DML on the base table. Check the additional work does not adversely

affect performance on the primary system.

Safety Requirements

The control file, Redo log file and Datafile of the database should not be lost. If lost the

connectivity of database cannot be established and hence the client cannot use the server.

For this matter, we will enable archiving in our database so that archive files will be

generated. Even when this is failed we can bring back the CRD files by cold or hot backup.In

a disaster situation where all files are lost you can only recover to the last SCN in the

archived redo logs. Beyond this point the recovery would have to make reference to the

online redo logs which are not present. Disaster recovery is therefore a type of incomplete

recovery. To perform disaster recovery connect to RMAN.

Security Requirements

The client should know the password of the server side database for the connectivity. If

password of that particular database is not know, the client cannot use the server side

database.

Software Quality Attributes

When we enable archiving in the database the data is backup in the system in the following

conditions:

1. After every 3MB of data filled in redo log file.

2. Whenever one member of redo log file is filled.

3. In Every 3 secs

4. After Every commit

18
5. Whenever one-third of redo log file is filled

2.3 Technical Requirements ( Hardware /Software)

Operating Environment

The project is implemented on the Linux Operating System. The version of the

operating system is Redhat 7.

Hardware Interfaces

The project needs at least 1GB RAM for the installation of database and approximately

80GB Hard Disk space.

Software Interfaces

The ORACLE DATABASE 11g is setup on Linux Operating System Redhat 7. The tool used to

create database is Database Configuration Assistant(DBCA). For a system to be client or

server we need to do the configuration of specific files in both the system. For server side

the file to be configured is listener.ora and for client side the file is tnsname.ora. This is

done by Network Configuration Assistant(NETCA). Now to establish a connection between

two machines we use NEAT. NEAT specified hostname for both the machines.Recovery

Manager (RMAN) is an Oracle Database client that performs backup and recovery tasks on

your databases and automates administration of your backup strategies. It greatly

simplifies backing up, restoring, and recovering database files.The RMAN environment

consists of the utilities and databases that play a role in backing up your data.

Communications Interfaces

The communication between two machines is done by the IP address ,hostname and

machine name of both the systems. NEAT tool is used to specify the hostname of both the

systems.

19
CHAPTER 5
SYSTEM ARCHITECTURE

The basic Architecture of the report is as follows:

20
REFRENCES

 Qun Li School of computer science & technology Nanjing University of Science and
Technology Nanjing, China
 Honglin Xu School of Information Jiangnan University Wuxi, China

 There are some references from we can get information about oracle and it’s product.
These are as follows:-

 www.oracle.com
 www.tutorialspoint.com
 www.stackoverflow.com
 www.javatpoint.com

21
PUBLISEHED RESEARCH PAPER

Backup and recovery are mainly classified into


BACKUP AND RECOVERY IN two ways:

ORACLE DATABASE 1. Recovery manager


2. User managed backup and utility
Akriti Singh, Bachelors Of Technology
Poornima College Of Engineering, Jaipur Recovery Manager:
2015pcecsakriti@poornima.org
Recovery Manager (RMAN) is an Oracle
Database client that performs backup and
Abstract recovery tasks on your databases and automates
administration of your backup strategies. It
Backup and recovery of oracle database protect greatly simplifies backing up, restoring, and
our database from getting lost. There can be recovering database files. To take RMAN
many events where loss of data can occur. There backup of a database, we create and save copies
can be many such instance where your critical of databases to disk and tape with certain
data could be lost. Hence backing up your retention policies. A duplicate or copy database
database becomes so important. Some of the created by recovery manager, that is, RMAN is
reasons for loss of data and files are: mostly used to test backup and recovery
procedures before implementing them on the
 Accidently misplacing or deleting data real databases and eventually storing the RMAN
 Corruption of files due to virus backups.
 Hardware crashing
 Moving your files from one system to User managed backup and utility:
another Other than RMAN, oracle also supports User-
Introduction managed backup and recovery, where you can
implement backup and recovery of databases
One of the mandatory task of every Oracle using mixture of host operating commands as
database administrator is to make backup or well as SQL Plus commands, meaning that you
backup oracle database. Even with adequate will have to use different commands for
precautions, important database can be still different OS. In user managed backup and
destroyed by some user error, hardware or recovery, user will be handling how and when
software failure. The only way to prevent this the backup has to be implemented. There can be
situation is to perform regular backup operation. different objects that can be backup through user
managed backup and utility like datafiles,
archive log files, control files, parameter files.

Out of the two backup strategies, RMAN backup


is recommended since it is more user friendly
when compared to user managed backup and
utility.

The backup is more categorized on the basis of


the part of database that is stored for backup.
These are:
Now we know the need of backup and recovery
techniques. 1. Whole database backup
2. Partial database backup
Whole database backup:
22
inconsistent backups consistent by reading all
archived and online redo logs, starting with the
earliest SCN in any of the datafile headers, and
applying the changes from the logs back into the
datafiles. If the database must be up and running
24 hours a day, seven days a week, then you
have no choice but to perform inconsistent
backups of the whole database. A backup of
online datafiles is called an online backup. This
requires that you run your database in
ARCHIVELOG mode.

A whole database backup is a backup of every Database Backup models


datafile in the database, plus the control file.
Whole database backups are the most common
type of backup.
Whole database backups can be taken in either
ARCHIVELOG or NOARCHIVELOG mode.
Before performing whole database backups,
however, be aware of the implications of
backing up in ARCHIVELOG and
NOARCHIVELOG modes.

A whole database backup is either a consistent


backup or an inconsistent backup. Whether a
backup is consistent determines whether you
need to apply redo logs after restoring the
backup. Before starting database backup models, we
need to know about the configuration files which
Consistent backup is the one where backup of a are essential for running of an oracle database.
database or part of a database is backup in which The files which are mandatory are datafiles,
all read/write datafiles and control files are redolog files and control files. The datafiles
checkpointed with the same SCN. contain all the information about the data and
The only way to make a consistent whole tables of different users in the database. Redo
database backup is to shut down the database log files continuously stores the data of files for
with the NORMAL, IMMEDIATE, or backup purpose into files with extension of
TRANSACTIONAL options and make the .redo. When a crash is occurred in the database,
backup while the database is closed. If a all these files need to be restored through
database is not shut down cleanly, for example, different models of back for the working of
an instance fails or you issue a SHUTDOWN database. The models for backup are:
ABORT statement, then the database's datafiles
are always inconsistent 1. Database cold backup
So called cold back or offline back up is done
when the database is offline and no updation can
In Inconsistent backup, files being backed up do be done in the database during the backup
not contain all the changes made at all the SCNs. process. This is the safest way to back up
In other words, some changes are missing. This because it avoids the risk of copying data that
means that the files in the backup contain data may be in the process of being updated.
taken from different points in time. This can However, a cold backup involves downtime
occur because the datafiles are being modified as
backups are being taken. Oracle recovery makes
23
because users cannot access the database during  Disadvantage of hot backup are that the
the backup. data can be inconsistent.If the data is
The steps to perform a cold back up is as altered while the backup is in progress,
follows: the resulting copy may not match the
 Shut down the database using normal final state of the data.
operation or immediate shutdown command.
 Then use cp command to copy the files from
one place to another.
In general, an organization and companies do
not recommend cold backup techniques as the
database has large offline cost and no updation
can be done at that time.

Conclusion
Oracle provides backup utilities and different
models to execute it for different situations each
with its own speciality and features. The DBA
should be aware of all the backup strategies used
in the database and should track all the activities
done. Backup techniques are used to strengthen
the quality and security of the database. It is one
of the major aspect of the database used in
organizations and companies.

REFERENCES
Database Hot Backup
 Qun Li School of computer science
Hot backup or dynamic backup or online backup & technology Nanjing University of
is performed when the database is active and Science and Technology Nanjing,
some updation is going on in it. In online China
backup, the database is still accessible to the  Honglin Xu School of Information
user. Recovery Manager(RMAN) is an example Jiangnan University Wuxi, China
of hot backup in Oracle database. Hot backup is
done without interrupting the implementation of
database operations. Hot backup is classified
into logical backup and physical backup.

Advantages of hot backup are that they do not


have any kind of downtime and hence it is very
convenient for multi users to use the database.

24
CERTIFICATE

25
PLAGIARISM REPORT (MUST <40%)

seminar

ORIGINALITY REPORT

33 % 28% 10% 21%


SIMILARITY INDEX INTERNET SOURCES PUBLICATIONS STUDENT PAPERS

PRIMARY SOURCES

www.ijcaonline.org
1 Internet Source 5%

www.slideshare.net
2 Internet Source 4%
Submitted to Qun Li School of computer science &
technology Nanjing University of Science and
Technology Nanjing, China
3 Student Paper
4%

26
Submitted to Singapore of Technology
4 Student Paper
3%

Submitted to Wayne Manor Polytechnic College


5 Student Paper
3%

www.oracle.com
6 Internet Source
2%

Intellipaat.com
7
2%

27
Stackoverflow.com
8 Internet source 2%
Submitted to Honglin Xu School of Information
Jiangnan University Wuxi, China
9
2%
Student Paper

Tutorialspoint.com
10 Internet Source 2%

www.oracle-dba-online.com
11 Internet Source 1%

www.searchdatabackup.techtarget.com
13 Internet Source 1%

Submitted to Institute of Technology, Parul


15
University 1%
28
Student Paper

www.orafaq.com
16
Internet Source
1%

29
30
31

Anda mungkin juga menyukai