AD

oracle backup database under linux and copied to the local area network shared directory

#! / Bin / sh
# Source / home / oracle / .bashrc
# Daily backup dump and copy it's. Tar.gz to windows share folder.
# Delete previous. Dmp and. Tar.gz files every 7 days.
export DATE = $ (date +% Y% m% d)
export DATE7AGO = $ (date +% Y% m% d-d '-7 day')
export DATE30GO = $ (date +% Y% m% d-d '30 day ago ')
export ORACLE_HOME = / u01/oracle/product/10.2.0/db_1
export ORACLE_BASE = / u02
export PATH = / bin: / sbin: / usr / bin: / usr / sbin: / usr / local / bin
export PATH = $ PATH: $ ORACLE_HOME: $ ORACLE_HOME / bin
export ORACLE_HOME_LISTNER = $ ORACLE_HOME
export ORACLE_SID = orcl
export LD_LIBRARY_PATH = $ ORACLE_HOME / lib: / usr / lib
export NLS_LANG = american_america.ZHS16GBK

mount-t cifs-o username = oracle, passwd = mypasswd, ip = 172.16.1.92 / / 172.16.1.92/linuxdata / backup
cd / data
exp kingking / kkncsys @ ORCL_LOCAL file = ncdata $ DATE.dmp
tar czf ncdata $ DATE.tar.gz ncdata $ DATE.dmp

cp ncdata $ DATE.tar.gz / backup & & rm ncdata $ DATE7AGO.dmp-f & & rm ncdata $ DATE7AGO.tar.gz-f & & rm / backup / ncdata $ DATE30GO.tar.gz-f

Exist in the above documents databackup.sh, added to the crontab in:

[Oracle @ mylinux ~] $ su
Password:
[Root @ mylinux oracle] # crontab-e

0 0 * * * / bat / databackup.sh

[Root @ mylinux oracle] # crontab-l
0 0 * * * / bat / databackup.sh
[Root @ mylinux oracle] #

Another Note: If you do not root crontab for regular operation of the task, then, need to consider rights issue, to ensure / data and / backup operation can be timed to the user such as oracle access.
标签: orcl, oracle home, export path, path path, oracle product, tar gz, bashrc, ld library, library path, local area network, passwd, backup database, czf, crontab e, dmp, cifs, share folder, listner, backup cd, backup operation
分类: Database
时间: 2010-02-09

相关文章

  1. oracle backup script under linux

    #! / Bin / sh source / home / oracle / .bash_profile $ ORACLE_HOME / bin / rman <<EOF connect target / r ...
  2. linux local area network (Internet), copies of documents

    If the LAN has two machines A and B, A machine admin requirement is to copy the file to the B machine. Command ...
  3. Oracle backup and recovery simple batch file - change

    Recommendation one: Using Task Scheduler, batch files, and the EXP ORACLE export feature, can date back up fil ...
  4. Installing Oracle 10g database linux

    Red Hat Enterprise Linux Server release 5.3 (Tikanga) Installation Oracle 10g database Step 1: Modify several ...
  5. linux install Oracle 10g database

    Red Hat Enterprise Linux Server release 5.3 (Tikanga) Installation Oracle 10g database Step 1: Modify several ...
  6. oracle backup under linux some heart

    1. J2ee recently doing a web project based on this project web server and database are deployed on linux serve ...
  7. Oracle rac 10g for linux vmware installation notes

    Notes did not add order for reference purposes only friends can not understand to explore. Oh one network card ...
  8. ORACLE backup solution

    There are three standard Oracle database backup methods, namely the export / import (EXP / IMP), hot standby a ...
  9. How to convert a 32-bit database to 64-bit database on Linux

    How to convert a 32-bit database to 64-bit database on Linux Note: 341880.1 This document provides details for ...
  10. innobackupex-1.5.1 backup database, MySQL server has gone away solution

    Backup database is in use innobackupex the following error message, mainly because the mysql disconnect the id ...
  11. MySQL database under Linux binary log recovery methods

    MySQL database under Linux binary log recovery methods September 21, 2009 04:04 pm Monday, if the MySQL server ...
  12. Oracle 10g installation in linux redhat as4 whole process diagram

    http://blog.chinaunix.net/u/6589/index.html *** ORACLE-RAC **** http://ahcz.szq.blog.163.com/blog/static/13058 ...
  13. oracle create database manually

    oracle building a database is required for general use windows interface Create Database Congiguration Assitan ...
  14. Oracle 10g under Redhat linux 5 installation notes

    In fact, the official oracle documentation OracledocR2 write it in detail. SID == ORACLE_SID == instance name ...
  15. Flashback knowledge of Oracle 10g database

    Knowledge of Oracle 10g database flashback original definition: the table name == XX create table XX ( ID VARC ...
  16. oracle backup and recovery (transfer)

    oracle is not used in the rman backup recovery, see the article, although incomplete, suggestive Transfer: htt ...
  17. oracle backup command imp exp

    oracle backup command for oracle backup and recovery, the following details on how you use the backup command ...
  18. How to reconfigure the Oracle EM Database Control

    How to reconfigure the Oracle EM Database Control Author: eygle | English Version [reprint, please indicate th ...
  19. [Reserved] ORACLE Detailed: database name instance name. ORACLE_SID. Database domain, and the global database name service name

    Detailed: database name, instance name, ORACLE_SID, database name, global database name, service name -------- ...