pdb做不完全恢复
1.数据库全备份
run
{
allocate channel ch1 device type disk;
allocate channel ch2 device type disk;
allocate channel ch3 device type disk;
backup as compressed backupset full filesperset 10 database format '/u01/rmanbak/fullbk_%d_%s_%u_%T.bak';
sql 'alter system archive log current';
backup as compressed backupset archivelog all format '/u01/rmanbak/daily_arch_%d_%s_%u_%T.bak' delete input;
backup current controlfile format '/u01/rmanbak/daily_ctl_%d_%s_%u_%T.bak';
backup spfile format '/u01/rmanbak/daily_spfile_%d_%s_%u_%T.bak';
release channel ch1;
release channel ch2;
release channel ch3;
crosscheck backup;
crosscheck archivelog all;
delete noprompt expired backup;
delete noprompt obsolete;
}
或者是单个pdb备份
run
{
allocate channel ch1 device type disk;
allocate channel ch2 device type disk;
allocate channel ch3 device type disk;
backup as compressed backupset full filesperset 10 pluggable database pdb format '/u01/rmanbak/pdbbak/pdb_fullbk_%d_%s_%u_%T.bak';
sql 'alter system archive log current';
backup as compressed backupset archivelog all format '/u01/rmanbak/pdbbak/daily_arch_%d_%s_%u_%T.bak' delete input;
backup current controlfile format '/u01/rmanbak/pdbbak/daily_ctl_%d_%s_%u_%T.bak';
backup spfile format '/u01/rmanbak/pdbbak/daily_spfile_%d_%s_%u_%T.bak';
release channel ch1;
release channel ch2;
release channel ch3;
crosscheck backup;
crosscheck archivelog all;
delete noprompt expired backup;
delete noprompt obsolete;
}
2.执行不完全恢复
关闭pdb
alter pluggable database pdb close immediate;
删除该pdb的数据文件
[oracle@19c pdbbak]$ cd /u01/app/oracle/oradata/ora19c/pdb
[oracle@19c pdb]$ rm *.dbf
创建辅佐目录
mkdir -p /u01/recover
执行不完全恢复
基于scn(可行)
run{
set until scn 1498061;
restore pluggable database pdb;
recover pluggable database pdb auxiliary destination '/u01/recover';
}
基于时间点(可行)
RMAN>
run{
set until time "TO_DATE('2023-04-12 22:11:00','YYYY-MM-DD HH24:MI:SS')";
restore pluggable database pdb;
recover pluggable database pdb auxiliary destination '/u01/recover';
}
基于sequence(执行报错)
RMAN>
run{
set until sequence 24 thread 1;
restore pluggable database pdb;
recover pluggable database pdb auxiliary destination '/u01/recover';
}
报错信息如下:
Starting recover at 12-APR-23
Segmentation fault (core dumped)
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
2022-04-13 安装npm
2022-04-13 bigkey和hotkey