oracle数据导出备份语句,Oracle数据库备份与恢复之日志备份

以前大家了解了Oracle数据库的在线备份,另外,进行数据库全备份后需要备份归档的日志文件。

1. 建立数据库备份的脚本

在上面建立的目录下建立如下的两个脚本。

1.1 建立执行备份任务的脚本(批处理文件)

文件内容如下:

@echo OFF

Rem ====================================

Rem NAME - archive_backup_Run.bat

Rem FUNCTION - Creates a backup script for a User Managed backup

Rem NOTES - This script will create a script and run OS copy commands

Rem on closed (cold) database

Rem MODIFIED - ksmith 01/01/02 Original File

Rem ===============================

Rem For Windows, set environment variables for the root path.

set ORACLE_SID=TSTDB

set ORACLE_CONNECTSTRING=tstdb

set ORACLE_BASE=c:\oracle

set ORACLE_HOME=%ORACLE_BASE%\ora92

set ORACLE_DATA=%ORACLE_BASE%\oradata\%ORACLE_SID%

set ORACLE_ADMIN=%ORACLE_BASE%\admin\%ORACLE_SID%

%ORACLE_HOME%\bin\sqlplus /nolog @archive_backup.sql > archive_backup.log

1.2 建立完成备份认为的命令文件(sqlplus内执行的sql脚本)

文件内容如下:

Rem ===============================

Rem NAME - archive_backup.sql

Rem FUNCTION - Creates a backup command file for a User Managed Archive Log backup

Rem NOTES - This script will create a script and run OS copy commands

Rem on an open or closed database.

Rem MODIFIED - Mr. Tianliang Guo 2002/08/19

Rem ==========================================

Rem Set SQL*Plus variables to manipulate output

set feedback off

set pagesize 0

set heading off

set verify off

set linesize 150

set trimspool on

Rem Set SQL*Plus user variables used in script

define adm = 'sys'

define pwd = 'oracle9i'

Rem for Windows

define dir = 'C:\oracle\admin\TSTDB\backup\archive log'

define fil = 'archive_backup_commands.sql'

define spo = 'archive_backup_output.lst'

define cpy = 'copy'

Rem login database

connect

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值