rman SBT_TAPE NFS disk 模拟NBU带库 FRA

-----------------rman 将本地磁盘变成磁带-----------------------------------
 
##RAC 本地 /nfs----两个备份策略 cluster=n

run {
allocate channel ch00 device type 'SBT_TAPE'
   PARMS="SBT_LIBRARY=oracle.disksbt,
   ENV=(BACKUP_DIR=/nfs)";   
backup recovery area ; }

run {
allocate channel ch00 device type 'SBT_TAPE'
   PARMS="SBT_LIBRARY=oracle.disksbt,
   ENV=(BACKUP_DIR=/nfs)";   
restore datafile 3 ; }

run {
allocate channel ch00 device type 'SBT_TAPE'
   PARMS="SBT_LIBRARY=oracle.disksbt,
   ENV=(BACKUP_DIR=/nfs)";   
delete obsolete device type sbt;
 }

run {
allocate channel ch00 device type 'SBT_TAPE'
   PARMS="SBT_LIBRARY=oracle.disksbt,
   ENV=(BACKUP_DIR=/nfs)";   
restore database;
recover database;
 }

------------------------磁盘磁带两个策略

To maintain two disctinct retention policies for disk and tape backups.

SOLUTION

Decide which device needs the longest recovery window - typically this will be TAPE.
Configure the default retention policy to your longest recovery window egt 60 days.

RMAN>CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 60 DAYS;


This ensures that if 'delete obsolete' is run without any further specification, your highest retention policy is always observed.
The daily housekeeping routine will then delete obsolete tape backups using the default, and delete obsolete disk backups using an explicit recovery window overriding the default.
For example, if tapes are to be kept 28 days but disk backups are kept for just 7 days:

RMAN>DELETE OBSOLETE DEVICE TYPE  TAPE;
RMAN>DELETE OBSOLETE RECOVERY WINDOW OF 7 DAYS DEVICE TYPE DISK ;

RMAN> backup archivelog all delete input;
 
all, or   until time 'sysdate -7' 
 
RMAN> run {
backup archivelog all;
delete archivelog until time 'sysdate -1' like '/u01/archives/TEST/%';
delete archivelog until time 'sysdate -5' like '/u02/archives/TEST/%';
}

RMAN> run {
    allocate channel c1 type 'sbt_tape';
    set archivelog destination to '+FRA/TEST/ARCHIVELOG/2010_08_13';
    restore archivelog
         from time "to_date('13/08/2010-00:00:00','dd/mm/yyyy-hh24:mi:ss')"
         until time "to_date('14/08/2010-00:00:00','dd/mm/yyyy-hh24:mi:ss')";
  }

SQL>Select file_type, percent_space_used as used,percent_space_reclaimable as reclaimable,
    number_of_files as "number" from v$recovery_area_usage;
    


SQL> select name, space_limit as Total_size ,space_used as Used, 
    SPACE_RECLAIMABLE as reclaimable ,NUMBER_OF_FILES as "number" 
    from  V$RECOVERY_FILE_DEST;

 CROSSCHECK FOREIGN ARCHIVELOG ALL;
  DELETE EXPIRED FOREIGN ARCHIVELOG ALL;


 backup as compressed  backupset database plus archivelog ; 
 Delete obsolete device type disk;
crosscheck archivelog all

You have a number of choices on how to resolve a full Fast Recovery Area when no files are eligible for deletion:

1. Make more disk space available and increase DB_RECOVERY_FILE_DEST_SIZE

SQL> alter system set db_recovery_file_dest_size=xG SCOPE=BOTH;  -- (larger amount)

2. Move backups from the fast recovery area to tertiary storage such as tape.

RMAN>BACKUP RECOVERY AREA;

Note : Flashback logs cannot be backed up outside the recovery area and so are not backed up by BACKUP RECOVERY AREA.

3. Run DELETE for any files that have been removed with an operating system utility. If you use host operating system commands to delete files, then the database will not be aware of the resulting free space.

