楼主: anchen211

用RMAN能否实现定时备份?

[复制链接]
论坛徽章:
4
ITPUB元老
日期:2005-04-05 09:18:50授权会员
日期:2005-12-08 16:03:33会员2006贡献徽章
日期:2006-04-17 13:46:34会员2007贡献徽章
日期:2007-09-26 18:42:10
11#
 楼主| 发表于 2005-1-19 08:54 | 只看该作者

怎么做的,共享一下嘛!

最初由 mugen 发布
[B]我现在做的就是每周日晚上23点做一次rman的全备份 [/B]


这位老兄,能否把你的脚本共享一下呀?

使用道具 举报

回复
论坛徽章:
4
ITPUB元老
日期:2005-04-05 09:18:50授权会员
日期:2005-12-08 16:03:33会员2006贡献徽章
日期:2006-04-17 13:46:34会员2007贡献徽章
日期:2007-09-26 18:42:10
12#
 楼主| 发表于 2005-1-19 10:56 | 只看该作者

怎么有错误?

最初由 NinGoo 发布
[B]# script:bakup.rcv
# creater:chenjiping
# date:5.8.2003
# desc:backup all database datafile in archive with rman

# connect database
connect rcvcat rman/rman@back;
connect target internal/virpure;

# start backup database
run{
allocate channel c1 type disk;
backup full tag 'dbfull' format 'd:\backup\full%u_%s_%p' database
include current controlfile;
sql 'alter system archive log current';
release channel c1;
}
# end [/B]


这是我的脚本:
# connect database
connect catalog rman/rman;
connect target sys/123456@cfmc;

# start backup database
run
{
allocate channel t1 type disk;
allocate channel t2 type disk;
backup
filesperset=20
format='/ora8/m01/app/oracle/oradatabak/archbak/al_%d_%t_%s_%p'
(archivelog like '/ora8/m01/app/oracle/admin/cfmc/arch/%' channel t1 delete input)
(archivelog like '/orabak/arch/%' channel t2 delete input);
}
sh /scripts/ftparch.sh

这是报的错:
[root@localhost scripts]# sh archbackup.sh
archbackup.sh: line 8: connect: command not found
archbackup.sh: line 9: connect: command not found
archbackup.sh: line 12: run: command not found
archbackup.sh: line 14: allocate: command not found
archbackup.sh: line 15: allocate: command not found
archbackup.sh: line 16: backup: command not found
archbackup.sh: line 19: archivelog: command not found
archbackup.sh: line 20: archivelog: command not found

使用道具 举报

回复
招聘 : 数据库管理员
论坛徽章:
66
ITPUB元老
日期:2005-07-16 18:49:11授权会员
日期:2005-10-30 17:05:33ITPUB新首页上线纪念徽章
日期:2007-10-20 08:38:44现任管理团队成员
日期:2011-05-07 01:45:08版主3段
日期:2012-05-15 15:24:11
13#
发表于 2005-1-19 11:08 | 只看该作者
你牛,在ROOT下运行,你要在ORACLE用户下运行。

使用道具 举报

回复
招聘 : 数据库管理员
论坛徽章:
66
ITPUB元老
日期:2005-07-16 18:49:11授权会员
日期:2005-10-30 17:05:33ITPUB新首页上线纪念徽章
日期:2007-10-20 08:38:44现任管理团队成员
日期:2011-05-07 01:45:08版主3段
日期:2012-05-15 15:24:11
14#
发表于 2005-1-19 11:13 | 只看该作者
#
# must by run in oracle env....
#
. .bash_profile

$ORACLE_HOME/bin/rman catalog rman/rman target sys/123456@cfmc;

# start backup database
run
{
allocate channel t1 type disk;
allocate channel t2 type disk;
backup
filesperset=20
format='/ora8/m01/app/oracle/oradatabak/archbak/al_%d_%t_%s_%p'
(archivelog like '/ora8/m01/app/oracle/admin/cfmc/arch/%' channel t1 delete input)
(archivelog like '/orabak/arch/%' channel t2 delete input);
}

使用道具 举报

回复
论坛徽章:
4
ITPUB元老
日期:2005-04-05 09:18:50授权会员
日期:2005-12-08 16:03:33会员2006贡献徽章
日期:2006-04-17 13:46:34会员2007贡献徽章
日期:2007-09-26 18:42:10
15#
 楼主| 发表于 2005-1-19 11:16 | 只看该作者

还是不行呀

最初由 xzh2000 发布
[B]你牛,在ROOT下运行,你要在ORACLE用户下运行。 [/B]


