Oracle自动导出脚本,在windows下
2007-10-19 15:34
411 查看
脚本文件名为:oraclebackup.bat,其内容如下,只须更改一些参数,把下面的文件弄成系统执行计划就可以了。
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
rem windows环境下Oracle数据库的自动备份脚本。
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
rem 可以将本批处理设成windows任务计划下自动执行。
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
@echo off
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
@echo ================================================
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
@echo windows环境下Oracle数据库的自动备份脚本
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
@echo 说明:启动备份时,需要配置以下变量
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
@echo 1、BACKUP_DIR 指定要备份到哪个目录
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
@echo 2、ORACLE_USERNAME 指定备份所用的Oracle用户名
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
@echo 3、ORACLE_PASSWORD 指定备份所用的Oracle密码
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
@echo 4、ORACLE_DB 指定备份所用的Oracle连接名
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
@echo 5、BACK_OPTION 备份选项,可以为空,可以为full=y,可以为owner=a用户,b用户 等等....
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
@echo 6、RAR_CMD 指定RAR命令行压缩工具所在目录
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
@echo ================================================
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
rem 以下变量需要根据实际情况配置
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
set BACKUP_DIR=E:数据库备份
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
set ORACLE_USERNAME=username
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
set ORACLE_PASSWORD=password
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
set ORACLE_DB=db
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
set BACK_OPTION=
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
set RAR_CMD="C:Progra~1WinRARRar.exe"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
for /f "tokens=1,2" %%a in ('date/t') do set TODAY=%%a
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
set BACK_NAME=%ORACLE_DB%_%TODAY%(%time:~0,2%时%time:~3,2%分)_
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
set BACK_FULL_NAME=%BACKUP_DIR%%BACK_NAME%
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
rem 开始备份
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
exp %ORACLE_USERNAME%/%ORACLE_PASSWORD%@%ORACLE_DB% %BACK_OPTION% file="%BACK_FULL_NAME%.dmp" log="%BACK_FULL_NAME%exp.log"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
rem 压缩并删除原有文件
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
%RAR_CMD% a -df "%BACK_FULL_NAME%back.rar" "%BACK_FULL_NAME%.dmp" "%BACK_FULL_NAME%exp.log"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
rem windows环境下Oracle数据库的自动备份脚本。
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
rem 可以将本批处理设成windows任务计划下自动执行。
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
@echo off
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
@echo ================================================
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
@echo windows环境下Oracle数据库的自动备份脚本
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
@echo 说明:启动备份时,需要配置以下变量
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
@echo 1、BACKUP_DIR 指定要备份到哪个目录
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
@echo 2、ORACLE_USERNAME 指定备份所用的Oracle用户名
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
@echo 3、ORACLE_PASSWORD 指定备份所用的Oracle密码
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
@echo 4、ORACLE_DB 指定备份所用的Oracle连接名
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
@echo 5、BACK_OPTION 备份选项,可以为空,可以为full=y,可以为owner=a用户,b用户 等等....
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
@echo 6、RAR_CMD 指定RAR命令行压缩工具所在目录
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
@echo ================================================
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
rem 以下变量需要根据实际情况配置
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
set BACKUP_DIR=E:数据库备份
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
set ORACLE_USERNAME=username
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
set ORACLE_PASSWORD=password
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
set ORACLE_DB=db
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
set BACK_OPTION=
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
set RAR_CMD="C:Progra~1WinRARRar.exe"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
for /f "tokens=1,2" %%a in ('date/t') do set TODAY=%%a
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
set BACK_NAME=%ORACLE_DB%_%TODAY%(%time:~0,2%时%time:~3,2%分)_
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
set BACK_FULL_NAME=%BACKUP_DIR%%BACK_NAME%
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
rem 开始备份
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
exp %ORACLE_USERNAME%/%ORACLE_PASSWORD%@%ORACLE_DB% %BACK_OPTION% file="%BACK_FULL_NAME%.dmp" log="%BACK_FULL_NAME%exp.log"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
rem 压缩并删除原有文件
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
%RAR_CMD% a -df "%BACK_FULL_NAME%back.rar" "%BACK_FULL_NAME%.dmp" "%BACK_FULL_NAME%exp.log"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
相关文章推荐
- Oracle自动导出脚本(WINDOWS停的,导出文件名自动加上日期和时间)
- Oracle自动导出脚本(WINDOWS停的,导出文件名自动加上日期和时间)
- Windows 下 Oracle数据库自动备份批处理脚本
- oracle用户表空间导出导入脚本,以及windows下定时备份脚本
- WINDOW下ORACLE数据自动导出并压缩的脚本
- Windows下的Oracle导出脚本
- windows下建立自动任务--(oracle 数据导出自动任务)
- windows下,oracle的自动备份(导出)
- windows平台下Oracle自动备份脚本
- Oracle windows下自动启动脚本
- (转)Oracle数据库的自动导出备份脚本(windows环境)
- Windows 下 Oracle数据库自动备份批处理脚本
- Oracle 数据库备份自动执行脚本_For_Windows
- (转)Oracle数据库的自动导出备份脚本(windows环境)
- Oracle数据库的自动导出备份脚本(windows环境)
- Oracle 数据库导入导出的脚本
- oracle自动备份bat脚本
- 虚拟化--050 vsphere【新提醒】Windows虚拟机10分钟自动同步时间脚本虚拟人工作室 - 虚拟人培训中心
- windows下Oracle 11g数据库每天自动备份的实现方法
- ANT 脚本根据windows 和linux操作系统的不同,自动采用不同的编译方式