PITR 回复PDB 如何配置 channel CONFIGURE DEVICE TYPE

Point In Time Recovery On Pluggable Database CONFIGURE DEVICE TYPE

For the purposes of this document, the following fictitious environment is used as an example to describe the procedure:

Pluggable Database Name: TEST_PDB

********************* 

Patch 19809171 applied but still facing RMAN-06813 

run {
allocate channel ch1 device type disk;
set until time='15:11:17 11:26:00';
restore pluggable database TEST_PDB;
recover pluggable database TEST_PDB;
alter pluggable database TEST_PDB open resetlogs;
release channel ch1;
}

...

Starting restore at 2017-11-15_11:53:43
released channel: ch1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 11/15/2017 11:53:43
RMAN-06813: could not translate pluggable database TEST_PDB

Cause

 Incorrect command followed to recover dropped PDB after applying patch 19809171

不需要先restore,CDB里面没有pdb的信息了

Solution

 Try below command to recover dropped PDB

CONFIGURE DEVICE TYPE DISK PARALLELISM 4 BACKUP TYPE TO BACKUPSET;
run {
set until time='15:11:17 11:26:00';
recover pluggable database TEST_PDB;
}

 There might be chance that you may encounter RMAN-00600 [7038] [pdbpitr_recover3] during the recovery .In that case suggest to refer document 2329008.1 for the workaround / fix 

         RMAN-00600 [7038] [pdbpitr_recover3] (Doc ID 2329008.1)

------------------------------

Symptoms

PDB(Pluggable database) PITR fails with below error

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 01/20/2017 09:55:29
RMAN-03015: error occurred in stored script Memory Script
RMAN-06034: at least 1 channel must be allocated to execute this command

Changes

Cause

NOTE: In the images and/or the document content below, the user information and environment data used represents fictitious data from the Oracle sample schema(s), Public Documentation delivered with an Oracle database product or other training material.  Any similarity to actual environments, actual persons, living or dead, is purely coincidental and not intended in any manner.

The issue is caused because Manual channels have been allocated for PDB PITR .

 PDB PITR creates creates auxiliary instance automatically which does  the Point in time recovery using automatic channels based on the configuration information in Rman.

run {

allocate channel t1 type 'sbt_tape';
allocate channel t2 type 'sbt_tape';
set until time "to_date('JAN 12 2017 03:00:00','MON DD YYYY HH24:MI:SS')";
restore pluggable database <pdb_name>;
recover pluggable database <pdb_name>;
alter pluggable database <pdb_name> open resetlogs; }

Solution

You cannot manually allocate a channel when RMAN will implicitly create the auxiliary instance.

Solution in this case :-


Disk backup
-----------------

If the backups are available on disk and your disk channels have been configured as default you can run the below

run { set until time "to_date('JAN 12 2017 03:00:00','MON DD YYYY HH24:MI:SS')";
restore pluggable database <pdb_name>;
recover pluggable database <pdb_name>;
alter pluggable database <pdb_name> open resetlogs; }

Sbt backup
--------------------

If the backups are on Tape and you have default channel in Rman configuration set to disk then change it temporarily to sbt

Rman> Connect target /

Rman>show device type;

Rman> CONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE' send 'NB_ORA_POLICY................<as per your configuration>.....'   ;

Re-run the PDB PITR without any channels

run { set until time "to_date('JAN 12 2017 03:00:00','MON DD YYYY HH24:MI:SS')";
restore pluggable database <pdb_name>;
recover pluggable database <pdb_name>;
alter pluggable database <pdb_name> open resetlogs; }


In this Document

  • 6
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
对于 PostgreSQL 的 PITR (Point-In-Time Recovery),备份和恢复的方法如下: 备份: 1. 首先,在 PostgreSQL 中开启 WAL 日志功能,通过修改 postgresql.conf 文件中的 `wal_level` 参数为 `replica` 或 `logical`。 2. 然后,在 pg_hba.conf 文件中添加一个用于备份的用户,并授权该用户访问需要备份的数据库。 3. 运行以下命令备份 WAL 日志文件: ``` pg_basebackup -X stream -U backup_user -D /path/to/backup/directory -P ``` 其中,`backup_user` 是在 pg_hba.conf 文件中添加的备份用户,`/path/to/backup/directory` 是备份文件保存的目录。 4. 定期备份 `pg_xlog` 目录下的 WAL 日志文件。 恢复: 1. 首先,停止 PostgreSQL 数据库。 2. 将备份文件复制到 PostgreSQL 数据库的数据目录中。 3. 将备份文件中的 `pg_xlog` 目录下的 WAL 日志文件复制到数据库数据目录的 `pg_xlog` 目录下。 4. 启动 PostgreSQL 数据库并执行以下命令: ``` pg_resetxlog -f /path/to/data/directory ``` 其中,`/path/to/data/directory` 是数据库数据目录的路径。 5. 然后,通过以下命令将数据库恢复到指定的时间点: ``` pg_restore -U postgres -d database_name -t table_name -I backup_file -c -n public -j 4 -v -F c -h localhost -p 5432 --time='YYYY-MM-DD HH24:MI:SS' ``` 其中,`database_name` 是要恢复的数据库名称,`table_name` 是要恢复的表名称,`backup_file` 是备份文件的名称,`--time` 参数指定要恢复到的时间点,格式为 `YYYY-MM-DD HH24:MI:SS`。 以上就是 PostgreSQL PITR 的备份和恢复方法。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值