请看报错:
[oracle@localhost scripts]$ su - oracle
Password:
[oracle@localhost oracle]$ sh /scripts/archbackup.sh
/scripts/archbackup.sh: line 8: connect: command not found
/scripts/archbackup.sh: line 9: connect: command not found
/scripts/archbackup.sh: line 12: run: command not found
/scripts/archbackup.sh: line 14: allocate: command not found
/scripts/archbackup.sh: line 15: allocate: command not found
/scripts/archbackup.sh: line 16: backup: command not found
/scripts/archbackup.sh: line 19: archivelog: command not found
/scripts/archbackup.sh: line 20: archivelog: command not found
[oracle@localhost oracle]$ svrmgrl

Oracle Server Manager Release 3.1.7.0.0 - Production

Copyright (c) 1997, 1999, Oracle Corporation.  All Rights Reserved.

Oracle8i Enterprise Edition Release 8.1.7.0.1 - Production
With the Partitioning option
JServer Release 8.1.7.0.1 - Production

SVRMGR>

使用道具 举报

回复
论坛徽章:
4
ITPUB元老
日期:2005-04-05 09:18:50授权会员
日期:2005-12-08 16:03:33会员2006贡献徽章
日期:2006-04-17 13:46:34会员2007贡献徽章
日期:2007-09-26 18:42:10
16#
 楼主| 发表于 2005-1-19 11:22 | 只看该作者

这句话什么意思?

是要ORACLE_HOME下在.bash_profile中加入这句话吗?
$ORACLE_HOME/bin/rman catalog rman/rman target sys/123456@cfmc;

使用道具 举报

回复
招聘 : 数据库管理员
论坛徽章:
66
ITPUB元老
日期:2005-07-16 18:49:11授权会员
日期:2005-10-30 17:05:33ITPUB新首页上线纪念徽章
日期:2007-10-20 08:38:44现任管理团队成员
日期:2011-05-07 01:45:08版主3段
日期:2012-05-15 15:24:11
17#
发表于 2005-1-19 11:30 | 只看该作者
你运行偶给你改后的那部分。

使用道具 举报

回复
招聘 : 数据库管理员
论坛徽章:
66
ITPUB元老
日期:2005-07-16 18:49:11授权会员
日期:2005-10-30 17:05:33ITPUB新首页上线纪念徽章
日期:2007-10-20 08:38:44现任管理团队成员
日期:2011-05-07 01:45:08版主3段
日期:2012-05-15 15:24:11
18#
发表于 2005-1-19 11:38 | 只看该作者

Re: 这句话什么意思?

最初由 anchen211 发布
[B]是要ORACLE_HOME下在.bash_profile中加入这句话吗?
$ORACLE_HOME/bin/rman catalog rman/rman target sys/123456@cfmc; [/B]


不是。

使用道具 举报

回复
招聘 : 数据库管理员
论坛徽章:
66
ITPUB元老
日期:2005-07-16 18:49:11授权会员
日期:2005-10-30 17:05:33ITPUB新首页上线纪念徽章
日期:2007-10-20 08:38:44现任管理团队成员
日期:2011-05-07 01:45:08版主3段
日期:2012-05-15 15:24:11
19#
发表于 2005-1-19 11:42 | 只看该作者
$more test.sh
#!/bin/bash
$ORACLE_HOME/bin/rman catalog rman/rman target sys/123456@cfmc;

# start backup database
run
{
allocate channel t1 type disk;
allocate channel t2 type disk;
backup
filesperset=20
format='/ora8/m01/app/oracle/oradatabak/archbak/al_%d_%t_%s_%p'
(archivelog like '/ora8/m01/app/oracle/admin/cfmc/arch/%' channel t1 delete input)
(archivelog like '/orabak/arch/%' channel t2 delete input);
}

使用道具 举报

回复
论坛徽章:
4
ITPUB元老
日期:2005-04-05 09:18:50授权会员
日期:2005-12-08 16:03:33会员2006贡献徽章
日期:2006-04-17 13:46:34会员2007贡献徽章
日期:2007-09-26 18:42:10
20#
 楼主| 发表于 2005-1-19 11:52 | 只看该作者

还是有问题呀,请再看看吧!

最初由 xzh2000 发布
[B]$more test.sh
#!/bin/bash
$ORACLE_HOME/bin/rman catalog rman/rman target sys/123456@cfmc;

# start backup database
run
{
allocate channel t1 type disk;
allocate channel t2 type disk;
backup
filesperset=20
format='/ora8/m01/app/oracle/oradatabak/archbak/al_%d_%t_%s_%p'
(archivelog like '/ora8/m01/app/oracle/admin/cfmc/arch/%' channel t1 delete input)
(archivelog like '/orabak/arch/%' channel t2 delete input);
} [/B]



我执行您以上的脚本,结果如下:
[oracle@localhost oracle]$ sh /scripts/archbackup.sh
/scripts/archbackup.sh: line 11: test.sh: command not found

Recovery Manager: Release 8.1.7.0.1 - Production

RMAN-06005: connected to target database: CFMC (DBID=1791010199)
RMAN-06008: connected to recovery catalog database

RMAN>

就停在这不动了,我看了看备份的目的地,也没有新备份的文件呀.

使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表