What?
=====
This directory contains SQL scripts to create the initial NAV databases.


Files
=====
manage.sql       - Creates the manage database
types.sql        - Initializes the equipment vendor and type tables of the
                   manage database
snmpoid.sql      - Initializes the SNMP OID registry of the manage database
logger.sql       - Creates the navlog database
navprofiles.sql  - Creates the navprofiles database
arnold.sql       - Creates the arnold database


How to create the databases from scratch
========================================
This section assumes your PostgreSQL server is configured to directly
identify the local unix account postgres as the postgres database user
(with the "ident sameuser" directive in pg_hba.conf).  su from root to
the postgres account before performing these commands.

First, create a database user for NAV, and choose a password for it:

  createuser --no-createdb --no-adduser --pwprompt nav

Now, create the databases:

  createdb --owner nav --encoding UTF-8 manage
  createdb --owner nav --encoding UTF-8 navprofiles
  createdb --owner nav --encoding UTF-8 logger
  createdb --owner nav --encoding UTF-8 arnold
  createlang plpgsql manage
  createlang plpgsql navprofiles

Then, finally, initialize the databases.  These scripts are run as the
nav user you created above, so you will be prompted for the password
you chose.

  psql -f manage.sql manage nav
  psql -f types.sql manage nav
  psql -f snmpoid.sql manage nav
  psql -f navprofiles.sql navprofiles nav
  psql -f logger.sql logger nav
  psql -f arnold.sql arnold nav

Please be aware that on some installations, the PostgreSQL superuser
might not be named postgres.
