Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to back up and restore Oracle database in common operation

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article is about the common operation of Oracle database backup and recovery, the editor feels very practical, so share with you to learn, I hope you can learn something after reading this article, say no more, follow the editor to have a look.

Oracle database backup and recovery

When doing database operations, database backup and recovery are often encountered. Backups in Oracle are divided into two types: logical backup and physical backup. Physical backup can be divided into two categories: cold backup and hot backup.

Logical backup and recovery

Using the exp command for backup, you can add multiple parameter options to implement different export policies. Parameters include owner, table, etc.

Use of the exp command

Exp system/admin123 file=/home/backup/b.dmp

Where system/admin123 is the user name and password used when logging in to the database, and file=/home/backup/b.dmp is the file path where the data export is specified.

The owner parameter, which specifies a user name, will export only the objects owned by the user in the list of user names.

Exp system/admin123 owner= (scott,test) file=/home/backup/b.dmp

The tables parameter, which specifies the table parameter and which data tables to export

Exp system/admin123 tables= (people,employees) file=/home/backup/b.dmp

This command executes and exports the people and employees tables for the system user.

Physical backup / restore

This refers to the files that directly back up the database. Physical backup is divided into cold backup and hot backup.

Cold backup / restore

Cold backup refers to backing up all database files when the database is closed. These files include: all data files, all control files, all online REDO LOG files, and Init.ora files.

Database cold backup:

1. Log in to the database as an administrator and shut down the database.

Sqlplus / as sysdba shutdown normal

two。 After shutting down the database, back up the physical files. These physical files are at {ORACLE_HOME} / product/11.1.0/oradata/test by default, where test is the database name.

You can use the copy command on the system for backup

You can also add the host keyword to the SQL > command line and use the host command directly.

SQL > host copy / home/oracle/product/11.1.0/oradata/test / home/backup/

This realizes the cold backup of the database. The recovery of cold backup is very convenient, as long as the database is closed, copy the backed up files to the original location.

The above is how to backup and restore in the common operation of Oracle database. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report