RMAN>CROSSCHECK BACKUP;
RMAN>CROSSCHECK ARCHIVELOG ALL;

RMAN>Delete expired backup;
RMAN>Delete expired archivelog all;
RMAN>Delete force obsolete;

4. Make sure that your guaranteed restore points are necessary. If not, delete them

SQL>Drop restore point <restore_point_name>;

5. If flashback logs are enable then make sure you have enough space for all the flashback logs. If its not required then you can turn off flashback.

SQL>Alter database FLASHBACK OFF;

6. Review your backup retention policy and if required change the RMAN RETENTION POLICY

RMAN>CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;

Exceptions :

- If RMAN is not part of backup strategy  and archivelogs are going to FRA then manual intervention  required for deletion of archivelogs. Periodically purse old archivelogs

for example

RMAN>Delete archivelog all completed before  'SYSDATE-7';

- By default RMAN backup goes to FRA. While taking RMAN backup if backup location explicitly specified to fast recovery area location then those backup pieces are not considered as part of FRA for auto management.

- For Archivelogs backup to FRA use USE_DB_RECOVERY_FILE_DEST rather than giving explicit path of FRA

SQL> alter system set log_archive_dest_10='LOCATION=USE_DB_RECOVERY_FILE_DEST'  scope=both;

------------------------archive log 备份

RMAN>  backup  as compressed  backupset archivelog all;

Starting backup at 02-DEC-23
current log archived
Finished Control File and SPFILE Autobackup at 02-DEC-23

RMAN>   delete noprompt force archivelog all   backed up 1 times to device type sbt;

没有可以删除的,因为只是备份到了disk

RMAN> run {
2> allocate channel ch00 device type 'SBT_TAPE'
3>     PARMS="SBT_LIBRARY=oracle.disksbt,
4>    ENV=(BACKUP_DIR=/nfs)";   
5>  backup recovery area ; }

released channel: ORA_DISK_1
allocated channel: ch00
channel ch00: SID=813 instance=cdb2 device type=SBT_TAPE
channel ch00: WARNING: Oracle Test Disk API

Starting backup at 02-DEC-23
specification does not match any datafile copy in the repository
skipping backup set key 82; already backed up 1 time(s)

channel ch00: starting archived log backup set
channel ch00: specifying archived log(s) in backup set
input archived log thread=2 sequence=39 RECID=407 STAMP=1154562772
input archived log thread=2 sequence=40 RECID=408 STAMP=1154562774
input archived log thread=2 sequence=41 RECID=409 STAMP=1154562778
input archived log thread=2 sequence=42 RECID=410 STAMP=1154562781
input archived log thread=2 sequence=43 RECID=411 STAMP=1154562795
channel ch00: starting piece 1 at 02-DEC-23
channel ch00: finished piece 1 at 02-DEC-23
piece handle=5f2d2eoi_175_1_1 tag=TAG20231202T235354 comment=API Version 2.0,MMS Version 8.1.3.0
 

RMAN>  delete noprompt force archivelog all   backed up 1 times to device type sbt;
Deleted 5 objects

删除了archivelog 但是磁盘和SBT都有一个备份


 

RMAN>  alter system switch logfile;

Statement processed 

RMAN>  run {
2>   allocate channel ch00 device type 'SBT_TAPE'
3>       PARMS="SBT_LIBRARY=oracle.disksbt,
4>      ENV=(BACKUP_DIR=/nfs)";   
5>    backup recovery area ; }

released channel: ORA_DISK_1
allocated channel: ch00
channel ch00: SID=813 instance=cdb2 device type=SBT_TAPE
channel ch00: WARNING: Oracle Test Disk API

