.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "oar-database 1" .TH oar-database 1 "2016-04-07" "oar-database" "OAR commands" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" oar\-database \- manage OAR database. .SH "SYNOPSIS" .IX Header "SYNOPSIS" \&\fBoar-database\fR \fI\-\-create\fR [\fI\s-1OPTIONS\s0\fR] .PP \&\fBoar-database\fR \fI\-\-drop\fR [\fI\s-1OPTIONS\s0\fR] .PP \&\fBoar-database\fR \fI\-\-upgrade\fR [\fI\s-1OPTIONS\s0\fR] .PP \&\fBoar-database\fR \fI\-\-reset\fR [\fI\s-1OPTIONS\s0\fR] .PP \&\fBoar-database\fR \fI\-\-check\fR [\fI\s-1OPTIONS\s0\fR] .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\s-1OAR\s0 uses a database for it's persitent data either using the MySQL or PostgreSQL backend (see oar.conf). oar-database is provided to manage that database. .SH "ACTIONS" .IX Header "ACTIONS" .IP "\fB\-\-create\fR" 4 .IX Item "--create" Create an \s-1OAR\s0 database: inject schema and default data and create users/roles. .IP "\fB\-\-drop\fR" 4 .IX Item "--drop" Drop an existing \s-1OAR\s0 database and associated users/roles. .IP "\fB\-\-upgrade\fR" 4 .IX Item "--upgrade" Upgrade an existing \s-1OAR\s0 database. .IP "\fB\-\-reset\fR" 4 .IX Item "--reset" Reset an existing \s-1OAR\s0 database to the state of the fresh new one. .IP "\fB\-\-check\fR" 4 .IX Item "--check" Check that \s-1OAR\s0 database is accessible and up to date (schema version). .SH "OPTIONS" .IX Header "OPTIONS" .SS "General parameters" .IX Subsection "General parameters" .IP "\fB\-\-conf\fR=\fI\s-1OAR_CONF_FILE\s0\fR" 4 .IX Item "--conf=OAR_CONF_FILE" Define the \s-1OAR\s0 configuration file to use. By default \fI/etc/oar/oar.conf\fR is used. If this file doesn't exist, the default parameters for each value are used. .IP "\fB\-\-update\-conf\fR" 4 .IX Item "--update-conf" The database parameters given in the command line are written to the \s-1OAR_CONF_FILE\s0 .IP "\fB\-f,\-\-force\-sql\fR" 4 .IX Item "-f,--force-sql" Force to continue the execution even if a \s-1SQL\s0 command fails .IP "\fB\-y,\-\-force\-yes\fR" 4 .IX Item "-y,--force-yes" Force oar-database to continue without prompt even if it could be harmful. .SS "Database backend parameters" .IX Subsection "Database backend parameters" These parameters are only required by the \fI\-\-create\fR and \fI\-\-drop\fR actions. .IP "\fB\-\-db\-is\-local\fR" 4 .IX Item "--db-is-local" Use local admin account to execute command (PostgreSQL). .IP "\fB\-\-db\-admin\-user\fR=\fI\s-1DB_ADMIN_USER\s0\fR" 4 .IX Item "--db-admin-user=DB_ADMIN_USER" Set database backend admin username. .IP "\fB\-\-db\-admin\-pass\fR=\fI\s-1DB_ADMIN_PASS\s0\fR" 4 .IX Item "--db-admin-pass=DB_ADMIN_PASS" Set database backend admin password. .SS "\s-1OAR\s0 database parameters" .IX Subsection "OAR database parameters" If not specified, \s-1OAR\s0 database parameters are taken from \fI\s-1OAR_CONF_FILE\s0\fR. Please prefer setting the configurations in that file instead of using these options. .IP "\fB\-\-db\-type\fR=\fI\s-1DB_TYPE\s0\fR" 4 .IX Item "--db-type=DB_TYPE" Database backend to use, \fImysql\fR or \fIPg\fR (for PostgreSQL). .IP "\fB\-\-db\-user\fR=\fI\s-1DB_USER\s0\fR" 4 .IX Item "--db-user=DB_USER" Set \s-1OAR\s0 username to access the database. Override the one set in \s-1OAR_CONF_FILE.\s0 .IP "\fB\-\-db\-pass\fR=\fI\s-1DB_PASS\s0\fR" 4 .IX Item "--db-pass=DB_PASS" Set \s-1OAR\s0 user password to access the database. Override the one set in \s-1OAR_CONF_FILE.\s0 .IP "\fB\-\-db\-host\fR=\fI\s-1DB_HOST\s0\fR" 4 .IX Item "--db-host=DB_HOST" Set the database backend hostname. Override the one set in \s-1OAR_CONF_FILE.\s0 .IP "\fB\-\-db\-port\fR=\fI\s-1DB_PORT\s0\fR" 4 .IX Item "--db-port=DB_PORT" Set the database backend \s-1TCP\s0 port. Override the one set in \s-1OAR_CONF_FILE.\s0 .IP "\fB\-\-db\-name\fR=\fI\s-1DB_NAME\s0\fR" 4 .IX Item "--db-name=DB_NAME" Set \s-1OAR\s0 database name. Override the one set in \s-1OAR_CONF_FILE.\s0 .IP "\fB\-\-db\-ro\-user\fR=\fI\s-1DB_RO_USER\s0\fR" 4 .IX Item "--db-ro-user=DB_RO_USER" Set \s-1OAR\s0 username for read-only access the database. Override the one set in \s-1OAR_CONF_FILE.\s0 .IP "\fB\-\-db\-ro\-pass\fR=\fI\s-1DB_RO_PASS\s0\fR" 4 .IX Item "--db-ro-pass=DB_RO_PASS" Set \s-1OAR\s0 user password for read-only access the database. Override the one set in \s-1OAR_CONF_FILE.\s0 .IP "\fB\-d,\-\-debug\fR" 4 .IX Item "-d,--debug" Activate the display of debugging information. .IP "\fB\-h,\-\-help\fR" 4 .IX Item "-h,--help" Display this help. .SH "EXAMPLES" .IX Header "EXAMPLES" .SS "MySQL" .IX Subsection "MySQL" First you need to specify the database parameters in /etc/oar/oar.conf. These parameters will be used by \fBoar-database\fR. .PP To create a new database (assuming that the MySQL root password is \fB\s-1PASS\s0\fR): .PP \&\fBoar-database \-\-create \-\-db\-admin\-user root \-\-db\-admin\-pass \s-1PASS\s0\fR .PP To upgrade an existing database: .PP \&\fBoar-database \-\-upgrade\fR .SS "PostgreSQL" .IX Subsection "PostgreSQL" First you need to specify the database parameters in /etc/oar/oar.conf. These parameters will be used by \fBoar-database\fR. If your PostgreSQL database is on the local system, you can use the \fB\-\-db\-is\-local\fR option which will use PostgreSQL unix account (needs root privileges). .PP To create a new database: .PP \&\fBoar-database \-\-create \-\-db\-is\-local\fR .PP To upgrade an existing database: .PP \&\fBoar-database \-\-upgrade\fR .SS "Advanced usages" .IX Subsection "Advanced usages" To make some tests or to administrate several databases, you can also specify the sql parameters on the command line. For example: .PP \&\fBoar-database \-\-create \-\-db\-type=Pg \-\-db\-host=HOST \e \-\-db\-user=oar \-\-db\-pass=PASS \e \-\-db\-admin\-user=ADMIN_USER \-\-db\-admin\-pass=ADMIN_PASS\fR .PP will create the oar database and the oar user on the postgresql system hosted by \fB\s-1HOST\s0\fR. The user \fB\s-1ADMIN_USER\s0\fR must have the right to create new databases and new roles on this system. .SH "FILES" .IX Header "FILES" .IP "/usr/lib/oar/database/mysql_structure.sql, /usr/lib/oar/database/pg_structure.sql" 4 .IX Item "/usr/lib/oar/database/mysql_structure.sql, /usr/lib/oar/database/pg_structure.sql" \&\s-1SQL\s0 instructions for creating the structure of the oar database. .IP "/usr/lib/oar/database/mysql_default_admission_rules.sql, /usr/lib/oar/database/pg_default_admission_rules.sql" 4 .IX Item "/usr/lib/oar/database/mysql_default_admission_rules.sql, /usr/lib/oar/database/pg_default_admission_rules.sql" \&\s-1SQL\s0 instructions for inserting the default admission rules in the oar database. .IP "/usr/lib/oar/database/default_data.sql" 4 .IX Item "/usr/lib/oar/database/default_data.sql" \&\s-1SQL\s0 instructions for inserting the default data in the oar database. .IP "/usr/lib/oar/database/mysql_reset_structure.sql, /usr/lib/oar/database/pg_reset_structure.sql" 4 .IX Item "/usr/lib/oar/database/mysql_reset_structure.sql, /usr/lib/oar/database/pg_reset_structure.sql" \&\s-1SQL\s0 instruction for emptying an existing oar database. .IP "/usr/lib/oar/database/mysql_structure_upgrade_*.sql, /usr/lib/oar/database/pg_structure_upgrade_*.sql" 4 .IX Item "/usr/lib/oar/database/mysql_structure_upgrade_*.sql, /usr/lib/oar/database/pg_structure_upgrade_*.sql" \&\s-1SQL\s0 instructions for upgrading an existing database. .SH "COPYRIGHTS" .IX Header "COPYRIGHTS" .Vb 1 \& Copyright 2003\-2016 Laboratoire d\*(AqInformatique de Grenoble (http://www.liglab.fr). This software is licensed under the GNU General Public License Version 2 or above. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .Ve