Record local and remote oracle backup in linux

Source: Internet
Author: User


Record local and remote oracle backup in linux
Client server environment: rhel-server-5.4-x86_64 + oracle10g remote backup server environment: windows server 2008 network environment: formal server on the internet, remote backup server on the Intranet (unable to map to the Internet)
Requirements for www.2cto.com: website engineering and databases must be backed up on local and remote servers every day.
Retain the backup solution for the previous five days. 1. Install software such as serv-u on windows server 2008 to back up the project on the Linux server.
The packages and database packages are uploaded (pushed) to the remote backup server, but the remote server is Intranet and cannot be reflected.
The FTP server cannot be set up because it is exposed to the Internet. Therefore, this solution is not feasible.
Www.2cto.com solution 2: Build an FTP server on a Linux server. The remote backup server uses flashfxp and other software.
Regularly download and 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 authenticated 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. Then open the ftp service and change server_args =-l-a to server_args =-l to remove-.
You have the right to use ftp to log on and start the FTP service. Here I use service xinetd restart and service vsftpd.
Restart reports vsftpd: unrecognized service. I don't know why. Port 21 is started. I also tested
I tried FTP and could use root to log on.
Www.2cto.com: edit the website project package, database backup, delete files, and other scripts: db_back.sh, web_back.sh, and clear. sh [root @ yinyong/] # mkdir-p/bak/temp // create database, log, and other Backup Paths [root @ yinyong/] # mkdir-p/bak/db_bak // create a local database backup path [root @ yinyong/] # mkdir-p/var/ftp/pub // create a remote backup database storage path [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 when policy?m=d=.tar.gz hbskjt_db. $
(Date + % Y % m % d). * // local backup tar zcf/var/ftp/pub/hbskjt_db together with the database and logs. $ (date 1_policy1_m1_d1_.tar.gz hbskjt_db. $
(Date + % Y % m % d ). * // package the database and logs 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 script is successfully verified locally. Compile the web_back.sh script [root @ yinyong/] # mkdir-p/bak/web_bak // create the backup path project path under/home/tomcat/webapps/oa [root @ yinyong ~] # Vi/home/oracle/db_web.sh cd/home/tomcat/webapps tar zcf/bak/web_bak/oa _ $ (date when policy?m=d=.tar.gz oa // local project backup storage path tar zcf/ var/ftp/pub/oa _ $ (date too %y1_m1_d1_.tar.gz oa // remote project backup storage path [root @ yinyong oracle] # chmod 777 db_web.sh [root @ yinyong oracle] #. /db_web.sh [root @ yinyong web_bak] # ls oa_20120911.tar.gz local verification script. The backup is successful because it is a daily backup, and the server's disk size may blow up one day, so you need to delete the previous
Only the backups of the last five days are retained. This requires a delete script clear. sh [root @ yinyong ~]. # Vi/home/oracle/clear. sh rm-rf/bak/web_bak/oa _ $ (date-d-5day + "% Y % m % d ")*. gz // local backup retains rm-rf/bak/temp /*. * // The path contains dmp and log files, which have been packaged, compressed, and backed up, rm-rf/bak/db_bak/hbskjt_db $ (date-d-5day + "% Y % m % d") * should be deleted every day ")*. gz rm-rf/var/ftp/pub/hbskjt_db $ (date-d-1day + "% Y % m % d ")*. gz // Remote Backup
Retained for only one day. Make sure that the latest data of the day is downloaded every day, solve the Problem of overwriting files. rm-rf/var/ftp/pub/oa _ $ (date-d-1day + "% Y % m % d ")*. gz [root @ yinyong oracle] # chmod 777 clear. sh edit cron [root @ yinyong ~] # Crontab-e 0 1 ***/home/oracle/db_back.sh // back up the database at AM 0 2 ***/home/oracle/db_web.sh // back up the website at AM 0 3 ***/home/oracle/clear. sh // Delete the previous backup at AM. Currently, the backup of the local server is ready. Now you need to configure windows server 2008 remote server. Use the FlashFXPliehuo4.2.6 software to configure the logon parameters: configure the storage path of the remote server: d: \ tet \ pub Linux Server backup path:/var/ftp/pub: right-click "queue" to generate the following configuration file: Right-click to save as * fqf file. Click "Software Tools"> "scheduler" to create a new scheduler task. Select the * fqf file saved in "queue file" to configure the scheduler task. Then, the task can be automatically downloaded, A directory for remote backup on a Linux server, preferably one day
Delete, so that the content downloaded every day is the latest, without the need to repeat the download and overwrite the previous
Project, database, etc. It is best to set this scheduled task in the early morning to reduce the number of tasks caused by downloads.
.

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.