Starting backup at 02-DEC-23
specification does not match any datafile copy in the repository 
skipping backup set key 99; already backed up 1 time(s)
channel ch00: starting archived log backup set
channel ch00: specifying archived log(s) in backup set
input archived log thread=2 sequence=44 RECID=412 STAMP=1154562880
input archived log thread=2 sequence=45 RECID=413 STAMP=1154562882
input archived log thread=2 sequence=46 RECID=414 STAMP=1154562887
channel ch00: starting piece 1 at 02-DEC-23
channel ch00: finished piece 1 at 02-DEC-23
piece handle=5j2d2eqt_179_1_1 tag=TAG20231202T235509 comment=API Version 2.0,MMS Version 8.1.3.0
channel ch00: backup set complete, elapsed time: 00:00:01
Finished backup at 02-DEC-23

Starting Control File and SPFILE Autobackup at 02-DEC-23
piece handle=c-2265125454-20231202-22 comment=API Version 2.0,MMS Version 8.1.3.0
Finished Control File and SPFILE Autobackup at 02-DEC-23
released channel: ch00

RMAN>  delete noprompt force archivelog all   backed up 1 times to device type sbt;
Deleted 3 objects

只是备份FRA,Archivelog也是FRA一部分,SBT上有一个备份,DISK上没有备份,删了就没了

RMAN> delete noprompt force archivelog all;

released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=813 instance=cdb2 device type=DISK
specification does not match any archived log in the repository

本地和FRA都没了,删不了。。。。。。。

RMAN>  alter system switch logfile;

RMAN>  run {
2>   allocate channel ch00 device type 'SBT_TAPE'
3>        PARMS="SBT_LIBRARY=oracle.disksbt,
4>      ENV=(BACKUP_DIR=/nfs)";   
5>    backup recovery area ; }

RMAN>  delete noprompt force archivelog all   backed up 1 times to device type  disk;

allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=813 instance=cdb2 device type=DISK

-----disk 确实没有备份,删除策略不生效

RMAN> backup recovery area; --------------backup fra 到disk 不行

RMAN>  backup recovery area device type disk;

Starting backup at 02-DEC-23
using channel ORA_DISK_1
specification does not match any datafile copy in the repository
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup command at 12/02/2023 23:56:56
RMAN-06603: TO DESTINATION option must be specified with RECOVERY AREA, RECOVERY FILES or DB_RECOVERY_FILE_DEST on disk device
RMAN-01007: at line 1 column 22 file: standard input

RMAN>  delete noprompt force archivelog all   backed up 1 times to device type  disk;

released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=813 instance=cdb2 device type=DISK

---备份到本地可以删除也可以本地恢复

RMAN> backup archivelog all;
Finished Control File and SPFILE Autobackup at 02-DEC-23

RMAN>  delete noprompt force archivelog all   backed up 1 times to device type  disk;

Deleted 5 objects

RMAN>  restore archivelog  from sequence 47 thread 2;

Starting restore at 02-DEC-23
using channel ORA_DISK_1

channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=2 sequence=47
channel ORA_DISK_1: restoring archived log
archived log thread=2 sequence=48
channel ORA_DISK_1: restoring archived log
archived log thread=2 sequence=49
channel ORA_DISK_1: restoring archived log
archived log thread=2 sequence=50
channel ORA_DISK_1: restoring archived log
archived log thread=2 sequence=51
channel ORA_DISK_1: reading from backup piece +DATA1/CDB/BACKUPSET/2023_12_02/annnf0_tag20231202t235747_0.318.1154516267
channel ORA_DISK_1: piece handle=+DATA1/CDB/BACKUPSET/2023_12_02/annnf0_tag20231202t235747_0.318.1154516267 tag=TAG20231202T235747
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 02-DEC-23

RMAN>

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/191928.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

蓝桥杯day04——查询后矩阵的和

1.题目 给你一个整数 n 和一个下标从 0 开始的 二维数组 queries &#xff0c;其中 queries[i] [typei, indexi, vali] 。 一开始&#xff0c;给你一个下标从 0 开始的 n x n 矩阵&#xff0c;所有元素均为 0 。每一个查询&#xff0c;你需要执行以下操作之一&#xff1a; …

已知二叉树采用顺序存储,求编号为i和j的结点的最近公共祖先结点编号。

