Download O2 System Administration Reference Manual

Transcript
O2 System
Administration
Reference Manual
Release 5.0 - May 1998
In for m ation in t h is docu m en t is su bject t o ch an ge with ou t
n ot ice an d sh ou ld n ot be con str u ed as a com m it m en t by
O2 Tech n ology.
Th e soft war e descr ibed in th is docu m en t is deliver ed u n der a
licen se or n on disclosu r e agr eem en t.
Th e soft war e can on ly be u sed or copied in accor dan ce wit h t h e
ter m s of th e agr eem en t . It is again st t h e law t o copy t h is
soft war e t o m agn et ic t ape, disk , or an y ot h er m ediu m for an y
pu r pose ot h er t h an t h e pu r ch aser ’s own u se.
Copyr igh t 1992-1998 O 2 Tech n ology.
All r igh t s r eser ved. No par t of t h is pu blicat ion can be
r epr odu ced, st or ed in a r et r ieval syst em or t r an sm it t ed in an y
for m or by an y m ean s, elect r on ic, m ech an ical, ph ot ocopy
with ou t pr ior wr itt en per m ission of O2 Tech n ology.
O2 , O 2 En gin e API, O2 C, O2 DBAccess, O2 En gin e, O2 Gr aph ,
O2 Kit , O2 Look , O2 St or e, O2 Tools, an d O2 Web ar e r egist er ed
tr adem ar k s of O2 Tech n ology.
SQL an d AIX ar e r egist er ed t r adem ar k s of In t er n at ion al
Bu sin ess Mach in es Cor por at ion .
Su n , Su n OS, an d SOLARIS ar e r egist er ed t r adem ar k s of Su n
Micr osystem s, In c.
X Win dow System is a r egist er ed tr adem ar k of t h e
Massach u set t s In st itu t e of Tech n ology.
Un ix is a r egist er ed t r adem ar k of Un ix Syst em Labor at or ies, In c.
HPUX is a r egist er ed t r adem ar k of H ewlet t -Pack ar d Com pan y.
BOSX is a r egist er ed t r adem ar k of Bu ll S.A.
IRIX is a r egist er ed t r adem ar k of Siem en s Nixdor f, A.G.
NeXTSt ep is a r egister ed t r adem ar k of t h e NeXT Com pu t er , In c.
Pu r ify, Qu an t ify ar e r egist er ed tr adem ar k s of Pu r e Soft war e In c.
Win dows is a r egist er ed t r adem ar k of Micr osoft Cor por ation .
All oth er com pan y or pr odu ct n am es qu ot ed ar e t r adem ar k s or
r egist er ed t r adem ar k s of t h eir r espect ive t r adem ar k h older s.
Who should read this manual
Th is m an u al con tain s a com pr eh en sive list of O 2 adm in ist r at ion
com m an ds. Th e fu ll syn t ax an d all opt ion s ar e det ailed.
It sh ou ld be r ead in con ju n ct ion wit h t h e O2 Sy stem Ad ministration
Guid e.
• O2 System Administration Guide
Th is m an u al is for t h e O2 syst em adm in ist r at or . It ou tlin es th e elem en t s
wh ich com pr ise th e O2 pack age an d descr ibes h ow t o in st all O 2 . It also
descr ibes h ow t o cu st om ize an d tu n e t h e syst em for in dividu al u ser s.
Th e m an u al descr ibes all con figu r at ion option s an d t h e u t ilit y pr ogr am s
n eeded for in itializin g, safe-gu ar din g, r est or in g, an d delet in g n am ed O2
syst em s.
Th is m an u al sh ou ld be r ead in con ju n ct ion wit h th e O2 Sy stem
Ad ministration Reference Manual wh ich con t ain s a fu ll list of
adm in istr at ion com m an ds.
Oth er docu m en t s available ar e ou t lin ed, click below.
See O2 Documentation Set
TABLE OF CONTENTS
Th is m an u al is divided in t o t h e followin g ch apt er s:
• 1 - In t r odu ct ion
• 2 - O 2 Syst em com m an ds
• 3 - O 2 Dat abase Adm in ist r at ion com m an ds
• 4 - O 2 Sch em a Adm in ist r at ion com m an ds
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
5
TABLE OF CONTENTS
1
Introduction
9
Structure of this manual ...............................................................10
Which commands can you use? ...................................................11
General use of commands ............................................................11
Help ..............................................................................................11
Batch files ....................................................................................11
Presentation conventions..............................................................12
Syntax presentation ......................................................................12
Naming conventions ....................................................................13
Set up environment ......................................................................13
2
O2 System Commands
15
2.1 Options for the O2 System Commands .................................16
2.2 O2 System Commands ............................................................20
o2api_shell ...................................................................................21
o2dba_backup ..............................................................................22
o2dba_backup_display.................................................................27
o2dba_backup_label.....................................................................30
o2dba_base_dump........................................................................32
o2dba_base_load ..........................................................................35
o2dba_check.................................................................................38
o2dba_copy ..................................................................................41
o2dba_env ....................................................................................43
o2dba_init.....................................................................................45
o2dba_monitor .............................................................................47
o2dba_move_volume ...................................................................50
o2dba_restore ...............................................................................52
o2dba_rm .....................................................................................57
o2dba_schema_dump...................................................................59
o2dba_schema_load .....................................................................62
o2dba_shell ..................................................................................65
o2dba_shutdown ..........................................................................67
o2dsa_shell...................................................................................69
o2patch .........................................................................................71
6
O2 System Adm in ist r at ion Refer en ce M an u al
TABLE OF CONTENTS
o2server ....................................................................................... 72
o2shell.......................................................................................... 74
o2tools ......................................................................................... 76
3
O2 DBA Commands
79
3.1 Applications ............................................................................. 80
3.2 Bases ........................................................................................ 81
3.3 Clusters .................................................................................... 84
Create cluster ............................................................................... 84
Delete cluster ............................................................................... 85
Display clusters ........................................................................... 85
Promote cluster ............................................................................ 86
3.4 Display command .................................................................... 86
3.5 Help ........................................................................................... 86
3.6 Indexes ..................................................................................... 87
3.7 Names ....................................................................................... 88
3.8 Programs .................................................................................. 89
3.9 Query ........................................................................................ 90
3.10 Transactions ............................................................................ 91
3.11 Volumes .................................................................................... 93
3.12 List ............................................................................................ 95
4
O2 DSA Commands
97
4.1 Attributes .................................................................................. 98
4.2 Bases ........................................................................................ 98
4.3 Classes ..................................................................................... 99
4.4 Libraries.................................................................................. 102
4.5 Methods .................................................................................. 103
4.6 Names ..................................................................................... 104
O2 Syst em Adm in ist r at ion Refer en ce M an u al
7
TABLE OF CONTENTS
4.7 Schemas..................................................................................106
4.8 Sources ................................................................................... 111
4.9 Inheritance .............................................................................. 112
4.10 List ........................................................................................... 113
INDEX
8
O2 System Adm in ist r at ion Refer en ce M an u al
117
1
1
I ntr oduction
O2 SYSTEM AD MINISTRATION COMM ANDS
O2 pr ovides a n u m ber of system adm in ist r at ion fu n ct ion s. Th ese
fu n ct ion s ar e called t h r ou gh com m an ds wh ich ar e descr ibed in t h is
m an u al. Th e con t ext in wh ich t h ese fu n ct ion s m ay be u sed an d t h e best
way t o get t h e m ost fr om an O2 syst em is discu ssed in t h e O2 Sy stem
Ad ministration Guid e.
Adm in ist r ation com m an ds fall in to t h r ee cat egor ies. Th er e ar e O2
syst em com m an ds, O2 dat abase adm in ist r at ion com m an ds an d O 2
sch em a adm in ist r ation com m an ds.
System com m an ds in clu de t h ose n ecessar y for st ar t in g an d st oppin g
O2 , copyin g, ch eck in g, r em ovin g an d r efor m at t in g, am on g ot h er s.
O2 dat abase adm in ist r at ion com m an ds ar e k n own as O2 DBA
com m an ds an d t h ey in clu de com m an ds t o adm in ist er volu m es, bases,
in dexes, clu st er s an d so on .
O2 sch em a adm in ist r at ion com m an ds ar e k n own as O2 DSA com m an ds
an d t h ey in clu de com m an ds t o cr eat e a sch em a or t o expor t som e of it s
classes, for exam ple.
If you ar e u sin g O 2 C r efer t o th e O2 C docu m en t at ion for m or e specific
com m an ds.
O2 Syst em Adm in ist r at ion Refer en ce Man u al
9
1
Introduction
Structure of this manual
O 2 syst em com m an ds ar e ou t lin ed in Sect ion 2. Com m an ds ar e given in
alph abet ical or der .
O 2 DBA an d O2 DSA com m an ds ar e descr ibed in Section s 3 an d 4. Each
sect ion is divided in t o su bsect ion s wit h a su bsect ion per elem en t t h at
can be adm in ist er ed given in alph abet ical or der . For exam ple
applicat ion s, bases, et c.
Th e act ion s wh ich can be car r ied ou t on each elem en t ar e list ed in
alph abet ical or der . For exam ple, cr eat e, delet e, display, et c.
Th is m an u al con tain s t h e followin g sect ion s:
10
1.
In t r odu ct ion
2.
O2 Syst em Com m an ds
3.
O2 DBA Com m an ds
4.
O2 DSA Com m an ds
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
Which commands can you use?
Which commands can you use?
Regar dless of t h e t ype of licen se you h ave, you can u se all system
com m an ds an d O2 DBA com m an ds.
To u se O2 DSA com m an ds you n eed a developm en t licen ce.
General use of commands
O 2 com m an ds ar e case sen sit ive an d m u lt iple com m an ds m u st be
separ at ed by sem icolon s. However , t h e syst em ign or es spacin g or lin e
br eak s. In t h e descr ipt ion s below spacin g is for pr esen t at ion pu r poses
on ly.
You can type t h e com m an ds dir ectly in O2 sh ell, O2 DBA or O2 DSA.
O 2 execu t es a com m an d or ser ies of com m an ds wh en it en cou n t er s a
t er m in at ion in dicat or . Th is is control/D for Un ix an d control/Z for
Win dows.
You can give com m en ts bet ween /* an d */ (as in C).
Help
To get on -lin e h elp, u se t h e com m an d:
help [O2_keyword]
If you t ype help, you obt ain a fu ll list of O2 com m an ds. Th e syn tax an d
a br ief descr ipt ion is given for each com m an d.
Wh en you u se an O2_keyword, help gives in for m at ion for th ose
com m an ds wh ich con t ain th e k eywor d.
Batch files
Com m an ds m ay be execu t ed fr om a file in st ead of bein g en t er ed
m an u ally. You do t h is by t ypin g t h e com m an d:
# "/path/filename"
or
#include "/path/filename"
Th e path can be an y valid pat h . It can begin wit h t h e O2 k eywor d
O2HOME, wh ich in dicat es t h e O2 in stallat ion dir ect or y. All com m an ds in
filename m u st be separ at ed by a “;”.
O2 Syst em Adm in ist r ation Refer en ce Man u al
11
1
Introduction
You can also execu t e com m an ds fr om a file by r edir ect in g t h e st an dar d
in pu t as follows: o2dba_shell <filename. All t h e com m an ds in
filename m u st be separ at ed by a “;”.
For t h e r edir ect ion t o wor k pr oper ly, t h e last com m an d in filename
m u st be qu i t . If it is n ot , an im plicit abor t is car r ied ou t aft er t h e last
com m an d.
Presentation conventions
Th e followin g pr esen t at ion con ven t ion s ar e u sed in th is m an u al.
Syntax presentation
O 2 com m an ds ar e pr esen t ed in a typewriter t ype face as ar e all t h e
br ack ets, com m as an d colon s t h at ar e par t of t h e lan gu age syn t ax, e.g:
import schema o2kit class Date, Bitmap;
Keywor ds ar e pr esen t ed in t ypewr it er t ypeface wh ile oth er it em s ar e in
it alics. Th ese in clu de in for m at ion you m u st en t er an d t er m s wh ich
su m m ar ize an ot h er par t of t h e com m an d. Opt ion s ar e en closed in
squ ar e br ack et s.
For exam ple:
[create] cluster root_name on path
If t h e closin g squ ar e br ack et is followed by an ellipsis (...) t h en you can
r epeat t h e in for m ation en t er ed.
export schema [class Class_name [, Class_name]...]
With ou t t h e ellipsis, t h e in for m at ion can be en t er ed on ly on ce.
display volume [volume_name] [stat]
Wh en differ en t valu es can be in pu t t h ey ar e sh own in br aces { } an d
each ch oice is separ at ed by th e wor d or.
catalog transaction {on or off}
12
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
Naming conventions
Wh en br aces, squ ar e br ack et s an d t h e wor d or ar e par t of th e
com m an d syn t ax th ey ar e n ot sh own in it alics bu t in typewr it er
t ypeface,
{ }, [ ], or.
Naming conventions
Nam es in O 2 m u st begin wit h a let t er an d can be followed by an y
n u m ber of let t er s, digits or u n der scor e ch ar act er s. You can u se
u pper -case an d lower -case lett er s bu t n am es ar e case-sen sit ive.
• Names
Th ese ar e class_name, attribute_name, method_name,
property_name, n am ed valu e or n am ed object (obj_or_value_name),
volume_name, schema_name, base_name, constant_name.
Th er e ar e sever al ot h er special k in ds of n am es:
• user_name
Th is is th e oper at in g system log-in n am e.
• "/path/filename" and "/directory_path"
Th ese specify an oper atin g syst em file an d dir ect or y n am e. Th ey m u st
be valid pat h s an d m u st be en closed in dou ble-qu ot e m ar k s. Th ey ar e
r efer r ed t o as t h e path_name in t h e com m an ds in t h is m an u al.
• documentation
Th is is fr ee t ext t h at can h ave m u lt iple lin es.
Set up environment
A n u m ber of com m an ds exist t o set u p you r en vir on m en t .
An O 2 en vir on m en t con sist s of t h e followin g elem en t s:
• Cu r r en t volu m e
• Cu r r en t sch em a
• Cu r r en t base
• Cu r r en t class
O2 Syst em Adm in ist r ation Refer en ce Man u al
13
1
Introduction
Th e display com m an d sh ows t h e cu r r en t en vir on m en t.
An O 2 n am ed sy st em is a logical u n it m ade u p of on e or m or e ph ysical
volu m es, on e or m or e sch em as, an d on e or m or e bases. Th er e m ay be
sever al n am ed syst em s act ive on on e com pu t er or n et wor k , bu t a sin gle
O 2 session oper at es on on e n am ed system , wh ich m u st be specified
wh en O2 is st ar t ed.
Th e n am e of t h e base, sch em a, volu m e or class is oft en opt ion al in a
com m an d. Th is is becau se a defau lt valu e is tak en . If t h e n am e is n ot
en t er ed, t h e syst em t ak es t h e cu r r en t base, t h e sch em a n am e as
establish ed by t h e set base or set schema com m an d, or t h e cu r r en t
volu m e, in it ially DefaultVol.
DefaultVol is t h e fir st u ser volu m e, cr eat ed du r in g syst em
in itializat ion . Th e cu r r en t class is defin ed u sin g t h e set class
com m an d.
O 2 au t om at ically ch an ges t h e cu r r en t volu m e wh en ever a set schema
or set base com m an d specifies a sch em a r esidin g in a differ en t
ph ysical volu m e. Th e cu r r en t volu m e always follows t h e cu r r en t
sch em a.
Th er e is n o set volume com m an d.
With in a n am ed syst em , t h e r elat ion sh ip bet ween ph ysical volu m es,
logical bases an d sch em as is r ecor ded in a cat al ogu e. Com m an ds
wh ich cr eat e, delet e or r en am e t h ese elem en t s in volve ch an ges t o t h e
cat alogu e.
Updat in g t h e cat alogu e can be m ade par t of a developm en t t r an sact ion
wh ich you com m it explicit ly. Alt er n at ively, you can car r y ou t each
cat alogu e u pdat e as a t r an sact ion . In t h is way O 2 com m it s u pdat es
im m ediat ely.
Wh ich m et h od you u se is defin ed by t h e followin g com m an d:
catalog transaction {on or off}
wh er e off is t h e defau lt valu e.
14
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
2
2
O2 System Commands
Th is ch apt er ou tlin es t h e O2 syst em com m an ds. It is divided in t o t h e
followin g sect ion s :
• Opt ion s for t h e O2 Syst em Com m an ds
• O2 Syst em Com m an ds
Th e pr ogr am s called by t h ese com m an ds ar e fou n d in th e bin
su bdir ector y of t h e O 2 in st allat ion dir ector y.
O2 Syst em Adm in ist r at ion Refer en ce Man u al
15
2
O2 System Commands
2.1 Options for the O2 System Commands
All O2 syst em com m an ds n eed opt ion s t o r u n . Th er e ar e t wo k in ds of
opt ion s:
• Opt ion s for O2 Stor e clien t s - th ese ar e th e o2 ser v er op t i on s.
• Opt ion s for O2 clien t s - t h ese ar e t h e o2 opt i on s.
2.1.1 o2server options
Th ese opt ion s ar e u sed by o2server, o2dba_init, o2dba_monitor,
o2dba_shutdown, o2dba_backup, o2dba_restore, o2dba_copy,
o2dba_env, an d o2dba_rm.
Th e option s ar e fou n d by descen din g or der of pr ior it y:
• In th e com m an d lin e.
Exam ple:
o2server -mode single-user
• As a st r in g in t h e O2SERVEROPTIONS en vir on m en t var iable.
Exam ple:
setenv O2SERVEROPTIONS "-mode single-user"
• In th e O2HOME/ .o2ser ver r c con figu r at ion file.
Exam ple:
my_system.mode = single-user
Refer t o t h e O2 Sy stem Administration Guid e for fu r th er det ails
con cer n in g t h e con figu r at ion file .o2ser ver r c.
16
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
Options for the O2 System Commands :
An alph abetical list of all t h e opt ion s t h at you can defin e in t h e
.o2ser ver r c file is as follows:
+[syst em .] background
[syst em .] cachesize = size in k ilobyt es (ser ver cach e)
[syst em .] cataldir = pat h t o dir ect or y
[syst em .] coldlogdir = pat h t o dir ect or y
[syst em .] defaultvolsize = size in k ilobyt es
+[syst em .] foreground
[syst em .] logdir = pat h t o dir ect or y
[syst em .] logsize = size in k ilobyt es
[syst em .] mode = m u lt i-u ser , sin gle-u ser , or tr an sact ion -off
[syst em .] server = m ach in e n am e for o2ser ver
[syst em .] shadowdir = pat h t o dir ect or y
[syst em .] shadowsize = size in k ilobyt es
system = syst em n am e
+[syst em .] verbose
2.1.2 o2 options
Th ese opt ion s ar e u sed by o2shell, o2dsa_shell, o2dba_shell,
o2tools, o2dba_schema_dump, o2dba_schema_load, o2dba_check,
an d all C++ system com m an ds (o2ccp_, r efer t o t h e C++ Binding
Reference Manual ). For t h e C++ Ru n t im e opt ion s see bot h C++ m an u als,
t h e C++ Binding Reference Manual an d t h e C++ Bind ing Guid e. For t h e
OQL opt im izer opt ion r efer t o t h e In dexin g Ch apt er in th e Sy stem
Ad ministration Guide.
Th e opt ion s ar e fou n d by descen din g or der of pr ior ity:
• In th e com m an d lin e.
Exam ple:
o2dba_check -verbose
• As a st r in g in t h e O2OPTIONS en vir on m en t var iable.
Exam ple:
setenv O2OPTIONS "-verbose"
• In th e HOME/ .o2r c con figu r at ion file t h at is defin ed in t h e u ser
HOM E.
Exam ple:
+my_system.verbose
• In th e O2HOME/ .o2r c con figu r at ion file.
Exam ple:
+my_system.verbose
O2 Syst em Adm in ist r ation Refer en ce Man u al
17
2
O2 System Commands
The .o2rc configuration file
Th e .o2r c con figu r ation file m ay exist in an y u ser HOME. A global file
can also exist in t h e O2HOME dir ect or y. Th is file con t ain s
fr ee-for m at ted lin es, wh er e each lin e defin es an opt ion applied t o an
O2 clien t .
Th e gen er al syn t ax of an opt ion defin ition is:
[system_name.] property_name = property_value
or
+[system_name.] boolean_property_name
Exam ple:
my_system.cachesize = 400000
+ my_system.verbose
Th e syst em _n am e m ay be om it t ed. In th is case t h e pr oper t y applies t o
t h e syst em u sed by t h e O2 com m an d. Th is can be seen in th e
followin g exam ple:
system = my_system
cachesize = 40000
another_system.cachesize = 20000
A lin e begin n in g wit h th e ";" ch ar act er is a com m en t .
An alph abet ical list of all th e opt ion s t h at you can defin e in t h e .o2r c
files is as follows:
18
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
Options for the O2 System Commands :
+[syst em .] alpha disable t h e gr aph ical opt ion for br owsin g
[syst em .] cachesize = size in k ilobyt es (clien t cach e)
[syst em .] libpath = pat h 1: pat h 2: ...path n (dir ect or ies for
dyn am ic libr ar ies)
[syst em .] libs = lib1: lib2: ..libn (dyn am ic libr ar ies for O2 C)
+[syst em .] o2cccheck1 do dyn am ic t ype ch eck in g in C++
applicat ion s
[syst em .] o2ccnumber2 = n u m ber of C++ object s in t h e er ase
bu ffer
[syst em .] oql_index_selectivity3 = m in im u m selectivit y for
ch oosin g in in dex
[syst em .] server = m ach in e n am e wh er e o2ser ver r u n s
[syst em .] swapdir = pat h t o dir ect or y
[syst em .] swapsize = size in k ilobyt es
system = syst em n am e
+[syst em .] verbose
1. Refer to the C++ manuals
2. Refer to the C++ manuals
3. See Indexing in the System Administration
Guide
O2 Syst em Adm in ist r ation Refer en ce Man u al
19
2
O2 System Commands
2.2 O2 System Commands
Th is ch apt er ou t lin es t h e com m an ds list ed below. Th ey ar e given in
alph abet ical or der .
• o2api_shell
• o2dba_backup
• o2dba_backup_display
• o2dba_backup_label
• o2dba_base_dump
• o2dba_base_load
• o2dba_check
• o2dba_copy
• o2dba_env
• o2dba_init
• o2dba_monitor
• o2dba_move_volume
• o2dba_restore
• o2dba_rm
• o2dba_schema_dump
• o2dba_schema_load
• o2dba_shell
• o2dba_shutdown
• o2dba_shell
• o2patch
• o2server
• o2shell
• o2tools
20
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
O2 System Commands : o2api_shell
o2api_shell
Summary
Calls u p t h e O2 Sch em a adm in ist r at ion u t ilit y, wh ich allows you t o
access t h e O2 En gin e API developm en t com m an ds.
Syntax
o2api_shell [-system system_name] [-server machine_name]
o2api_shell -version
o2api_shell -help
o2api_shell -env
Description
Th is syst em com m an d allows you t o develop an d t est O2 applicat ion s
in t en ded to be u sed exclu sively wit h O 2 En gin e API.
It gives you access t o all th e O2 com m an ds, as does o2shell. Un lik e
o2shell, h owever , n o sou r ce su ppor t is pr ovided.
For in st an ce, if you cr eat e a class wit h O2 En gin e API pr im it ives you can
display t h is class wit h o2api_shell, wh ile o2shell will fail becau se it
expect s t o fin d t h e sou r ce code of t h e class.
Options
-system
Specifies t h e O 2 n am ed syst em t o con n ect t o. An
o2server m u st alr eady be r u n n in g on th is syst em
befor e o2api_shell is in vok ed.
-server
Specifies t h e m ach in e n am e wh er e o2server is
r u n n in g.
-version
Displays in for m at ion abou t t h e cu r r en t ver sion an d
exit s.
-help
Displays in for m at ion abou t t h e possible opt ion s an d
exit s.
-env
Displays t h e act u al valu e t ak en for t h e opt ion s an d
exit s. Allows you t o ver ify t h at t h e opt ion m ech an ism
(explicit an d im plicit ) is cor r ect ly set .
Default Options
Th e pr eviou s o2opt ion s an d ot h er s can be im plicit ly set
as explain ed in 2.1.2.
Environment variables
O2HOME
Is m an dat or y an d con t ain s t h e pat h t o t h e O 2
in st allat ion dir ect or y.
O2OPTIONS
See 2.1.2.
O2 Syst em Adm in ist r ation Refer en ce Man u al
21
2
O2 System Commands
o2dba_backup
Summary
Back s u p a syst em
Syntax
o2dba_backup{-file filename [ -size filesize ] |
-tape device_name}
[-system system_name] [-server server_name]
[-witharchive] [-archivelog] [-nointeractive] [-continue]
[-date [yy-]mmdd[HHMM]
[-period {num[-HHMM] | numH | dd[-HHMM]W | dd[-HHMM]M]}
[-verbose]
o2dba_backup -version
o2dba_backup -help
o2dba_backup -env
Description
o2dba_backup per for m s system back u p eith er on -lin e or off-lin e
depen din g on wh eth er t h e ser ver is r u n n in g.
By defau lt , o2dba_backup car r ies ou t a fu ll back u p of th e system . Th e
ser ver 's log m ode (h ot or cold) is left u n ch an ged aft er t h e back u p. If
opt ion -witharchive is in vok ed, a fu ll back u p of t h e syst em is followed
by con t in u ou s back u p of th e log files. In t h is case o2dba_backup set s
t h e ser ver t o cold log m ode.
If o2dba_backup is in vok ed wit h option -archivelog, th e cold log files
ar e con t in u ou sly ar ch ived. Th e ser ver is set t o cold log m ode. Th is
opt ion is sim ilar t o t h e opt ion -witharchive except t h at a fu ll syst em
back u p is n ot car r ied ou t.
Th e ph ysical su ppor t s for t h e back u p can be eit h er t apes or r egu lar files
on separ at e ph ysical devices. Th e back u p can ext en d acr oss m u lt iple
back u p m edia volu m es. If t h e back u p device is a r egu lar file t h e opt ion
-size specifies t h e m axim u m file size in k ilo-byt es. Th er e ar e t h r ee
con dition s in wh ich o2dba_backup st ops an d waits for a n ew back u p
file: t h e ph ysical device is fu ll; t h e m axim u m size of a file allowed by
t h e oper at in g syst em is r each ed; or t h e m axim u m size of t h e file
specified by t h e opt ion -size is r each ed.
A u n iqu e back u p id entifier is gen er at ed an d wr it t en t o t h e fir st volu m e of
t h e back u p m edia wh en a back u p session begin s. Th e id entifier is
com posed of a t im e-st am p of th e session an d t h e n am e of t h e syst em
bein g saved. Wh en r est or in g t h e system , t h is iden t ifier can be u sed t o
iden t ify t h e desir ed back u p ver sion .
22
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
O2 System Commands : o2dba_backup
By defau lt, o2dba_backup r u n s in in ter act ive m ode. If a back u p span s
m u lt i-volu m es t h e system qu er ies t h e u ser for back u p m edia volu m e
ch an ges. If opt ion -nointeractive is in vok ed, t h e system sen ds a
m essage t o t h e back u p h istor y log file, an d polls per iodically t h e back u p
device u n t il a volu m e ch an ge h as been det ect ed, u pon wh ich it r esu m es
syst em back u p. In bot h m odes, o2dba_backup ver ifies t h at t h e
m ou n t ed back u p m edia volu m e wor k s. Th e opt ion -nointeractive is
u sefu l wh en o2dba_backup is in t egr ated in t o an au t om atic system
adm in ist r at ion en vir on m en t.
En t r ies ar e gen er at ed in t o t h e back u p h ist or y file. Th ese ar e:
• en t r ies of t h e begin n in g an d t h e en d of t h e back u p session ;
• en t r ies abou t back u p m edia volu m es an d t h eir log files;
Th e above in for m at ion is u sed wh en o2dba_backup r esu m es system
back u p aft er h avin g been stopped.
By defau lt , o2dba_backup begin s a n ew back u p session . To r esu m e t h e
pr ecedin g back u p session in st ead of star t in g a n ew on e u se opt ion
-continue. To r esu m e t h e pr ecedin g syst em back u p session aft er a
ser ver sh u t down or a syst em cr ash , o2dba_backup r equ ir es t h e fir st
volu m e of t h e back u p m edia in or der t o r etr ieve th e identifier of t h e
session . o2dba_backup m u st scan t h e m edia volu m es t o locate t h e
volu m e t o con t in u e t h e back u p.
Sign al INT or TERM ar e u sed t o t er m in at e a syst em back u p session ,
wh ich leaves t h e ser ver in cold log m ode. Aft er war ds, o2dba_backup
can be r e-lau n ch ed t o eit h er begin a n ew back u p session or r esu m e t h e
pr ecedin g session wit h option -continue. Th e sign als INT an d TERM
ar e u t ilized wh en back u p is car r ied ou t by a t h ir d par t y back u p
pr odu ct , for fu r t h er in for m at ion see th e Sy stem Ad ministration Guid e.
Options
-archivelog
Ar ch ive cold log files with ou t doin g syst em back u p. Th e
pr ogr am con t in u es t o r u n u n t il explicit ly st opped.
-continue
Resu m es t h e pr ecedin g back u p in stead of begin n in g a
n ew on e. You can ch an ge back u p t ype by givin g
an ot h er dat e or per iod by sam ples.
O2 Syst em Adm in ist r ation Refer en ce Man u al
23
2
O2 System Commands
-date [yy-]m m dd[HHM M]
Th e back u p sh ou ld be per for m ed u p t o a given t im e.
H
h ou r - 00 t o 23
M
m in u te - 00 t o 59
d
day of m on t h - 01 t o 31
m
m on t h of year - 01 to 12
y
year - 00 t o 99
Not e: 00 cor r espon ds t o t h e year 2000.
Th e n am e of t h e file wh ich will con t ain t h e back u p.
-file
-period period
Begin s a n ew back u p session per iodically accor din g t o
t h e r u le defin ed by period. Th e r u n n in g session is
t er m in at ed befor e t h e n ew session begin s. Th is
gu ar an t ees t h at in for m at ion can n ot be lost bet ween
t wo su ccessive back u p session s. Ar gu m en t period
m u st h ave on e of t h e followin g for m s:
num [-HHM M]
Begin s
num
H
M
a n ew session ever y num days;
n u m ber of days
h ou r - 00 t o 23
m in u t e - 00 t o 59
numH
Begin s a n ew session ever y num h ou r s;
num
n u m ber of h ou r s
24
dd [-HH MM]W
Begin s
dd
H
M
a n ew session ever y week ;
days of t h e week - 01 to 07
h ou r - 00 t o 23
m in u t e - 00 t o 59
dd [-HH MM]M
Begin s
dd
H
M
a n ew session ever y m on t h ;
days of m on t h - 01 t o 31
h ou r - 00 t o 23
m in u t e - 00 t o 59
-server
Ru n th e o2server pr ocess on server_name, if n ot
alr eady r u n n in g.
-system
Specifies t h e O 2 syst em n am e. If t h is opt ion is n ot
u sed, t h e syst em n am e given by t h e en vir on m en t is
u sed (see Defau lt opt ion s below).
-tape
Th e n am e of t h e device wh ich will con t ain t h e back u p.
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
O2 System Commands : o2dba_backup
-witharchive
Th e syst em back u p is followed by cold log file
ar ch ivin g. Th e pr ogr am con tin u es t o r u n u n t il
explicit ly st opped.
-verbose
Ret u r n s addit ion al in for m at ion abou t t h e oper at ion .
-version
Displays in for m at ion abou t t h e cu r r en t ver sion an d
exit s.
-help
Displays in for m at ion abou t t h e possible opt ion s an d
exit s.
-env
Displays t h e act u al valu e t ak en for t h e opt ion s an d
exit s. Allows you t o ver ify th at t h e opt ion
m ech an ism (explicit an d im plicit ) is cor r ect ly set .
Default Options
Th e pr eviou s o2 ser ver opt ion s as well as ot h er
opt ion s can be im plicit ly set as explain ed in 2.1.1.
Environment variables
O2HOME
Is m an dator y an d con t ain s t h e pat h t o t h e O 2
in st allat ion dir ect or y.
O2SERVEROPTIONS See 2.1.1.
Example
Th e com m an d below back s u p syst em sys t o device /dev/mnt.
o2dba_backup st ops wh en th e back u p fin ish es. It r u n s in t er act ively. If
volu m e ch an ge is n eeded, t h e u ser will be qu er ied.
o2dba_backup -system sys -tape /dev/mnt
Th e followin g com m an d back s u p t h e syst em t o device /dev/mnt. Aft er
t h e back u p is com plet ed, o2dba_backup con t in u es t o back u p t h e cold
log file u n t il Oct ober 20 m idn igh t of t h e cu r r en t year .
o2dba_backup -tape /dev/mnt -witharchive -nointeractive
-date 10200000
Th e followin g com m an d en su r es a week ly back u p. A back u p session
begin s ever y M on day at 12 n oon t ill n ext Mon day befor e bein g
su cceeded by an ot h er session .
o2dba_backup -tape /dev/mnt -witharchive -nointeractive
-period 01-1200W
O2 Syst em Adm in ist r ation Refer en ce Man u al
25
2
O2 System Commands
Th e followin g com m an d r esu m es an in t er r u pt ed back u p session . Su ch
opt ion s m ay be u t ilized aft er a sever e system cr ash .
o2dba_backup -tape /dev/mnt -continue -nointeractive
Th e followin g is an exam ple of an in t er act ive session .
warning: Reach end of tape. Insert the next tape (#2) and
strike Enter ...
warning: Bad medium Id... Insert another tape and strike
Enter ...
FILES
En tr ies ar e gen er at ed in t h e back u p h ist or y file du r in g t h e back u p
session . Th e back u p h istor y file is fou n d in th e sam e dir ect or y as t h e
syst em 's catalog file. Th is is a per -syst em plain text file. It s n am e is
com posed by th e system n am e an d pr efix o2backuplog.
SEE ALSO o2dba_restore, o2dba_backup_display, o2dba_backup_label
26
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
O2 System Commands : o2dba_backup_display
o2dba_backup_display
Summary
Display back u p h ist or y
Syntax
o2dba_backup_display{-file filename |-tape device_name}
[-system system_name] [-label string]
[-history filename] [-date [yy-]mmdd[HHMM] ] [-verbose]
o2dba_backup_display -version
o2dba_backup_display -help
o2dba_backup_display -env
Description
o2dba_backup_display an alyzes t h e back u p h istor y an d display t h e
in for m at ion in an u ser fr ien dly way. Th e in for m at ion pr ovides:
• th e per iod th e syst em h as been back ed u p;
• if a back u p span s m u lt i volu m es, t h e iden t ificat ion of each volu m e;
• syst em st at es labeled du r in g back u p session s;
o2dba_backup_display m ay be u sed to an alyze t h e h ist or y file of a
syst em back u p in or der t o wor k ou t a plan for syst em r estor at ion .
o2dba_backup_display t ak es t h e defau lt syst em 's back u p h ist or y file
u n less an ar gu m en t filename is given . Th e file filename m u st be a
back u p h ist or y file.
In st ead of r eadin g back u p h ist or y in for m at ion fr om a back u p h ist or y
file, o2dba_backup_display can r ead in for m at ion dir ectly fr om
syst em back u p ar ch ives. Th e opt ion s -file or -tape ar e pr ovided for
t h is pu r pose.
Options
-date
Pr ovides th e even t s for t h e specified date.
-file
Th e n am e of t h e file wh ich will con t ain th e back u p.
-history
Specifies th e n am e of th e h istor ic file wh ich m u st be
u sed.
O2 Syst em Adm in ist r ation Refer en ce Man u al
27
2
O2 System Commands
-label
Associat es t h e descr ipt ive label string t o th e cu r r en t
syst em state.
-system
Specifies t h e O 2 syst em n am e. If t h is opt ion is n ot
u sed, t h e syst em n am e given by t h e en vir on m en t is
u sed (see Defau lt opt ion s below).
-tape
Th e n am e of t h e device wh ich will con t ain t h e back u p.
-verbose
Retu r n s addit ion al in for m at ion abou t t h e oper at ion .
-version
Displays in for m at ion abou t t h e cu r r en t ver sion an d
exit s.
-help
Displays in for m at ion abou t t h e possible opt ion s an d
exit s.
-env
Displays t h e act u al valu e t ak en for t h e opt ion s an d
exit s. Allows you t o ver ify t h at t h e option
m ech an ism (explicit an d im plicit ) is cor r ect ly set .
Default Options
Th e pr eviou s o2 ser ver option s as well as ot h er
opt ion s can be im plicit ly set as explain ed in 2.1.1.
Environment variables
O2HOME
Is m an dat or y an d con t ain s t h e pat h t o t h e O2
in st allat ion dir ect or y.
O2SERVEROPTIONS See 2.1.1.
Example
An exam ple of a back u p h ist or y file for a syst em m ay look lik e th is:
Begin backup session system_name_22091997150154 in
/home/user/system_name/tmp/system_name at 22/09/1997 15:01
Beginning of media volume system_name_22091997150154_1 at
22/09/1997 15:01
State 22091997150101 label sep97 at 22/09/1997 15:01
Writing volume CatalVol /u/system_name/dve/home/bases/catalog_system_name at
22/09/1997 15:01
Done volume CatalVol /u/system_name/dve/home/bases/catalog_system_name at
22/09/1997 15:02
28
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
O2 System Commands : o2dba_backup_display
Writing volume DefaultVol /u/system_name/dve/home/bases/DefaultVol_3_system_name at
22/09/1997 15:02
Done volume DefaultVol /u/system_name/dve/home/bases/DefaultVol_3_system_name at
22/09/1997 15:02
Writing log
/u/system_name/dve/home/bases/coldlog_6_system_name
(Interval : 22/09/1997 15:01 - 22/09/1997 15:01) at
22/09/1997 15:02
Done log
/u/system_name/dve/home/bases/coldlog_6_system_name
(Interval : 22/09/1997 15:01 - 22/09/1997 15:01) at
22/09/1997 15:02
End complete system backup system_name_22091997150154 at
22/09/1997 15:02
State 22091997150201 label sep97 at 22/09/1997 15:02
End backup session system_name_22091997150154 in
/home/user/system_name/tmp/system_name at 22/09/1997 15:02
An d th e o2dba_backup_display r epor t s som et h in g lik e t h is:
Backup session ‘sys_22091997150154' :
from: ‘22/09/1997 15:01:00' to: ‘22/09/1997 15:02:00'
backup media volumes:
volume: ‘sys_22091997150154_1'
states:
state ‘22091997150101' labeled ‘Avant_repas' at ‘22/09/1997
15:01:00'
state ‘22091997150201' labeled ‘Apres_repas' at ‘22/09/1997
15:02:00'
volumes list:
‘/u/sys/dve/home/bases/catalog_sys'
‘/u/sys/dve/home/bases/DefaultVol_3_sys'
log list:
‘/u/sys/dve/home/bases/coldlog_0_sys'
O2 Syst em Adm in ist r ation Refer en ce Man u al
29
2
O2 System Commands
o2dba_backup_label
Summary
Mar k s t h e cu r r en t syst em st at e wit h a label
Syntax
o2dba_backup_label [-system system_name]
[-label string ] [-verbose]
o2dba_backup_label -version
o2dba_backup_label -help
o2dba_backup_label -env
Description
o2dba_backup_label allows t o explicit ly give a n ew label t o a system .
It is possible for th e u ser t o associat e a syst em st at e wit h a t ext -for m ed
descr ipt ion wh ich is m ean in gfu l t o t h e u ser . Th is is in t en ded t o be u sed
by t h e adm in ist r at or t o m ak e a lan dm ar k wh ich is m ean in gfu l fr om t h e
applicat ion 's poin t of view.
A syst em st at e labelin g en t r y is gen er ated in t h e back u p h ist or y log. Th e
en t r y in dicat es t h e t im e st am p of t h e oper ation an d t h e associat ed
descr ipt ive st at e label if it exist s.
Du r in g r est or at ion , th e system adm in ist r at or can set t h e t im e st am p
associat ed wit h a par t icu lar label, u sin g th e opt ion date. Th e list of
labels can be displayed with t h e com m an d o2dba_backup_display.
Options
30
-label
Associat es string as a descr ipt ive label t o t h e cu r r en t
syst em state.
-server
Ru n th e o2server pr ocess on server_name, if n ot
alr eady r u n n in g.
-system
Specifies t h e O 2 syst em n am e. If t h is opt ion is n ot
u sed, t h e syst em n am e given by t h e en vir on m en t is
u sed (see Defau lt opt ion s below).
-verbose
Retu r n s addit ion al in for m at ion abou t t h e oper at ion .
-version
Displays in for m at ion abou t t h e cu r r en t ver sion an d
exit s.
-help
Displays in for m at ion abou t t h e possible opt ion s an d
exit s.
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
O2 System Commands : o2dba_backup_label
-env
Default Options
Displays t h e act u al valu e t ak en for t h e opt ion s an d
exit s. Allows you t o ver ify th at t h e opt ion
m ech an ism (explicit an d im plicit ) is cor r ect ly set .
Th e pr eviou s o2 ser ver opt ion s as well as ot h er
opt ion s can be im plicit ly set as explain ed in 2.1.1.
Environment variables
O2HOME
Is m an dator y an d con t ain s t h e pat h t o t h e O 2
in st allat ion dir ect or y.
O2SERVEROPTIONS See 2.1.1.
File
En t r ies ar e gen er at ed in t h e back u p h istor y file du r in g back u p. By
defau lt , t h e back u p h ist or y file is fou n d in t h e sam e dir ect or y as th e
syst em 's cat alog file. Th is is a syst em specific plain t ext file. It s n am e is
com posed of th e syst em n am e an d su ffix o2backuplog.
SEE ALSO o2dba_restore, o2dba_backup, o2dba_backup_display
O2 Syst em Adm in ist r ation Refer en ce Man u al
31
2
O2 System Commands
o2dba_base_dump
Summary
Syntax
Bu ilds a du m p con t ain in g on e or m or e bases fr om a given O 2 syst em .
o2dba_base_dump {-file filename | -tape device_name}
[-system system_name] [-server machine_name]
[[-base base_name] ...] [-all] [-noindex]
[-nocluster] [-verbose] [-optimize]
[-name user_label]
[-compressed]
o2dba_base_dump -version
o2dba_base_dump -help
o2dba_base_dump -env
Description
o2dba_base_dump du m ps t h e con t en t s of on e or m or e bases of an O 2
system to eit h er a file or tape device.
You can en t er t h e bases in t h e com m an d or ch oose t h em fr om a list . If
you en t er th em wit h th e com m an d, you ch oose ext er n al base n am es
wit h t h e -base or -all opt ion s.
If you do n ot u se eit h er of t h e above opt ion s t h e syst em displays t h e list
of all bases an d you select t h e bases you wan t .
St ar tin g fr om th is list of bases, o2dba_base_dump det ect s all
im por t -expor t r elation sh ips.
If th e object s in on e base r efer en ce object s in an ot h er base th at is n ot
select ed, you can eit h er :
a. r est ar t o2dba_base_dump an d ch oose all t h e bases con cer n ed,
in wh ich case t h e in t er -base r elat ion sh ip is pr eser ved
b. or do n ot h in g, in wh ich case r efer en ces t o objects in t h e
n on -select ed base ar e set t o n il an d a m essage is displayed.
o2dba_base_dump establish es a con n ect ion wit h an O2 ser ver r u n n in g
on t h e tar get syst em .
Options
32
-file
Th e n am e of a st an dar d file wh ich will con t ain t h e
du m p.
-compressed
Th e ou t pu t du m p is gen er ated in a com pr essed for m at .
-tape
Th e n am e of a t ape device wh ich will con t ain t h e du m p.
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
O2 System Commands : o2dba_base_dump
Default Options
-name
Wr it e at t h e begin n in g of t h e du m p a user_label.
-system
Specifies t h e O 2 n am ed syst em t o con n ect t o. An
o2server m u st alr eady be r u n n in g on th is syst em
befor e o2dba_base_dump is in vok ed.
-server
Specifies t h e m ach in e n am e wh er e o2server is
r u n n in g.
-base
Specifies t h e ext er n al n am e of a base (opt ion al). Th is
opt ion can be u sed r epeat edly t o pr ovide a list of bases.
If t h is opt ion or t h e -all opt ion is n ot u sed, a fu ll list
of bases is displayed for you t o ch oose fr om .
-all
All t h e bases in t h e given syst em ar e select ed.
-noindex
Do n ot du m p in dex in for m at ion . In t h is case
o2dba_base_load can n ot r estor e in dexes.
-nocluster
Do n ot du m p clu st er in for m at ion . D at a is du m ped bu t
clu st er in g in for m at ion is n ot t ak en in t o accou n t . In
t h is case o2dba_base_load can n ot r est or e clu st er in g.
-optimize
Uses clu st er in g in for m at ion t o opt im ize t h e ph ysical
position of dat a du m ped.
-verbose
Pr in t s in for m at ive m essages du r in g t h e
o2dba_base_dump session .
-version
Displays in for m at ion abou t t h e cu r r en t ver sion an d
exit s.
-help
Displays in for m at ion abou t t h e possible opt ion s an d
exit s.
-env
Displays t h e cu r r en t valu es for t h e var iou s opt ion s an d
exit s. Allows you t o ver ify t h at t h e opt ion m ech an ism
(explicit an d im plicit ) is cor r ect ly set .
Th e pr eviou s o2opt ion s an d ot h er s can be im plicit ly set
as explain ed in 2.1.2.
O2 Syst em Adm in ist r ation Refer en ce Man u al
33
2
O2 System Commands
Environment variables
O2HOME
Is m an dat or y an d con t ain s t h e pat h t o t h e O 2
in st allat ion dir ect or y.
O2OPTIONS
See 2.1.2.
Example
o2dba_base_dump -system sys -server svr -base b1 -base b2
-file bases.dump
o2dba_base_dump -system sys -server svr -all -tape
/dev/rmt0
Th e fir st exam ple du m ps t h e con t en t s of bases b1 an d b2 of t h e O2
syst em sys in t o a st an dar d file n am ed bases.dump.
Th e secon d exam ple du m ps all bases of t h e O2 syst em sys t o a t ape
device /dev/rmt0.
34
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
O2 System Commands : o2dba_base_load
o2dba_base_load
Summary
Loads dat a, pr eviou sly du m ped u sin g o2dba_base_dump, in t o exist in g
O2 bases.
Syntax
o2dba_base_load {-file filename | -tape device_name}
[-system system_name] [-server machine_name]
[-noindex] [-nocluster] [-verbose] [-Force]
o2dba_base_load
{-file filename | -tape device_name}
-identify
o2dba_base_load -version
o2dba_base_load -help
o2dba_base_load -env
Description
o2dba_base_load ext r act s t h e set of bases con t ain ed in a du m p
pr odu ced by o2dba_base_dump an d u pdates t h e cor r espon din g O2
bases in th e system .
Befor e st ar t in g t h is oper at ion , en su r e t h at:
a.
th e volu m es r equ ir ed by t h e n ew dat a act u ally exist.
b.
th e sch em as wh ich con t ain t h e bases ar e com piled an d ar e
exact ly t h e sam e as th ose in effect wh en t h e dat a was saved.
c.
bases wit h t h e sam e n am es exist an d ar e em pt y, t h at is, th ey
con t ain n o dat a, n o clu st er s an d n o in dexes.
You m u st n ot cr eate in dexes, clu st er s or base exten sion s, as t h ey ar e
r estor ed t o t h eir or igin al state wh en loadin g a base.
However , you can over r ide th e clu st er s an d in dexes, u sin g t h e
-nocluster an d -noindex opt ion s.
o2dba_base_load est ablish es a con n ection wit h an O2 ser ver r u n n in g
on t h e t ar get syst em .
Options
-file
Th e n am e of a st an dar d file wh ich will con t ain t h e
du m p.
-tape
Th e n am e of a t ape device wh ich will con t ain th e
du m p.
O2 Syst em Adm in ist r ation Refer en ce Man u al
35
2
O2 System Commands
-system
Specifies t h e O 2 n am ed syst em t o con n ect t o. An
o2server m u st alr eady be r u n n in g on t h is syst em
befor e o2dba_base_load is in vok ed.
-server
Specifies t h e m ach in e n am e wh er e o2server is
r u n n in g.
-identify
D isplay iden tifyin g in for m at ion abou t t h e du m ped
base.
-noindex
Ign or e in dex defin ition s con t ain ed in t h e du m p.
-nocluster
Ign or e clu st er in g in for m at ion con t ain ed in t h e du m p.
-Force
For ce t h e r est or at ion of a base w i t h ou t con sist en cy
ch eck . Th is m ay r en der a dat abase u n u sabl e! Refer t o
t h e O2 Sy stem Ad ministration Guide, in Sch em a
Updat es (base du m p an d base load).
-verbose
Pr in ts in for m ative m essages du r in g t h e
o2dba_base_load session .
-version
D isplays in for m at ion abou t t h e cu r r en t ver sion an d
exits.
-help
D isplays in for m at ion abou t t h e possible opt ion s an d
exits.
-env
D isplays t h e cu r r en t valu es for t h e var iou s opt ion s an d
exits. Allows you t o ver ify t h at th e opt ion m ech an ism
(explicit an d im plicit ) is cor r ect ly set.
Default Options
Th e pr eviou s o2opt ion s an d ot h er s can be im plicit ly set
as explain ed in 2.1.2.
Environment variables
O2HOME
Is m an dat or y an d con t ain s t h e pat h t o t h e O 2
in st allat ion dir ect or y.
O2OPTIONS
See 2.1.2.
Example
o2dba_base_load -system sys -server svr -file bases.dump
o2dba_base_load -system sys -server svr -tape /dev/rmt0
Th e above exam ples load dat a pr eviou sly du m ped by u sin g
o2dba_base_dump. In t h e fir st exam ple, t h e du m ped dat a was st or ed in
36
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
O2 System Commands : o2dba_base_load
a st an dar d file bases.dump, an d in t h e secon d on e t h e du m ped dat a
was stor ed in a tape wh ose device n am e is /dev/rmt0.
O2 Syst em Adm in ist r ation Refer en ce Man u al
37
2
O2 System Commands
o2dba_check
Summary
Ch eck s t h e con sist en cy of all objects of a sch em a or base. You can
ch eck a closed sch em a, a t r an sit ive closu r e of sch em as an d bases lin k ed
by an im por t r elat ion sh ip or a base an d its associat ed sch em a.
Syntax
o2dba_check [-system system_name] [-server machine_name]
[[-schema schema_name] ...] [-all_schemas]
[[-base base_name] ...] [-all_bases] [-all] [-log logging_file]
[-recover] [-verbose] [-help] [-Validate number_of_objects]
[-CheckingLevel {0| 1}]
o2dba_check -version
o2dba_check -help
o2dba_check -env
Description
o2dba_check gen er at es in for m at ion abou t er r on eou s r efer en ces am on g
object s an d com plex valu es in an O2 syst em . If o2dba_check is r u n in
r ecover m ode, er r on eou s r efer en ces ar e r eplaced as follows:
• r efer en ces t o object s ar e r eplaced by a n il poin t er .
• r efer en ces t o com plex valu es ar e r eplaced by a cor r espon din g valu e
t h at is in it ialized wit h O2 defau lt valu es.
o2dba_check oper at es on a list of sch em as an d bases st or ed in t h e
system , an d displays in for m at ion dir ect ly or r et u r n s it t o a file. You
en t er t h e sch em as an d bases in t h e com m an d or you can ch oose t h em
fr om a list .
Opt ion s ar e available t o select bases an d sch em as by t h eir ext er n al
n am es.
Th er e ar e also gr ou p opt ion s su ch as all, all_schemas an d
all_bases.
If you do n ot u se on e of t h ese opt ion s t h e list of syst em sch em as an d
bases is displayed an d you m u st ch oose fr om th is.
On ce sch em as an d bases h ave been select ed o2dba_check discover s
sch em as an d bases lin k ed t h r ou gh im por t r elat ion sh ips t o t h ose
select ed.
o2dba_check est ablish es a con n ection wit h an O2 ser ver wh ich m u st
alr eady be r u n n in g on th e system .
Th e o2dba_check oper at ion can be per for m ed in m u lt i-u ser m ode.
38
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
O2 System Commands : o2dba_check
o2dba_check can per for m t h e followin g t wo t ypes of con sist en cy
ch eck s:
• ver ificat ion of r efer en t ial in tegr it y (th er e ar e n o dan glin g in ter -object
r efer en ces).
• ver ificat ion of t h e com position gr aph as per t h e cor r espon din g
sch em a descr ipt ion .
By defau lt (i.e., wit h ou t t h e opt ion CheckingLevel or CheckingLevel
0), both t h ese t ypes of con sist en cy ch eck s ar e car r ied ou t in dept h .
If you u se th e opt ion CheckingLevel 1, t h e fir st t ype of con sisten cy
ch eck is car r ied ou t com plet ely; for t h e secon d t ype of con sist en cy
ch eck , on ly t h e fir st level of t ype com par ison is car r ied ou t.
Th e fir st level of t ype com par ison im plies t h at a r efer en ce t h at is
su pposed t o poin t t o a t u ple does n ot poin t t o a collect ion (an d vice
ver sa). If t h e t u ple object th at is poin t ed t o is n ot an in st an ce of t h e
expect ed class, or if t h e expect ed collect ion is a set of in teger s an d t h e
r eal collection is a bag of Per son s, t h is in con sist en cy is n ot r epor ted.
Options
-system
Specifies th e O2 n am ed system t o con n ect t o. An
o2server m u st alr eady be r u n n in g on t h is
syst em befor e o2dba_check is in vok ed.
-server
Specifies th e m ach in e n am e wh er e o2server is
r u n n in g.
-schema
Specifies th e ext er n al n am e of a sch em a on th e
syst em . Th is opt ion can be r epeat ed t o en t er
sever al sch em as.
-base
Specifies t h e ext er n al base n am e belon gin g t o t h e
syst em . Th is opt ion can be r epeat ed t o give a list
of bases t o o2dba_check.
-all_schemas
Select s all sch em as of a syst em .
-all_bases
Select s all bases of a syst em .
-all
Select s all sch em as an d bases of a syst em .
-log
Retu r n s in for m at ion on er r on eou s r efer en ces t o
t h e file n am ed logging_file. If n o dir ector y is
specified, t h e cu r r en t dir ect or y is u sed t o st or e
t h e log file.
-recover
Act ivat es r ecover y. Er r on eou s r efer en ces t o
object s ar e r eplaced by n il.
O2 Syst em Adm in ist r ation Refer en ce Man u al
39
2
O2 System Commands
-verbose
Ret u r n s addit ion al in for m at ion abou t t h e
oper at ion .
-help
Displays in for m ation abou t t h e possible option s
an d exit s.
-version
Displays in for m ation abou t t h e cu r r en t ver sion
an d exit s.
-env
Displays t h e act u al valu e t ak en for t h e opt ion s
an d exit s. Allows you t o ver ify th at t h e opt ion
m ech an ism (explicit an d im plicit ) is cor r ect ly set.
-Validate
Allows you t o ver ify a base or a sch em a in m or e
t h an on e t r an sact ion . A n ew tr an sact ion st ar t s
each t im e number_of_objects object s ar e
pr ocessed. To en su r e t h at t h e vu e of t h e base or
t h e sch em a is coh er en t , you m u st u se t h is opt ion
wit h a ser ver in sin gle-u ser m ode. Th is opt ion is
par t icu lar ly u sefu l wh en t h e r u n n in g of o2check
on a base cau ses m an y object u pdat es du e t o
sch em a m odificat ion .
-CheckingLevel
Allows you t o set t h e level of con sist en cy ch eck s.
Default Options
Th e pr eviou s o2opt ion s an d ot h er s can be im plicit ly set
as explain ed in 2.1.2.
Environment variables
40
O2HOME
Is m an dat or y an d con t ain s t h e pat h t o t h e O 2
in st allat ion dir ect or y.
O2OPTIONS
See 2.1.2.
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
O2 System Commands : o2dba_copy
o2dba_copy
Summary
Copies an O2 n am ed dat abase syst em t o an oth er
Syntax
o2dba_copy -source system_name1 -target system_name2
[-force] [-server machine_name] [-verbose]
[-volumes filename]
o2dba_copy -version
o2dba_copy -help
o2dba_copy -env
Description
Th e o2dba_copy pr ogr am copies t h e con ten ts of on e n am ed dat abase
syst em t o an ot h er .
Th e n am e of t h e sou r ce system is specified wit h t h e m an dat or y -source
ar gu m en t, an d t h at of t h e tar get syst em wit h th e m an dat or y -target
ar gu m en t.
Bot h syst em n am es m u st be defin ed in th e con figu r at ion file .o2ser ver r c
in t h e O2 in st allation dir ect or y. Th e o2dba_copy pr ogr am fir st ch eck s
t h at en ou gh disk space exist s for t h e copy. If t h er e is n ot en ou gh space,
n o copy is per for m ed an d a m essage is displayed.
Ot h er wise, it r em oves an y exist in g syst em wit h t h e sam e n am e as th e
t ar get syst em (system_name2), ask in g for con fir m at ion fir st u n less t h e
-force opt ion is specified; it t h en copies t h e cat alogu e volu m e of
system_name1 in t o th e catalogu e volu m e of system_name2.
Fin ally, each of t h e u ser volu m es of system_name1 is copied t o
system_name2. Th e pr ogr am ask s you for t h e t ar get location of each
u ser volu m e (u n less t h e -volumes opt ion is specified).
Th e o2dba_copy pr ogr am in vok es t h e o2server pr ogr am for it s own
pu r poses. An y exist in g o2server pr ocesses r u n n in g on t h e sam e
syst em m u st be t er m in at ed t o avoid con flict . If t h is h as n ot been don e,
o2dba_copy in for m s you an d h alts.
O2 Syst em Adm in ist r ation Refer en ce Man u al
41
2
Options
O2 System Commands
-force
Over wr it es an y exist in g t ar get syst em with ou t seek in g
con fir m at ion .
-server
Ru n t h e o2server pr ocess for t h e sou r ce an d th e
t ar get syst em s on machine_name.
-volumes
Rat h er t h an ask in g for u ser volu m e location s, t ak e
t h e r elevan t in for m at ion fr om file filename. Th e
con t en t s of t h is file m u st be a list of volu m e path
n am es wit h on e iden t ifier an d path n am e per lin e
cor r espon din g t o t h e location s in t o wh ich t h e u ser
volu m es of th e t ar get syst em ar e t o be copied. Th e file
sh ou ld t h u s con tain on e lin e per u ser volu m e in t h e
sou r ce syst em . See t h e exam ple of t h e syn t ax above.
Th e -volumes opt ion is m ost u sefu l wh en in vok in g
o2dba_copy in sh ell scr ipts.
-verbose
Retu r n s addit ion al in for m at ion abou t t h e oper at ion .
-version
Displays in for m ation abou t t h e cu r r en t ver sion an d
exit s.
-help
Displays in for m ation abou t t h e possible option s an d
exit s.
-env
Displays t h e act u al valu e t ak en for t h e opt ion s an d
exit s. Allows you t o ver ify t h at t h e opt ion m ech an ism
(explicit an d im plicit ) is cor r ect ly set .
All th e opt ion s follow t h e pr eceden ce r u les descr ibed
in 2.1.1.
Environment variables
O2HOME
Is m an dat or y an d con t ain s t h e path t o t h e O2
in stallat ion dir ect or y.
O2SERVEROPTIONSSee 2.1.1.
Example of the -volumes optionfile
create volume vol1 in /newpath/bases/vol1
create volume vol2 in /newpath/bases/vol2
extend volume vol2 in /newpath/bases/vol2_ext1
42
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
O2 System Commands : o2dba_env
o2dba_env
Summary
Syntax
Displays en vir on m en t details for an O2 dat abase.
o2dba_env
[-system system_name] [-server machine_name]
[-verbose]
o2dba_env -version
o2dba_env -help
o2dba_env -env
Description
Th e o2dba_env pr ogr am r epor t s on t h e en vir on m en t an d th e ph ysical
volu m es of an O 2 dat abase. Th e r epor t sh ows t h e in t er n al en vir on m en t
for t h e syst em , in clu din g th e n am es an d locat ion s of O2 execu t able
pr ogr am s an d r esou r ce files. Th e cat alogu e, sh adow, log an d all u ser
volu m es associated wit h t h e n am ed system ar e listed alon g wit h t h eir
sizes. Th e r epor t is based on t h e cu r r en t con ten ts of t h e cat alogu e
volu m e of t h e n am ed system . Th e o2dba_env pr ogr am in vok es th e
o2server pr ogr am for it s own pu r poses or u ses an exist in g o2server if
on e is r u n n in g.
Options
-system
Specifies t h e syst em n am e t o be r epor t ed. If t h is option
is n ot u sed, t h e system n am e is t ak en fr om t h e defau lt
opt ion s below.
-server
Ru n t h e o2server pr ocess on machine_name, wh ich
m u st be t h e n am e of a m ach in e on t h e n et wor k .
-verbose
Pr in t s in for m at ive m essages du r in g t h e o2dba_env
session .
-version
Displays in for m at ion abou t t h e cu r r en t ver sion an d
exit s.
-help
Displays in for m at ion abou t t h e possible opt ion s an d
exit s.
-env
Displays t h e act u al valu e t ak en for t h e opt ion s an d
exit s. Allows you t o ver ify t h at t h e opt ion m ech an ism
(explicit an d im plicit ) is cor r ect ly set .
Default Options
Th e pr eviou s o2ser ver opt ion s an d oth er s can be
im plicit ly set as explain ed in 2.1.1.
O2 Syst em Adm in ist r ation Refer en ce Man u al
43
2
O2 System Commands
Environment variables
O2HOME
Is m an dat or y an d con t ain s t h e pat h t o th e O2
in stallat ion dir ect or y.
O2SERVEROPTIONS See 2.1.1.
44
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
O2 System Commands : o2dba_init
o2dba_init
Summary
In it ializes an O2 dat abase syst em
Syntax
o2dba_init [-system system_name] [-server machine_name]
[-catalog catalogue] [-force] [-verbose]
o2dba_init -version
o2dba_init -help
o2dba_init -env
Description
Th e o2dba_init pr ogr am for m at s an d in it ializes t h e con t en t s of an O2
dat abase syst em .
An y existin g O 2 syst em wit h t h e sam e n am e is r em oved, with ou t
pr om pt in g if t h e -force opt ion is u sed.
Th e cat alogu e volu m e for t h e specified syst em n am e is t ak en fr om t h e
O2HOME in st allat ion dir ect or y or fr om t h e specified dir ect or y.
By defau lt , t h is base cat alogu e is t h e file catalog_o2ref fou n d in t h e
bases su bdir ect or y of t h e O 2 in st allation dir ect or y.
All of t h e system volu m e specificat ion s m u st be pr esen t in th e
.o2ser ver r c con figu r ation file in th e O2 in st allat ion dir ect or y, pr ior to
r u n n in g o2dba_init.
In addit ion , o2dba_init cr eates on e u ser volu m e for th e n am ed system
an d popu lates it wit h syst em -su pplied object s, m et h ods an d fu n ct ion s.
Th e u ser volu m e is cr eated in th e sam e dir ect or y as t h e cat alogu e
volu m e, an d h as th e n am e DefaultVol.
Th e o2dba_init pr ogr am in vok es t h e o2server pr ogr am for it s own
pu r poses. An y exist in g o2server pr ocesses r u n n in g on t h e sam e
syst em m u st be t er m in at ed t o avoid pr ot ocol con flicts. If th is h as n ot
been don e, o2dba_init in for m s you an d h alt s.
Options
-system
Specifies t h e O2 syst em n am e to in itialize. If t h is opt ion
is n ot u sed, t h e syst em n am e is given by t h e
en vir on m en t u sed (see Defau lt opt ion s below).
-server
Ru n t h e o2server pr ocess on machine_name, wh ich
m u st be t h e n am e of a m ach in e on t h e n et wor k .
O2 Syst em Adm in ist r ation Refer en ce Man u al
45
2
O2 System Commands
-catalog
Specifies t h e fu ll pat h an d filen am e of a base
cat alogu e t o u se in place of t h e st an dar d on e in t h e
bases su bdir ector y.
-force
No con fir m ation r equ ir ed t o r em ove a syst em wit h
th e sam e n am e.
-verbose
Ret u r n s addit ion al in for m at ion abou t th e oper at ion .
-version
D isplays in for m at ion abou t t h e cu r r en t ver sion an d
exit s.
-help
D isplays in for m at ion abou t t h e possible opt ion s an d
exit s.
-env
D isplays th e act u al valu e t ak en for t h e opt ion s an d
exit s. Allows you to ver ify th at t h e opt ion m ech an ism
(explicit an d im plicit) is cor r ectly set .
Default Options
Th e pr eviou s o2 ser ver opt ion s an d ot h er s can be
im plicit ly set as explain ed in 2.1.1.
Environment variables
O2HOME
Is m an dat or y an d con tain s th e pat h t o t h e O 2
in st allat ion dir ect or y.
O2SERVEROPTIONS See 2.1.1.
46
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
O2 System Commands : o2dba_monitor
o2dba_monitor
Summary
Mon itor O 2 tr an sact ion s an d ser ver session s.
Syntax
o2dba_monitor [-system system_name] [-server server_name]
[-list] [-kill {xid | all}]
[-shutdown now | nowarn | minutes]
[-log on | off | close]
[-recover log_file_name[-force]] [-stat] [-reset]
[-licence]
o2dba_monitor -version
o2dba_monitor -help
o2dba_monitor -env
Description
Th e o2dba_monitor com m an d calls u p a u t ilit y t o list or abor t
t r an sact ion s, collect st at istics on t r an sact ion s or sh u tdown a syst em .
It is also u sed t o m an age t h e cold log for r ecover y pu r poses.
If you u se n on e of t h e opt ion s given below, o2dba_monitor in dicat es if
an d wh er e a ser ver is cu r r en t ly r u n n in g on th at syst em .
If t h e ser ver is in t h e pr ocess of sh u tt in g down o2dba_monitor can n ot
con n ect t o it .
Options
-system
Specifies t h e O 2 system n am e. If t h is opt ion is n ot
u sed, t h e syst em n am e is given by t h e en vir on m en t
u sed (see Defau lt opt ion s below).
-server
Specifies t h e m ach in e n am e wh er e o2server is
r u n n in g.
-list
Th is com m an d list s active tr an sact ion s.
-kill
Th is k ills a t r an sact ion iden t ified by xid or all t h e
t r an saction s cu r r en t ly r u n n in g if you u se th e all
opt ion .
-shutdown
Allows you t o eit h er im m ediat ely st op t h e ser ver u sin g
t h e now opt ion , st op t h e ser ver wit h ou t br oadcast in g a
sh u t down m essage u sin g th e nowarn opt ion , or sh u t
down aft er a specified t im e u sin g t h e minutes opt ion
wh ich h as a defau lt valu e of on e m in u t e.
If n o clien t s ar e r u n n in g t h e m in u t es valu e is ign or ed
an d t h e sh u t down occu r s im m ediat ely.
O2 Syst em Adm in ist r ation Refer en ce Man u al
47
2
O2 System Commands
If nowarn is n ot u sed an d if at least on e clien t is act ive
a br oadcast m essage is sen t t o each win dow of t h e
wor k st at ion r u n n in g th e clien t(s), in dicat in g th at t h e
ser ver r u n n in g on a given syst em will be st opped
im m ediat ely or in a given n u m ber of m in u t es.
-log
En ables you t o t u r n on, off or t o close t h e ser ver cold
loggin g. It is bet t er t o u se th e .o2ser ver r c con figu r at ion
file t o en able loggin g r ath er t h an t h e opt ion log on.
If you u se log on t h e ser ver cr eates a file called
coldlog_system_name an d st ar t s loggin g all t h e
m odification s car r ied ou t by com m itt ed t r an sact ion s.
If you u se log off t h e ser ver closes th e
coldlog_system_name an d r en am es it
coldlog_n_system_name wh er e n is a n u m ber wh ich
in cr eases, st ar t in g at 0. Cold loggin g st ops.
If you u se log close, t h is h as t h e sam e effect as log off
except t h at it is im m ediat ely followed by log on . It
gu ar an t ees t h at n o t r an sact ion can com m it (i.e. t h er e
is n o in for m at ion loss) du r in g t h e swit ch . Th is opt ion is
u sed t o save t h e gen er at ed logs per iodically.
Wh en t h e coldlog_system_name file is closed O 2
r en am es it as
coldlog_sequence_number_system_name. Th e
sequ en ce n u m ber is in cr eased each t im e t h e file is
closed. Th ese files can th en be st or ed an d r eu sed in
t h eir or der of sequ en ce to r ecover t h e syst em .
-recover
En ables you t o apply all logged m odification s to a
back ed u p system . Th e fir st log of t h e list is t h e log
wh ich was st ar ted ju st aft er th e system back u p. Th e
ot h er s m u st be given in t h eir or der of sequ en ce.
If t h e force opt ion is set , th e pr ogr am r est or es th e
volu m es in t h e dir ect or ies specified in t h e .o2ser ver r c
file. Ot h er wise t h e u ser is ask ed for t h e locat ion of t h e
volu m es.
o2server is au tom at ically star t ed wh en you u se t h e
recover option . D o n ot u se o2server t o r ecover a
syst em .
-stat
D isplay ser ver st at ist ics.
-reset
Reset s all ser ver st at ist ics cou n ter s t o 0.
For fu r th er det ails on st at ist ics r efer t o t h e O2 Sy stem Administration Guid e.
48
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
O2 System Commands : o2dba_monitor
-verbose
Ret u r n s addit ion al in for m at ion abou t t h e oper at ion .
-version
Displays in for m at ion abou t t h e cu r r en t ver sion an d
exit s.
-help
Displays in for m at ion abou t t h e possible opt ion s an d
exit s.
-env
Displays t h e act u al valu e t ak en for t h e opt ion s an d
exit s. Allows you t o ver ify th at t h e opt ion
m ech an ism (explicit an d im plicit ) is cor r ect ly set .
-licence
Displays t h e st at u s of you r licen ce.
Default Options
Th e pr eviou s o2 ser ver opt ion s an d ot h er s can be
im plicit ly set as explain ed in 2.1.1.
Environment variables
O2HOME
Is m an dator y an d con t ain s t h e pat h t o t h e O 2
in st allat ion dir ect or y.
O2SERVEROPTIONS See 2.1.1.
O2 Syst em Adm in ist r ation Refer en ce Man u al
49
2
O2 System Commands
o2dba_move_volume
Summary
Moves O2 volu m es to ot h er oper at in g system files.
Syntax
o2dba_move_volume [-system system_name] [-server machine_name]
-source old_path -target new_path
[-verbose]
o2dba_move_volume -version
o2dba_move_volume -help
o2dba_move_volume -env
Description
Th e o2dba_move_volume pr ogr am ch an ges th e ph ysical locat ion of an
O2 volu m e or exten sion . Th e com plet e pat h of you r O2 volu m e t o m ove is
specified with t h e m an dat or y -source ar gu m en t , an d t h e n ew location
is specified by t h e m an dat or y -target ar gu m en t . Th is pr ogr am m oves
t h e con ten ts of t h e O2 volu m e in t o a file specified by th e n ew com plet e
pat h n am e of t h e volu m e.
Th e o2dba_move_volume pr ogr am in vok es t h e o2server pr ogr am for
it s own pu r poses. An y exist in g o2server pr ocesses r u n n in g on t h e
sam e system m u st be ter m in ated t o avoid pr ot ocol con flict s. If t h is h as
n ot been don e, o2dba_move_volume in for m s you an d h alt s.
Options
50
-system
Specifies t h e O 2 syst em n am e. If t h is opt ion is n ot
u sed, t h e syst em n am e given by t h e en vir on m en t
var iable is u sed (see D efau lt opt ion s below).
-server
Ru n th e o2server pr ocess for t h e sou r ce an d t h e
t ar get system s on machine_name.
-source
Th e pat h t o t h e volu m e t h at you wan t t o m ove (an OS
file wh er e t h e volu m e r esides).
-target
Th e pat h t o t h e file t o wh ich you wan t to m ove you r
volu m e.
-verbose
Ret u r n s addit ion al in for m ation on t h e oper at ion .
-version
D isplays in for m at ion abou t t h e cu r r en t ver sion an d
exits.
-help
D isplays in for m at ion abou t t h e possible opt ion s an d
exits.
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
O2 System Commands : o2dba_move_volume
-env
Default Options
Displays t h e act u al valu e t ak en for t h e opt ion s an d
exit s. Allows you t o ver ify t h at t h e opt ion m ech an ism
(explicit an d im plicit ) is cor r ect ly set .
Th e pr eviou s o2 ser ver option s an d ot h er s can be
im plicit ly set as explain ed in 2.1.1.
Environment variables
O2HOME
Is m an dat or y an d con t ain s t h e pat h to t h e O 2
in st allat ion dir ect or y.
O2SERVEROPTIONS See 2.1.1.
O2 Syst em Adm in ist r ation Refer en ce Man u al
51
2
O2 System Commands
o2dba_restore
Summary
Rest or es a syst em fr om it s back u p
Syntax
o2dba_restore
{-file filename | -tape device_name}
[-system system_name] [-server server_name]
[ -id identify ][ -recover cold_log_filename ][-identity]
[-volumes vol_loc_filename] [-verbose] [-date
[yy-]mmdd[HHMM] ]
o2dba_restore -version
o2dba_restore -help
o2dba_restore -env
Description
o2dba_restore r est or es a system fr om it s back u p ar ch ives obt ain ed by
o2dba_backup. Th e syst em system_name m u st n ot exist .
Aft er bein g lau n ch ed, o2dba_restore r est or es a syst em by r eadin g
back u p m edia volu m es in th e sam e or der as t h ey wer e wr it t en .
If t h e back u p h as been obt ain ed wit h ou t opt ion -witharchive, t h e
o2dba_restore st ops aft er th e system is r est or ed.
If t h e back u p was cr eated wit h opt ion -witharchive, it con t ain s a fu ll
syst em back u p wit h cold log ar ch ives. o2dba_restore r est or es t h e
syst em an d t h e cold log ar ch ives. If n o t ar get date is specified,
o2dba_restore k eeps r eadin g ar ch ives as lon g as t h er e ar e back u p
ar ch ives left . If a t ar get date is specified, o2dba_restore st ops as soon
as t h e syst em is r est or ed t o t h at dat e.
If a back u p was cr eat ed wit h opt ion -archivelog, it con t ain s on ly cold
log ar ch ives. o2dba_restore u pdat es t h e syst em with th ese log files. It
is th e u ser 's r espon sibilit y t o r estor e t h e syst em t o th e st at e ju st befor e
t h e log files wer e ar ch ived befor e u sin g o2dba_restore t o u pdat e t h e
syst em .
o2dba_restore m ay r equ ir e u ser in ter ven t ion . If a back u p span s
m u lt i-volu m es, o2dba_restore will in for m ed t h e u ser wh en t o car r y
ou t volu m e ch an ges. o2dba_restore t h en ver ifies t h at t h e m ou n t ed
back u p m edia volu m e is oper at ion al an d par t of t h e back u p. If th is is
n ot t h e case o2dba_restore n ot ifies t h e u ser an d wait s for t h e volu m e
t o be r eplaced.
Th er e exist m u lt iple scen ar ios for r estor in g an O2 syst em aft er a disk
cr ash .
52
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
O2 System Commands : o2dba_restore
1. You k n ow pr ecisely wh ich back u p m u st be r estor ed. In t h is case,
place t h e fir st volu m e of t h e back u p in t h e t ape r eader (opt ion -tape) or
en t er t h e n am e of t h e file wh ich con t ain s t h e fir st volu m e (opt ion
-file), an d t h e t ool r est or es t h e O 2 syst em fr om t h e back u p. As an
ext r a pr ecau t ion , you can specify t h e iden t ifier of t h e back u p, u sin g
opt ion -id. In t h is case, o2dba_restore ver ifies t h at t h is iden t ifier
cor r espon ds t o t h e iden tifier fou n d in t h e back u p. If t h e two iden t ifier s
do n ot m atch , an er r or m essage is displayed an d o2dba_restore h alts.
2. You do n ot k n ow pr ecisely wh ich back u p t ape or file m u st be
r estor ed, bu t k n ow t o wh ich dat e you wou ld lik e t o r est or e th e O2
syst em . In t h is case, u se o2dba_backup_display to locate t h e fir st
volu m e of t h e back u p (see o2dba_backup_display). Th en place th e
fir st volu m e of t h e back u p in th e t ape r eader (option -tape) or en t er t h e
n am e of t h e file wh ich con tain s t h e fir st volu m e (opt ion -file), an d t h e
t ool r est or es t h e O 2 syst em fr om t h e back u p. You sh ou ld pr ovide t h e
dat e u n t il wh ich t h e r estor at ion sh ou ld be car r ied ou t (opt ion -date). In
t h is m ode, t h e tool r estor es th e O2 syst em fr om t h e back u p to t h e dat e
specified wit h option -date .
3. You do n ot k n ow pr ecisely wh ich back u p t ape or file m u st be
r estor ed, n or wh ich dat e cor r espon ds t o t h e desir ed O 2 syst em , bu t you
k n ow th e label cor r espon din g t o t h e desir ed O 2 syst em . In t h is case, u se
o2dba_backup_display t o locat e t h e fir st volu m e of t h e back u p an d
t h e dat e associat ed wit h t h is label (see o2dba_backup_display). Th en
place t h e fir st volu m e of t h e back u p in t h e t ape r eader (opt ion -tape) or
en t er s t h e n am e of t h e file wh ich con t ain s t h e fir st volu m e (option
-file), an d t h e t ool r est or es t h e O 2 system fr om t h e back u p. You
sh ou ld pr ovide t h e dat e t o wh ich t h e r est or at ion sh ou ld be car r ied ou t
(option -date). In t h is m ode, t h e t ool r est or es t h e O2 syst em fr om th e
back u p u n til t h e specified dat e fr om t h e -date opt ion . For cases 2 an d
3, as an ext r a pr ecau t ion , you can specify t h e iden t ifier of t h e back u p,
u sin g opt ion -id, obt ain ed wit h o2dba_backup_display.
In cer t ain scen ar ios, t h e r est or at ion is com plet ed by r est or in g th e cold
log of th e ser ver (u sin g opt ion -recover). In effect , it can h appen t h at
t h e last back u p does n ot cor r espon d t o th e st at e of t h e syst em at th e
t im e of a disk cr ash . In su ch a sit u at ion , if you wish t o r est or e th e
syst em t o t h e st at e befor e t h e cr ash , you m u st fir st r est or e t h e m ost
r ecen t back u p an d th en apply t h e cold logs of th e ser ver (opt ion
-recover). Th e fir st cold log t o apply cor r espon ds t o t h e cold log
followin g t h e last cold log t h at was r est or ed fr om t h e back u p. Th en
apply t h e cold logs on e after th e ot h er t o com plet e all th e cold logs u p to
t h e cu r r en t on e in clu sive.
Options
O2 Syst em Adm in ist r ation Refer en ce Man u al
53
2
O2 System Commands
-date [yy-]m m dd[HHM M]
Specifies t h e dat e t o wh ich t h e syst em sh ou ld be
r est or ed. Th e u t ilit y r estor es t h e syst em t o t h e st at e
ju st befor e t h is dat e.
H
h ou r - 00 t o 23
M
m in u te - 00 t o 59
d
day of m on t h - 01 t o 31
m
m on t h of year - 01 to 12
y
year - 00 t o 99
-id
Specifies t h e back u p iden t ifier t o be u sed.
o2dba_restore ver ifies t h e ver sion con tain ed in th e
back u p m edia cor r espon ds t o t h e ver sion bein g ask ed.
Back u p iden tifier is logged in t h e back u p h ist or y file.
By u sin g o2dba_backup_display we obt ain
in for m at ion s abou t back u p session s an d t h eir
iden tifier s.
-identify
D u m ps back u p in for m at ion fr om back u p m edia. Th is
n eeds th e fir st volu m e of t h e back u p m edia t o be r ead.
Th e in for m at ion in clu des back u p iden t ifier , t im e st am p
of t h e back u p et c.
-file
Th e n am e of t h e file wh ich con t ain s t h e back u p.
-recover
Recover s t h e syst em fr om file filename. Th e file m u st
be a cold log file. Th is opt ion is u sed t o access a cold
log file t h at h as n ot been back ed u p befor e t h e syst em
cr ash , t o r ecover t r an sact ion s logged in t h e file. Th is
file m u st be r ecover ed aft er th e ar ch ived log files.
-server
Ru n th e o2server pr ocess on server_name, if n ot
alr eady r u n n in g.
-system
Specifies t h e O 2 syst em n am e. If t h is opt ion is n ot
u sed, t h e syst em n am e given by t h e en vir on m en t is
u sed (see Defau lt opt ion s below).
-tape
Th e n am e of t h e device wh ich con t ain s t h e back u p.
-volumes
Pr ovides t h e system -r equ ir ed volu m e locat ion s in a file
vol_loc_filename, r at h er t h an pr ovidin g t h is
in for m at ion in t er act ively. Th e con t en t s of t h is file m u st
be a list of st an dar d O2 com m an ds u sed to cr eat e n ew
volu m es or exten d exist in g volu m es. Th e file sh ou ld
con tain on e lin e per u ser volu m e of t h e back u p
file/ t ape, e.g.:
create volume VolName1 in /u/tmp
extend volume VolName2 in /u/tmp2
54
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
O2 System Commands : o2dba_restore
Th e -volumes opt ion is u sefu l wh en in vok in g
o2dba_restore in sh ell scr ipt s.
-verbose
Retu r n s addit ion al in for m at ion abou t t h e oper at ion .
-version
Displays in for m ation abou t t h e cu r r en t ver sion an d
exit s.
-help
Displays in for m at ion abou t t h e possible opt ion s an d
exit s.
-env
Displays t h e act u al valu e t ak en for th e opt ion s an d
exit s. Allows you t o ver ify t h at t h e opt ion m ech an ism
(explicit an d im plicit ) is cor r ect ly set .
Default Options
Th e pr eviou s o2 ser ver option s as well as oth er opt ion s
can be im plicit ly set as explain ed in 2.1.1.
Environment variables
O2HOME
Is m an dat or y an d con t ain s t h e pat h t o th e O 2
in st allation dir ect or y.
O2SERVEROPTIONS See 2.1.1.
Example
Exam ple of t h e -volu m es opt ion file
create volume vol1 in /newpath/bases/vol1
create volume vol2 in /newpath/bases/vol2
extend volume vol2 in /newpath/bases/vol2_ext1
Th e com m an d below r est or es syst em sys fr om back u p device
/dev/mnt. It r u n s in t er act ively. If volu m e ch an ge is n eeded, t h e u ser
will be qu er ied.
o2dba_restore -system sys -tape /dev/mnt
Th e followin g com m an d r estor es th e syst em fr om device /dev/mnt t o
t h e st at e it was on Oct ober 20, 1997. Th e back u p h ist or y file of t h e
syst em wh ich h ad been saved is ~/bkuphist.
o2dba_restore -tape /dev/mnt -date 97-1020
Su ppose aft er a device failu r e, we h ave a system back u p wh ich con tain s
u p t o t h e last cold log file gen er at ed by th e syst em an d we h ave
O2 Syst em Adm in ist r ation Refer en ce Man u al
55
2
O2 System Commands
su cceeded t o save t h e cu r r en t log file of t h e syst em aft er t h e cr ash . Aft er
h avin g r est or ed t h e syst em fr om it s back u p, t h e followin g com m an d
cou ld be u sed t o u pdat e t h e syst em t o th e state ju st befor e t h e cr ash .
o2dba_restore -system sys -recover ~/saved_log
SEE ALSO o2dba_backup, o2dba_backup_label, o2dba_backup_display
56
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
O2 System Commands : o2dba_rm
o2dba_rm
Summary
Rem oves an O 2 n am ed dat abase system
Syntax
o2dba_rm
[-system system_name] [-server machine_name]
[-force] [-verbose]
o2dba_rm -version
o2dba_rm -help
o2dba_rm -env
Description
Th e o2dba_rm pr ogr am delet es all ph ysical volu m es of a n am ed
dat abase syst em . Th e cat alogu e, sh adow an d log volu m es as well as all
u ser volu m es associat ed wit h t h e n am ed syst em ar e delet ed. Th e
o2dba_rm pr ogr am in vok es t h e o2server pr ogr am for its own pu r poses.
An y exist in g o2server pr ocesses r u n n in g on t h e sam e syst em m u st be
t er m in at ed to avoid pr ot ocol con flict s. If t h is h as n ot been don e,
o2dba_rm war n s th e u ser an d h alt s.
Options
-system
Specifies t h e O 2 system n am e t o r em ove. If t h is opt ion
is n ot u sed, t h e syst em n am e given by t h e en vir on m en t
is u sed (see D efau lt opt ion s below).
-server
Ru n s t h e o2server pr ocess on machine_name, wh ich
m u st be t h e n am e of a m ach in e on t h e n et wor k .
-force
No con fir m at ion r equ ir ed t o r em ove t h e syst em .
-verbose
Ret u r n s addit ion al in for m at ion abou t t h e oper ation .
-version
Displays in for m at ion abou t t h e cu r r en t ver sion an d
exit s.
-help
Displays in for m at ion abou t t h e possible opt ion s an d
exit s.
-env
Displays t h e act u al valu e t ak en for t h e opt ion s an d
exit s. Allows you t o ver ify t h at t h e opt ion m ech an ism
(explicit an d im plicit ) is cor r ect ly set .
Default Options
Th e pr eviou s o2 ser ver option s an d ot h er s can be
im plicit ly set as explain ed in 2.1.1.
O2 Syst em Adm in ist r ation Refer en ce Man u al
57
2
O2 System Commands
Environment variables
O2HOME
Is m an dat or y an d con tain s th e pat h t o t h e O 2
in st allat ion dir ect or y.
O2SERVEROPTIONS See 2.1.1.
58
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
O2 System Commands : o2dba_schema_dump
o2dba_schema_dump
Summary
Bu ilds a du m p con t ain in g on e or sever al sch em a defin it ion s.
Th is com m an d du m ps t h e defin it ion of on e or sever al O2 sch em as in t o a
file or t ape device.
Syntax
o2dba_schema_dump {-file filename | -tape device_name}
[-system system_name] [-server machine_name]
[[-schema schema_name] ...|-all] [-sources]
[-name user_label] [-verbose]
o2dba_schema_dump -version
o2dba_schema_dump -help
o2dba_schema_dump -env
Description
o2dba_schema_dump is u sed t o con st r u ct a du m p of on e or sever al
sch em as fr om an O2 syst em .
You specify t h e n am es of th e sch em as to be du m ped u sin g eit h er t h e
-schema or t h e -all opt ion s or by select in g t h em fr om a list displayed
by o2dba_schema_dump.
Th is du m p is in ten ded t o be u sed by o2dba_schema_load t o load th e
sch em a on t o t h e tar get syst em .
For each sch em a n am e, o2dba_schema_dump est ablish es a list of
com plem en t ar y sch em as an d bases im por t ed by th e select ed sch em as.
On ly t h e sch em as select ed by t h e u ser ar e copied to t h e du m p. Th e
con t en t s of t h e im por ted sch em as an d bases, if an y, ar e n ot copied.
Th e im por t ed sch em as wh ich ar e n ot stor ed in t h e du m p m u st exist in
t h e t ar get system befor e car r yin g ou t th e o2dba_schema_load
oper at ion .
Th e im por t ed bases ar e cr eat ed by t h e load oper at ion if t h ey do n ot
alr eady exist .
Refer t o section 8.10 of t h e O2 Sy stem Ad ministration Guide for fu r t h er
explan at ion s.
o2dba_schema_dump est ablish es a con n ection wit h an O2 ser ver
r u n n in g on t h e system specified.
Th e o2dba_schema_dump oper ation m u st be per for m ed in sin gle u ser
m ode on ly. Th is is don e by set t in g t h e -mode option of t h e o2server
com m an d t o single-user.
O2 Syst em Adm in ist r ation Refer en ce Man u al
59
2
O2 System Commands
Options
-file
Th e n am e of a st an dar d file wh ich will con t ain th e
du m p.
-tape
Th e n am e of a t ape device wh ich will con t ain t h e du m p.
-name
Wr ite at t h e begin n in g of t h e du m p a user_label.
-system
Specifies t h e O2 n am ed syst em t o con n ect t o. An
o2server m u st alr eady be r u n n in g on t h is syst em
befor e o2dba_schema_dump is in vok ed.
-server
Specifies t h e m ach in e n am e wh er e o2server is
r u n n in g.
-schema
Specifies t h e ext er n al n am e of a sch em a t o be du m ped.
Th is opt ion can be u sed r epeat edly in or der t o give a
list of sch em as t o o2dba_schema_dump.
If th e all or schema option is n ot u sed, you ch oose
fr om a list of sch em as displayed by
o2dba_schema_dump.
-all
Select all sch em as on t h e sam e syst em .
If th e all or schema option is n ot u sed, you ch oose
fr om a list of sch em as displayed by
o2dba_schema_dump.
Default Options
60
-sources
Th e sou r ce code of th e sch em a elem en t s (classes, n am e
et c.) is in clu ded in t h e du m p if it exists.
-verbose
Pr in ts in for m ative m essages du r in g t h e
o2dba_schema_dump session .
-version
D isplays in for m at ion abou t t h e cu r r en t ver sion an d
exits.
-help
D isplays in for m at ion abou t t h e possible opt ion s an d
exits.
-env
D isplays t h e cu r r en t valu es for th e opt ion s an d exit s.
Allows you t o ver ify t h at t h e option m ech an ism (explicit
an d im plicit) is cor r ectly set .
Th e pr eviou s o2opt ion s an d ot h er s can be im plicit ly set
as explain ed in 2.1.2.
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
O2 System Commands : o2dba_schema_dump
Environment variables
O2HOME
Is m an dat or y an d con t ain s t h e pat h t o t h e O 2
in st allat ion dir ect or y.
O2OPTIONS
See 2.1.2.
Example
o2dba_schema_dump -system sys -server svr -schema sch1
-schema sch2 -file schema.dump
o2dba_schema_dump -system sys -server svr -all -tape
/dev/rmt0
Th e fir st exam ple saves t h e con t en t s of sch em a sch1 an d sch em a sch2
in t o a st an dar d file n am ed schema.dump. Th e secon d exam ple du m ps
all sch em as of th e O 2 syst em sys t o a t ape device /dev/rmt0.
O2 Syst em Adm in ist r ation Refer en ce Man u al
61
2
O2 System Commands
o2dba_schema_load
Summary
Loads a set of sch em as in to an O2 t ar get syst em .
Syntax
o2dba_schema_load {-file filename | -tape device_name }
[-system system_name] [-server machine_name]
[-force] [-verbose] [-sources]
o2dba_schema_load {-file filename | -tape device_name}
-identify
o2dba_schema_load -version
o2dba_schema_load -help
o2dba_schema_load -env
Description
o2dba_schema_load ext r act s th e set of sch em as con tain ed in a du m p
pr odu ced by o2dba_schema_dump an d cr eat es or u pdat es t h e
cor r espon din g O2 sch em as in a t ar get syst em .
o2dba_schema_load is in vok ed wit h a filename or device_name.
Sch em as ar e iden t ified by t h eir ext er n al n am es.
If a given sch em a n am e fou n d in t h e du m p exists in t h e system_name, it
is r eplaced. An im por t ed base fou n d in du m p is in st alled in
system_name on ly if system_name does n ot con t ain a base with t h e
sam e n am e. In t h is case, t h e base is cr eated em pt y. Th e con t en t s of
im por t ed bases ar e n ever saved by o2dba_schema_dump.
Wh en you load a sch em a on t o a t ar get syst em wh er e t h e sch em a alr eady
exist s, o2dba_schema_dump ch eck s t h at t h e t wo sch em a ver sion s ar e
com pat ible. If th ey ar e n ot com pat ible, t h e oper at ion is abor t ed.
Refer t o sect ion 8.10 of t h e O2 Sy stem Ad ministration Guid e for fu r t h er
explan at ion s con cer n in g con sisten cy ch eck s.
o2dba_schema_load est ablish es a con n ect ion wit h an O2 ser ver
r u n n in g on t h e tar get syst em . Th e oper at ion m u st be per for m ed in
sin gle u ser m ode on ly. Th is is don e by set t in g th e -mode opt ion of t h e
o2server com m an d t o single-user.
62
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
O2 System Commands : o2dba_schema_load
Options
-file
Nam e of th e file wh ich con tain s th e du m p.
-tape
Nam e of th e t ape device wh ich con t ain s t h e du m p.
-system
Specifies t h e O 2 n am ed syst em t o con n ect t o. An
o2server m u st alr eady be r u n n in g on th is syst em
befor e o2dba_schema_load is in vok ed.
-server
Specifies t h e m ach in e n am e wh er e o2server is
r u n n in g.
-sources
Rest or es t h e sou r ce code if it exist s in t h e du m p for a
sch em a. Not e th at a sch em a wit h ou t sou r ce code can
on ly be m an aged u sin g t h e o2api_shell. It is h owever
possible to r ecr eat e class sou r ce code by u sin g t h e
o2sh ell com m an d create sources.
War n i n g: If you do n ot u se t h is opt ion , an y sch em a
sou r ce codes in t h e tar get syst em ar e over wr itt en by
t h e sch em a with ou t sou r ce code.
-identify
Displays iden t ifyin g in for m ation abou t t h e du m p file or
device.
-force
No con fir m at ion r equ ir ed befor e each sch em a load.
-verbose
Pr in t s in for m at ive m essages du r in g t h e
o2dba_schema_load session .
-version
Displays in for m at ion abou t t h e cu r r en t ver sion an d
exit s.
-help
Displays in for m at ion abou t t h e possible opt ion s an d
exit s.
-env
Displays t h e cu r r en t valu es for t h e var iou s opt ion s an d
exit s. Allows you t o ver ify t h at t h e opt ion m ech an ism
(explicit an d im plicit ) is cor r ect ly set .
Default Options
Th e pr eviou s o2option s as well as ot h er opt ion s can be
im plicitly set as explain ed in 2.1.2.
Environment variables
O2HOME
Is m an dat or y an d con t ain s t h e pat h t o t h e O 2
in st allat ion dir ect or y.
O2OPTIONS
See 2.1.2.
O2 Syst em Adm in ist r ation Refer en ce Man u al
63
2
O2 System Commands
Example
o2dba_schema_load -system sys -server svr -file schema.dump
o2dba_schema_load -system sys -server svr -tape /dev/rmt0
Th e above exam ples load sch em as pr eviou sly du m ped by u sin g
o2dba_schema_dump. In t h e fir st exam ple, t h e sch em a was du m ped in t o
a st an dar d file schema.dump. In t h e secon d exam ple, t h e du m ped
sch em a ar e on t h e t ape device /dev/rmt0.
64
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
O2 System Commands : o2dba_shell
o2dba_shell
Summary
Syntax
Calls u p t h e O2 dat abase adm in ist r at ion u t ilit y. Th is gives you access t o
O2 DBA com m an ds.
o2dba_shell [-system system_name] [-server machine_name]
[-verbose] [-alpha]
o2dba_shell -version
o2dba_shell -help
o2dba_shell -env
Description
You m u st en t er t h e o2dba_shell com m an d t o u se database
adm in ist r at ion com m an ds an d OQL qu er y session s. o2dba_shell
m ak es available t h ose com m an ds wh ich do n ot r equ ir e a developm en t
licen se. Th ese com m an ds ar e descr ibed in Ch apt er 3.
o2dba_shell est ablish es a con n ect ion wit h a n am ed O2 dat abase
syst em u sin g o2server, wh ich m u st alr eady be r u n n in g.
Options
Default Options
-system
Specifies t h e O 2 n am ed syst em t o con n ect t o. An
o2server m u st alr eady be r u n n in g on th is syst em
befor e o2dba_shell is in vok ed.
-server
Specifies t h e m ach in e n am e wh er e o2server is
r u n n in g.
-alpha
Disables t h e gr aph ical in t er face for dat abase br owsin g.
Uses a du m b t er m in al style.
-verbose
Pr in t s in for m at ive m essages du r in g t h e o2dba_shell
session .
-version
Displays in for m at ion abou t t h e cu r r en t ver sion an d
exit s.
-help
Displays in for m at ion abou t t h e possible opt ion s an d
exit s.
-env
Displays t h e act u al valu e t ak en for t h e opt ion s an d
exit s. Allows you t o ver ify t h at t h e opt ion m ech an ism
(explicit an d im plicit ) is cor r ect ly set .
Th e pr eviou s o2opt ion s an d ot h er s can be im plicit ly set
as explain ed in 2.1.2.
O2 Syst em Adm in ist r ation Refer en ce Man u al
65
2
O2 System Commands
Environment variables
66
O2HOME
Is m an dat or y an d con t ain s t h e pat h t o t h e O 2
in st allat ion dir ect or y.
O2OPTIONS
See 2.1.2.
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
O2 System Commands : o2dba_shutdown
o2dba_shutdown
Summary
St ops a ser ver
Syntax
o2dba_shutdown [-system system_name] [-server machine_name]
{[-now] | [-nowarn] | [-time<minutes>]}
[-verbose]
o2dba_shutdown -version
o2dba_shutdown -help
o2dba_shutdown -env
Description
Th e o2dba_shutdown u t ilit y allows you t o st op a given syst em pr oper ly.
Options
-system
Specifies t h e O 2 system n am e t o sh u t down . If th is
opt ion is n ot u sed, t h e system n am e given by t h e
en vir on m en t is u sed (see D efau lt opt ion s below).
-server
Specifies t h e m ach in e wh er e o2server r u n s.
-now
Usin g th is opt ion stops t h e ser ver im m ediat ely.
If t h e -nowarn opt ion is also u sed t h e ser ver is stopped
im m ediat ely wit h ou t br oadcast in g a sh u tdown
m essage.
-nowarn
Th e defau lt war n in g m essage is n ot sen t . A defau lt
war n in g m essage is sen t t o each clien t syst em . Th e
m essage st ates t h at t h e ser ver r u n n in g on a given
syst em will be st opped im m ediat ely or in a given
n u m ber of m in u t es.
-time
Th is opt ion allows you t o st op t h e ser ver in a given
n u m ber of m in u t es.
If t h is opt ion is n ot u sed, a defau lt of on e m in u t e is
u sed. If n o clien t s ar e r u n n in g, sh u tdown is
im m ediat e.
-verbose
Ret u r n s addit ion al in for m at ion abou t t h e oper ation .
-version
Displays in for m at ion abou t t h e cu r r en t ver sion an d
exit s.
-help
Displays in for m at ion abou t t h e possible opt ion s an d
exit s.
O2 Syst em Adm in ist r ation Refer en ce Man u al
67
2
O2 System Commands
-env
Default Options
D isplays th e act u al valu e t ak en for t h e opt ion s an d
exit s. Allows you to ver ify th at t h e opt ion m ech an ism
(explicit an d im plicit) is cor r ectly set .
Th e pr eviou s o2 ser ver opt ion s an d ot h er s can be
im plicit ly set as explain ed in 2.1.1.
Environment variables
O2HOME
Is m an dat or y an d con tain s th e pat h t o t h e O 2
in st allat ion dir ect or y.
O2SERVEROPTIONS See 2.1.1.
Example
o2dba_shutdown -system sys.
68
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
O2 System Commands : o2dsa_shell
o2dsa_shell
Summary
Calls u p t h e O2 sch em a adm in ist r ation u t ility. Th is gives you access t o
O2 DSA com m an ds. If you ar e u sin g O2 C you do n ot n eed t o u se t h e
o2dsa_shell com m an d.
Syntax
o2dsa_shell [-system system_name] [-server machine_name]
[-verbose] [-alpha]
o2dsa_shell -version
o2dsa_shell -help
o2dsa_shell -env
Description
You m u st en t er t h e o2dsa_shell com m an d to u se sch em a
adm in ist r at ion com m an ds an d OQL qu er y session s. o2dsa_shell
m ak es available t h ose com m an ds wh ich r equ ir e a developm en t licen se.
Th ese com m an ds ar e descr ibed in Ch apter 4.
o2dsa_shell est ablish es a con n ect ion wit h a n am ed O2 dat abase
syst em u sin g o2server, wh ich m u st alr eady be r u n n in g.
Options
Default Options
-system
Specifies t h e O 2 n am ed syst em t o con n ect t o. An
o2server m u st alr eady be r u n n in g on th is syst em
befor e o2dsa_shell is in vok ed.
-server
Specifies t h e m ach in e n am e wh er e o2server is
r u n n in g.
-alpha
Disables t h e gr aph ical in t er face for dat abase br owsin g.
Uses a du m b t er m in al style.
-verbose
Pr in t s in for m at ive m essages du r in g t h e o2dsa_shell
session .
-version
Displays in for m at ion abou t t h e cu r r en t ver sion an d
exit s.
-help
Displays in for m at ion abou t t h e possible opt ion s an d
exit s.
-env
Displays t h e act u al valu e t ak en for t h e opt ion s an d
exit s. Allows you t o ver ify t h at t h e opt ion m ech an ism
(explicit an d im plicit ) is cor r ect ly set .
Th e pr eviou s o2opt ion s an d ot h er s can be im plicit ly set
as explain ed in 2.1.2.
O2 Syst em Adm in ist r ation Refer en ce Man u al
69
2
O2 System Commands
Environment variables
70
O2HOME
Is m an dat or y an d con t ain s t h e pat h t o t h e O 2
in st allat ion dir ect or y.
O2OPTIONS
See 2.1.2.
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
O2 System Commands : o2patch
o2patch
Summary
Pat ch es an O 2 dat abase syst em .
Syntax
o2patch -system system_name [-server machine_name]
Description
o2patch is u sed t o u pgr ade a ver sion fr om on e r elease to a m or e r ecen t
on e.
For exam ple, you u se o2patch t o u pgr ade fr om r elease 5.1.1 t o 5.1.2.
To fin d ou t wh ich ver sion an d/ or r elease you h ave, t ype o2dba_shell
-version.
For in st allat ion in st r u ct ion s r efer t o th e in stallat ion sh eet wh ich is
deliver ed wit h t h e ver sion .
To st ar t o2patch, an o2server pr ocessin g t h e syst em called
system_name m u st be r u n n in g.
Options
-system
Th e n am e of th e O2 syst em t o pat ch . A syst em n am e
m u st be specified wit h t h e -system option ; oth er wise
o2patch can n ot st ar t .
-server
Specifies t h e n am e of t h e m ach in e wh er e o2ser ver is
r u n n in g.
O2 Syst em Adm in ist r ation Refer en ce Man u al
71
2
O2 System Commands
o2server
Summary
St ar ts a ser ver for an O2 dat abase session
Syntax
o2server [-system system_name] [-verbose][-mode mode]
[-foreground]
o2server -version
o2server -help
o2server -env
Description
Th e o2server pr ogr am pr ovides a con n ection between O2 an d t h e
ph ysical st or age volu m es associat ed wit h a logical, n am ed dat abase
system .
An o2server pr ocess is star t ed au t om at ically by som e O2 pr ogr am s
(o2dba_copy, o2dba_env, o2dba_init, o2dba_rm, o2dba_backup and
o2dba_restore), an d is t er m in at ed by t h ese pr ogr am s as t h ey exit .
For ot h er pr ogr am s, o2server m u st be in vok ed m an u ally pr ior t o
st ar t in g an O 2 session . Th e o2server is st ar t ed u p in back gr ou n d
u n less you u se t h e foreground opt ion .
o2server m u st be t er m in at ed u sin g o2dba_shutdown. If t h e ser ver is
sh u t t in g down an o2 clien t as o2dba_monitor> can n ot con n ect t o t h e
o2ser ver
Th er e m u st be on e an d on ly on e o2server pr ocess execu t in g for each
n am e syst em in u se.
Wh en t h e o2server pr ocess is st ar t ed, it cr eat es an d for m at s t h e
sh adow volu m e wit h an elast ic size. Th is volu m e is r em oved wh en
o2server exit s.
o2server also r esizes t h e log volu m e if n ecessar y wh en it st ar t s. To
ch an ge t h e log size, you ch an ge th e .o2ser ver r c file an d r estar t t h e
ser ver .
If o2server is in t er r u pt ed by a h ar dwar e or power failu r e, for exam ple,
sim ply r est ar t it . A war m r ecover y m ech an ism en su r es dat a in t egr ity.
See t h e O2 Sy stem Ad ministration Guide for m or e det ails.
Options
72
-system
Specifies t h e O 2 syst em n am e. If t h is opt ion is n ot
u sed, t h e syst em n am e given by t h e en vir on m en t is
u sed (see Defau lt opt ion s below).
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
O2 System Commands : o2server
-verbose
In ver bose m ode, o2server r et u r n s det ails of
im por t an t even t s su ch as t r an sact ion s, cr eat ion of
O 2 St or e files, con n ect ion of u ser s, et c.
-mode
Th is opt ion specifies t h e m ode in wh ich t h e ser ver
oper ates in t er m s of con cu r r en cy con t r ol, r ollback s
an d cr ash r ecover y. Th e followin g valu es ar e accepted:
multi-user
M u lt i-u ser con cu r r en cy con t r ol en abled,
Abor t s en abled, Recover y en abled
single-user
M u lt i-u ser con cu r r en cy con t r ol disabled,
Abor t s en abled, Recover y en abled
transaction-off
M u lt i-u ser con cu r r en cy con t r ol disabled,
Abor t s disabled, Recover y disabled
-version
Displays in for m at ion abou t t h e cu r r en t ver sion an d
exits.
-help
Displays in for m at ion abou t t h e possible opt ion s an d
exits.
-env
Displays t h e act u al valu e t ak en for th e opt ion s an d
exits. Allows you to ver ify t h at t h e opt ion m ech an ism
(explicit an d im plicit ) is cor r ect ly set.
Default Options
Th e pr eviou s o2 ser ver opt ion s an d ot h er s can be
im plicit ly set as explain ed in 2.1.1.
Environment variables
O2HOME
Is m an dat or y an d con t ain s t h e pat h t o th e O2
in st allat ion dir ect or y.
O2SERVEROPTIONS See 2.1.1.
O2 Syst em Adm in ist r ation Refer en ce Man u al
73
2
O2 System Commands
o2shell
Summary
St ar ts an O 2 developm en t dat abase session .
Syntax
o2shell [-system system_name] [-server machine_name]
[-alpha][-verbose]
[-libs lib1:lib2...libn]
[-libpath path1:path2...pathn]
o2shell -version
o2shell -help
o2shell -env
Description
Th is com m an d calls u p an en vir on m en t wh ich allows you t o develop an d
t est O2 application s u sin g O2 C. O2 DBA an d O 2 D SA com m an ds ar e also
available via o2shell. See th e O2 C Reference Manual for O 2 C specific
com m an ds.
You n eed an O 2 C developm en t licen se t o r u n o2shell.
o2shell est ablish es a con n ect ion wit h a n am ed O 2 syst em for wh ich an
o2server m u st be act ive.
Options
74
-system
Specifies t h e O 2 n am ed syst em t o con n ect t o. An
o2server m u st alr eady be r u n n in g on t h is syst em
befor e o2shell is in vok ed.
-server
Specifies t h e m ach in e n am e wh er e o2server is
r u n n in g.
-alpha
D isables t h e gr aph ical in t er face for dat abase br owsin g.
Uses a du m b t er m in al st yle.
-verbose
Pr in ts in for m ative m essages du r in g t h e o2shell
session .
-libs
Cau ses t h e O2 C com piler t o look for ext er n al fu n ct ion s
in libr ar ies n am ed liblib1.xx, wh er e xx depen ds on
t h e oper at in g syst em . It m u st be a sh ar ed libr ar y. Th e
libr ar ies ar e sou gh t fir st in dir ect or ies specified by t h e
-libpath option pr ior to t h e st an dar d libr ar y
dir ect or ies.
-libpath
Cau ses t h e O 2 C com piler to look for libr ar ies in t h e
specified dir ect or ies befor e sear ch in g in t h e st an dar d
libr ar y dir ector ies.
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
O2 System Commands : o2shell
-version
Displays in for m at ion abou t t h e cu r r en t ver sion an d
exit s.
-help
Displays in for m at ion abou t t h e possible opt ion s an d
exit s.
-env
Displays t h e act u al valu e t ak en for t h e opt ion s an d
exit s. Allows you t o ver ify t h at t h e opt ion m ech an ism
(explicit an d im plicit ) is cor r ect ly set .
Default Options
Th e pr eviou s o2opt ion s an d ot h er s can be im plicit ly set
as explain ed in 2.1.2.
Environment variables
O2HOME
Is m an dat or y an d con t ain s t h e pat h t o t h e O 2
in st allat ion dir ect or y.
O2OPTIONS
See 2.1.2.
O2 Syst em Adm in ist r ation Refer en ce Man u al
75
2
O2 System Commands
o2tools
Summary
St ar ts a gr aph ical O 2 developm en t dat abase session .
Syntax
o2tools [-system system_name] [-server machine_name]
[-verbose]
[-libs lib1:lib2...libn]
[-libpath path1:path2...pathn]
o2tools -version
o2tools -help
o2tools -env
Description
Th is com m an d calls u p an en vir on m en t wh ich allows you t o develop an d
t est O2 applicat ion s u sin g t h e gr aph ical developm en t en vir on m en t . See
t h e O2 Tools User Manual .
You n eed an O 2 Tools developm en t licen se t o r u n o2tools.
o2tools est ablish es a con n ect ion wit h a n am ed O 2 syst em for wh ich an
o2server m u st be act ive.
Options
76
-system
Specifies t h e O 2 n am ed syst em t o con n ect t o. An
o2server m u st alr eady be r u n n in g on t h is syst em
befor e o2tools is in vok ed.
-server
Specifies t h e m ach in e n am e wh er e o2server is
r u n n in g.
-verbose
Pr in ts in for m ative m essages du r in g t h e o2tools
session .
-libs
Cau ses t h e O2 C com piler t o look for ext er n al fu n ct ion s
in libr ar ies n am ed liblib1.xx, wh er e xx depen ds on
t h e oper at in g syst em . It m u st be a sh ar ed libr ar y. Th e
libr ar ies ar e sou gh t fir st in dir ect or ies specified by t h e
-libpath option pr ior to t h e st an dar d libr ar y
dir ect or ies.
-libpath
Cau ses t h e O 2 C com piler to look for libr ar ies in t h e
specified dir ect or ies befor e sear ch in g in t h e st an dar d
libr ar y dir ector ies.
-version
D isplays in for m at ion abou t t h e cu r r en t ver sion an d
exits.
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
O2 System Commands : o2tools
-help
Displays in for m at ion abou t t h e possible opt ion s an d
exit s.
-env
Displays t h e act u al valu e t ak en for t h e opt ion s an d
exit s. Allows you t o ver ify t h at t h e opt ion m ech an ism
(explicit an d im plicit ) is cor r ect ly set .
Default Options
Th e pr eviou s o2opt ion s an d ot h er s can be im plicit ly set
as explain ed in 2.1.2.
Environment variables
O2HOME
Is m an dat or y an d con t ain s t h e pat h t o t h e O 2
in st allat ion dir ect or y.
O2OPTIONS
See 2.1.2.
O2 Syst em Adm in ist r ation Refer en ce Man u al
77
2
78
O2 System Commands
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
3
3
O2 DBA Commands
O2 DATABASE ADMINISTRATION
COMMAND S
Th is ch apt er con t ain s descr ipt ion s of O2 dat abase adm in ist r at ion
com m an ds. To u se t h ese com m an ds en t er th e o2dba_shell com m an d.
Th e o2dba_shell com m an d is ou tlin ed in O2 Syst em Com m an ds.
Th ese com m an ds ar e also available wh en you u se t h e o2dsa_shell
com m an d an d all com m an ds ou tlin ed in t h is m an u al ar e available if
you h ave a developm en t licen se.
Elem en t s wh ich can be adm in ist er ed ar e in su bsect ion s an d list ed in
alph abet ical or der . Wit h in each su bsection com m an ds ar e given in
alph abet ical or der .
You will fin d at th e en d of t h is ch apt er t h e List of t h e var iou s
com m an ds.
Th is ch apt er is divided in t o t h e followin g sect ion s :
•
•
•
•
•
•
Applicat ion s
Bases
Clu ster s
D isplay com m an d
H elp
In dexes
• Nam es
• Pr ogr am s
• Qu er y
• Tr an saction s
• Volu m es
O2 Syst em Adm in ist r at ion Refer en ce Man u al
79
3
O2 DBA Commands
3.1 Applications
Com m an ds exist t o display O2 applicat ion defin ition s. You can also
display an d pr in t docu m en t at ion in an applicat ion .
• Displaying an application
To display pr ogr am n am es an d sign atu r es of th e cu r r en t or specified
application :
display application [appli_name]
To list all t h e applicat ion s defin ed in t h e cu r r en t sch em a:
display applications
• Documentation for an application
To display applicat ion docu m en t at ion :
display doc in application [appli_name]
To pr in t t h is docu m en t at ion :
print doc in application [appli_name] path_name
• Printing an application
To pr in t t h e pr ogr am n am es an d sign atu r es of th e cu r r en t or specified
application :
print application [appli_name] path_name
• Running an application
You can r u n an applicat ion u sin g th e followin g com m an d:
run application appli_name
[(value_spec[, value_spec]...)]
Th is com m an d fir st ly r u n s t h e applicat ion ’s pr ogr am called init if it
exist s. It th en displays a m en u con t ain in g all pu blic pr ogr am s of t h e
application . Ot h er wise th e dashboard pr ogr am is st ar ted if it exist s. If
t h e init pr ogr am h as par am et er s, you m u st specify t h e par am et er
valu es in a com m a-separ at ed list , en closed bet ween br ack et s () aft er
t h e applicat ion n am e appli_name, in t h e sam e or der as t h e init
pr ogr am par am et er s.
80
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
Bases
3.2 Bases
To m an ipu lat e bases, t h e followin g com m an ds exist.
• Creating a base
To cr eate a base, u se t h e com m an d:
[create] base base_name [schema schema_name]
[volume volume_name] [size size] [factor factor]
Th is cr eat es a logical dat abase on t h e specified ph ysical volu m e or th e
cu r r en t volu m e, if n o volu m e is specified.
Th e st r u ct u r e an d beh avior of t h e n ew base is deter m in ed by t h e
sch em a schema_name (or by t h e cu r r en t sch em a if n o sch em a is
specified).
An im plicit set base is per for m ed to set th e cu r r en t base t o t h is n ew
base. Th e n am e of t h e n ew base m u st n ot con flict wit h t h e n am e of an y
exist in g base.
A base an d it s sch em a can be on differ en t ph ysical volu m es.
• Size
An in it ial size in k ilobyt es can be specified for t h is dat abase so t h at
adjacen t disk space is r eser ved for it . Th e syst em allocat es extr a space if
t h is in itial size is t oo sm all.
Th is size m u st be sm aller th an t h e r em ain in g file space size of t h e
volu m e. Th e in it ial defau lt size is 64 k ilobytes.
• Factor
You can also specify a p age f i l l f act or bet ween 1% an d 100%. Th e
defau lt page fill fact or is 95. Th is m ean s t h at 5% of th e page space is n ot
u sed in or der t o accom m odat e expan sion s of object s (st r in gs an d
collection s).
Th is fact or is on ly u sed wh en a per sist en t object is cr eat ed an d wh en
t h e tr an sact ion wor k s in th e appen d m ode. Th is m ode can be act ivat ed
by t h e O 2 En gin e API pr im it ive, o2_storage_layout (O2_TAIL). See t h e
O2 Engine API Reference Manual for fu r t h er det ails.
O2 Syst em Adm in ist r ation Refer en ce Man u al
81
3
O2 DBA Commands
• Deleting a base
To delet e a base, type th e followin g com m an d:
delete base [base_name]
Th is r em oves a base fr om t h e ph ysical volu m e. All object s an d valu es
st or ed in t h e base ar e delet ed. You can n ot delet e t h e cu r r en t base as
well as a base t h at h as been set as th e wor k in g base in th e cu r r en t
t r an sact ion .
• Displaying bases
To display t h e det ails of a base, or of t h e cu r r en t base if n o base is
specified, u se t h e followin g com m an d:
display base [base_name] [ stat]
In for m at ion displayed abou t t h e base in clu des it s n am e, it s in ter n al
iden tifier , t h e ph ysical volu m e n am e on wh ich it r esides, th e n am e of
t h e sch em a to wh ich it belon gs.
Wh en you u se th e [stat] opt ion , you also obt ain th e n u m ber of O 2
files wh ich m ak e u p th e base an d t h e size of t h e base. You also get
in for m at ion abou t each file con t ain ed in t h e base: t h e in t er n al n am e
an d iden t ifier of t h e O2 Stor e files, t h e car din alit y of r ecor ds in t h is file,
t h e n u m ber of pages occu pied on disk .
Th er e ar e differ en t k in ds of files: bagfile for lar ge set s,
collectionIndex for lar ge list s an d u n iqu e set s, o2Index for u ser
defin ed in dexes, cluster for u ser defin ed clu st er s, ldiFile for lon g
bytes an d st r in gs, an d defaultFile for an y ot h er t ype of dat a.
To list t h e n am es of all bases, t ype t h e followin g com m an d:
display bases [stat ]
Wh en you u se th e [stat] opt ion , you obtain det ails for each base as
ou t lin ed in t h e display base com m an d above.
• Extend a base
To add a volu m e t o a base, u se t h e followin g com m an d:
extend base base_name volume volume_name
82
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
Bases
• Garbage a base
To clean u p a base u se t h e followin g com m an d:
garbage base [base_name]
Th is clean s u p t h e base by collect in g t h e u n r each able objects of a given
base an d r eleases disk space. It is r ecom m en ded t h at you u se t h is
com m an d fr om t im e t o t im e.
En su r e t h at all per sist en t object s in a base ar e r each able fr om a
per sist en t r oot in a base. Th is is becau se gar bage collect ion wor k s
wit h in a base wh ich m ean s t h at t h ose object s in a par t icu lar base t h at
ar e on ly r each able fr om an ot h er base will also be gar baged.
• Renaming a base
To r en am e a base, u se t h e com m an d:
rename base base_name as new_base_name
Th is ch an ges t h e n am e of a specified base t o th e n ew n am e given , or of
t h e cu r r en t base if on ly t h e n ew base n am e is given .
Th e n ew n am e m u st n ot con flict wit h an exist in g base n am e.
• Resetting the index & cluster in a base
To dest r oy in valid in dex an d clu st er s aft er a sch em a h as been m odified,
u se t h e followin g com m an d:
reset index cluster in base base_name
See t h e O2 Sy stem Administration Guid e for m or e det ails.
• Setting a base
To set t h e base base_name t o t h e cu r r en t base, t ype:
set base base_name
Th e sch em a associat ed t o t h e base is au tom at ically set as th e cu r r en t
wor k in g sch em a.
Th e ph ysical volu m e con tain in g t h e base is set as t h e cu r r en t volu m e.
O2 Syst em Adm in ist r ation Refer en ce Man u al
83
3
O2 DBA Commands
3.3 Clusters
Clu st er com m an ds exist for classes or n am ed collect ion s.
Create cluster
Th e cluster com m an d syn t ax is as follows:
[ create ] cluster
[
[
[
[
root_name
[ on path ]
index index_path ]
in volume vol_name ]
size integer_number ]
at integer_number]
wh er e root_name is
root_name
:=
constant_name
|
class_name
wh er e path is
path := *[ (component_path) ] | (component_path)
component_path := attribute_name [*] [(component_path)]
| component_path [, component_path...]
wh er e index_path is
index_path
:=
attribute_name [. attribute_name
...]
Opt ion s ar e ou t lin ed below.
• on
If you do n ot specify t h e path u sin g t h e on clau se, t h e class ext en t (i.e.
all th e per sisten t valu es of t h e class) or th e com plex valu e of a n am e, is
added t o t h e defin ed clu st er .
• index
Clu st er via an exist in g in dex defin it ion given by index_path. Th e
r esu ltin g clu st er file is t h en sor t ed u sin g t h e in dex.
• in volume
Clu st er in t h e volu m e called vol_name. Th e defau lt volu m e is t h e volu m e
in wh ich t h e base was in it ially cr eat ed.
84
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
Clusters:Delete cluster
• size
Specify an in it ial size in k ilobyt es for t h e dat abase in or der t o r eser ve
adjacen t disk space. Th e defau lt size of an O2 file is 32 k ilobyt es.
• at
In ser t t h e clu st er defin ition at position integer_number in t h e pr ior it y
list . A low n u m ber cor r espon ds t o a h igh pr ior it y. If n ot specified, t h e
clu st er is in ser t ed at t h e en d of t h e list an d will h ave t h e lowest pr ior it y.
• ( ) and ( , )
Wh en applied t o t u ple st r u ct u r ed object s or valu es, t h ese br ack et s
specify t h at com pon en t s can be obtain ed u sin g t h e att r ibu t e
attribute_name an d ar e t o be clu ster ed wit h t h eir par en t s. Usin g a
com m a t o separ at e t h em you can give sever al at t r ibu t es, an d for each
on e you can specify th e com pon en t s by component_path.
• *
Wh en applied t o collect ion -st r u ct u r ed object s or valu es (set , bag or list ),
all t h e elem en t s of t h e collect ion ar e clu st er ed wit h t h at collect ion . Note
t h at t h e elem en t s t h em selves can be eit h er collect ion s or t u ples, an d
you can en ter an oth er component_path for th em .
Delete cluster
To delet e t h e clu ster given by root_name, u se t h e followin g com m an d:
delete cluster
root_name
Display clusters
To display t h e r oot n am es of all t h e clu st er s defin ed on t h e cu r r en t
base, u se t h e com m an d:
display clusters [stat]
If you u se th e stat k eywor d, t h e path an d statistical in for m at ion is
also displayed.
O2 Syst em Adm in ist r ation Refer en ce Man u al
85
3
O2 DBA Commands
Promote cluster
To pr om ote n ewly cr eat ed objects in clu st er s u se th e followin g
com m an d:
promote
Th is com m an d t r igger s th e clu st er in g fu n ct ion bu t does n ot validat e th e
t r an sact ion .
3.4 Display command
To display t h e n am es of t h e cu r r en t sch em a, base an d class, t ype t h e
followin g com m an d:
display [stat]
With stat, you also get st at ist ical in for m ation abou t t h e cu r r en t n am ed
syst em , t h e volu m e con t ain ed in t h e syst em , t h e size on disk , each
sch em a n am e an d own er , each base n am e an d its associat ed sch em a,
an d t h e n u m ber of per sist en t collect ion s an d in dexes for each base.
3.5 Help
To get on -lin e h elp, you u se t h e com m an d:
help [O2_keyword]
If you t ype help, you obt ain a fu ll list of O2 com m an ds. Th e syn t ax an d
a br ief descr ipt ion is given for each com m an d.
Wh en you u se an O2_keyword, help gives in for m at ion for t h ose
com m an ds wh ich con t ain t h e k eywor d.
86
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
Indexes:Promote cluster
3.6 Indexes
You can m ain t ain on e or m or e in dexes on a n am ed set or list . Th is
in cr eases t h e speed at wh ich set or list elem en t s ar e accessed du r in g
qu er y execu t ion . You m u st declar e t h e set or list as a constant_name.
• Creating an index
To cr eate an d m ain t ain an in dex for t h e n am ed set or list
constant_name on th e pat h index_path, t ype t h e com m an d:
[create] index constant_name on index_path
[in volume volume_name]
Th e index_path specificat ion is as follows:
attribute_name [.attribute_name]...
Th e last attribute_name you give m u st be eit h er an at om ic valu e or an
object . An y ot h er attribute_names ar e tu ple-valu ed at t r ibu tes.
• Displaying an index
To list th e n am es of all t h e collect ion s on wh ich in dexes ar e defin ed
display index [stat]
To display t h e list of all t h e k ey pat h s for th e collection constant_name:
display index constant_name [stat]
To display t h e det ails abou t th e in dex specified:
display index constant_name on index_path [stat]
If you add stat, you get t h e in dex iden t ifier , th e car din alit y an d t ype of
k eys in t h e in dex, t h e t ype of in dexed data, t h e n u m ber of pages an d t h e
in t er n al O2 St or e file n am e.
• Deleting an index
To delet e an in dex for th e n am ed set or list on t h e pat h index_path:
delete index constant_name on index_path
O2 Syst em Adm in ist r ation Refer en ce Man u al
87
3
O2 DBA Commands
3.7 Names
Th ese com m an ds apply to n am ed objects an d valu es.
• Displaying a named object or value
To display t h e defin it ion of t h e n am ed object or n am ed valu e specified:
display name obj_or_value_name [ stat]
If you u se stat, you get st at ist ical in for m at ion if t h e n am ed object or
valu e is a collect ion
To list all t h e n am es defin ed for t h e cu r r en t sch em a:
display names
• Displaying documentation for a named object or value
To display docu m en t at ion on a n am ed object or valu e:
display doc in name obj_or_value_name
• Printing a named object or value
To pr in t t h e defin it ion of t h e n am ed object or n am ed valu e specified:
print name obj_or_value_name path_name [stat]
Wh en you u se t h e stat k eywor d, you get st at ist ical in for m at ion if th e
n am ed object or valu e is a collection .
To pr in t ou t th e list of all t h e n am es defin ed for t h e cu r r en t sch em a:
print names path_name
• Printing documentation for a named object or value
To pr in t docu m en t at ion on a n am ed object or valu e:
print doc in name obj_or_value_name path_name
88
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
Programs:Promote cluster
3.8 Programs
• Displaying a program
To display t h e sign atu r e of t h e pr ogr am prog_name in th e cu r r en t
or specified applicat ion :
display program prog_name [in application appli_name]
To list t h e n am es an d sign at u r es of all pr ogr am s in t h e cu r r en t or
specified applicat ion :
display programs [in application appli_name]
• Documentation of a program (development option)
To display docu m en t at ion t o t h e cu r r en t or specified pr ogr am :
display program doc [program_name]
[ in application appli_name]
• Printing a program (development option)
To pr in t t h e sign atu r e of t h e pr ogr am prog_name in t h e cu r r en t or
specified applicat ion :
print program prog_name
[in application appli_name] path_name
To pr in t t h is docu m en t at ion :
print program doc [program_name]
[in application appli_name] path_name
To pr in t t h e list of t h e n am es an d sign at u r es of all pr ogr am s in t h e
cu r r en t or specified application :
print programs [in application appli_name] path_name
O2 Syst em Adm in ist r ation Refer en ce Man u al
89
3
O2 DBA Commands
• Running a program
You can r u n a par ticu lar pr ogr am of an application u sin g t h e com m an d:
run program prog_name[(value_spec [, value_spec]... )]
in application appli_name [(value_spec [, value_spec]... )]
Th e pr ogr am prog_name m u st be pu blic. If th e pr ogr am h as in pu t
ar gu m en ts, you m u st specify t h e valu es in a com m a-separ at ed list ,
en closed in br ack et s (), aft er t h e pr ogr am n am e prog_name, in t h e
sam e or der as pr ogr am ar gu m en t s. If t h e applicat ion appli_name h as
an init pr ogr am wit h par am et er s, you m u st specify t h e par am et er
valu es in a com m a-separ at ed list , en closed in br ack ets () aft er t h e
application n am e appli_name, in t h e sam e or der as t h e init pr ogr am
par am et er s.
3.9 Query
To call t h e OQL qu er y in t er pr et er , t ype t h e com m an d:
query
Th e in t er act ive OQL in t er pr eter is in vok ed, an d you can en t er qu er y
in st r u ct ion s. Refer to t h e OQL User Manual for m or e in for m at ion .
To en d a qu er y session , t ype:
quit
Th is r et u r n s you t o t h e m ain com m an d in t er pr et er .
90
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
Transactions:Promote cluster
3.10 Transactions
Wh en you u se O2 DBA you do so in t h e con t ext of a tr an sact ion . To save
you r wor k you m u st validat e th e t r an sact ion . You can also r oll back
wh at you h ave don e u p t o t h e last validat ion .
Th e followin g com m an ds allow you t o con t r ol t h e cu r r en t tr an sact ion :
• Aborting a transaction
abort
Th is can cels all th e u pdat es car r ied ou t du r in g t h e cu r r en t t r an sact ion
an d im m ediat ely st ar ts a n ew t r an sact ion .
• Controlling commitment
catalog transaction {on or off}
Th e defau lt valu e is off wh ich m ean s t h at you con t r ol wh en you com m it
a t r an sact ion . Wh en t h e valu e is set t o on , O2 au tom at ically u pdat es th e
cat alogu e in a sin gle at om ic t r an sact ion .
Th e followin g catalogu e u pdat es ar e car r ied ou t by O 2 :
- create/delete volume, base, index, cluster, schema
- import/export schema, base
- delete import/export
• Committing a transaction
commit
Th is en ds t h e cu r r en t t r an sact ion an d com m it s m odification s. It fr ees
m em or y u sed by O2 an d st ar t s a n ew t r an saction .
• Ending a transaction
end transaction
Th is validat es t h e cu r r en t t r an sact ion an d star t s a r ead-on ly
t r an sact ion . Th e n ext com m an d you u se will r u n wit h ou t access t o t h e
lock in g m ech an ism . So u pdat es can n ot be car r ied ou t . Th is com m an d is
gen er ally u sed befor e star t in g an OQL session wit h ou t lock in g object s
an d wit h ou t in t er fer in g wit h ot h er tr an sact ion s r u n n in g con cu r r en tly.
O2 Syst em Adm in ist r ation Refer en ce Man u al
91
3
O2 DBA Commands
• Quitting
quit
Th is com m its m odificat ion s, fr ees m em or y u sed by O2 an d en ds t h e O 2
session .
• Returning to transaction mode
transaction
Th is r et u r n s you t o t r an sact ion m ode wh en you h ave been in r ead-on ly
m ode.
• Validating a transaction
validate
Th is en ds t h e cu r r en t t r an saction an d com m it s m odification s m ade bu t
it does n ot fr ee m em or y u sed by O2 . It th en st ar t s a n ew t r an sact ion .
92
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
Volumes:Promote cluster
3.11 Volumes
• Creating a volume
To cr eat e a ph ysical O 2 u ser volu m e, u se t h e com m an d:
[create] volume volume_name size integer
[blocksize integer] [in path_name]
Th is cr eat es t h e volu m e volume_name wit h t h e specified size in
k ilobytes. Th e cu r r en t volu m e is n ot set t o th is n ew volu m e. If t h e size
is set t o zer o 80% of t h e available size of t h e file syst em is allocated for
t h is volu m e. blocksize gives, in k ilobyt es, th e size of t h e block s t o
in cr em en t ally allocat e st or age on t h e disk . Th e defau lt is 256 k ilobyt es.
path_name is a dir ect or y wh er e th e volu m e will be cr eated.
New sch em as an d bases can t h en be cr eat ed in t h e n ew volu m e.
• Deleting a volume
To delet e a ph ysical O2 u ser volu m e, u se t h e com m an d:
delete volume [volume_name]
Th is r em oves an exist in g volu m e volume_name. An y sch em as or bases
st or ed on t h at volu m e m u st be deleted befor e delet in g t h e volu m e
oth er wise an er r or is displayed. Th e volu m e m u st be delet ed befor e
m ou n t in g it. Th er e is n o explicit m ou n t v ol u m e or d i sm ou n t v ol u m e
com m an d, as volu m es ar e m ou n t ed au t om atically. Wh en a volu m e is
delet ed, t h e file in wh ich it is st or ed is delet ed. Th e volu m e DefaultVol
can n ot be delet ed.
• Displaying volumes
To list t h e volu m e n am e an d t h e in ter n al volu m e iden t ifier , u se t h e
followin g com m an d:
display volume [volume_name] [stat]
Wh en you add stat, you obt ain t h e volu m e size on disk . You also get
t h e files cor r espon din g to t h is volu m e in t h e cat alogu e dir ect or y. Th e
volu m e size displayed is t h e size r eally occu pied by t h e dat a an d can be
sm aller t h at t h e cor r espon din g oper at in g syst em file.
O2 Syst em Adm in ist r ation Refer en ce Man u al
93
3
O2 DBA Commands
To list all t h e ph ysical O2 u ser volu m es associat ed with t h e cu r r en t
n am ed O2 syst em , t ype t h e followin g com m an d:
display volumes [stat]
Wh en you u se stat, you obt ain t h e in for m at ion ou t lin ed in t h e display
volume com m an d for each volu m e.
• Extending a volume
To exten d an O2 u ser volu m e wit h a n ew file, u se t h e com m an d
extend volume volume_name size integer [in pathname]
Th is adds to t h e volu m e an ext en sion in t h e dir ector y t h at is defin ed by
t h e path_name. Th e size of t h e exten sion is given in k ilobyt es. If size = 0
80% of th e available space in t h e file syst em is pot en t ially u sable.
• Renaming a volume
To r en am e an exist in g ph ysical O2 u ser volu m e, u se t h e com m an d
rename volume volume_name as new_volume_name
Th is r en am es t h e volu m e volume_name. Not e t h at on ly th e n am e as
k n own t o O2 is ch an ged. Th e oper at in g syst em n am e of t h e ph ysical
volu m e r em ain s t h e sam e. Th e volu m e DefaultVol can n ot be r en am ed.
94
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
List:Promote cluster
3.12 List
Th e list of all t h e com m an ds is given in alph abet ical or der :
• abort
• catalog transaction {on or off}
• commit
• [create] base base_name [schema schema_name]
• [ create ] cluster
root_name [ on path ]
• [create] index constant_name on index_path [in volume
volume_name]
• [create] volume volume_name size integer [blocksize integer] [in path_name]
• delete base [base_name]
• delete cluster root_name
• delete index constant_name on index_path
• delete volume [volume_name]
• display base [base_name] [stat]
• display bases [stat]
• display clusters [stat]
• display doc in application [appli_name]
• display doc in name obj_or_value_name
• display index constant_name [stat]
• display name obj_or_value_name [stat]
• display names
• display program prog_name [in application appli_name]
• display program doc [program_name]
• display programs [in application appli_name]
• display [stat]
• display volume [volume_name] [stat]
O2 Syst em Adm in ist r ation Refer en ce Man u al
95
3
O2 DBA Commands
• display volumes [stat]
• end transaction
• extend base base_name volume volume_name
• extend volume volume_name size integer [in pathname]
• garbage base [base_name]
• help [O2_keyword]
• print application [appli_name] path_name
• print doc in application [appli_name] path_name
• print doc in name obj_or_value_name path_name
• print name obj_or_value_name path_name [stat]
• print names path_name
• print program prog_name
• print program doc [program_name]
• print programs [in application appli_name] path_name
• promote
• query
• quit a query
• quit a transaction
• rename base base_name as new_base_name
• reset index cluster in base base_name
• run application appli_name
• run program prog_name[(value_spec [, value_spec]...)]
• set base base_name
• transaction
• validate
96
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
4
4
O2 DSA Commands
O2 SCHEMA AD MINISTRATION COMMANDS
Th is ch apt er pr ovides descr ipt ion s of O2 sch em a adm in ist r at ion
com m an ds. To u se t h ese com m an ds en t er th e o2dsa_shell com m an d.
Th e o2dsa_shell com m an d is ou tlin ed in O2 Syst em Com m an ds.
You can also u se all O2 DBA com m an ds ou t lin ed in O2 DBA Com m an ds.
Th ese com m an ds ar e also available dir ect ly u n der O2 sh ell if you h ave
an O2 C developm en t licen se.
Som e com m an ds ar e on ly available wit h a developm en t licen se.
Elem en t s wh ich can be adm in ist er ed ar e in su bsect ion s an d list ed in
alph abet ical or der . Wit h in each su bsection com m an ds ar e given in
alph abet ical or der .
You will fin d at th e en d of t h is ch apt er t h e List of all t h e var iou s
com m an ds.
Th is ch apt er is divided in t o t h e followin g sect ion s :
• Att r ibu t es
• Bases
• Classes
• Libr ar ies
• M et h ods
• Nam es
• Sch em as
• Sou r ces
O2 Syst em Adm in ist r at ion Refer en ce Man u al
97
4
O2 DSA Commands
4.1 Attributes
Tu ple at tr ibu t es can be u pdat ed. On ly t h e r en am e com m an d is ou t lin ed
h er e.
• Renaming an attribute
To r en am e an at t r ibu t e in t h e cu r r en t or specified class:
rename attribute attribute_name
[from class superclass_name]
as attribute_name [in class class_name]
On ly u se t h e from class clau se for in h er it ed at t r ibu tes.
4.2 Bases
You can also u se all t h e O2 DBA com m an ds wh ich apply to bases. See
Sect ion 3.
• Importing a base
To access in for m ation stor ed in a base of an ot h er sch em a, you u se t h e
com m an d:
import base base_name
name object_name [, object_name]...
You r application can n ow access dat a st or ed in you r base an d dat a
st or ed in an ot h er base th r ou gh t h e im por t ed n am es. Th is com m an d
specifies var iou s n am ed object defin it ion s defin ed in t h e sch em a
gover n in g t h e specified base. Th ese defin it ion s m u st be m ar k ed as
expor table.
Each m et h od applied t o an object belon gin g t o an ot h er base r u n s on
t h is base. If su ch a m et h od cr eates n ew per sist en t objects, t h ese object s
ar e cr eat ed in t h e im por ted base.
98
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
Classes
• Modifying base status
To m odify t h e st atu s of a base, u se t h e followin g com m an d:
[modify] status TEST [in base base_name]
4.3 Classes
Com m an ds exist t o delet e an d display class defin ition s an d
docu m en tation , to r en am e a class an d t o r en am e an at t r ibu t e of a class.
You can also u se all t h e O 2 D BA com m an ds wh ich apply t o classes. See
Sect ion 3.
• Confirming class updates (development option)
Wh en you ch an ge t h e ph ysical st r u ctu r e of a class, wh en you cr eat e a
n ew class or wh en you im por t a class fr om an ot h er sch em a you m u st
con fir m t h e u pdat es or cr eat ion befor e open in g or cr eatin g r elat ed
bases.
confirm class [class_name]
confirm classes
• Deleting a class (development option)
To delet e t h e defin it ion of t h e cu r r en t class or of t h e class_name
specified, u se t h e com m an d:
delete class [class_name]
O2 Syst em Adm in ist r ation Refer en ce Man u al
99
4
O2 DSA Commands
To delet e t h e defin ition of t h e specified class class_name an d all it s
su bclasses, you can u se t h e com m an d:
delete classes from class_name
• Displaying a class
To display t h e t ype defin it ion of t h e cu r r en t class or specified class
class_name, u se th e com m an d:
display class [class_name]
To list t h e n am es of all classes defin ed u n der t h e cu r r en t sch em a, you
can u se th e com m an d:
display classes
• Display documentation about a class
To display docu m en t at ion abou t t h e cu r r en t or specified class, u se t h e
com m an d:
display doc in class [class_name]
• Documentation about a class
To add docu m en t at ion abou t t h e cu r r en t or specified class, u se th e
com m an d:
doc in class [class_name] [documentation]
• Inheritance of a class
You can ch an ge th e su per class of a class:
[create] inherit [Class_name] Superclass_name
100
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
Classes
Th is com m an d m ak es t h e specified or cu r r en t class in h er it it s
pr oper t ies fr om t h e su per class Superclass_name. Th is im plies possible
ch an ges t o th e t ype an d m eth od defin ition s of t h e class.
You can delet e a lin k bet ween a su per class an d a class:
delete inherit [Class_name] Superclass_name
Th is m ean s t h at t h e specified or cu r r en t class n o lon ger in h er it s its
pr oper t ies fr om t h e su per class Superclass_name. Th is im plies possible
ch an ges t o th e t ype an d m eth od defin ition s of t h e specified class. If t h e
specified class h as n o ot h er su per classes, it becom es a dir ect su bclass
of t h e class Object.
• Printing a class
To pr in t t h e t ype defin ition of t h e cu r r en t class or specified class
class_name, u se t h e com m an d:
print class [class_name] path_name
To pr in t t h e list of n am es of all classes defin ed u n der th e cu r r en t
sch em a, u se th e com m an d:
print classes path_name
• Printing documentation on a class
To copy t h e docu m en t at ion t o a file, u se t h e com m an d:
print doc in class [class_name] path_name
• Reimporting a class
To r eim por t a class aft er it h as been m odified, u se t h e com m an d:
reimport class class_name
O2 Syst em Adm in ist r ation Refer en ce Man u al
101
4
O2 DSA Commands
• Renaming a class
To r en am e t h e cu r r en t or specified class, u se th e com m an d:
rename class [class_name as] new_class_name
• Saving a class
To save a class sou r ce defin it ion in a file:
save class [class_name] path_name
4.4 Libraries
Bin ar y object s ar e pr odu ced wh en you com pile O 2 C code or wh en you
im por t C++ fu n ct ion m em ber s. You can cr eat e libr ar ies t o con t ain all t h e
bin ar y object s of a sch em a. Th e con t en t s of t h ese libr ar ies ar e st or ed in
an O2 dat abase an d ar e t r an sfor m ed in to libr ar ies wh en t h e sch em a is
open ed. You can also st or e a libr ar y in a st an dar d file.
Th e followin g libr ar y com m an ds can n ot be u sed on Spar c st at ion s
r u n n in g Su n OS.
Wh en a libr ar y is st or ed in an O 2 sch em a, it is loaded th e fir st t im e on e
of its m et h ods is u sed. If t h e libr ar y is stor ed in a file it becom es exter n al
t o O2 . You m u st call it in a Mak efile or wh en you star t O2 wit h t h e libpath an d -libs opt ion s.
Th e dir ect or y wh er e a libr ar y is t o be st or ed m u st exist. Th e libr ar y is
n ot cr eat ed if t h e pat h n am e for t h e file exist s alr eady.
• Creating a library
To cr eat e a libr ar y con tain in g all t h e bin ar y object s belon gin g t o a
sch em a called [schema_name], u se t h e followin g com m an d:
create library [schema_name] [path_name]
102
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
Methods
Th e libr ar y is st or ed in t h e act u al O 2 sch em a u sed t o bu ild it , or in t h e
specified file (if specified).
Th is com m an d wor k s even if all th e sch em a defin it ion s ar e n ot
com plet e. It does n ot wor k if t h e sou r ce code of a pr ogr am / m et h od/
fu n ct ion is m issin g.
• Creating a shared library
To cr eate a sh ar ed libr ar y, u se t h e followin g com m an d:
create shared library [schema_name] [path_name]
Th is is th e sam e as t h e cr eat e libr ar y com m an d except th at t h e libr ar y
is sh ar ed bet ween differ en t sch em as givin g in cr eased per for m an ce an d
disk space.
Not e t h at t h e bin ar ies u sed t o cr eate a sh ar ed libr ar y ar e delet ed fr om
t h e sch em a. So t h at if you n eed t o ch an ge O2 C code, or im por t n ew C++
fu n ct ion s, or ch an ge t h e sign at u r e of an im por t ed C++ fu n ct ion , you
m u st r ebu ild all bin ar ies. Th is im plies a com plete r ecom pilat ion of t h e
sch em a. Th is com m an d is r ecom m en ded for sch em as t h at ar e st able
an d ar e n ot oft en m odified.
4.5 Methods
M et h ods in clu de O2 C m et h ods an d im por t ed C++ fu n ction m em ber s.
• Displaying a method
To display t h e sign atu r e of a m et h od method_name:
display method method_name [in class class_name]
To display t h e n am es an d sign at u r es of t h e locally-defin ed
m et h ods in t h e cu r r en t or specified class:
display methods [in class class_name]
[from superclass_name]
O2 Syst em Adm in ist r ation Refer en ce Man u al
103
4
O2 DSA Commands
Use t h e from opt ion t o display all th e m eth ods in h er it ed fr om t h e
su per class superclass_name.
• Documentation of a method
To add docu m en t at ion to t h e specified m et h od:
method doc [method_name] [in class class_name]
[documentation]
To display t h is docu m en t at ion :
display method doc [method_name] [in class class_name]
To pr in t t h is docu m en t at ion :
print method doc [method_name] [in class class_name]
path_name
• Printing a method
To pr in t t h e sign at u r e of a m et h od method_name:
print method method_name [in class class_name]
To pr in t t h e n am es an d sign at u r es of t h e locally-defin ed m et h ods in t h e
cu r r en t or specified class:
print methods [in class class_name]
[from superclass_name] path_name
Use t h e from opt ion t o pr in t all th e m et h ods in h er it ed fr om t h e
su per class superclass_name.
4.6 Names
Com m an ds exist t o cr eat e, delet e an d display n am e defin it ion s an d
docu m en t at ion as well as to m odify an d ch an ge n am es.
You can also u se all t h e O2 DBA com m an ds wh ich apply to n am es. See
Sect ion 3.
104
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
Names
• Creating a named object or value
To cr eat e a n am ed object or n am ed valu e, u se t h e com m an d:
[create] [constant] name obj_or_value_name: type_spec
If type_spec is a class, it m u st exist in t h e sch em a.
If t h e n am e is con st an t or if type_spec is a type, an in stan ce of an
object or valu e, type_spec is cr eat ed in th e dat abase.
For a n on -con st an t object n am e, on ly t h e n am e is cr eated.
Th e object it self m u st be cr eat ed by a pr ogr am u sin g th e n ew
in st r u ct ion .
• Deleting a named object or value
To delet e a n am e:
delete name obj_or_value_name
Th is does n ot au t om atically delet e t h e act u al valu e or object .
If t h e valu e or object is per sist en t for an ot h er r eason , for exam ple. if it is
par t of an oth er per sist en t object , t h e act u al object or valu e is n ot
delet ed.
• Documentation for a named object or value
To add docu m en t at ion to a cu r r en t or specified n am ed object or valu e:
doc in name [obj_or_value_name] [documentation]
• Modifying a named object or value
To m odify a n am ed object or n am ed valu e:
modify [constant] name obj_or_value_name: type_spec
O2 Syst em Adm in ist r ation Refer en ce Man u al
105
4
O2 DSA Commands
You can m ak e a n am e con st an t or r em ove t h e con st an t pr oper t y, in
wh ich case t h e type_spec is t h e sam e as in t h e or igin al defin it ion an d
t h e dat a r efer r ed t o by t h is n am e can st ill be accessed.
However , if t h e type is ch an ged, th e lin k bet ween t h e n am e an d dat a is
br ok en an d th e com m an d wor k s in exact ly t h e sam e way as t h e cr eat e
n am e com m an d.
• Renaming a named object or value (development option)
To ch an ge t h e n am e associat ed with an object or valu e:
rename name obj_or_value_name as obj_or_value_name
Th is does n ot affect t h e act u al object or valu e. If t h e n am e is a con stan t
n am e, t h e n ew n am e is also con st an t .
• Saving a name (development option)
To save a n am e sou r ce defin it ion t o a file:
save name obj_or_value_name path_name
4.7 Schemas
• Creating a schema
To cr eat e a sch em a, u se t h e com m an d:
[create] schema schema_name [volume volume_name]
Th is cr eat es a sch em a schema_name on t h e ph ysical volu m e
volume_name (or t h e cu r r en t volu m e, if n o volu m e is specified). Th e n ew
sch em a on ly con t ain s t h e defin it ion of t h e syst em -su pplied class
Object.
106
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
Schemas
An im plicit set schema occu r s t o set th e cu r r en t sch em a t o t h e n ew
sch em a. Th e schema_name m u st n ot alr eady exist for an exist in g
sch em a or base.
• Deleting a schema
To delet e a sch em a, u se t h e com m an d:
delete schema [schema_name]
Th is r em oves t h e specified sch em a fr om th e ph ysical volu m e. Th is
oper ation is r efu sed if t h er e ar e bases associat ed wit h t h e sch em a. Th e
cu r r en t sch em a can n ot be delet ed.
A sch em a can n ot be delet ed if it is set as t h e wor k in g sch em a in th e
cu r r en t t r an saction . Th e best way is t o delet e t h e sch em a as t h e fir st
com m an d of t h e session .
Alt er n atively, you can m ove t o an ot h er sch em a u sin g t h e set schema
com m an d, com m it th e t r an sact ion an d t h en delet e th e sch em a. If t h e
sch em a you m ove t o h as been cr eat ed in a differ en t volu m e t o t h e
sch em a you wan t t o delet e, you r em ain posit ion ed in t h at volu m e aft er
t h e com m it , an d th is m ay cau se er r or s. For exam ple, m ovin g t o th e
pr edefin ed sch em a o2kit is n ot r ecom m en ded as it is cr eated in t h e
cat alogu e volu m e.
• Displaying schemas
To display t h e det ails of t h e specified sch em a, or of t h e cu r r en t sch em a
if n o sch em a is specified, u se t h e followin g com m an d:
display schema [schema_name] [stat]
In for m at ion displayed abou t t h e sch em a in clu des it s n am e, it s in t er n al
iden t ifier , th e ph ysical volu m e n am e on wh ich it is fou n d, th e n u m ber of
bases th at it con t ain s.
Wh en you u se t h e stat opt ion , you obt ain m or e in for m at ion . You also
get a list of all u ser bases in t h is sch em a, t h e n u m ber of classes an d
m et h ods associated wit h t h is sch em a, t h e size of t h e sou r ce base an d
defin ition base. Each sch em a is m ade u p of t wo bases: t h e fir st con t ain s
t h e sch em a sou r ces an d t h e secon d con t ain s t h e com piled sch em a.
O2 Syst em Adm in ist r ation Refer en ce Man u al
107
4
O2 DSA Commands
To list t h e n am es of all sch em as u n der t h e pr esen t ph ysical volu m e,
t ype t h e followin g com m an d :
display schemas [stat]
Wh en you u se t h e stat opt ion , you obtain m or e in for m at ion for each
sch em a as ou t lin ed in t h e display schema com m an d above.
• Displaying schemas with imported elements
To list sch em as t h at h ave im por t ed elem en t s fr om t h e sch em a
schema_name, you u se t h e com m an d:
display import schema_name
To list all t h e sch em as t h at h ave im por t ed elem en ts fr om t h e base
base_name, u se th e com m an d:
display import base_name
• Deleting an export command
To r ever se an expor t com m an d:
delete export [class class_name [, class_name]...]
[name obj_or_value_name [, obj_or_value_name]...]
If n o sch em a defin it ion s ar e specified, t h e com m an d is r efu sed.
• Exporting a schema
You can u se all or par t of an ot h er sch em a t o bu ild you r sch em a by
im por t in g on e or m or e of it s classes.
To expor t on e or m or e sch em a defin it ion s, you u se t h e com m an d:
export schema [class class_name [, class_name]...]
[name obj_or_value_name [, obj_or_value_name]...]
108
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
Schemas
Each specified class an d n am e defin ition of t h e cu r r en t sch em a is
m ar k ed as bein g expor t able. Th is m ean s t h at t h ese defin ition s ar e n ow
pu blic an d you can im por t t h em fr om an ot h er sch em a.
Th e sim ple com m an d export schema r efr esh es t h e expor t ed it em s
aft er an u pdat e of t h e expor t ed classes.
• Importing a schema
To im por t all or som e of an ot h er sch em a’s defin it ion s, u se th e
com m an d:
import schema schema_name
[class class_name [, class_name]...]
[name obj_or_value_name [, obj_or_value_name]...]
In t h e cu r r en t sch em a, you r applicat ion can n ow u se t h e class, n am ed
object an d n am ed valu e defin it ion s specified as if t h ey h ad been defin ed
in th e cu r r en t sch em a.
H owever , you can n ot m odify t h ese im por ted class defin ition s. You m u st
cr eat e su bclasses an d m odify t h e m et h ods an d t ype st r u ctu r es of t h ese
su bclasses. An im por t ed class defin it ion always h as a pr ivat e t ype
st r u ct u r e even if it h as a pu blic st r u ct u r e in th e sch em a of or igin . If
n ecessar y, you can u se th e public or read option s of th e pr oper
com m an ds t o ch an ge th is.
• Renaming a schema
To r en am e a sch em a, u se t h e followin g com m an d:
rename schema schema_name as new_schema_name
Th is ch an ges t h e n am e of t h e specified sch em a, or of th e cu r r en t
sch em a if on ly on e sch em a n am e is given .
Th e n ew n am e m u st n ot con flict wit h an y exist in g sch em a.
O2 Syst em Adm in ist r ation Refer en ce Man u al
109
4
O2 DSA Commands
• Saving a schema (development option)
To save t h e defin it ion s of t h e sch em a schema_name t o on e or m or e ASCII
files, t ype t h e com m an d:
save schema [schema_name] path_or_file_name
If t h e path_or_file_name cor r espon ds t o a dir ect or y, t h e sch em a
defin it ion s ar e st or ed, on e by on e, in separ at e files:
• Each class defin it ion is st or ed in two files:
schema_name.Class_name.o2, for t h e class st r u ct u r e an d m et h od
sign at u r es, an d schema_name.Class_name.o2c, wh ich h olds t h e
m et h od bodies.
• Each applicat ion is st or ed in t wo files:
schema_name.appli_name.o2, con t ain in g t h e applicat ion defin it ion ,
t h e var iable defin ition s an d t h e pr ogr am sign at u r es, an d
schema_name.appli_name.o2c, wh ich h olds t h e pr ogr am bodies.
• All fu n ct ion defin it ion s an d sign at u r es ar e st or ed t oget h er in a file
called schema_name.funcs.o2, an d t h eir bodies ar e stor ed in
schema_name.funcs.o2c.
• All n am ed t ype defin it ion s ar e st or ed toget h er in a file called
schema_name.types.o2.
• All n am ed object an d valu e defin ition s ar e st or ed in a file called
schema_name.names.o2.
• All r edefin ed (m et h od or at t r ibu te) pr oper t ies ar e st or ed in t h e file
schema_name.properties.o2
• Th r ee com m an d files ar e gen er at ed t o r est or e t h e sch em a defin it ion s:
- schema_name.load.o2 r est or es all sch em a defin it ion s (i.e. files
en din g in .o2, bu t n on e of t h e O 2 C im plem en t at ion s.
- schema_name.load.o2c r est or es t h e bodies (files en din g in .o2c).
- schema_name.load r est or es ever yt h in g.
Th ese com m an d files m ay be in vok ed u n der an O2 sh ell in t h e followin g
way:
#"[directory_path]schema_name.load[.o2[c]]"
If path_or_file_name cor r espon ds t o a file, or an yt h in g ot h er t h an a
dir ect or y, th en t h e en t ir e sch em a is st or ed in a sin gle file with t h at
n am e. Th is file m ay t h en be in vok ed to r estor e t h e sch em a as a wh ole
(or to r epr odu ce it in an ot h er sch em a elsewh er e) by execu t in g it as an
O2 com m an d file:
#"directory_path_or_file_name"
110
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
Sources
• Setting a schema
To set t h e sch em a schema_name t o t h e cu r r en t sch em a, u se t h e
com m an d:
set schema schema_name
Th e ph ysical volu m e t h at con t ain s t h e sch em a is set as th e cu r r en t
volu m e.
4.8 Sources
• Creating sources
If you h ave cr eated you r sch em a in O 2 En gin e API an d you wan t t o
visu alize it in O 2 Tools you can u se t h is com m an d t o cr eat e t h e sou r ces:
create sources
You also u se t h is com m an d if you wan t t o r eest ablish you r sou r ces after
h avin g dest r oyed t h em u sin g t h e delete sources com m an d.
Important
Th is com m an d on ly r e-establish es t h e sou r ce of t h e classes n ot t h e
bodies of m et h ods, pr ogr am s, fu n ct ion s, docu m en t at ion or cr oss
r efer en ces.
• Deleting sources (development option)
You u se t h is com m an d t o dest r oy all t h e sou r ces of th e cu r r en t sch em a.
delete sources
O2 Syst em Adm in ist r ation Refer en ce Man u al
111
4
O2 DSA Commands
4.9 Inheritance
• Creating inheritance
You can set u p in h er it an ce lin k s bet ween t wo classes t h at alr eady exist
u sin g t h e com m an d :
inherit subclass_name superclass_name
• Deleting inheritance
You can also dest r oy in h er itan ce lin k s u sin g :
delete inherit subclass_name superclass_name
Th e su bclass st ops in h er itin g t h e pr oper t ies of t h e su per class.
112
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
List
4.10 List
• confirm class [class_name]
• confirm classes
• [create] inherit [Class_name] Superclass_name
• create library [schema_name] [path_name]
• [create] [constant] name obj_or_value_name: type_spec
• [create] schema schema_name [volume volume_name]
• create shared library [schema_name] [path_name]
• create sources
• delete class [class_name]
• delete classes from class_name
• delete export [class class_name [, class_name]...] [name
obj_or_value_name [, obj_or_value_name]...]
• delete inherit [Class_name] Superclass_name
• delete name obj_or_value_name
• delete schema [schema_name]
• delete sources
• delete inherit subclass_name superclass_name
• display class [class_name]
• display classes
• display doc in class [class_name]
• display import base_name
• display import schema_name
• display method method_name [in class class_name]
• display method doc [method_name] [in class class_name]
O2 Syst em Adm in ist r ation Refer en ce Man u al
113
4
O2 DSA Commands
• display methods [in class class_name] [from
superclass_name]
• display schema [schema_name] [stat]
• display schemas [stat]
• doc in class [class_name] [documentation]
• doc in name [obj_or_value_name] [documentation]
• export schema [class class_name [, class_name]...] [name
obj_or_value_name [, obj_or_value_name]...]
• import base base_name
• import schema schema_name
[class class_name [,
class_name]...] [name obj_or_value_name [,
obj_or_value_name]...]
• inherit subclass_name superclass_name
• method doc [method_name] [in class class_name] [documentation]
• modify [constant] name obj_or_value_name: type_spec
• [modify] status TEST [in base base_name]
• print class [class_name] path_name
• print classes path_name
• print doc in class [class_name] path_name
• print method method_name [in class class_name]
• print method doc [method_name] [in class class_name]
path_name
• print methods [in class class_name] [from superclass_name]
path_name
• reimport class class_name
• rename attribute attribute_name
• rename class [class_name as] new_class_name
• rename name obj_or_value_name as obj_or_value_name
114
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
List
• rename schema schema_name as new_schema_name
• save class [class_name] path_name
• save name obj_or_value_name path_name
• save schema [schema_name] path_or_file_name
• set schema schema_name
O2 Syst em Adm in ist r ation Refer en ce Man u al
115
4
116
O2 DSA Commands
O 2 Syst em Adm in ist r at ion Refer en ce M an u al
I NDEX
O2 System Administration Reference Manual
117
INDEX
Sym bol s
C
.o2r c Con figu r at ion File 18
.o2ser ver r c Con figu r at ion File 16
catalog transaction 91
Class
Com m an ds 99
Con fir m at ion 99
Delet ion 99
Display 100, 101
Docu m en t at ion 100, 100
In h er itan ce 100
Pr in t 100, 101
Reim por t 101
Ren am in g 102
Save 102
A
abort 91
Applicat ion
Com m an ds 80
Display 80
Docu m en t at ion 80
Pr in t 80
Ru n 80
Att r ibu t e
Ren am in g 98
B
Base
Com m an ds 81
Cr eat ion 81
Delet ion 82
Displayin g 82
Ext en din g 82
Gar bage 83
Im por t 98
Ren am in g 83
Reset t in g In dex Clu ster 83
Set t in g 83
118
Clu st er
Com m an ds 84
Cr eat ion 84
Delet ion 85
Display 85
Pr om ot e 86
cluster 84
Com m an d
Tu ple att r ibu t es 98
Com m en t s 11
commit 91
Con figu r at ion File
.o2r c 18
.o2ser ver r c 16
confirm class 99
confirm classes 99
create base 81
create index 87
create inherit 100
create inheritance 112
create library 102
create name 105
create schema 106
create shared library 103
create sources 111
create volume 93
Cr eat ion
In h er itan ce 100
O2 System Administration Reference Manual
INDEX
D
E
delete base 82
delete class 99
delete classes from 100
delete cluster 85
delete export 108
delete index 87
delete inherit 101
delete name 105
delete schema 107
delete sources 111, 112
delete volume 93
D elet ion
In h er it 101
display 86
display application 80
display base 82
display bases 82
display class 100
display classes 100
display clusters 85
display doc 80, 100
display doc in class 100
display doc in name 88
display import 108
display index 87
display method 103
display method doc 104
display methods 103
display name 88
display names 88
display program 89
display program doc 89
display programs 89
display schema 107
display schemas 108
display stat 86
display volume 93
display volumes 94
doc in class 100, 100
doc in name 105
end transaction 91
En vir on m en t 13
Expor t Com m an d
Delet ion 108
export schema 108
extend base 82
extend volume 94
G
garbage base 83
Gar bage collect ion 83
H
Help
On -lin e 11, 86
help 11, 86
I
import base 98
import schema 109
In dex
Cr eat ion 87
Delet ion 87
Display 87
Main t en an ce 87
inherit 100
O2 System Administration Reference Manual
119
INDEX
In h er it an ce
Cr eat ion 112
Delet ion 112
O
L
Libr ar y
Com m an ds 102
Cr eat ion 102
M
M et h od
Display 103
Docu m en t at ion 104
Pr in t in g 103, 104
method doc 104
modify name 105
N
name 98, 105
Nam es
Modify 105
Object cr eat ion 105
Object delet ion 105
Object display 88
Object docu m en tation 88, 88, 105
Object m odification 105
Object r en am in g 106
Pr in t in g 88
Savin g 106
Valu e cr eat ion 105
Valu e delet ion 105
Valu e display 88, 88
Valu e docu m en tation 88, 88, 105
Valu e m odification 105
Valu e r en am in g 106
120
o2api_shell 21
o2dba_backup 22
o2dba_backup_display 27
o2dba_backup_label 30
o2dba_base_dump 32
o2dba_base_load 35
o2dba_check 38
o2dba_copy 41
o2dba_env 43
o2dba_init 45
o2dba_monitor 47, 72
o2dba_move_volume 50
o2dba_restore 52
o2dba_rm 57
o2dba_schema_dump 59
o2dba_schema_load 62
o2dba_shell 65
o2dba_shutdown 67
o2dsa_shell 69
o2patch 71
o2server 72
o2shell 74
o2tools 76
On -lin e Help 11, 86
Opt ion s
o2 17
o2ser ver 16
OQL 90
P
print
print
print
print
print
application 80
class 101, 101
classes 101
doc 80
doc in name 88
O2 System Administration Reference Manual
INDEX
print method 104
print method doc 104
print methods 104
print name 88
print names 88
print program 89
print program doc 89
print programs 89
Pr ogr am
Com m an ds 89
Display 89
Docu m en t at ion 89
Pr in t 89
Ru n 90
promote 86
Q
S
save class 102
save name 106
save schema 110
Sch em a
Cr eat ion 106
Delet ion 107
Display 107
Display im por t 108
Expor t 108
Im por t 109
Ren am in g 109
Savin g 110
Set wor k in g sch em a 111
set base 83
set schema 111
Sh ar ed Libr ar y
Cr eat ion 103
Qu er y
Com m an ds 90
Qu it 90
Sou r ces
Cr eat ion 111
Delet ion 111
stat option 82, 86
Statistics
Nam ed syst em 86
query 90
quit 90, 92
Syst em Com m an ds
Opt ion s 16
R
T
reimport class 101
rename attribute 98
rename base 83
rename class 102
rename name 106
rename schema 109
rename volume 94
reset index cluster in base 83
run application 80
run program 90
Tr an sact ion 91
Abor t 91
Com m an ds 91
Com m it 91, 91
En d 91
Qu it 92
Validat e 92
transaction 92
Tu ple At t r ibu te
Com m an ds 98
O2 System Administration Reference Manual
121
INDEX
V
validate 92
Volu m e
Com m an ds 93
Cr eat e 93
Delet e 93
Display 93
Ext en d 94
Ren am in g 94
122
O2 System Administration Reference Manual