Maison base de données tutoriel mysql RMAN异机恢复目录不同--set newname datafile

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

Jun 07, 2016 pm 05:31 PM

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

    Déclaration de ce site Web
    Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn

    Article chaud

    Repo: Comment relancer ses coéquipiers
    3 Il y a quelques semaines By 尊渡假赌尊渡假赌尊渡假赌
    R.E.P.O. Crystals d'énergie expliqués et ce qu'ils font (cristal jaune)
    1 Il y a quelques semaines By 尊渡假赌尊渡假赌尊渡假赌
    Hello Kitty Island Adventure: Comment obtenir des graines géantes
    3 Il y a quelques semaines By 尊渡假赌尊渡假赌尊渡假赌
    Combien de temps faut-il pour battre Split Fiction?
    3 Il y a quelques semaines By DDD

    Article chaud

    Repo: Comment relancer ses coéquipiers
    3 Il y a quelques semaines By 尊渡假赌尊渡假赌尊渡假赌
    R.E.P.O. Crystals d'énergie expliqués et ce qu'ils font (cristal jaune)
    1 Il y a quelques semaines By 尊渡假赌尊渡假赌尊渡假赌
    Hello Kitty Island Adventure: Comment obtenir des graines géantes
    3 Il y a quelques semaines By 尊渡假赌尊渡假赌尊渡假赌
    Combien de temps faut-il pour battre Split Fiction?
    3 Il y a quelques semaines By DDD

    Tags d'article chaud

    Bloc-notes++7.3.1

    Bloc-notes++7.3.1

    Éditeur de code facile à utiliser et gratuit

    SublimeText3 version chinoise

    SublimeText3 version chinoise

    Version chinoise, très simple à utiliser

    Envoyer Studio 13.0.1

    Envoyer Studio 13.0.1

    Puissant environnement de développement intégré PHP

    Dreamweaver CS6

    Dreamweaver CS6

    Outils de développement Web visuel

    SublimeText3 version Mac

    SublimeText3 version Mac

    Logiciel d'édition de code au niveau de Dieu (SublimeText3)

    Réduisez l'utilisation de la mémoire MySQL dans Docker Réduisez l'utilisation de la mémoire MySQL dans Docker Mar 04, 2025 pm 03:52 PM

    Réduisez l'utilisation de la mémoire MySQL dans Docker

    Comment modifier une table dans MySQL en utilisant l'instruction ALTER TABLE? Comment modifier une table dans MySQL en utilisant l'instruction ALTER TABLE? Mar 19, 2025 pm 03:51 PM

    Comment modifier une table dans MySQL en utilisant l'instruction ALTER TABLE?

    Comment résoudre le problème de MySQL ne peut pas ouvrir la bibliothèque partagée Comment résoudre le problème de MySQL ne peut pas ouvrir la bibliothèque partagée Mar 04, 2025 pm 04:01 PM

    Comment résoudre le problème de MySQL ne peut pas ouvrir la bibliothèque partagée

    Qu'est-ce que Sqlite? Aperçu complet Qu'est-ce que Sqlite? Aperçu complet Mar 04, 2025 pm 03:55 PM

    Qu'est-ce que Sqlite? Aperçu complet

    Exécutez MySQL dans Linux (avec / sans conteneur Podman avec phpmyadmin) Exécutez MySQL dans Linux (avec / sans conteneur Podman avec phpmyadmin) Mar 04, 2025 pm 03:54 PM

    Exécutez MySQL dans Linux (avec / sans conteneur Podman avec phpmyadmin)

    Exécuter plusieurs versions MySQL sur macOS: un guide étape par étape Exécuter plusieurs versions MySQL sur macOS: un guide étape par étape Mar 04, 2025 pm 03:49 PM

    Exécuter plusieurs versions MySQL sur macOS: un guide étape par étape

    Quels sont les outils de GUI MySQL populaires (par exemple, MySQL Workbench, PhpMyAdmin)? Quels sont les outils de GUI MySQL populaires (par exemple, MySQL Workbench, PhpMyAdmin)? Mar 21, 2025 pm 06:28 PM

    Quels sont les outils de GUI MySQL populaires (par exemple, MySQL Workbench, PhpMyAdmin)?

    Comment configurer le cryptage SSL / TLS pour les connexions MySQL? Comment configurer le cryptage SSL / TLS pour les connexions MySQL? Mar 18, 2025 pm 12:01 PM

    Comment configurer le cryptage SSL / TLS pour les connexions MySQL?

    See all articles