oar-database(8)
β¨ oar-database(8) β the OAR commands glow-up β¨
okay bestie, gather round, because this is the manual page for oar-database, part of the OAR commands family, and it's lowkey the most important little tool in your whole OAR setup. it manages the OAR database. that's it, that's the vibe. π
πΈ NAME πΈ
oar-database β manage OAR database.
like. literally what it says. it's the database babysitter. π
π SYNOPSIS π
oar-database --create [OPTIONS]
oar-database --drop [OPTIONS]
oar-database --upgrade [OPTIONS]
oar-database --reset [OPTIONS]
oar-database --check [OPTIONS]
five actions, five moods, pick your fighter. π¦
π DESCRIPTION π
OAR keeps its persistent data in a database, and that database is either the MySQL backend or the PostgreSQL backend (peep oar.conf to see which one you're rocking). oar-database is the whole reason you exist here β it's the tool that manages that database for you. no cap.
π₯ ACTIONS π₯
--createβ create an OAR database: inject the schema and the default data, and create the users/roles. baby's first database. πΌ--dropβ drop an existing OAR database and its associated users/roles. it's giving destructive. say goodbye fr fr. π--upgradeβ upgrade an existing OAR database. glow-up, but for schemas. β¨--resetβ reset an existing OAR database back to the state of a fresh new one. factory reset, but make it OAR. π§--checkβ check that the OAR database is accessible and up to date (schema version). the vibe check. π«Ά
β¨ OPTIONS β¨
π General parameters
--conf=OAR_CONF_FILEβ define the OAR configuration file to use. by default/etc/oar/oar.confis the one. and if that file doesn't even exist? no stress, the default parameters for each value get used instead. iconic behavior honestly.--update-confβ the database parameters you gave on the command line get written to theOAR_CONF_FILE. so it remembers. main character energy. π-f,--force-sqlβ force it to keep going even if a SQL command fails. bold. reckless. respect. π-y,--force-yesβ forceoar-databaseto continue without prompting you, even if it could be harmful. π¨
β οΈ bestie, that one literally says "even if it could be harmful". it will NOT ask. it will NOT hesitate. know what you're doing before you type it.
π Database backend parameters
these are only required by the --create and --drop actions. iykyk.
--db-is-localβ for PostgreSQL: use the local admin account to execute admin commands. for MySQL: use the unix socket connection to execute admin commands. local queen. π--db-admin-user=DB_ADMIN_USERβ set the database backend admin username.--db-admin-pass=DB_ADMIN_PASSβ set the database backend admin password.
π OAR database parameters
if you don't specify these, the OAR database parameters get taken from OAR_CONF_FILE. and honestly? please prefer setting your config in that file instead of using these options. do it for me. π₯Ί
--db-type=DB_TYPEβ the database backend to use:mysql, orPg(which is for PostgreSQL).--db-user=DB_USERβ set the OAR username used to access the database. overrides the one set inOAR_CONF_FILE.--db-pass=DB_PASSβ set the OAR user password used to access the database. overrides the one set inOAR_CONF_FILE.--db-host=DB_HOSTβ set the database backend hostname. overrides the one set inOAR_CONF_FILE.--db-port=DB_PORTβ set the database backend TCP port. overrides the one set inOAR_CONF_FILE.--db-name=DB_NAMEβ set the OAR database name. overrides the one set inOAR_CONF_FILE.--db-ro-user=DB_RO_USERβ set the OAR username for read-only access to the database. overrides the one set inOAR_CONF_FILE.--db-ro-pass=DB_RO_PASSβ set the OAR user password for read-only access to the database. overrides the one set inOAR_CONF_FILE.-d,--debugβ activate the display of debugging information. we love receipts. π-h,--helpβ display this help.
π EXAMPLES π
π¬ MySQL
first, you need to specify the database parameters in /etc/oar/oar.conf. these parameters will be used by oar-database.
to create a new database (assuming the MySQL root password is PASS):
oar-database --create --db-admin-user root --db-admin-pass PASS
or, if the MySQL server is local and accessible using the unix socket:
oar-database --create --db-is-local
to upgrade an existing database:
oar-database --upgrade
π PostgreSQL
first, you need to specify the database parameters in /etc/oar/oar.conf. these parameters will be used by oar-database. if your PostgreSQL database is on the local system, you can use the --db-is-local option, which will use the PostgreSQL unix account (needs root privileges, so bring your sudo energy π).
to create a new database:
oar-database --create --db-is-local
to upgrade an existing database:
oar-database --upgrade
π Advanced usages
to make some tests, or to administrate several databases, you can also specify the sql parameters on the command line. for example:
oar-database --create --db-type=Pg --db-host=HOST \
--db-user=oar --db-pass=PASS \
--db-admin-user=ADMIN_USER --db-admin-pass=ADMIN_PASS
this will create the oar database and the oar user on the postgresql system hosted by HOST. the user ADMIN_USER must have the right to create new databases and new roles on this system. no shortcuts, no exceptions. β
π FILES π
/usr/lib/oar/database/mysql_structure.sql,/usr/lib/oar/database/pg_structure.sqlβ SQL instructions for creating the structure of the oar database./usr/lib/oar/database/mysql_default_admission_rules.sql,/usr/lib/oar/database/pg_default_admission_rules.sqlβ SQL instructions for inserting the default admission rules in the oar database./usr/lib/oar/database/default_data.sqlβ SQL instructions for inserting the default data in the oar database./usr/lib/oar/database/mysql_reset_structure.sql,/usr/lib/oar/database/pg_reset_structure.sqlβ SQL instruction for emptying an existing oar database./usr/lib/oar/database/mysql_structure_upgrade_*.sql,/usr/lib/oar/database/pg_structure_upgrade_*.sqlβ SQL instructions for upgrading an existing database.
π COPYRIGHTS π
Copyright 2003-2018 Laboratoire d'Informatique 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.
and that's the whole page, bestie!! π«Ά this was oar-database from the OAR commands set, dated 2025-03-24, and you can find it again under oar-database(8) whenever you need it. go manage that database, you absolute legend. mwah. πβ¨
π¦ where this page comes from
- debian trixie: oar-server 2.6.1-1 Β· GPL-2.0-or-later
- ubuntu questing: oar-server 2.6.1-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms