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.