3 Replies Latest reply on Aug 6, 2012 8:59 AM by Me_101

    Error duplicate databases

    Me_101
      Hi,

      I just created two databases 11.2.0.1 on windows 7 64bits on my laptop, called PRODUCTION and TEST, and i want to duplicate PRODUCTION on TEST.

      I only created both and take a full backup from PRODUCTION ("rman> backup full database include current controlfile plus archivelog"), nothing more.

      i connect with rman from TEST:

      $ rman target sys/oracle@PRODUCTION auxiliary /

      RMAN> duplicate target database to 'TEST' nofilenamecheck;

      then i get this error:

      iniciando la recuperaci¾n del medio fÝsico
      fallo de la recuperaci¾n del medio fÝsico
      RMAN-00571: ===========================================================
      RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
      RMAN-00571: ===========================================================
      RMAN-03002: fallo del comando Duplicate Db en 08/06/2012 08:45:06
      RMAN-03015: se ha producido un error en el script Memory Script almacenado
      ORA-00283: recovery session canceled due to errors
      RMAN-11003: fallo al analizar/ejecutar la sentencia SQL: alter database recover
      if needed
       start until change 994197 using backup controlfile
      ORA-00283: recovery session canceled due to errors
      ORA-01110: data file 1: 'C:\USERS\my_user\MIBBDD\ORADATA\PRODUCTION\SYSTEM01.D
      BF'
      ORA-01157: cannot identify/lock data file 1 - see DBWR trace file
      ORA-01110: data file 1: 'C:\USERS\my_user\MIBBDD\ORADATA\PRODUCTION\SYSTEM01.D
      BF'
      my system datafile is correct at PRODUCTION database:

      STATUS
      -------
      NAME
      -------------------------------------------------------------
      SYSTEM
      C:\USERS\my_user\MIBBDD\ORADATA\PRODUCTION\SYSTEM01.DBF
      ONLINE
      C:\USERS\my_user\MIBBDD\ORADATA\PRODUCTION\SYSAUX01.DBF
      ONLINE
      C:\USERS\my_user\MIBBDD\ORADATA\PRODUCTION\UNDOTBS01.DBF
      ONLINE
      C:\USERS\my_user\MIBBDD\ORADATA\PRODUCTION\USERS01.DBF
      ONLINE
      C:\USERS\my_user\MIBBDD\ORADATA\PRODUCTION\EXAMPLE01.DBF

      at alert.log on TEST i can see some errors on all datafiles:
      Errors in file c:\users\my_user\mibbdd\diag\rdbms\test\test\trace\test_dbw0_1332.trc:
      ORA-01157: cannot identify/lock data file 1 - see DBWR trace file
      ORA-01110: data file 1: 'C:\USERS\my_user\MIBBDD\ORADATA\PRODUCTION\SYSTEM01.DBF'
      ORA-27086: unable to lock file - already in use
      OSD-00002: información adicional sobre errores
      at trace file of DBWr i can see the same error on all datafiles:
      O/S-Error: (OS 32) El proceso no tiene acceso al archivo porque está siendo utilizado por otro proceso.
      skgfglk: C:_USERS_my_user_MIBBDD_ORADATA_PRODUCTION_UNDOTBS01.DBF possible holder 6716:5580, flags 1DDE: Problem Key 'ORA 1110' was flood controlled (0x1) (no incident)
      ORA-01110: data file 3: 'C:\USERS\my_user\MIBBDD\ORADATA\PRODUCTION\UNDOTBS01.DBF'
      ORA-27086: unable to lock file - already in use
      OSD-00002: información adicional sobre errores
      I am not using the PRODUCTION database for nothing, it just only open, no DDL, no DML, nothing...

      what is the problem and how to solve it?

      thanks
        • 1. Re: Error duplicate databases
          Sebastian Solbach -Database Community-Oracle
          Hi,

          when duplicating a database without giving any more information on the same computer, rman will try to duplicate the files on the same!! folder structure.
          As a result (and because you specified nofilenamecheck) he tries to overwrite your production files (which he cannot do, since your DB is open).
          I would be glad for the error... otherwise you would have destroyed (knowingle, because of using nofilenamecheck) your production DB.

          For restore you should RMAN to exchange the storage folders for your database. Use the "set newname for datafile/tablespace/database" with giving a new location.

          Regards
          Sebastian
          • 2. Re: Error duplicate databases
            Tareq Alkhateeb
            you have to edit the parameter file of the test database and include the following parameters:

            db_file_name_convert=<production files location>,<test files location>
            log_file_name_convert=<production redo location>,<test redo location>

            regards,
            Tareq Alkahteeb
            • 3. Re: Error duplicate databases
              Me_101
              Thanks so much, I follow your advice and did:
              RUN{
              SET NEWNAME FOR DATAFILE 1 TO 'C:\USERS\my_user\MIBBDD\ORADATA\TEST\SYSTEM01.DBF'; 
                SET NEWNAME FOR DATAFILE 2 TO 'C:\USERS\my_user\MIBBDD\ORADATA\TEST\SYSAUX01.DBF'; 
                SET NEWNAME FOR DATAFILE 3 TO 'C:\USERS\my_user\MIBBDD\ORADATA\TEST\UNDOTBS01.DBF'; 
                SET NEWNAME FOR DATAFILE 4 TO 'C:\USERS\my_user\MIBBDD\ORADATA\TEST\USERS01.DBF'; 
                SET NEWNAME FOR DATAFILE 5 TO 'C:\USERS\my_user\MIBBDD\ORADATA\TEST\EXAMPLE01.DBF'; 
                SET NEWNAME FOR TEMPFILE 'C:\USERS\my_user\MIBBDD\ORADATA\PRODUCTION\TEMP01.DBF' TO 'C:\USERS\my_user\MIBBDD\ORADATA\TEST\TEMP01.DBF';
                SET NEWNAME FOR TEMPFILE 'C:\USERS\my_user\MIBBDD\ORADATA\PRODUCTION\TEMP02.DBF' TO 'C:\USERS\my_user\MIBBDD\ORADATA\TEST\TEMP02.DBF';
                 DUPLICATE TARGET DATABASE TO 'TEST';
                 }
              Duplicate completed!!