永发信息网

如果rman中不执行release channel 会怎么样

答案:2  悬赏:60  手机版
解决时间 2021-04-07 14:59
如果rman中不执行release channel 会怎么样
最佳答案
Oracle数据库中rman备份脚本非常实用
  查询字符集
  SQL> select * from nls_database_parameters;
  NLS_CHARACTERSET
  AL32UTF8
  备份时字符集很重要,不然会出乱码
  一、0级备份(全备)红色是要修改的,根据个人的存放位置。
  [oracle@oracle122 script]$ cat db_bak0.rman
  run
  {
  configure retention policy to recovery window of 8 days;
  configure controlfile autobackup on;
  configure controlfile autobackup format for device type disk to '/home/oracle/rmanbak/%F';
  allocate channel ch1 device type disk format '/home/oracle/rmanbak/inc0_%d_%s_%p_%u_%T';
  backup incremental level 0 tag='level 0' database skip inaccessible filesperset 10 plus archivelog filesperset 20;
  release channel ch1;
  }
  allocate channel for maintenance device type disk;
  crosscheck backup;
  delete noprompt expired backup;
  delete noprompt obsolete;
  delete noprompt archivelog until time 'sysdate-30';
  0级运行脚本
  [oracle@oracle122 script]$ cat exec_0_level.sh
  ORACLE_HOSTNAME=oracle122; export ORACLE_HOSTNAME
  ORACLE_BASE=/u01/app; export ORACLE_BASE
  ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1; export ORACLE_HOME
  ORACLE_SID=orcl; export ORACLE_SID
  ORACLE_TERM=xterm; export ORACLE_TERM
  PATH=/usr/sbin:$PATH; export PATH
  PATH=$ORACLE_HOME/bin:$PATH; export PATH
  export DATE=$(date +%Y_%m_%d)
  export NLS_LANG="Simplified Chinese_china".AL32UTF8
  /u01/app/oracle/product/11.2.0/dbhome_1/bin/rman target sys/sys_admin cmdfile /home/oracle/rmanbak/script/db_bak0.rman log /home/oracle/rmanbak/script/log/rman_$DATE.log append
  二、1级备份(增量)
  [oracle@oracle122 script]$ cat db_bak1.rman
  run
  {
  configure retention policy to recovery window of 8 days;
  configure controlfile autobackup on;
  configure controlfile autobackup format for device type disk to '/home/oracle/rmanbak/%F';
  allocate channel ch1 device type disk format '/home/oracle/rmanbak/inc1_%d_%s_%p_%u_%T';
  backup incremental level 1 tag='level 1' database skip inaccessible filesperset 10 plus archivelog filesperset 20;
  release channel ch1;
  }
  allocate channel for maintenance device type disk;
  crosscheck backup;
  delete noprompt expired backup;
  delete noprompt obsolete;
  delete noprompt archivelog until time 'sysdate-30';
  1级运行脚本
  [oracle@oracle122 script]$ cat exec_1_level.sh
  ORACLE_HOSTNAME=oracle122; export ORACLE_HOSTNAME
  ORACLE_BASE=/u01/app; export ORACLE_BASE
  ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1; export ORACLE_HOME
  ORACLE_SID=orcl; export ORACLE_SID
  ORACLE_TERM=xterm; export ORACLE_TERM
  PATH=/usr/sbin:$PATH; export PATH
  PATH=$ORACLE_HOME/bin:$PATH; export PATH
  export DATE=$(date +%Y_%m_%d)
  export NLS_LANG="Simplified Chinese_china".AL32UTF8
  /u01/app/oracle/product/11.2.0/dbhome_1/bin/rman target sys/sys_admin cmdfile /home/oracle/rmanbak/script/db_bak1.rman log /home/oracle/rmanbak/script/log/rman_$DATE.log append
  三、2级备份(从0级追加到现在的备份)
  [oracle@oracle122 script]$ cat db_bak2.rman
  run
  {
  configure retention policy to recovery window of 8 days;
  configure controlfile autobackup on;
  configure controlfile autobackup format for device type disk to '/home/oracle/rmanbak/%F';
  allocate channel ch1 device type disk format '/home/oracle/rmanbak/inc2_%d_%s_%p_%u_%T';
  backup incremental level 2 tag='level 2' database skip inaccessible filesperset 10 plus archivelog filesperset 20 delete all input;
  release channel ch1;
  }
  allocate channel for maintenance device type disk;
  crosscheck backup;
  delete noprompt expired backup;
  delete noprompt obsolete;
  2级运行脚本
  [oracle@oracle122 script]$ cat exec_2_level.sh
  ORACLE_HOSTNAME=oracle122; export ORACLE_HOSTNAME
  ORACLE_BASE=/u01/app; export ORACLE_BASE
  ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1; export ORACLE_HOME
  ORACLE_SID=orcl; export ORACLE_SID
  ORACLE_TERM=xterm; export ORACLE_TERM
  PATH=/usr/sbin:$PATH; export PATH
  PATH=$ORACLE_HOME/bin:$PATH; export PATH
  export DATE=$(date +%Y_%m_%d)
  export NLS_LANG="Simplified Chinese_china".AL32UTF8
  /u01/app/oracle/product/11.2.0/dbhome_1/bin/rman target sys/sys_admin cmdfile /home/oracle/rmanbak/script/db_bak2.rman log /home/oracle/rmanbak/script/log/rman_$DATE.log append
  定时备份星期天为0级全备,星期三为2级备份,星期一,星期二,星期四,星期五,星期六为1级增量备份晚上11点开始备份
  [oracle@oracle122 script]$ crontab -l
  * 23 * * 0 /home/oracle/rmanbak/script/exec_0_level.sh
  * 23 * * 1 /home/oracle/rmanbak/script/exec_1_level.sh
  * 23 * * 2 /home/oracle/rmanbak/script/exec_1_level.sh
  * 23 * * 3 /home/oracle/rmanbak/script/exec_2_level.sh
  * 23 * * 4 /home/oracle/rmanbak/script/exec_1_level.sh
  * 23 * * 5 /home/oracle/rmanbak/script/exec_1_level.sh
  * 23 * * 6 /home/oracle/rmanbak/script/exec_1_level.sh
全部回答
期待看到有用的回答!
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
郑州市公安局保安公司家属院(北门)怎么去啊,
甚至的甚部首查字法应该怎么查
dnf土罐时装怎么删除
求3days 全CG图片
2011年大2在校生预征报名系统中的提报报名信
丙酸钠是起什么作用
铁将军6026关闭智能暗锁怎样关闭
车牌号豫ksb0o7怎么样
长春生孩子可靠吗?
尚品时尚男装这个地址在什么地方,我要处理点
康佳LED42R6100PDE电视usb升级失败,开不了机
小说大纲和小说提纲一样吗?
永定219省道95公里200米超速
怎么形容陪一个从小到大甚至到她结婚的岁月
京东商城联盟问题
推荐资讯
she should ( )a rest at home
儿童吃饭尝不出味道挂什么科
洁康干洗(盛德路)地址在什么地方,我要处理点
多种肉类菜品采购清单价格
24+42+76+58=(24+76)+(42+58),只运用了
万地宝17-17-17硫基复合肥多少钱一吨啊
中医中药治病有科学依据吗?
有的人说女人比男人累 有的人说男人比女人累
湖北罗邑在哪里?
手机上出现“无法连接到服务器”
求四神集团1234下载
冯特幼儿园正商红河谷园怎么去啊,有知道地址
正方形一边上任一点到这个正方形两条对角线的
阴历怎么看 ?