To copy the FDB using the commands built-in the Objectivity/DB(long version)

2000.12.20 S. Yokkaichi

2001.02.28 revised by S. Yokkaichi
2003.06.19 revised by S. Yokkaichi, on the AMS/LS at the STEP 4
2003.07.06 revised by S. Yokkaichi, STEP 4 is moved as the STEP 2.5

How to make a snapshot-copy of PHENIX-FDB and install it to local site are described in this document.
Current size of PHENIX-FDB is about 5-600MB. When it grow to an order of 10-100GB, these methods are too slow to copy such a large size DB. Some incremental copying method should be adopted. Babar group has already developed such a method. We have to learn their method.
STEP 1 : take a snapshot of FDB at RCF
     1a: using 'oocopyfd'
     1b: using 'oobackup'
STEP 2 : transfer to local site (using simple unix commands)
(STEP 2.5: you have to run AMS/LS)
STEP 3 : install to local site (using 'ooinstallfd')

STEP 1 : take a snapshot of FDB at RCF In the end of this step, you see that all FDB files are under one directory and you can make a tar-file of FDB in the directory. In order to minimize a disturbance of the official FDB, this step should be executed at once, and many offsite managers should use the tar-file made then. 1a: using 'oocopyfd' 1b: using 'oobackup' 1a.0 You have to login phoncs1a, which is a current DB server of PHENIX. If OBJY-FTO or DRO adopted again in future, this method cannot be adopted and you have to use method 1b. Command Sample: oocopyfd -fdnumber 20 \ -dirpath /data/yokkaich/objytest/copy001204 \ /export/database/objy/PHENIX_NEW
1b.0 login to rcas and 'setenv OO_FD_BOOT $PHENIX_FD_BOOT'. 1b.1 Prepare the directories to store and restore your backup set. Protection mode of the directories should be: drwxrwxrwx. 1b.2. Make backup and restore to user's local directory. Example of arguments are in /phenix/yokkaich/objytest/tool/copybybkp001117.csh. This example was executed from rcas2022. 1b.2.1 ooquery Check the backup set saved in FDB. If the command hung-up, you cannot access the DB from your executing host (not permitted to you/too far/too slow/etc.) or the DB is corrupted. 1b.2.2 oocreateset (make the entry of your backup set in the FDB) Command Sample in above example file: set SETNAME=ccjtest-200011-001 set BKPNAME=test13 set VOLNAME=vol-test13 set BKPDIR=/phenix/data06/yokkaich/objytest/bkptest001117-13 set RESTOREDIR=/phenix/data06/yokkaich/objytest/bkptest001117-13-restore oocreateset -set $SETNAME 1b.2.3 oobackup (make the backup-file of the whole FDB in objy-backup-format.) typical 10 minutes (I have seen the cases takes 3min., 5min.and 10min, possibly because of network problem.) Command Sample in above example file: oobackup -set $SETNAME -backup $BKPNAME -volume $VOLNAME \ -capacity 10240 -level 0 -device $BKPDIR 1b.2.4 oorestore (extract the whole FDB to your local directory from the backup.) cd your directory to restoration and execute the command. typical 2min. Command Sample in above example file: oorestore -set $SETNAME -backup $BKPNAME -volume $VOLNAME \ -device $BKPDIR -newdirectory $RESTOREDIR -newhost If any read lock exists on FDB, this restore process fails because this command try to get the update locks. I have asked to Japanese Objy support about this problem. They said to use the option '-standalone' to make a copy using backup-command, as in this case. They also said that the restore process will fail when the existing lock is made under the MROW mode. I have not try this option yet.
I have tried '-standalone' option and works well.(added 010228)
In this stage, FDID is still same as official one(=26700).
STEP 2. transfer (using simple unix commands) 2.1 tar typically 1min for 225MB tar file. 2.2 gzip typically 1.5min for 225MB-> gzip file 23MB 2.3 scp (rcas2022->ccjsun) typically 3.5min 2.4 tar xvf typically 1min., with a write permission if you want to write your data to the DB.
STEP 2.5. You have to run the processes AMS (advanced multithread server) and LS (lockserver) to install and use the FDB. Actually, user process using the DB communicates the processes and does not read the FDB files you installed directly. To run AMS and LS, use the command respectivly:
% oostartams
% oolockserver
on the host which can see the above FDB files, directly or via NFS. For 'oolockserver', the directory '/usr/spool/objy' needed on the host( with a write permission for the user of 'oolockserver') or warned by the command.
STEP 3. ooinstallfd at ap03(linux node) in CCJ. (change the RCF-local information(hostname,FDID,etc.) to CCJ's) Example is /ccj/u/yokkaich/objy/copytest/tool/install001117.csh typically 1min. Only boot-file and FDB-file are changed (it can be seen using a timestamp infomation of files). Command Sample in above example file: /afs/rhic/oodb/pro/bin/ooinstallfd \ -lockserverhost \ -fdnumber 11 \ /ccj/w/r01/phenix/DB/objy/001117/FDB/PHENIX_NEW The last argument is a new bootfilename, not a directory name.
In this stage, FDID is changed as you assigned in argument (=11, in above example).

Last modified: Mon Jul 7 11:01:08 2003