4. Setting up your test Federated Database


The Objectivity runtime and development tools are installed in AFS at the RCF. Klog to AFS. Make sure that you belong to the "system:oodbusers" AFS group. Find it out like this:

>  pts mem $USER
Groups _user_ (id: XXXX) is a member of:
  system:oodbusers
  phnxlib:software
  phenix

If you don't have "oodbusers" permission, ask Martin Purschke or submit a CTS ticket asking for it.

If you have properly sourced PHENIX login file (phenix_setup.csh) you will have the following basic environment variables defined:

  $OBJYSYS  = /afs/rhic/oodb/pro
  $PHENIX_FD_BOOT = phnxobjy.phenix.bnl.gov::/database/main_federation/PHENIX_26000.boot
  $XAPPLRESDIR = $OBJYSYS/etc/app-defaults (to run ootoolmgr)

Mind that the directory of your default Federation $OO_FD_BOOT is not set when you log in (this allows you e.g. to perform your tests with your privately defined database).  phenix_setup.csh provides instead a convenient variable PHENIX_FD_BOOT pointing to the official Federation.

Therefore, if you just want to use PHENIX Federation type:

> setenv OO_FD_BOOT $PHENIX_FD_BOOT

Otherwise, if you want to create your own private Federation, go on with the following steps:
 

  1. Create a directory where you will store your Federated database (and give it group-write rights so that Objy server can write on it), e.g. (I use here as an example /phenix/data24/, but you should use the directories allocated to your relevant PWGs):
  2. > mkdir /phenix/data24/${USER}/objy/
    > chmod g+w /phenix/data24/${USER}/objy/
     

  3. Define the directory where your Federation will be located:
  4. > setenv OO_FD_BOOT /phenix/data24/${USER}/objy/myFDB_BOOT
     

  5. Define the number identity of your Federation (take a look before at the number IDs reserved for PHENIX, and check if a given FID is already used by some colleague ... is this cgi really working ?):
  6. > setenv OBJY_FID 26XXX
     

  7. Create your own Objectivity federation with the proper FID, host machine and path, lock server, journal file path, page size, and bootfile path (last option):
  8. > oonewfd \
     -fdnumber $OBJY_FID \
     -fdfilehost rmine204.rcf.bnl.gov \
     -fdfilepath /phenix/data24/${USER}/objy/myFDB \
     -lockserverhost phnxobjy.phenix.bnl.gov \
     -jnldirpath /phenix/data24/${USER}/objy \
     -pagesize 8192 \
      $OO_FD_BOOT
      (or rmine204.rcf.bnl.gov::/phenix/data24/${USER}/objy/myFDB_BOOT)

    Objy will respond:

    Objectivity/DB (TM) Create Federated Database Utility, Version 5.2.1
    Copyright (c) Objectivity, Inc 1993, 2000. All rights reserved.

    Federated Database "/phenix/data24/user/objy/myFDB_BOOT" created.
     

  9. If you were successful in creating the federation you should see two files in the database directory
  10. The Boot file is an ASCII file that contains basic information describing the federation. The Federated Database file is where the information about the database schema (the persistent classes) and location of database files will be stored.
     
  11. If you want now to delete _properly_ your test Federation (instead of removing by hand the directories) type:
  12. > oodeletefd -f  $OO_FD_BOOT
     

If you want to make a database within the federation, do:

  1. > oonewdb -db myDatabase

  2.  
  3. You can see the characteristics of your Federation now via:
  4. > oodumpcatalog

    Objectivity/DB (TM) List Database Files Utility, Version 5.2.1
    Copyright (c) Objectivity, Inc 1990, 2000. All rights reserved.

    FD Name   = myFDB_BOOT
    FD ID     = 26XXX
    FD File   = rmine204.rcf.bnl.gov::/phenix/data24/user/objy/myFDB
    Boot File = rmine204.rcf.bnl.gov::/phenix/data24/user/objy/myFDB_BOOT
    Jnl Dir   = rmine204.rcf.bnl.gov::/phenix/data24/user/objy
    Lock Host = phnxobjy.phenix.bnl.gov

    DB Name   = myDatabase
    DB ID     = 2
    DB Image  = rmine204.rcf.bnl.gov::/phenix/data24/enterria/objy/myDatabase.myFDB_BOOT.DB
     

Finally, if you want to store some objects in your database do the following:

  1. Download the "tarball" program "myObject-1.0.tar.gz" graciously prepared by Dave Morrison.
  2. Unpack the files into a convenient work directory:
  3. > cd /phenix/workarea/${USER}
    > gunzip ${HOME}/myObject-1.0.tar.gz
    > tar -xvf ${HOME}/myObject-1.0.tar

  4. Configure the test progam and build the example
  5. > mkdir myObject-build
    > cd myObject-build
    > ../myObject-1.0/configure --with-bootfile=$OO_FD_BOOT
    > make

  6. Run the ooInsert.C and ooScan.C progams:
  7. ./ooInsert
    ./ooScan
    I am an object of class `myObject' created with ID = 1
    I am an object of class `myObject' created with ID = 2

  8. Take a look at the schema of your Federation now:
  9. > ooschemadump

    schema *
    0
    1000001 1000000
    {
    class myObject
    basic
    1000000 1000000
    1 0 2 0 2 0 0
    {
    Embedded
    : public ooObj
    1001
    1 0 0 0

    Basic
    protected int32 _id
    2 1 0 0
    }

    }


Previous: 3. Objy Administration Tools | 4. Setting up your Federated Database | Next: 5. Adding your own classes to the PHENIX Federation


enterria@in2p3.fr, denterri@bnl.gov

Last modified: Tue Nov 8 19:50:16 EDT 2000