Home > Database > Mysql Tutorial > oracle数据定时备份

oracle数据定时备份

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 15:07:08
Original
1096 people have browsed it

欢迎进入Oracle社区论坛,与200万技术人员互动交流 >>进入 oracle数据定时备份 有个简单需求:oracle数据库放到host-a上面,我希望在host-b每天早上3点备份host-a指定oracle table数据。 步骤一、在host-b安装oracle环境或者oracle instant client 步骤二、

欢迎进入Oracle社区论坛,与200万技术人员互动交流 >>进入

    oracle数据定时备份

    有个简单需求:oracle数据库放到host-a上面,我希望在host-b每天早上3点备份host-a指定oracle table数据。

    步骤一、在host-b安装oracle环境或者oracle instant client

    步骤二、在host-b配置TNS Name

    Java代码

    # 编辑并添加下面配置

    vi /u01/app/oracle/network/admin/tnsnames.ora

    Java代码

    host_a_db =

    (DESCRIPTION =

    (ADDRESS_LIST =

    (ADDRESS = (PROTOCOL = TCP)(HOST =  host-a )(PORT = 1521))

    )

    (CONNECT_DATA = (SID = logstat)(SERVER = DEDICATED))

    )

    步骤三、编写shell脚本

    Java代码

    vi backup.sh #内容如下

    exp logstat/xxxx@host_a_db FILE=snda-`date -d yesterday +%Y%m%d`.dmp TABLES=T1,T2 BUFFER=64000

    #只保留7天的备份

    find /home/oracle/snda_bak -name '*.dmp' -mtime +6 -exec rm -fr {}  \;

    备份文件名称包含当前日期前一天日期,这样的效果“snda-20130415.dmp”

    步骤四:挂crontab

    3 3 * * * source .bash_profile; /home/oracle/backup.sh > out.log

    --end

oracle数据定时备份

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template