Tape backup for Oracle Database automatic backup under UNIX

Source: Internet
Author: User
Tags ftp commands

The following articles mainly introduce how to automatically back up Oracle databases under UNIX. The following describes the specific solutions, such as tape backup and remote backup, I hope this will help you in your future studies. The following describes the specific content of the text.

I believe that many system administrators are doing the same job every day-backing up data. Once the system fails and data recovery is required, the system is powerless.

Tape backup

The tar-backup file copies the data files exported using the export command to the tape.

Tar-backup file content:

 
 
  1. tar rvf /dev/rmt/0n/backup/ 

This command backs up files generated on the current day in the/backup Directory to the tape. In this file, the tar command uses three parameters. The r option indicates that a file is written to the tape without damaging the original content of the tape. The v option indicates that the file information is displayed during the copy process, the f option is followed by the tape device name, specifying where the file is copied. The n option indicates that the tape drive is not replayed. /Dev/rmt/0 indicates the first tape drive of the UNIX host. Similarly,/dev/rmt/1 indicates the second tape drive of the UNIX host, and so on.

After writing the ora-env, ora-backup, and tar-backup files, run the following commands:

 
 
  1. chmod 755 ora—env   
  2. chmod 755 ora—backup   
  3. chmod 755 tar—backup  

In this way, all three files become executable files.

Remote Backup

We know that FTP commands are usually used to transmit data between two hosts, but they are generally implemented through interaction, that is, you need to manually enter the IP address, user name, and password of the target host. Obviously, this does not meet the requirements of automatic backup. Fortunately, we can achieve our goal by writing a. netrc file. This file must be named. netrc and stored in the user registration directory on the machine where the FTP command is started. The file permission should be disabled for read access by the group or other users.

In this way, when a user uses an FTP command, the system will find it in the user's registration directory. if the netrc file can be found, the file will be executed first. Otherwise, the user will be prompted interactively to enter the user name and password.

Before using the FTP command, you should first create a directory on another UNIX machine for backup to accommodate the backup files. The directory created in this document is/pub. It should be noted that, in order to speed up the backup, the transmission rate between the two hosts should be as high as possible, preferably on the same LAN.

The content of the. netrc file is as follows:

 
 
  1. machine host2 

Host2 is the host name used for backup

 
 
  1. login oracle 

Oracle is a user on the backup host.

 
 
  1. passWord oracle 

The password of an oracle user is oracle

 
 
  1. macdef init 


The above content is an introduction to the actual operation steps for automatic backup of Oracle databases under UNIX. I hope you will get some benefits.

Article by: http://database.ctocio.com.cn/448/8997448_1.shtml

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.