题目描述&#xff1a;已知二叉树采用顺序存储&#xff0c;求编号为 i和j的结点的最近公共祖先结点编号。 分析&#xff1a; 令两个下标从两个初始点开始&#xff0c;你追我赶的交替向上&#xff0c;直到在某地相遇。即先令较大的下标&#xff08;对应位置较低的点&#xff09;…

C++作业2

自己封装一个矩形类(Rect)&#xff0c;拥有私有属性:宽度(width)、高度(height)&#xff0c; 定义公有成员函数: 初始化函数:void init(int w, int h) 更改宽度的函数:set_w(int w) 更改高度的函数:set_h(int h) 输出该矩形的周长和面积函数:void show() 代码&#xff1a…

数字图像处理(实践篇)十七 Shi-Tomasi 角点检测

目录 一 涉及的函数 二 实践 在使用OpenCV之前&#xff0c;需要先安装相关的库和依赖项&#xff0c;命令如下所示&#xff1a; # 安装OpenCV的基础版pip install opencv-python# 安装OpenCV的扩展版pip install opencv-contrib-python 一 涉及的函数 OpenCV 提供了cv2.goo…

gitee仓库使用教程

目录 一、项目与仓库映射 二、git常用命令的用法 一、项目与仓库映射 下载安装git&#xff1b;在本地项目文件夹右击鼠标点击Git Bash Here;输入git init&#xff0c;这个目录变成git可以管理的仓库&#xff0c;会出现一个.git文件夹&#xff0c;如果没出现的话需要选择“显…

DAPP开发【02】Remix使用

系列文章目录 系列文章在DAPP开发专栏 文章目录 系列文章目录使用部署测试网上本地项目连接remix本地项目连接remix 使用 创建一个新的工作空间 部署测试网上 利用metaMask连接测试网络 添加成功&#xff0c;添加时需要签名 即可进行编译 即可部署 本地项目连接remix 方…

探秘RabbitMQ:社区插件与扩展的奇妙世界【RabbitMQ 三】

&#x1f38f;&#xff1a;你只管努力&#xff0c;剩下的交给时间 &#x1f3e0; &#xff1a;小破站 探秘RabbitMQ&#xff1a;社区插件与扩展的奇妙世界 前言第一&#xff1a;RabbitMQ社区插件简介第二&#xff1a;高级队列插件特性实现延迟队列 - rabbitmq_delayed_message_…

Pytorch 中的 Hook 机制

Hook 是 PyTorch 中⼀个⼗分有⽤的特性。利⽤它&#xff0c;我们可以不必改变⽹络输⼊输出的结构&#xff0c;⽅便地获取、改变⽹络中间层变量的值和梯度。这个功能被⼴泛⽤于可视化神经⽹络中间层的feature、gradient&#xff0c;从⽽诊断神经⽹络中可能出现的问题&#xff0c…

JVM内存结构

一、 整体结构 .java文件被javac编译成.class字节码文件。 .class文件再由JVM编译成设用于具体系统的机器码文件 下图即JVM编译.class文件的过程 JVM分为 类加载器&#xff0c; 内存结构&#xff0c; 执行引擎三部分 一、类加载器负责加载二进制字节码文件 二、方法区存储类…

反序列化漏洞(二)

目录 pop链前置知识&#xff0c;魔术方法触发规则 pop构造链解释&#xff08;开始烧脑了&#xff09; 字符串逃逸基础 字符减少 字符串逃逸基础 字符增加 实例获取flag 字符串增多逃逸 字符串减少逃逸 延续反序列化漏洞(一)的内容 pop链前置知识&#xff0c;魔术方法触…

【Excel/Matlab】绘x-y图并求切线和截距(详细图解)

最近做大物实验数据较多&#xff0c;手绘图比较麻烦且不精确&#xff0c;所以开始用电脑作图&#xff0c;粗浅记录一下。 方法一 excel &#xff08;简单快捷&#xff09; 1 录入数据 在excel中录入数据 2 生成平滑线散点图 选中录入的所有数据->右键点击快速分析->选择…

