Wednesday, March 7, 2007

HOW TO MOVE YOUR DATABASE FILES IN AN ORACLE FAILSAFE ENVIRONMENT


You want to move a datafile for some reasons, but your database is a
Failsafe one.

If the new location is on the same shared disk as other database files,
then you can use method 1 or method 2.

BUT if you want to move a datafile on another disk, that is still not used by
other database files, in this case the structure of your Oracle failsafe group
is changed and you must use method 2.

In this case, you add a new resource to your Oracle Failsafe group.


First Method:

You can only use this method when the new location of your datafile does not
affect the organization of your failover group.

For example, you have just altered your database, adding a datafile within a
tablespace, but, by mistake, you put it on the local disc of one of the nodes.
Your failsafe group is "damaged" because it cannot operate a correct failover.

in case of doubts or problems, use Method 2.


1) In the GUI Failsafe Manager, simply take your database offline:

Right click on your database name, and choose Offline Immediate.

Thus, your database will be shutdown properly and your oracle services
will be stopped .

This step is essential for a failsafe database :

If you try to shutdown a failsafe database without making it offline via
failsafe manager, your database will restart automatically .


On the node,owner of the shared disk resource (where database files reside):

2) If needed, copy the datafile to its new location.

3) Start your OracleService using control panel (where is your
database SID).

4) At MSDOS prompt, type :

C:> SET ORACLE_SID=

5) Launch Server Manager :

C:> SVRMGR30 (if your database version is v8.0.5, SVRMGRL if the
database is 8i)

SVRMGR > Connect Internal/password (NOTE: if you are using 9i you must
connect using: due to the
desupport of the internal user with 9i)

SVRMGR > STARTUP MOUNT PFILE=

SVRMGR > ALTER DATABASE RENAME FILE ' TO
<'new location and name'>;


Verify the result of your alter database command:

SVRMGR > SELECT name FROM V$DATAFILE;

SVRMGR > ALTER DATABASE OPEN;

You can now shutdown your database and exit Server Manager.

6) The last step is to make your database available throught Failsafe:
With Failsafe manager, right click on your database name and choose
Online.

Your database is now started and available.


Second Method:

You want to move a database file from a disk to another that is not part of your
Oracle failsafe group.

In this case, the structure of your failover group is changed because you add a
new resource, a disk resource to your failover group.

Be aware of the new location of the datafile:

This disk cannot be part of another failover Group, not only an Oracle
failsafe group but also a Microsoft cluster group.

You can verify that using Microsoft cluster manager.

1) Remove your database from your Oracle Failsafe group.

Using Gui Failsafe manager, right click on your database name and select
Remove from group.

This operation shutdown your database, modify virtual server configuration
for your database to regenerate a standalone database.

2) On the node owner of the shared disks resource (where reside your datafiles),
you can move your datafile on another disk.

See step 4) to 5) above to change the location of your database file.

3) Your database is a standalone one and you must add it to your Oracle
Failsafe group to apply failover policy on it.

a) In the troubleshooting menu, choose verify standalone database.

b) In the GUI Failsafe Manager, Drag and drop your database name, which
appears under Standalone Databases folder, to your Failsafe Group.

Or, select your database name in the standalone databases folder.
Click on the database menu, to choose Add to group command.

You will give the same informations you gave the first time you added
this database to the failsafe group: Dbname, Location of your init.ora,
failover policy ...

Your database is now part of Oracle Failsafe group with a new shared disk
resource.

No comments: