File mapping for onlinelogs

  • 0
  • 1
  • Question
  • Updated 1 year ago
  • Answered
Hi,

I'm trying to figue out how i can use file mapping with V2P, to get my redologs mapped to a specific directory.

on the vdb i'm converting

/mnt/provision/devdb/datafile/DEVDB/onlinelog/o1_mf_3_df7b5wtx_.log

The converted database have to have redo logs under /u02/oratada/redo

So i'm trying this :

target directory = /u02/oradata

file mapping for redo
/DEVDB/onlinelog => to change with /redo => but this gives un error

No path matched the mapping rules you provided: "/DEVDB/onlinelog:/redo"

Any idea on how to make it working please

Regards,

Mouhssine
Photo of Mouhssine SAIDI

Mouhssine SAIDI

  • 4,622 Points 4k badge 2x thumb

Posted 1 year ago

  • 0
  • 1
Photo of Stephanie Burks

Stephanie Burks, Employee

  • 160 Points 100 badge 2x thumb
Official Response
Hello Mouhssine,

Unfortunately, you can not use file mapping to modify the location of redo logs.
You can only use it to change the location of the controlfile and datafiles listed using the query:
SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
/mnt/provision/testc/datafile/datafile/dbdhcp1/oradata/dbdhcp1/system01.dbf
/mnt/provision/testc/datafile/datafile/dbdhcp1/oradata/dbdhcp1/undotbs01.dbf
/mnt/provision/testc/datafile/datafile/dbdhcp1/oradata/dbdhcp1/sysaux01.dbf
/mnt/provision/testc/datafile/datafile/dbdhcp1/oradata/dbdhcp1/users01.dbf
/mnt/provision/testc/datafile/datafile/dbdhcp1/oradata/dbdhcp1/dbv_ZX5G.dbf
/mnt/provision/testc/datafile/datafile/dbdhcp1/oradata/dbdhcp1/tts01.dbf

In order to move the redo logs to /u01/oradata/redo on the physical database, you have to do it after the V2P is complete.

I did a quick test using V2P
I set my target directory to /u01/oradata (you would use /u02/oradata)

After it completed I did an export ORACLE_SID=VtesD5D and connected to my new physical database using "sqlplus / as sysdba"

I then did the folllowing:

SQL> select member from v$logfile;
MEMBER
--------------------------------------------------------------------------------
/u01/oradata/TESTC/onlinelog/o1_mf_3_df326wkd_.log
/u01/oradata/TESTC/onlinelog/o1_mf_2_df326w20_.log
/u01/oradata/TESTC/onlinelog/o1_mf_1_df326vld_.log
/u01/oradata/VTESTC_D5D/onlinelog/o1_mf_4_dftx83qg_.log
/u01/oradata/VTESTC_D5D/onlinelog/o1_mf_5_dftx83w2_.log

SQL> shutdown  
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> quit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

mkdir /u01/oradata/redo

mv /u01/oradata/TESTC/onlinelog/o1_mf_3_df326wkd_.log /u01/oradata/redo/
mv /u01/oradata/TESTC/onlinelog/o1_mf_2_df326w20_.log /u01/oradata/redo/
mv /u01/oradata/TESTC/onlinelog/o1_mf_1_df326vld_.log /u01/oradata/redo/
mv /u01/oradata/VTESTC_D5D/onlinelog/o1_mf_4_dftx83qg_.log /u01/oradata/redo/
mv /u01/oradata/VTESTC_D5D/onlinelog/o1_mf_5_dftx83w2_.log /u01/oradata/redo/

ls -al /u01/oradata/redo
total 162520
drwxrwxr-x  2 ora10205 oinstall     4096 Mar 30 17:35 .
drwxrwxr-x 11 ora10205 oinstall     4096 Mar 30 17:13 ..
-rw-rw-r--  1 ora10205 oinstall 52429312 Mar 30 17:14 o1_mf_1_df326vld_.log
-rw-rw-r--  1 ora10205 oinstall 52429312 Mar 30 17:14 o1_mf_2_df326w20_.log
-rw-rw-r--  1 ora10205 oinstall 52429312 Mar 30 17:32 o1_mf_3_df326wkd_.log
-rw-r-----  1 ora10205 oinstall  4194816 Mar 30 17:14 o1_mf_4_dftx83qg_.log
-rw-r-----  1 ora10205 oinstall  4194816 Mar 30 17:14 o1_mf_5_dftx83w2_.log

sqlplus / as sysdba
SQL*Plus: Release 10.2.0.5.0 - Production on Thu Mar 30 17:36:15 2017

Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.

Connected to an idle instance.

