搜索
首页数据库mysql教程RMAN异机恢复目录不同--set newname datafile

RMAN异机恢复mdash;mdash;目录不同--set newname datafile

今天想要做下异机恢复,,由于原库与现库的目录不同,所以要转换一下。脑中第一反应就是db_file_name_convert,可是设置好这个参数之后发现不行,restore根本没有转换,还会报错:

channel ORA_DISK_1: reading from backup piece /orabak/Oracle_bak/fullrac_EPTDB_821_1_20130802
ORA-19870: error reading backup piece /orabak/oracle_bak/fullrac_EPTDB_821_1_20130802
ORA-19504: failed to create file "/dev/rrac_lv02_20g"
ORA-27040: file create error, unable to create file
IBM AIX RISC System/6000 Error: 13: Permission denied
 

于是查了下db_file_name_convert这个参数。 

DB_FILE_NAME_CONVERT

PropertyDescription

Parameter type String

Syntax DB_FILE_NAME_CONVERT = 'string1' , 'string2' , 'string3' , 'string4' , ...

Where:

  • string1 is the pattern of the primary database filename

  • string2 is the pattern of the standby database filename

  • string3 is the pattern of the primary database filename

  • string4 is the pattern of the standby database filename

  • You can use as many pairs of primary and standby replacement strings as required. You can use single or double quotation marks.

    The following are example settings that are acceptable:

    DB_FILE_NAME_CONVERT = '/dbs/t1/','/dbs/t1/s_','dbs/t2/ ','dbs/t2/s_'

    Default value There is no default value.

    Modifiable ALTER SESSION

    Basic No

    DB_FILE_NAME_CONVERT is useful for creating a duplicate database for recovery purposes. It converts the filename of a new datafile on the primary database to a filename on the standby database. If you add a datafile to the primary database, you must add a corresponding file to the standby database. When the standby database is updated, this parameter converts the datafile name on the primary database to the datafile name on the standby database. The file on the standby database must exist and be writable, or the recovery process will halt with an error.

    If you specify an odd number of strings (the last string has no corresponding replacement string), an error is signalled during startup. If the filename being converted matches more than one pattern in the pattern/replace string list, the first matched pattern takes effect. There is no limit on the number of pairs that you can specify in this parameter (other than the hard limit of the maximum length of multivalue parameters).

    Set the value of this parameter to two strings. The first string is the pattern found in the datafile names on the primary database. The second string is the pattern found in the datafile names on the standby database.

    You can also use DB_FILE_NAME_CONVERT to rename the datafiles in the clone control file when setting up a clone database during tablespace point-in-time recovery.

    可以看出,这个参数只能在建立备库使用,在做异机恢复时该参数不起作用。

    于是只能用set newname datafile 1 to ‘…’;之后再restore,restore之后需要switch datafile all;
    run
    {
    set newname for datafile 1 to '/ora/oradata/eptdb/rrac_system_2g';
    set newname for datafile 2 to '/ora/oradata/eptdb/rrac_undo1_5g';
    restore database;
    switch datafile all;
    }

    操作成功,没有报错!

    推荐阅读:

    Oracle基础教程之通过RMAN复制数据库

    RMAN备份策略制定参考内容

    RMAN备份学习笔记

    Oracle数据库备份加密 RMAN加密

    linux

    声明
    本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
    如何使用Alter Table语句在MySQL中更改表?如何使用Alter Table语句在MySQL中更改表?Mar 19, 2025 pm 03:51 PM

    本文讨论了使用MySQL的Alter Table语句修改表,包括添加/删除列,重命名表/列以及更改列数据类型。

    如何为MySQL连接配置SSL/TLS加密?如何为MySQL连接配置SSL/TLS加密?Mar 18, 2025 pm 12:01 PM

    文章讨论了为MySQL配置SSL/TLS加密,包括证书生成和验证。主要问题是使用自签名证书的安全含义。[角色计数:159]

    您如何处理MySQL中的大型数据集?您如何处理MySQL中的大型数据集?Mar 21, 2025 pm 12:15 PM

    文章讨论了处理MySQL中大型数据集的策略,包括分区,碎片,索引和查询优化。

    哪些流行的MySQL GUI工具(例如MySQL Workbench,PhpMyAdmin)是什么?哪些流行的MySQL GUI工具(例如MySQL Workbench,PhpMyAdmin)是什么?Mar 21, 2025 pm 06:28 PM

    文章讨论了流行的MySQL GUI工具,例如MySQL Workbench和PhpMyAdmin,比较了它们对初学者和高级用户的功能和适合性。[159个字符]

    如何使用Drop Table语句将表放入MySQL中?如何使用Drop Table语句将表放入MySQL中?Mar 19, 2025 pm 03:52 PM

    本文讨论了使用Drop Table语句在MySQL中放下表,并强调了预防措施和风险。它强调,没有备份,该动作是不可逆转的,详细介绍了恢复方法和潜在的生产环境危害。

    如何在JSON列上创建索引?如何在JSON列上创建索引?Mar 21, 2025 pm 12:13 PM

    本文讨论了在PostgreSQL,MySQL和MongoDB等各个数据库中的JSON列上创建索引,以增强查询性能。它解释了索引特定的JSON路径的语法和好处,并列出了支持的数据库系统。

    您如何用外国钥匙代表关系?您如何用外国钥匙代表关系?Mar 19, 2025 pm 03:48 PM

    文章讨论了使用外国密钥来代表数据库中的关系,重点是最佳实践,数据完整性和避免的常见陷阱。

    如何保护MySQL免受常见漏洞(SQL注入,蛮力攻击)?如何保护MySQL免受常见漏洞(SQL注入,蛮力攻击)?Mar 18, 2025 pm 12:00 PM

    文章讨论了使用准备好的语句,输入验证和强密码策略确保针对SQL注入和蛮力攻击的MySQL。(159个字符)

    See all articles

    热AI工具

    Undresser.AI Undress

    Undresser.AI Undress

    人工智能驱动的应用程序,用于创建逼真的裸体照片

    AI Clothes Remover

    AI Clothes Remover

    用于从照片中去除衣服的在线人工智能工具。

    Undress AI Tool

    Undress AI Tool

    免费脱衣服图片

    Clothoff.io

    Clothoff.io

    AI脱衣机

    AI Hentai Generator

    AI Hentai Generator

    免费生成ai无尽的。

    热门文章

    R.E.P.O.能量晶体解释及其做什么(黄色晶体)
    3 周前By尊渡假赌尊渡假赌尊渡假赌
    R.E.P.O.最佳图形设置
    3 周前By尊渡假赌尊渡假赌尊渡假赌
    R.E.P.O.如果您听不到任何人,如何修复音频
    3 周前By尊渡假赌尊渡假赌尊渡假赌

    热工具

    螳螂BT

    螳螂BT

    Mantis是一个易于部署的基于Web的缺陷跟踪工具,用于帮助产品缺陷跟踪。它需要PHP、MySQL和一个Web服务器。请查看我们的演示和托管服务。

    MinGW - 适用于 Windows 的极简 GNU

    MinGW - 适用于 Windows 的极简 GNU

    这个项目正在迁移到osdn.net/projects/mingw的过程中,你可以继续在那里关注我们。MinGW:GNU编译器集合(GCC)的本地Windows移植版本,可自由分发的导入库和用于构建本地Windows应用程序的头文件;包括对MSVC运行时的扩展,以支持C99功能。MinGW的所有软件都可以在64位Windows平台上运行。

    SublimeText3 Mac版

    SublimeText3 Mac版

    神级代码编辑软件(SublimeText3)

    SublimeText3 英文版

    SublimeText3 英文版

    推荐:为Win版本,支持代码提示!

    禅工作室 13.0.1

    禅工作室 13.0.1

    功能强大的PHP集成开发环境