3

I would like to duplicate to the same server Oracle Database with RMAN. I've configured flash recovery area for Oracle Database. My database is using SPFILE as shown below.

SQL> SELECT DECODE(value, NULL, 'PFILE', 'SPFILE') "Init File Type"
FROM sys.v_$parameter WHERE name = 'spfile

SPFILE

My questions are:

  1. if my source database uses SPFILE then do I have create a PFILE from the SPFILE? If so, how can I do that?

  2. What do they mean by this?

    You only need to create directories that are referenced in the PFILE or SPFILE.

    Which directories need to be created?

    Production Database : /u01/app/oracle/oradata/DB11G/. My SPFILE (spfileDB11g.ora):

    DB11G.__java_pool_size=4194304
    DB11G.__large_pool_size=4194304
    DB11G.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
    DB11G.__pga_aggregate_target=155189248
    DB11G.__sga_target=264241152
    DB11G.__shared_io_pool_size=0
    DB11G.__shared_pool_size=171966464
    DB11G.__streams_pool_size=4194304
    *.audit_file_dest='/u01/app/oracle/admin/DB11G/adump'
    *.audit_trail='db'
    *.compatible='11.2.0.0.0'
    *.control_files='/u01/app/oracle/oradata/DB11G/control01.ctl','/u01/app/oracle/oradata/DB11G/control02.ctl'#Restore Controlfile
    *.db_block_size=8192
    *.db_domain='localdomain'
    *.db_flashback_retention_target=720
    *.db_name='DB11G'
    *.db_recovery_file_dest='/u01/app/oracle/fra'
    *.db_recovery_file_dest_size=3221225472
    *.diagnostic_dest='/u01/app/oracle'
    *.dispatchers='(PROTOCOL=TCP) (SERVICE=DB11GXDB)'
    *.log_archive_dest_1='location=/u01/app/oracle/archive_logs'
    *.log_archive_format='db11g%r_%t_%s.arc'
    *.memory_target=417333248
    *.open_cursors=3^AC^@^@C"^@^@^D^@^@^@^@^@^@^@^@^@^A^DU^F^@^@00
    *.processes=150
    *.remote_login_passwordfile='EXCLUSIVE'
    *.undo_tablespace='UNDOTBS1'
    
  3. if backup files (autobackup and backup set) are in a different path on the source host (not default FRA Path) then how can I use the duplicate command? BTW, only the flashback logs are in the default location (/u01/app/oracle/fra/flashback). Path: /u01/app/oracle/oradata/DB11G/autobackup and /u01/app/oracle/oradata/DB11G/backupset.

1
  • Any suggestions?
    – Cell-o
    May 4, 2013 at 12:56

2 Answers 2

5

If my source database uses SPFILE then do I have create a PFILE from the SPFILE?

Yes, you need to create a temporary PFILE to use while duplicating the database. You will later switch the new instance to use the SPFILE.

Use

CREATE PFILE = 'path/to/pfile' FROM SPFILE;

You only need to create directories that are referenced in the PFILE or SPFILE. Which directories need to be created?

You will start the database as NOMOUNT to begin the duplication. This means the controlfiles will not be read, and so you don't need to have the directories in which the datafiles reside present in your new host. However, the directories references in the parameter files must be present. From your transcript,

DB11G.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
*.audit_file_dest='/u01/app/oracle/admin/DB11G/adump' 
*.control_files='/u01/app/oracle/oradata/DB11G/control01.ctl','/u01/app/oracle/oradata/DB11G/control02.ctl'#Restore Controlfile
*.db_recovery_file_dest='/u01/app/oracle/fra'
*.diagnostic_dest='/u01/app/oracle'
*.log_archive_dest_1='location=/u01/app/oracle/archive_logs'

You may find this chapter of the documentation useful: http://docs.oracle.com/cd/B28359_01/backup.111/b28270/rcmdupdb.htm#i1006474

4
  • thanks for your answer. is it very important pfile name? so is that correct? CREATE PFILE = '$ORACLE_HOME\bin\dbs\init.ora' FROM SPFILE; My spfile : spfileDB11g.ora 2 - $ mkdir -p /u01/app/oracle/oradata/DB11G $ mkdir -p /u01/app/oracle/fra/DB11G $ mkdir -p /u01/app/oracle/admin/DB11G/adump $ mkdir -p /u01/app/oracle/archive_logs --> I will create all directories on the remote server. is that correct?
    – Cell-o
    May 4, 2013 at 19:25
  • 1
    nice answer, thanks for contributing and joining the site! May 4, 2013 at 19:31
  • Am I missing something here? Are you creating the new instance as you should be able to set up the instance to use an spfile before running the rman duplicate command. Otherwise you'll need to take a note of the control file names as you will need to edit the pfile to update the control file statement if I am not mistaken May 4, 2013 at 20:51
  • is there any comment related 3rd question?
    – Cell-o
    May 5, 2013 at 20:01
0

3

In case of the oldskool manual duplicate on the target server ( where you want the duplication ) you can do rman target / catalog start with '<path to backup>';

Then it'll print out all the backups, don't worry if you have other files in here. He'll give a couldn't read header something.

After this you should do crosscheck backup; So it will be updated with what is present. It'll show the backups it can't reach anymore with expired. You don't have to do delete expired.

You can can also do a duplicate from an active database which is easier. cfr http://docs.oracle.com/cd/B28359_01/backup.111/b28270/rcmdupdb.htm#i1006629

2
  • thanks. Let's say paths are : /u01/app/oracle/backups/autobackup , /u01/app/oracle/backups/backupset. can you give me exactly DUPLICATE command with PARAMETERs?
    – Cell-o
    May 6, 2013 at 13:08
  • I cannot at this time. The link I provided should suffice to give you enough information. When using the duplicate from active database you won't need the backup files. It will start from the datafiles present on the source and recover using the archives. There might be something else you'll need to pay attention for, that is if the file structure is not the same. You'll have to make the proper adjustments in the duplicate block or in the spfile/pfile. I assume you have a test setup? Play a bit with it. Report the failures.
    – Munchi
    May 7, 2013 at 11:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.