Creating and populating the database

The creation/population procedure depends on which DBMS product you have installed:

To avoid problems at a later stage, make sure you set your database to use a character encoding that is suitable for your language. The examples here will use utf-8. Please notice that 8-bit ASCII encoding is generally a poor choice and should be avoided.

Oracle

To create a new Database in Oracle you can use the specific tools as DBCA (Database Configuration Assistant) or manually with SQL commands as follows.

To create the database: % sqlplus
CREATE USER username IDENTIFIED BY password;
CREATE DATABASE portofinodb NATIONAL CHARACTER SET utf8;
GRANT ALL PRIVILEGES TO username;

To populate it with the empty template: sqlplus username/password @mdtemplate_oracle.sql

Microsoft SQL Server

You can use the SQL Server Enterprise Manager to create a new database and to populate it with the portofinodb or the command line istructions as follows.

To populate it with the empty template: osql.exe -U username - P password -d portofinodb -i mdtemplate_mssqlserver.sql

IBM DB2

You can use the DB2 Control Center (db2cc) to create a new database and to populate it with the portofinodb or the command line istructions as follows.

To create the database: CREATE DATABASE portofinodb USING CODESET UTF-8 TERRITORY US PAGESIZE 32 k
UPDATE DB CFG FOR portofinodb USING APP_CTL_HEAP_SIZE 4000

To populate it with the empty template: db2 -s -f mdtemplate_db2.sql

PostgreSQL

You can use the specific tool pgadmin to create a new database and to populate it with the portofinodb or the command line istructions as follows.

To create the database: % psql
CREATE USER username WITH PASSWORD 'password';
CREATE DATABASE portofinodb WITH OWNER=username ENCODING='UTF8';

To populate it with the empty template: psql -f mdtemplate_postgresql.sql portofinodb username

MySQL

You can use a graphical tool like MySQL Administrator, MySQL Query Browser or phpmyadmin to create a new database and to populate it with the mdtemplate_mysql.sql file. Alternatively follow these instructions:

To create and populate the database with the empty template:
mysql -uroot -p portofinodb < mdtemplate_mysql.sql

To create the user and grant it privileges:
mysql -u root -p
Then:
grant all on model.* to username@localhost identified by 'password';
grant all on meta.* to username@localhost;
grant all on model.* to username@'%' identified by 'password';
grant all on meta.* to username@'%';

Apache Derby

To create the database launch the ij application. And then crete it using the following commands.

connect 'jdbc:derby:/tmp/portofinodb;create=true';
run 'mdtemplate-derby.sql';
exit;

If you prefer to use a graphical front-end with Derby, we recommend SQuirreL SQL Client.


Previous: Downloading Portofino

Next: Installing the JDBC driver