Odbinit: Difference between revisions

From MidasWiki
Jump to navigation Jump to search
(Created page with "{{Pagelinks}} = Links = <div style="column-count:3;-moz-column-count:3;-webkit-column-count:3"> * odbedit command list * Odbedit examples * Using the ODB * ...")
 
(The midas documentation has moved to https://midas.triumf.ca/docs/)
Tag: Replaced
 
Line 1: Line 1:
{{Pagelinks}}
The midas documentation has moved. See [https://midas.triumf.ca/docs/develop/reference/reference/programs/#odbinit odbinit] in Programs and options and [https://midas.triumf.ca/docs/develop/getting_started/first_experiment/#creating-the-odb Creating the ODB] in Set up your first experiment for the new documentation about the odbinit program.
 
= Links =
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
* [[odbedit command list]]
* [[Odbedit examples]]
* [[ODB|Using the ODB]]
* [[mhttpd]] webserver
* [[Online Database|ODB structure]]
</div>
 
= Purpose =
The utility  {{Utility|name=odbinit}} initializes the ODB.
 
;NOTE
: Normally, <span style="color:darkcyan;font-style:italic">odbedit</span> is sufficient to [[FAQ#How to recover from a corrupted ODB|recover from a corrupted ODB]]
 
However, if this does not solve the problem, it may be necessary to use {{Utility|name=odbinit}}, then reload the contents of the ODB from a saved file.
= Usage =
<pre>
[mpet@titan01 ~/online_npet]$ odbinit -h
Checking environment... experiment name is "npet", remote hostname is ""
usage: odbinit [options...]
options:
  [-e Experiment] --- specify experiment name
  [-s size] --- specify new size of ODB in bytes, default is 1048576
  [--env] --- create new env.sh and env.csh files in the current directory
  [--exptab] --- create new exptab file in the current directory
  [--cleanup] --- cleanup (preserve) old (existing) ODB files
  [-n] --- dry run, report everything that will be done, but do not actually do anything
</pre>
 
= Example =
In this case, the ODB shared memory is corrupted, and the .ODB.SHM has been recreated with a size of 0.
<pre>
[mpet@titan01 ~/online_npet]$ ls -l .ODB.SHM
-rw-r--r-- 1 mpet users 0 Nov 20 14:44 .ODB.SHM
 
[mpet@titan01 ~/online_npet]$ odbinit
Checking environment... experiment name is "npet", remote hostname is ""
Checking command line... experiment "npet", cleanup 0, dry_run 0, create_exptab 0, create_env 0
Checking MIDASSYS....../home/mpet/packages/midas_nov2018
Checking exptab... experiments defined in exptab file "/home/mpet/online/exptab":
0: "mpet"
1: "npet" <-- selected experiment
2: "test"
 
Checking exptab... selected experiment "npet", experiment directory "/home/mpet/online_npet/"
 
Checking experiment directory "/home/mpet/online_npet/"
Found existing ODB save file: "/home/mpet/online_npet/.ODB.SHM"
Looks like this experiment ODB is already initialized.
To create new empty ODB, please rerun odbinit with the "--cleanup" option.
[mpet@titan01 ~/online_npet]$
[mpet@titan01 ~/online_npet]$ odbinit --cleanup
Checking environment... experiment name is "npet", remote hostname is ""
Checking command line... experiment "npet", cleanup 1, dry_run 0, create_exptab 0, create_env 0
Checking MIDASSYS....../home/mpet/packages/midas_nov2018
Checking exptab... experiments defined in exptab file "/home/mpet/online/exptab":
0: "mpet"
1: "npet" <-- selected experiment
2: "test"
 
Checking exptab... selected experiment "npet", experiment directory "/home/mpet/online_npet/"
 
Checking experiment directory "/home/mpet/online_npet/"
Found existing ODB save file: "/home/mpet/online_npet/.ODB.SHM"
 
Checking shared memory...
Deleting old ODB shared memory...
Deleted existing ODB shared memory, please check that all MIDAS programs are stopped and try again.
[mpet@titan01 ~/online_npet]$
[mpet@titan01 ~/online_npet]$
[mpet@titan01 ~/online_npet]$
[mpet@titan01 ~/online_npet]$ odbinit --cleanup
Checking environment... experiment name is "npet", remote hostname is ""
Checking command line... experiment "npet", cleanup 1, dry_run 0, create_exptab 0, create_env 0
Checking MIDASSYS....../home/mpet/packages/midas_nov2018
Checking exptab... experiments defined in exptab file "/home/mpet/online/exptab":
0: "mpet"
1: "npet" <-- selected experiment
2: "test"
 
Checking exptab... selected experiment "npet", experiment directory "/home/mpet/online_npet/"
 
Checking experiment directory "/home/mpet/online_npet/"
Found existing ODB save file: "/home/mpet/online_npet/.ODB.SHM"
 
Checking shared memory...
Deleting old ODB shared memory...
[system.c:1015:ss_shm_delete,ERROR] shm_unlink(/npet_ODB_SHM) errno 2 (No such file or directory)
Good: no ODB shared memory
Deleting old ODB semaphore...
Deleting old ODB semaphore... create status 1, delete status 1
Preserving old ODB save file /home/mpet/online_npet/.ODB.SHM" to "/home/mpet/online_npet/.ODB.SHM.1542755393"
 
Checking ODB size...
Requested ODB size is 0 bytes
ODB size file is "/home/mpet/online_npet//.ODB_SIZE.TXT"
ODB size file "/home/mpet/online_npet//.ODB_SIZE.TXT" does not exist, creating it...
Saved ODB size from "/home/mpet/online_npet//.ODB_SIZE.TXT" is 1048576 bytes
We will initialize ODB for experiment "npet" on host "" with size 1048576 bytes
 
Creating ODB...
Creating ODB... db_open_database() status 302
Saving ODB...
Saving ODB... db_close_database() status 1
Connecting to experiment...
 
Connected to ODB for experiment "npet" on host "" with size 1048576 bytes
Checking experiment name... status 1, found "npet"
Disconnecting from experiment...
 
Done
</pre>
Now [[ODB Access and Use#Save and reload the ODB|reload the ODB]] from a saved file using the {{Utility|name=odbedit}} command "load".
 
[[Category:Utilities]]

Latest revision as of 22:01, 30 October 2026

The midas documentation has moved. See odbinit in Programs and options and Creating the ODB in Set up your first experiment for the new documentation about the odbinit program.