Installing the Hockey Sample Schema and Loading Sample Data

After creating a database and confirming that it is up and running, you may install the sample Hockey schema (packaged with NuoDB) and load sample data.

To create a schema and load it with sample data, run script such as the following:

/opt/nuodb/samples/nuoadmin-quickstart --db-name <database name> --archive-path </full-path/to/archive>
[--server-id <server ID>] [--rest-address <host[:port]>]
[--dba-user <dba user>] [--dba-password <dba password>]

For example, to create the Hockey schema in the test database, run the following script:

/opt/nuodb/samples/nuoadmin-quickstart --db-name test --archive-path /var/opt/nuodb/production-archives/test

Before the Hockey schema quick start installation runs, the following message displays the options that will be used:

Found NUODB_HOME=/opt/nuodb
Creating quickstart database with the following arguments:
[db-name=test, archive-path=/var/opt/nuodb/production-archives/test, server-id=nuoadmin-1,
dba-user=dba, dba-password=goalie, rest-address=localhost:8888]
Press enter to continue

Press the Enter key to accept the defaults and the installation continues.

When the installation finishes, follow the instructions displayed to try sample SQL (NuoDB SQLNuoDB SQL (nuosql) is a command line tool for exploring NuoDB databases. It enables you to execute SQL statements interactively, run batch scripts, access database metadata information, and perform DBA functions.) commands.

Creating Sample Quickstart Schema
Importing Sample Quickstart Data
Importing Players table
Importing Scoring table
Importing Teams table
Starting an interactive SQL session with nuosql
Database name: test
DBA Username: dba
DBA Password: goalie
Start executing SQL commands at the SQL prompt, such as:
SQL> show Teams;
SQL> select * from TEAMS where TEAMS.YEAR = 2011;
or a more advanced query:
SQL> select p.lastName, p.firstName, s.year, s.teamID, s.gamesPlayed
from players p, scoring s
where p.birthCountry = 'Slovakia' and s.playerID = p.playerID
order by p.lastName;
Use 'quit' to end the SQL session:
SQL> quit