rman SBT_TAPE NFS disk 模拟NBU带库 FRA

2023-12-03 08:45

本文主要是介绍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>

这篇关于rman SBT_TAPE NFS disk 模拟NBU带库 FRA的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/448828

相关文章

【C++】_list常用方法解析及模拟实现

相信自己的力量,只要对自己始终保持信心,尽自己最大努力去完成任何事,就算事情最终结果是失败了,努力了也不留遗憾。💓💓💓 目录   ✨说在前面 🍋知识点一:什么是list? •🌰1.list的定义 •🌰2.list的基本特性 •🌰3.常用接口介绍 🍋知识点二:list常用接口 •🌰1.默认成员函数 🔥构造函数(⭐) 🔥析构函数 •🌰2.list对象

usaco 1.2 Transformations(模拟)

我的做法就是一个一个情况枚举出来 注意计算公式: ( 变换后的矩阵记为C) 顺时针旋转90°:C[i] [j]=A[n-j-1] [i] (旋转180°和270° 可以多转几个九十度来推) 对称:C[i] [n-j-1]=A[i] [j] 代码有点长 。。。 /*ID: who jayLANG: C++TASK: transform*/#include<

hdu4431麻将模拟

给13张牌。问增加哪些牌可以胡牌。 胡牌有以下几种情况: 1、一个对子 + 4组 3个相同的牌或者顺子。 2、7个不同的对子。 3、13幺 贪心的思想: 对于某张牌>=3个,先减去3个相同,再组合顺子。 import java.io.BufferedInputStream;import java.io.BufferedReader;import java.io.IOExcepti

rman compress

级别         初始         备完    耗时    low          1804       3572    0:10     High         1812       3176   2:00     MEDIUM  1820       3288    0:13    BASIC      1828   3444    0:56 ---不如MEDIUM,

【每日一题】LeetCode 2181.合并零之间的节点(链表、模拟)

【每日一题】LeetCode 2181.合并零之间的节点(链表、模拟) 题目描述 给定一个链表,链表中的每个节点代表一个整数。链表中的整数由 0 分隔开,表示不同的区间。链表的开始和结束节点的值都为 0。任务是将每两个相邻的 0 之间的所有节点合并成一个节点,新节点的值为原区间内所有节点值的和。合并后,需要移除所有的 0,并返回修改后的链表头节点。 思路分析 初始化:创建一个虚拟头节点

每日一题|牛客竞赛|四舍五入|字符串+贪心+模拟

每日一题|四舍五入 四舍五入 心有猛虎,细嗅蔷薇。你好朋友,这里是锅巴的C\C++学习笔记,常言道,不积跬步无以至千里,希望有朝一日我们积累的滴水可以击穿顽石。 四舍五入 题目: 牛牛发明了一种新的四舍五入应用于整数,对个位四舍五入,规则如下 12345->12350 12399->12400 输入描述: 输入一个整数n(0<=n<=109 ) 输出描述: 输出一个整数

【算法专场】模拟(下)

目录 前言 38. 外观数列 算法分析 算法思路 算法代码 1419. 数青蛙 算法分析 算法思路 算法代码  2671. 频率跟踪器 算法分析 算法思路 算法代码 前言 在前面我们已经讲解了什么是模拟算法,这篇主要是讲解在leetcode上遇到的一些模拟题目~ 38. 外观数列 算法分析 这道题其实就是要将连续且相同的字符替换成字符重复的次数+

模拟实现vector中的常见接口

insert void insert(iterator pos, const T& x){if (_finish == _endofstorage){int n = pos - _start;size_t newcapacity = capacity() == 0 ? 2 : capacity() * 2;reserve(newcapacity);pos = _start + n;//防止迭代

开发板NFS挂载文件目录

文章目录 序NFS1. 安装 NFS 服务器和客户端在服务器上(NFS 服务器端)在客户端上(NFS 客户端) 2. 配置 NFS 服务器创建共享目录编辑 `/etc/exports` 文件启动 NFS 服务 3. 在客户端挂载 NFS 共享创建挂载点挂载 NFS 共享验证挂载 4. 设置开机自动挂载5. 解决权限问题 序 本节主要实现虚拟机(服务器)与开发板(客户端)通过N

PHP实现二叉树遍历(非递归方式,栈模拟实现)

二叉树定义是这样的:一棵非空的二叉树由根结点及左、右子树这三个基本部分组成,根据节点的访问位置不同有三种遍历方式: ① NLR:前序遍历(PreorderTraversal亦称(先序遍历)) ——访问结点的操作发生在遍历其左右子树之前。 ② LNR:中序遍历(InorderTraversal) ——访问结点的操作发生在遍历其左右子树之中(间)。 ③ LRN:后序遍历(PostorderT