SQL> startup mount
ORACLE instance started.

Total System Global Area  591396864 bytes
Fixed Size    2098048 bytes
Variable Size  163581056 bytes
Database Buffers  419430400 bytes
Redo Buffers    6287360 bytes
Database mounted.

SQL> alter database rename file '/u01/oradata/TESTC/onlinelog/o1_mf_3_df326wkd_.log' to '/u01/oradata/redo/o1_mf_3_df326wkd_.log';

Database altered.

SQL> alter database rename file '/u01/oradata/TESTC/onlinelog/o1_mf_2_df326w20_.log' to '/u01/oradata/redo/o1_mf_2_df326w20_.log';

Database altered.

SQL> alter database rename file '/u01/oradata/TESTC/onlinelog/o1_mf_1_df326vld_.log' to '/u01/oradata/redo/o1_mf_1_df326vld_.log';

Database altered.

SQL> alter database rename file '/u01/oradata/VTESTC_D5D/onlinelog/o1_mf_4_dftx83qg_.log' to '/u01/oradata/redo/o1_mf_4_dftx83qg_.log';

Database altered.

SQL> alter database rename file '/u01/oradata/VTESTC_D5D/onlinelog/o1_mf_5_dftx83w2_.log' to '/u01/oradata/redo/o1_mf_5_dftx83w2_.log';

Database altered.

SQL> alter database open;
Database altered.

SQL> select member from v$logfile;

MEMBER
--------------------------------------------------------------------------------
/u01/oradata/redo/o1_mf_3_df326wkd_.log
/u01/oradata/redo/o1_mf_2_df326w20_.log
/u01/oradata/redo/o1_mf_1_df326vld_.log
/u01/oradata/redo/o1_mf_4_dftx83qg_.log
/u01/oradata/redo/o1_mf_5_dftx83w2_.log

SQL> quit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options


An additional note:

When you use File Mapping, keep the following in mind:
You can only use file mapping to relocate datafiles shown in v$datafile and the controlfile.

You can see which objects can be relocated by clicking the gree + sign to the right of File Mapping and then selecting "Validate"

That will provide you with the Original Path and the Result, which will be identical.

On the Source File Match side everything is relative to the db_create_file_dest parameter value, so you leave that off and just include everything that follows, including a leading /

On the Replacement side, everything is relative to the Target Directory, so you leave off the Target Directory (/u02/oradata)

 
SQL> show parameter db_create_file_dest    
/mnt/provision/testc/datafile

SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
/mnt/provision/testc/datafile/datafile/dbdhcp1/oradata/dbdhcp1/system01.dbf
/mnt/provision/testc/datafile/datafile/dbdhcp1/oradata/dbdhcp1/undotbs01.dbf
/mnt/provision/testc/datafile/datafile/dbdhcp1/oradata/dbdhcp1/sysaux01.dbf
/mnt/provision/testc/datafile/datafile/dbdhcp1/oradata/dbdhcp1/users01.dbf
/mnt/provision/testc/datafile/datafile/dbdhcp1/oradata/dbdhcp1/dbv_ZX5G.dbf
/mnt/provision/testc/datafile/datafile/dbdhcp1/oradata/dbdhcp1/tts01.dbf


As a test, to verify that I was doing everything correctly, I added "/datafile/dbdhcp1/oradata/dbdhcp1/dbv_ZX5G.dbf" as the Source File Match and set the Replacement to "/u01/oradata/redo/dbv_ZX5G.dbf"  (as I already created on /u01/oradata/redo on the target) and clicked Validate.

You can see the result below.



I then checked the target after the V2P completed (but before moving redo) and saw that the file was mapped correctly.

ls -al /u01/oradata/redototal 162520
drwxrwxr-x  2 ora10205 oinstall     4096 Mar 30 17:35 .
drwxrwxr-x 11 ora10205 oinstall     4096 Mar 30 17:13 ..
-rw-rw-r--  1 ora10205 oinstall   532480 Mar 30 17:57 dbv_ZX5G.dbf

I confirmed it in sqlplus

SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
/u01/oradata/datafile/dbdhcp1/oradata/dbdhcp1/system01.dbf
/u01/oradata/datafile/dbdhcp1/oradata/dbdhcp1/undotbs01.dbf
/u01/oradata/datafile/dbdhcp1/oradata/dbdhcp1/sysaux01.dbf
/u01/oradata/datafile/dbdhcp1/oradata/dbdhcp1/users01.dbf
/u01/oradata/redo/dbv_ZX5G.dbf
/u01/oradata/datafile/dbdhcp1/oradata/dbdhcp1/tts01.dbf

Hope this helps.
Stephanie
(Edited)