TCP_握手+挥手过程状态变化分析

TCP状态解读 握手挥手过程状态变化 同时握手 双发同时发起syn请求&#xff0c;状态变化过程如下&#xff1a; 图片来源&#xff1a;http://www.tcpipguide.com/free/t_TCPConnectionEstablishmentProcessTheThreeWayHandsh-4.htm 同时挥手 4次挥手&#xff0c;可以理解为2…

Linux的权限(一)

目录 权限的本质 Linux权限的概念 如何创建与删除普通用户 创建普通用户&#xff1a; 设置用户密码&#xff1a; 删除普通用户&#xff1a; 删除与该用户关联的主目录和邮件目录 &#xff1a; su指令 sudo指令 Linux权限管理 Linux中文件访问者有三种“人” Linux…

使用 Go 构建高性能的命令行工具

命令行工具&#xff08;CLI&#xff09;在软件开发中扮演着重要的角色&#xff0c;尤其是在自动化工具、开发工具链和服务器管理等领域。Go 语言以其简洁性和高性能而闻名&#xff0c;非常适合用来创建强大且高效的 CLI 工具。本文将详细介绍如何使用 Go 语言来构建 CLI 应用&a…

DL中的GPU使用问题

写在前面 在使用GPU进行深度学习训练经常会遇到下面几个问题&#xff0c;这里做一个解决方法的汇总。 &#x1f415;Q1&#x1f415;&#xff1a;在一个多卡服务器上&#xff0c;指定了cuda:1&#xff0c;但是0号显卡显存还是会被占用一定量的显存。 这个问题很经典的出现场景就…

甄知黄建华:从“天赋平平”到IT行业“六边形战士”,探索出企业数智化转型的“强IT”之路

本期我们先抛开人物和主体不表&#xff0c;从大环境开始谈起。随着科技的快速发展和全球商业环境的不断变化&#xff0c;中国企业对灵活性、创新性、全球化和效率的需求是迫切的&#xff0c;进行数字化转型来支撑企业的业务变革、组织优化已是业界共识。如何根据企业的实际情况…

【Element-ui】Element-ui是什么?如何安装

文章目录 前言一. 什么是Element UI?二. 安装Element UI2.1 安装方法12.2 安装方法2 三、引入Element3.1 完整引入3.2 按需引入 总结 前言 在Web开发中&#xff0c;使用现成的UI组件库能够极大地提高开发效率。而Element UI&#xff08;饿了么团队开发的一套基于Vue.js的UI组…

锐捷EWEB网管系统 RCE漏洞复现

0x01 产品简介 锐捷网管系统是由北京锐捷数据时代科技有限公司开发的新一代基于云的网络管理软件&#xff0c;以“数据时代创新网管与信息安全”为口号&#xff0c;定位于终端安全、IT运营及企业服务化管理统一解决方案。 0x02 漏洞概述 Ruijie-EWEB 网管系统 flwo.control.ph…

定时任务特辑 | Quartz、xxl-job、elastic-job、Cron四个定时任务框架对比,和Spring Boot集成实战

专栏集锦&#xff0c;大佬们可以收藏以备不时之需&#xff1a; Spring Cloud 专栏&#xff1a;http://t.csdnimg.cn/WDmJ9 Python 专栏&#xff1a;http://t.csdnimg.cn/hMwPR Redis 专栏&#xff1a;http://t.csdnimg.cn/Qq0Xc TensorFlow 专栏&#xff1a;http://t.csdni…

Docker从入门到实战:Docker快速部署、Dockerfile编写、容器间通信及共享数据实战、Docker-compose详解

文章目录 一、基本概念1、体系结构2、容器与镜像1&#xff09;镜像2&#xff09;容器a、容器内部结构b、容器生命周期 3、执行流程 二、常用命令docker pull 镜像名<:tags> &#xff1a;从远程仓库抽取镜像docker images&#xff1a;查看本地镜像docker run 镜像名<:t…