使用作业调度程序 (Oracle) 运行 RMAN 脚本
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1759598/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Running RMAN Scripts with the job scheduler (Oracle)
提问by Raggedtoad
Here's a good one for any Oracle gurus out there. I'm working on a web page that dynamically configures Oracle DB backup settings in a closed environment. Right now, I have everything set up to generate scheduled jobs that run pre-determined RMAN scripts that already exist on the Database server's disk. This works, but I want to go a step further.
对于任何 Oracle 专家来说,这是一个很好的选择。我正在处理一个在封闭环境中动态配置 Oracle DB 备份设置的网页。现在,我已经完成了所有设置,可以生成运行预先确定的 RMAN 脚本的计划作业,这些脚本已存在于数据库服务器的磁盘上。这有效,但我想更进一步。
Is there any way to create jobs with the scheduler that will run RMAN scripts which haven't first been written to disk? For example, is it possible to fire off an RMAN backup script directly from the scheduler by using a pipe of some sort? I've found some vague information on the RMAN Pipe Interface, but I can't see how I could create a private pipe, pack it with RMAN commands, and then feed it to RMAN all in one job run... Any thoughts would be very much appreciated.
有没有办法使用调度程序创建作业来运行尚未首先写入磁盘的 RMAN 脚本?例如,是否可以使用某种管道直接从调度程序启动 RMAN 备份脚本?我在RMAN 管道接口上发现了一些模糊的信息,但我看不到如何创建一个私有管道,用 RMAN 命令打包它,然后在一个作业运行中将它提供给 RMAN ......任何想法都会非常感谢。
采纳答案by Juraj
In anything related to backup/restore of the database, I advise you to prefer OS's means to execute scheduled jobs (cron/at on unix, Scheduled tasks on Windows). The advantage is that they are independent from oracle instance and you can better handle cases when oracle instance is down or malfunctioning. The "RMAN pipe interface" is meant to be used together with operating system's shell, as well.
在与数据库备份/恢复相关的任何事情中,我建议您更喜欢操作系统的方式来执行计划作业(在 unix 上为 cron/at,在 Windows 上为计划任务)。优点是它们独立于oracle 实例,可以更好地处理oracle 实例宕机或故障的情况。“RMAN 管道接口”也旨在与操作系统的外壳一起使用。
However, executing scripts directly from database is also possible: AskTom
但是,也可以直接从数据库执行脚本:AskTom
回答by Kamal
If you want to use DBMS_SCHEDULER then the script has to reside on the database server.
But if you install an Oracle client on the web server you can run RMAN from there and connect to the TARGET database. E.g.:
如果要使用 DBMS_SCHEDULER,则脚本必须驻留在数据库服务器上。
但是,如果您在 Web 服务器上安装 Oracle 客户端,则可以从那里运行 RMAN 并连接到 TARGET 数据库。例如:
rman 'usr/pwd@conn_str AS SYSDBA' CMDFILE /home/www/db/backup-full.rman
In this case the script can reside on the web server.
Hope this helps.
在这种情况下,脚本可以驻留在 Web 服务器上。
希望这可以帮助。