choose: sw hd | installObjy | setup: ams ls pud chs oids | confCH | maintain: ams ls pud chs oids | moveFD | creaBri

Search | Site Map .

How do I Move a Federation?

A federated database consists of a catalog that knows the location and name of the catalog and all the database files that belong to that federation. The catalog also knows the host name of the lockserver, journal server name and filepath and the bootfile server name and filepath.

We consider two cases where one may wish to move a federation from one server to another. In both cases the federation is assumed to reside on one server. It is also assumed that the user has run srtpath and set the OO_FD_BOOT env variable to the appropriate bootfile.

Case 1: The original host has been renamed

In this case the original machine no longer exists and the federation exists on a server with a different name from that in the catalog. These are the steps that are needed in order to make the federation recognise the new server:

  1. Make sure that there are no outstanding transactions on the federation. You may need to restart the lockserver (to remove the locks from the lock table) and move the journal files aside (don't delete the journal files, just rename them).

  2. Make sure that the lockserver process is running on the lock server host. Then run the objectivity command:

  3. ooinstallfd -lockserverhost <lock server host name> -nocatalog <bootfile>
        
  4. Run the script (existing in the BdbOpsUtils package, version V00-03-00 and above):

  5. BdbMovefederation.pl -bootfile <boot file> \
                         -server <data server host name> \
                         -lockserver <lock server host name> \
                         -jnlserver <journal server host name> \
                         -serverfilepath <file path on new server> \
                         -jnlfilepath <new journal file path> \
                         -bootfilepath <new boot file path>
        

    The serverfilepath option requires the new file path under which the federation will be placed, the jnlfilepath option requires the new file path for the journal files on the journal server and the bootfilepath option requires the new bootfile path.

    For example, suppose we wish to move a federation from objyserv07 to objyserv01 and the filepath under which we wish the federation to reside is /nfs/objyserv01/objy/databases/user1/hasan/18754. We also intend to use objyserv01 as the lock and journal server and we wish the journal files to appear under /nfs/objyserv01/objy/databases/user1/hasan/18754/journals and the bootfile to appear under /nfs/objyserv01/objy/databases/user1/hasan/18754/bootfile. The arguments to supply to the script would be:

    
    BdbMovefederation.pl -bootfile $OO_FD_BOOT \
                         -server objyserv01 \
                         -lockserver objyserv01 \
                         -jnlserver objyserv01 \
                         -serverfilepath /nfs/objyserv01/objy/databases/user1/hasan/18754 \
                         -jnlfilepath /nfs/objyserv01/objy/databases/user1/hasan/18754/journals \
                         -bootfilepath /nfs/objyserv01/objy/databases/user1/hasan/18754/bootfile
    
      
    This script will produce a tcshell script (changefederation.tcsh) that contains all the commands necessary to register in the catalog the location of the moved federation.

  6. Edit the changefederation.tcsh script and remove the commands after the "end of the oochangedb commands" (you only need to change the host name for the database files, the other commands would change attributes that were already changed with the ooinstallfd command)

  7. Make sure that your OO_FD_BOOT is pointing to the bootfile and make the changefederation.tcsh script exectuable, then run:

  8. changefederation.tcsh >& <somefile>
        
    Check the output file <somefile> for errors. The most likely cause of errors could be:
    1. Not having objy applications in the path (srtpath should fix this).
    2. The lockserver application not running.
    3. Incorrect database file permissions. Check that the ams server (if one is used), or the user belongs to the group that can read and update the database files.

Case 2: Moving a federation from host A to host B

Here, both the original host and the target host exist. These steps describe how to move the federation from one server to another. It is assumed that both the source and target federations exist on one server.
  1. Make sure that there are no outstanding locks on the federation and that there are no clients accessing the federation.


  2. Run the script (existing in the BdbOpsUtils package, version V00-03-00 and above):

  3. BdbMovefederation.pl -bootfile <boot file> \
                         -server <new data server host name> \
                         -lockserver <new lock server host name> \
                         -jnlserver <new journal server host name> \
                         -serverfilepath <new file path on new server> \
                         -jnlfilepath <new journal file path> \
                         -bootfilepath <new boot file path>
        

    The serverfilepath option requires the new file path under which the federation will be placed, the jnlfilepath option requires the new file path for the journal files on the journal server and the bootfilepath option requires the new bootfile path.

    For example, suppose we wish to move a federation from objyserv07 to objyserv01 and the filepath under which we wish the federation to reside is /nfs/objyserv01/objy/databases/user1/hasan/18754. We also intend to use objyserv01 as the lock and journal server and we wish the journal files to appear under /nfs/objyserv01/objy/databases/user1/hasan/18754/journals and the bootfile to appear under /nfs/objyserv01/objy/databases/user1/hasan/18754/bootfile. The arguments to supply to the script would be:


    BdbMovefederation.pl -bootfile $OO_FD_BOOT \
                         -server objyserv01 \
                         -lockserver objyserv01 \
                         -jnlserver objyserv01 \
                         -serverfilepath /nfs/objyserv01/objy/databases/user1/hasan/18754 \
                         -jnlfilepath /nfs/objyserv01/objy/databases/user1/hasan/18754/journals \
                         -bootfilepath /nfs/objyserv01/objy/databases/user1/hasan/18754/bootfile
    

    This script will produce a tcshell script (changefederation.tcsh) that contains all the commands necessary to register in the catalog the location of the moved federation.

  4. Make the tcshell script executable and run it redirecting the output to a log file:

  5. changefederation.tcsh >& <somefile>

    This should change in the catalog all the federation attributes. Check the output <somefile> file for errors. Possible causes for errors are:
    1. The objy applications not being in the path (srtpath should fix this).
    2. The lockserver application not running.
    3. Incorrect database file and directory permissions. Check that the ams server (if used) or the users belong to the group that can read and update the database files.


  6. Finally, move the directory containing the federation from the source host to the target host, eg:

  7. mv /nfs/objyserv07/objy/databases/user1/hasan/18754/*
        /nfs/objyserv01/objy/databases/user1/hasan/18754/
        
    and make sure that the ams server (if one is used) or the users have permission to read/write from/to the database files.

 


BaBar Public Site | SLAC | News | Links | Who's Who | Contact Us

Page Owner: Jacek Becla
Last Update: October 27, 2002