Data Backup and Recovery

SMO clone to a new path

sebastiansenen
4,065 Views

Hi,

The customer wants to use SMO to clone a DB (10gR2/11g, HPUX) and at the same time change the location (path) of the datafiles in order to use the SID of the clone and not the original DB as part of the full path:

* Original location: /db1/DB_PROD/xxxx.dbf  - Mount point is /db1

* Actual clone location: /db1_clone/DB_PROD/xxxx.dbf - Mount point is /db1_clone

* Desired clone location: /db1_clone/DB_CLONE/xxxx.dbf - Mount point is /db1_clone

I know that this would be possible by scripting a "mv" of the directory and a series of SQL commands to relocate the dbf files, but the idea is to use SMO to do all this automatically.

Is this possible?

Thanks in advance.

Sebastian.-

4 REPLIES 4

ekashpureff
4,065 Views

Yes, it's part of what SMO does when clonig.

The SMO clone template specifies how to mount the new cloned db

in the storage specification mountpoint section:

<mountpoint>
     <source>/mnt/path/source_datafile_mountpoint</source>
     <destination>/mnt/path/target_datafile_mountpoint</destination>
</mountpoint>

You could tweak the mountpoints further by calling a custom script.

See the cloning section of the SMO 3.1 Installation and Administration Guide.


At your service,

Eugene Kashpureff

sebastiansenen
4,065 Views

Hi,

Thanks Eugene for your quick answer!

I'm not sure that this is what I want (and I don't have an SMO instance to test right now)... You can easily  change your mount point when you clone using the GUI, but I want to change what's after the mount point... I think that as part of OFA is the add of the SID name to the directory where the DB resides, so when the SID changes on the clone, the client wants that directory to change too. (http://ss64.com/ora/syntax-ofa.html)

That's why in my example I can change the  mount point but not the directory:

* Original location: /db1/DB_PROD/xxxx.dbf  - Mount point is /db1

* Actual clone location: /db1_clone/DB_PROD/xxxx.dbf - Mount point is /db1_clone - Mount point has changed, directory after mount point remains the same.

* Desired clone location: /db1_clone/DB_CLONE/xxxx.dbf - Mount point is /db1_clone - Mount point has changed, I want the directory after the mount point to change too.

I guess this can't be done since netapp doesn't "understand" the filesystem structure (that seats on the LUN)... I wondered if SMO can do this for me too.

Please correct me if I'm wrong.

Thanks again and regards,

Sebastian.-

nithyana
4,065 Views

Yes, this will work with SMO.

The clone destination can be a different mount with different directory name. You can change the mount point as well as the directory following the mound point. Also you can add/skip a directory in the destination location.

For example:

The backup file is:

/mnt/XXXDB/XXXDB/redo01.log

and the clone destination can be

/mnt_1/XXXDB_CLONE/redo1.log

I have tried tried this scenario and this works for me. Let me know if you need any additional clarification.

Thanks,

Nithyananthan S

sebastiansenen
4,065 Views

Hi Nithyananthan,

Thanks for your answer. I know that this is possible for redo logs, but I want to achieve the same with datafiles... is there any way this can be done? If it is, could you tell me where in the process you change paths?

Thanks!

Sebastian.-

Public