DBAsupport.com Forums - Powered by vBulletin
Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Duplicate Database - RMAN - 10.2.0.4 - script error

  1. #1
    Join Date
    Mar 2011
    Posts
    9

    Duplicate Database - RMAN - 10.2.0.4 - script error

    This is my first time posting, so thanks all for this venue!

    My cohort has been working on a script to duplicate a 10.2. oracle database using rman from target prod(different host) to auxiliary test using rman and NetBackup. (all aix) The directory structure is different on both so we use the convert commands in the run script:

    clone/staging/rman_commands.lst
    connect target 'sys/targetpw@hostP'
    connect catalog 'rmanprod/rmanpw@rmanP'
    connect auxiliary 'sys/auxpw@hostT'
    run {
    allocate auxiliary channel 'aux_01' type sbt;
    allocate auxiliary channel 'aux_02' type sbt;
    send 'NB_ORA_CLIENT=hostP.corp.dom';
    set until time "to_date('24-Jun-11 10:22:00','DD-MON-YY HH24:MI:SS')";
    duplicate target database to auxT nofilenamecheck;
    set db_file_name_convert =
    '/instP_oradata/oradata/','/instT_oradata/oradata/'
    set log_file_name_convert =
    '/instP_oradata/oradata/','/instT_oradata/oradata/'
    release channel aux_01;
    release channel aux_02;
    }

    but we are getting this error message:

    RMAN> connect target *
    2> connect catalog *
    3> connect auxiliary *
    4> run {
    5> allocate auxiliary channel 'aux_01' type sbt;
    6> allocate auxiliary channel 'aux_02' type sbt;
    7>
    8> send 'NB_ORA_CLIENT=hostP.corp.dom';
    9> set until time "to_date('24-Jun-11 10:22:00','DD-MON-YY HH24:MI:SS')";
    10> duplicate target database to auxT nofilenamecheck;
    11> set db_file_name_convert
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-00558: error encountered while parsing input commands
    RMAN-01009: syntax error: found "db_file_name_convert": expecting one of: "archivelog, auxiliary, auxname, autolocate, autobackup, backup, command, controlfile, clonename, decryption, dbid, duplex, echo, encryption, high, limit, maxcorrupt, maxseq, newname, nocfau, parallelmediarestore, rpc, snapshot, until"

    I have a couple of questions:

    1) these are two different hosts, but the file system names are different, should we be using nofilenamecheck?
    2) when doing a cat of the spfile, even though we put the convert commands in the pfile and then created the spfile from the pfile, it doesn't show the convert commands.
    3) can you use set commands in a run block for convert or should they just be in the pfile?

    The basic path of what we are doing is:

    create pfile with the last two commands of db_file_name_convert and log_file_name_convert

    verify the password file

    stop the listener (aux db)

    shutdown immediate (aux db)

    startup nomount with new pfile (aux db)

    create spfile from new pfile (aux db)

    shutdown abort (aux db)

    startup (aux db)

    start listener

    run rman{ run block command - see above} --THIS IS WHERE WE ARE STUCK

    --duplicate -- duplicate -- duplicate ---
    success!

    stop the listener (aux db)

    shutdown immediate (aux db)

    startup nomount with new pfile (aux db)

    create spfile from new pfile (aux db)

    shutdown abort (aux db)

    startup (aux db)

    start listener (aux db)

    * The names and passwords have been changed to protect the innocent*

  2. #2
    Join Date
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,555
    db_file_name_convert is a command per-se - take out "set"
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.

  3. #3
    Join Date
    Mar 2011
    Posts
    9
    Is the nofilenamecheck also a goner? I mean should we take that out? The full filenames are different and on different hosts.

  4. #4
    Join Date
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,555
    Command should be...
    db_file_name_convert = '/instP_oradata/oradata/','/instT_oradata/oradata/'

    rather than...
    set db_file_name_convert = '/instP_oradata/oradata/','/instT_oradata/oradata/'
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.

  5. #5
    Join Date
    Mar 2011
    Posts
    9

    I understand that... but...

    what about the nofilenamecheck clause? should I take this out?

  6. #6
    Join Date
    Apr 2001
    Location
    Bangalore, India
    Posts
    727
    Oracle says

    "Prevents RMAN from checking whether target datafiles sharing the same names as the duplicated files are in use. Note that the NOFILENAMECHECK option is required when the standby and primary datafiles and logs have identical filenames."

    You are using db_file_name_convert to rename the files, I don't think you nneed to use NOFILENAMECHECK option.

    Thanks,
    Thomas Saviour(royxavier@yahoo.com)
    Technical Lead (Databases)
    Thomson Reuters (Markets)

    http://ora600tom.wordpress.com/

  7. #7
    Join Date
    Jul 2006
    Posts
    195
    In this example, we will copy PROD to TEST

    1) ensure you have a full backup on your prod machine:

    2) Setup convert parameters in your dev init.ora

    Here is my file system layout so you need to match it to your layout.
    In my example where I see 'prod' it will convert to 'dev'


    prod /u08/oradata/prod
    dev /u08/oradata/dev

    *.db_file_name_convert='prod','dev'
    *.log_file_name_convert='prod','dev'


    3) scp or rcp your PROD machine files to your dev machine and stick them
    into your "PROD" directory on your DEV machine


    4) script ro run on your dev machine once all files are copied over

    sqlplus ' / as sysdba ' < startup nomount pfile=/u01/app/oracle/product/10g/dbs/initdev.ora
    exit
    EOT

    rman catalog=rman/rman@tprod target=sys/prod@prod << EOT
    connect auxiliary sys/sdev

    duplicate target database to dev nofilenamecheck
    pfile=/u01/app/oracle/product/10g/dbs/initdev.ora
    #### This is the exact end time of your full database backup on PROD
    until time="TO_DATE('07/02/11:06:39:26','MM/DD/YY,HH24:MI:SS')";
    exit
    EOT

    If the database was busy during the backup, you will have to apply archive files from
    PROD to your dev machine.

    If your stuck on that part open another thread and I can show you how to get the
    arch files you need and apply them....

    Good luck

  8. #8
    Join Date
    Mar 2011
    Posts
    9

    Thanks!

    I am so GLAD I have a DEV database, because I horked it up pretty good. All my senior DBA cohorts are on vacation, working on other projects and in general being super busy, so I try to figure as much stuff as I can on my own before really bothering them, so this helps. I'm working with two DEV databases right now and I think I got them both in an interesting state. The first one is 11g which was GREAT because I figured out how to a duplicate from an active database which worked a little too wonderful, this one happened to also have TDE on a table and it had a wallet and now I am getting a master key not found even though the wallets both had the same password. Sigh. The second DEV database is 10 and again, I can't start it in anything but mount mode after trying to duplicate using RMAN and somehow losing something along the way. I have a question. My main goal is just to really duplicate them from Production using rman and whatever I read, I don't understand what happens to the currently existing datafiles, control files, etc. Are they just deleted or overwritten when the RMAN script runs a duplicate? Am I making my life more complicated by not just blowing everything away and then doing a duplicate? Thanks for any answers.

  9. #9
    Join Date
    Mar 2011
    Posts
    9
    Also, another question is since the duplicate command is run from the auxiliary database, why does everyone say make sure there is a full backup on the prod machine since RMAN is being used to duplicate the files from tape?

  10. #10
    Join Date
    Mar 2011
    Posts
    9

    Well...now I know

    How to do a restore from a cold backup. For my dev database with an encrypted tablespace I ended up getting a cold backup from my test database, doing a full restore and then refreshing them both from Production... Live and Learn!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width