How to back up a database on server a to server B in a Linux + Oracle environment

Source: Internet
Author: User

In Windows, it is very easy to back up, transfer, and restore data. You can directly use visual operations and then use Remote Desktop operations, at the same time, you can transfer the backup file to another server through remote desktop or folder sharing.

(1) Export the database to a data file using the exp command

In Linux, commands are usually used, so transferring backup files is not as simple as dragging. A simple method is to use Putty to obtain other tools and connect to server a through SSH. You can use the exp command to import data from a user to a DMP file, for example, if we want to transfer all the data under the PA user in server a to server B, the specific export command is:

Exp PA/password file = pa. dmp log = pa. Log rows = y;

(2) FTP command to transfer data to another server

In this way, a data file of PA. DMP and a log file of PA. Log are generated. Next, you need to connect to server B through SSH and obtain the data files on server a through FTP on the server.

FTP 192.168.100.100

Here, the connection 100.100 is the IP address of server a, and then enter the Linux user name and password just connected to server a through SSH to log on to server. The LS command can view the FTP directory on server A, which is the home directory of Linux users by default. Then, use the bin command to switch to the binary mode and run the get pa command. log can get this file to server B, and then get pa. DMP can download the data file. Run the bye command to end the FTP command line mode and return to the Linux Command Line.

Ftp> ls

Ftp> Bin

Ftp> get pa. Log

Ftp> get pa. dmp

Ftp> bye

(3) imp command Restore database

The next step is to restore the file to the database of server B, create a tablespace and a user on server B, and then run the IMP command to import the data in the file to the PA user of database B, the system automatically creates database objects, but the imported users must have the permissions to perform these operations.

Imp pa/password file = pa. dmp log = pa. Log fromuser = PA touser = PA commit = y ignore = y

In this way, our pa database will be transferred from server a to server B.

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.