Local and remote Oracle backup in Linux

Source: Internet
Author: User

Customer server environment: rhel-server-5.4-x86_64 + Oracle10g

Remote Backup server Environment: windows server 2008

Network Environment: the server is deployed on the Internet, and the remote backup server is deployed on the Intranet (the server cannot be mapped to the Internet)

Requirements: the website project and database must be backed up on the local server and remote server every day. The backups of the previous five days must be retained.

Solution 1: Install software such as serv-u on windows server 2008, and upload (push) The engineering package and database compressed package backed up on the Linux server to the remote backup server, however, the remote server is Intranet and cannot be mapped to the Internet. Therefore, the FTP server cannot be set up. Therefore, this solution is not feasible.

Solution 2: Build an FTP server on a Linux server, and regularly download the remote backup server through software such as flashfxp

Install the FTP package on Linux

[Root @ yinyong ~] # Rpm-ivh ftp-0.17-35.el5.i386.rpm
Warning: ftp-0.17-35.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ######################################## ### [100%]
1: ftp ####################################### #### [100%]
[Root @ yinyong ~] # Service vsftpd start
Vsftpd: unrecognized service
[Root @ yinyong ~] # Vi/etc/xinetd. d/gssftp
# Default: off
# Description: The specified FTP server accepts FTP connections \
# That can be authenticated with Kerberos 5.
Service ftp
{
Flags = REUSE
Socket_type = stream
Wait = no
User = root
Server =/usr/kerberos/sbin/ftpd
Server_args =-l
Log_on_failure + = USERID
Disable = no
}
[Root @ yinyong ~] # Service xinetd restart
Stopping xinetd: [OK]
Starting xinetd: [OK]
[Root @ yinyong ~] # Netstat-tnl
Tcp 0 0 0.0.0.0: 21 0.0.0.0: * LIST

Vi/etc/xinetd. d/gssftp change disable = yes to no, and then open the ftp service

Change server_args =-l-a to server_args =-l to remove-a, so that the system user has the right to use ftp to log on.

Then start the FTP service. Here I use service xinetd restart and use service vsftpd restart to report vsftpd: unrecognized service. I don't know why. Port 21 is enabled, and I have also tested that FTP can be logged on as root.

Edit website project packages, database backup and file deletion scripts: db_back.sh, web_back.sh, clear. sh

[Root @ yinyong/] # mkdir-p/bak/temp // create Backup Paths such as databases and logs
[Root @ yinyong/] # mkdir-p/bak/db_bak // create a local backup path for the database
[Root @ yinyong/] # mkdir-p/var/ftp/pub // create the storage path of the remote backup database
[Root @ yinyong ~] # Vi/home/oracle/db_back.sh
Su-oracle "-c exp hbskjt_0113/password file =/bak/temp/hbskjt_db. $ (date + % Y % m % d ). dmp owner = hbskjt0113 log =/bak/temp/hbskjt_db. $ (date + % Y % m % d ). log"
Cd/bak/temp
Tar zcf/bak/db_bak/hbskjt_db $ (date using policy1_m1_d1_.tar.gz hbskjt_db. $ (date + % Y % m % d). * // package local backup together with the database and log
Tar zcf/var/ftp/pub/hbskjt_db $ (date using policy?m=d=.tar.gz hbskjt_db. $ (date + % Y % m % d). * // The database and log are packaged for remote backup.
[Root @ yinyong oracle] # chmod 777 db_back.sh
[Root @ yinyong oracle] #./db_back.sh
[Root @ yinyong db_bak] # ls
Hbskjt_db20120911.tar.gz

[Root @ yinyong pub] # ls
Hbskjt_db20120911.tar.gz

The local verification script is successful.

  • 1
  • 2
  • Next Page

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.