| YaK:: Trying Versant ODBMS 7.0.1 | [Changes] [Calendar] [Search] [Index] [PhotoTags] |
After not touching the product in almost 10 years, I decided to download a free trial copy of the ODBMS and see if I still recognized it.
I do! In the /bin/ directory, I see commands that I wrote 20 years ago: sch2db, db2tty, verr, verrindx, dropclass. I'm pretty sure I'm also largely responsible for many files including these: h/cxxcls/linkvstr.h h/cxxcls/infovstr.h h/cxxcls/check.h h/cxxcls/cxxerr.h lib/error.msi And I still feel pretty proud of the brilliant C Preprocessor hackery in h/cxxcls/try.h
I installed in /gwarn/versant as my own user (strick). Because I didn't install as root, I had to do my own /etc/xinetd.d file for the ss.d program that accepts client connections.
export PATH=/gwarn/versant/7.0.1/bin/:/opt/gwarn/ActiveTcl8.4/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/home/strick/bin
562 $ export VERSANT_ROOT=/gwarn/versant/7.0.1
563 $ export VERSANT_DB=/gwarn/versant/db
564 $ export VERSANT_DBID=/gwarn/versant/dbid
565 $ export VERSANT_DBID_NODE=gwarn
578 $ dbid -N
UT_ER_DBID_CREATE: Cannot create database ID file at /gwarn/versant/dbid/osc-dbid ("ut/utlog.c", line 113)
E7066: UT_ER_DBID_CREATE: Cannot create database ID file at %s
]]
$ mkdir /gwarn/versant/dbid
581 $ dbid -N
612 $ verr 7066
====== SEARCHING FOR `7066' ======
7066, UT_ER_DBID_CREATE: Cannot create database ID file at %s
613 $ sch2db
Usage: sch2db [-options....] file1.sch file2.sch ...
-D db database: use database db (or use O_DBNAME environment)
-n no: make no changes
-y yes: make any changes
-i interactive (default): ask yes or no (stdin must be tty)
-e evolution: schema evolution is a potential strategy
-r rename: rename attribute is a potential strategy
-f force: dropping classes is a potential strategy
-u user: run as this DB user
-p password: enter password for the DB user entered in -u
614 $ db2tty
Usage 1: db2tty -D databaseName [options] [ classnames ... ]
Usage 2: db2tty -D databaseName [-l] -o loids
-i show instances
-a show all classes (including system)
-u username to access the DB
-p password for the user accessing the db
-s show schema infomation only
-t LX operate in long transaction LX
-l use read locks (default is NOLOCK)
-n number of objects per cursor fetch (default is 200,valid only with -i option)
-c loids set default configuration list to specified
loids and query with O_CM_VALIDATE option
-b do query with O_CM_MUST_HAVE_SMART option
-o loids display objects with specified loids
623 $ dropclass
Usage: dropclass [-options....] class1 class2 ...
-D db database: use database db (or use O_DBNAME environment)
-n no: make no changes
-y yes: make any changes
-i interactive (default): ask yes or no (stdin must be tty)
-u user: run as this DB user
-p password: enter password for the DB user entered in -u
616 $ oscp -v
7.0.1
617 $ oscp -b
Versant Release Version: 7.0.1.4.11.0
Platform: Red Hat Enterprise Linux
Operating System: 5.0
OS Patch Info:
C Version: gcc 4.1.2
C++ Version: g++ 4.1.2
C++ Patch Info:
...
# A license.xml file came in the email.
$ mv ~/Downloads/license.xml /gwarn/versant/7.0.1
$ makedb -p uno
VERSANT Utility MAKEDB Version 7.0.1.4
Copyright (c) 1988-2008 VERSANT Corporation
Making directory at /gwarn/versant/db/uno ...
Back end profile created at /gwarn/versant/db/uno/profile.be
Front end profile created at /home/strick/.osc/uno
626 $ createdb
Usage: createdb [options] <dbname>
options:
-i pre-allocate and initialize the database
-il pre-initialize the physical and logical logs to logvolmaxsize
-noprint suppress display messages
dbname: database name
627 $ createdb -i uno
VERSANT Utility CREATEDB Version 7.0.1.4
Copyright (c) 1988-2008 VERSANT Corporation
database ID is 1
Physical log volume created at /gwarn/versant/db/uno/physical.log
size=1024 pages ( page size = 2048 bytes )
Logical log volume created at /gwarn/versant/db/uno/logical.log
size=1024 pages ( page size = 2048 bytes )
System volume created at /gwarn/versant/db/uno/system
size=8192 pages ( page size=16384 bytes ), extent size=2, number of extents=4096
Formatting system volume ...
Creating system classes ...
631 $ startdb uno
VERSANT Utility STARTDB Version 7.0.1.4
Copyright (c) 1988-2008 VERSANT Corporation
Beginning physical recovery phase
Ending physical recovery phase
Beginning logical recovery phase
Ending logical recovery phase
Database is in multi-user mode ...
665 $ dblist
VERSANT Utility DBLIST Version 7.0.1.4
Copyright (c) 1988-2008 VERSANT Corporation
ID = 1
DB name = uno@gwarn
creator = strick
date created = Thu Oct 22 18:50:23 2009
db type = PERSONAL DATABASE
db version = 7.0.1.4
##### CREATE A SERVICE IN XINETD, AND HUP IT: #####
root@gwarn:~# cat /etc/xinetd.d/oscssd
service oscssd
{
id = oscssd
server = /gwarn/versant/7.0.1/bin/ss.d
flags = REUSE
type = UNLISTED
socket_type = stream
protocol = tcp
wait = no
user = strick
disable = no
port = 5019
}
698 $ db2tty -D uno -a -i
====== CLASS `class' ======
[no superclasses]
attributes:
name : char[]
supclses -> class[]
subclses -> class[]
numattrs : o_4b
attrs -> attribute[]
nummeths : o_4b
meths -> method[]
defaultval : o_u1b[]
memlen : o_4b
storlen : o_4b
status : o_4b
storseg : o_4b
storcls : o_4b
auxinfo : o_u1b[]
auxobj -> (NULL_DOMAIN)
prevvsn : o_u1b[0]
Instances of class 'class' :
## L {=0xf7c5e010;c_l_();;0} #0xf7c5e010[0.0.1:class] T=0xf7c62090 {reg,sch} (uno)
## name 6="class"
## supclses 0=( )
## subclses 0=( )
## numattrs 16
## attrs 16=( #0xf7c5e120[0.0.18:attribute] #0xf7c5e130[0.0.19:attribute] #0xf7c5e140[0.0.20:attribute] #0xf7c5e150[0.0.21:attribute]
## 4... #0xf7c5e160[0.0.22:attribute] #0xf7c5e170[0.0.23:attribute] #0xf7c5e180[0.0.24:attribute] #0xf7c5e190[0.0.25:attribute]
## 8... #0xf7c5e1a0[0.0.26:attribute] #0xf7c5e1b0[0.0.27:attribute] #0xf7c5e1c0[0.0.28:attribute] #0xf7c5e1d0[0.0.29:attribute]
## 12... #0xf7c5e1e0[0.0.30:attribute] #0xf7c5e1f0[0.0.31:attribute] #0xf7c5e200[0.0.32:attribute] #0xf7c5e210[0.0.33:attribute] )
## nummeths 0
## meths 0=( )
## defaultval 0=""
## memlen 100
## storlen 100
## status 0
## storseg -1
## storcls -1
## auxinfo 0=""
## auxobj #NIL
## prevvsn 0=""
...
...
...
|
Notice I had to add CC=' gcc -m32 -static ' because I installed 32-bit RedHat5.0 Versant on a somewhat-64-bit Ubuntu Hardy box. (I had been getting errors like this:
/usr/bin/ld: skipping incompatible /gwarn/versant/7.0.1//lib/libosc.so when searching for -losc /usr/bin/ld: skipping incompatible /gwarn/versant/7.0.1//lib/libosc.a when searching for -losc /usr/bin/ld: cannot find -losc)
712 $ cd /gwarn/versant/7.0.1/demo/c/tutorial
713 $ make CC=' gcc -m32 -static ' build_demo
gcc -m32 -static -g -I`oscp -p`/h -c basicemp.c
gcc -m32 -static -o basicemp basicemp.o -g -L`oscp -p`/lib -losc -lm -lpthread -ldl -lstdc++
gcc -m32 -static -g -I`oscp -p`/h -c employee.c
gcc -m32 -static -o employee employee.o -g -L`oscp -p`/lib -losc -lm -lpthread -ldl -lstdc++
gcc -m32 -static -g -I`oscp -p`/h -c depart.c
gcc -m32 -static -o depart depart.o -g -L`oscp -p`/lib -losc -lm -lpthread -ldl -lstdc++
gcc -m32 -static -g -I`oscp -p`/h -c basics.c
gcc -m32 -static -o basics basics.o -g -L`oscp -p`/lib -losc -lm -lpthread -ldl -lstdc++
gcc -m32 -static -g -I`oscp -p`/h -c updates.c
gcc -m32 -static -o updates updates.o -g -L`oscp -p`/lib -losc -lm -lpthread -ldl -lstdc++
gcc -m32 -static -g -I`oscp -p`/h -c links.c
gcc -m32 -static -o links links.o -g -L`oscp -p`/lib -losc -lm -lpthread -ldl -lstdc++
[ actually it was much noisier than that ]
723 $ PATH=.:$PATH make CC=' gcc -m32 ' run_demo
removedb -noprint -rmdir -f c_demo_db
makedb -p c_demo_db
VERSANT Utility MAKEDB Version 7.0.1.4
Copyright (c) 1988-2008 VERSANT Corporation
Making directory at /gwarn/versant/db/c_demo_db ...
Back end profile created at /gwarn/versant/db/c_demo_db/profile.be
Front end profile created at /home/strick/.osc/c_demo_db
createdb c_demo_db
VERSANT Utility CREATEDB Version 7.0.1.4
Copyright (c) 1988-2008 VERSANT Corporation
database ID is 4
Physical log volume created at /gwarn/versant/db/c_demo_db/physical.log
size=1024 pages ( page size = 2048 bytes )
Logical log volume created at /gwarn/versant/db/c_demo_db/logical.log
size=1024 pages ( page size = 2048 bytes )
System volume created at /gwarn/versant/db/c_demo_db/system
size=8192 pages ( page size=16384 bytes ), extent size=2, number of extents=4096
Formatting system volume ...
Creating system classes ...
basicemp c_demo_db
Created Employee class
basics c_demo_db Nick Tracy Bree
basics c_demo_db
Found Employee: Nick
Found Employee: Tracy
Found Employee: Bree
dropclass -y -D c_demo_db Employee
Schema changes needed:
Drop class `Employee' and all its instances
APPLYING SCHEMA CHANGES
employee c_demo_db
Created Employee class
updates c_demo_db < updates.data
Enter employee name to search for: Select returned 0 employee objects.
l-ist c-hange d-elete i-nsert a-ll : Creating employee ...
Continue? y/n
Enter employee name to search for: Select returned 0 employee objects.
l-ist c-hange d-elete i-nsert a-ll : Creating employee ...
Continue? y/n
Enter employee name to search for: Select returned 0 employee objects.
l-ist c-hange d-elete i-nsert a-ll : Creating employee ...
Continue? y/n
Enter employee name to search for: Select returned 1 employee objects.
l-ist c-hange d-elete i-nsert a-ll : Retrieving data for employees named Gery.
Gery Production $35000.00 #100022 Engineer
Continue? y/n
Enter employee name to search for: Select returned 1 employee objects.
l-ist c-hange d-elete i-nsert a-ll : Change job description to: Change department to: Continue? y/n depart c_demo_db
Created Department class
links c_demo_db
=>Create new Employee managers...
=>Create new Departments...
=>Create new Employees...
=>Assign Employees to Departments...
------------ 3 Departments and their Employees ------------
The Production department is managed by Bob Black
and is staffed by the following 2 employees:
Larry Link Production $35000.00 #100022 Engineer
Ethel Murtz Production $35000.00 #100022 Engineer
The Research & Development department is managed by Bill Green
and is staffed by the following 1 employees:
Oliver Object Research & Development $35000.00 #100022 Engineer
The Quality Assurance department is managed by Tom White
and is staffed by the following 0 employees:
------------
=>Delete employee Larry Link...
=>Move Ethel Murtz from Production to Quality Assurance...
------------ 3 Departments and their Employees ------------
The Production department is managed by Bob Black
and is staffed by the following 0 employees:
The Research & Development department is managed by Bill Green
and is staffed by the following 1 employees:
Oliver Object Research & Development $35000.00 #100022 Engineer
The Quality Assurance department is managed by Tom White
and is staffed by the following 1 employees:
Ethel Murtz Quality Assurance $35000.00 #100022 Engineer
------------
725 $ db2tty -D c_demo_db -i
====== CLASS `Employee' ======
[no superclasses]
attributes:
emp_name : char[]
emp_department : char[]
emp_salary : o_float
emp_number : o_u4b
emp_job_description : char[]
Instances of class 'Employee' :
## L {=0xf7c56840;c_l_();;0} #0xf7c56840[4.0.5135:Employee] T=0xf7c6a0b0 {reg} (c_demo_db)
## emp_name 5="John"
## emp_department 3="rd"
## emp_salary 35000
## emp_number 91
## emp_job_description 9="engineer"
## L {=0xf7c56850;c_l_();;0} #0xf7c56850[4.0.5136:Employee] T=0xf7c6a0d8 {reg} (c_demo_db)
## emp_name 5="Gery"
## emp_department 11="Production"
## emp_salary 35000
## emp_number 100022
## emp_job_description 9="Engineer"
## L {=0xf7c56860;c_l_();;0} #0xf7c56860[4.0.5137:Employee] T=0xf7c6a100 {reg} (c_demo_db)
## emp_name 4="Joe"
## emp_department 11="Production"
## emp_salary 35000
## emp_number 100022
## emp_job_description 9="Engineer"
## L {=0xf7c56870;c_l_();;0} #0xf7c56870[4.0.7187:Employee] T=0xf7c6a128 {reg} (c_demo_db)
## emp_name 10="Bob Black"
## emp_department 11="Production"
## emp_salary 35000
## emp_number 100022
## emp_job_description 8="Manager"
## L {=0xf7c56880;c_l_();;0} #0xf7c56880[4.0.7188:Employee] T=0xf7c6a150 {reg} (c_demo_db)
## emp_name 11="Bill Green"
## emp_department 23="Research & Development"
## emp_salary 35000
## emp_number 100022
## emp_job_description 8="Manager"
## L {=0xf7c56890;c_l_();;0} #0xf7c56890[4.0.7189:Employee] T=0xf7c6a178 {reg} (c_demo_db)
## emp_name 10="Tom White"
## emp_department 18="Quality Assurance"
## emp_salary 35000
## emp_number 100022
## emp_job_description 8="Manager"
## L {=0xf7c568a0;c_l_();;0} #0xf7c568a0[4.0.7194:Employee] T=0xf7c6a1a0 {reg} (c_demo_db)
## emp_name 12="Ethel Murtz"
## emp_department 18="Quality Assurance"
## emp_salary 35000
## emp_number 100022
## emp_job_description 9="Engineer"
## L {=0xf7c568b0;c_l_();;0} #0xf7c568b0[4.0.7195:Employee] T=0xf7c6a1c8 {reg} (c_demo_db)
## emp_name 14="Oliver Object"
## emp_department 23="Research & Development"
## emp_salary 35000
## emp_number 100022
## emp_job_description 9="Engineer"
****** Total 8 instances of class 'Employee' ******
====== CLASS `Department' ======
[no superclasses]
attributes:
dep_name : char[]
dep_manager -> Employee
dep_employees -> Employee[]
Instances of class 'Department' :
## L {=0xf7c56870;c_l_();;0} #0xf7c56870[4.0.7190:Department] T=0xf7c5e0d0 {reg} (c_demo_db)
## dep_name 11="Production"
## dep_manager #0xf7c568a0[4.0.7187:]
## dep_employees 0=( )
## L {=0xf7c56880;c_l_();;0} #0xf7c56880[4.0.7191:Department] T=0xf7c5e0f0 {reg} (c_demo_db)
## dep_name 23="Research & Development"
## dep_manager #0xf7c568b0[4.0.7188:]
## dep_employees 1=( #0xf7c568c0[4.0.7195:] )
## L {=0xf7c56890;c_l_();;0} #0xf7c56890[4.0.7192:Department] T=0xf7c5e130 {reg} (c_demo_db)
## dep_name 18="Quality Assurance"
## dep_manager #0xf7c568d0[4.0.7189:]
## dep_employees 1=( #0xf7c568e0[4.0.7194:] )
****** Total 3 instances of class 'Department' ******
|
strick ... formerly@ versant.com
$ find /gwarn/versant/7.0.1 -type f | xargs grep -i strick /gwarn/versant/7.0.1/h/check.h: * $Id: check.h,v 1.30 91/09/30 12:59:50 strick Exp $ /gwarn/versant/7.0.1/h/osc.h: * $Id: osc.h,v 1.41 94/11/22 17:34:29 strick Exp $ ...
| (last modified 2009-10-23) [Login] |