Database Setup
This section describes how to setup a database for an emarket installation.
PostgreSQL database setup
eMarket uses postgreSQL as the database. sections below describe how to install postgreSQL in Linux/UNIX and Windows operating systems.
PostgreSQL Installation in Linux, UNIX, Mac OS X
- Download "postgresql-x.x.x.tar.bz2" source tar ball from http://www.postgresql.org/ftp/source/
- Untar this file in the location of your choice.
- Follow the instructions below to compile and install the database.
(Refer to INSTALL file for detailed instructions.)./configure
gmake
su
gmake install
adduser postgres
mkdir /emarket/data/pgsql/
chown postgres /emarket/data/pgsql/
su - postgres
/usr/local/pgsql/bin/initdb -D /emarket/data/pgsql/emarketdb
export PGDATA=/emarket/data/pgsql/emarketdb
export PGPORT=5432
export PGOPTS="-i"
/usr/local/pgsql/bin/pg_ctl -l logs/logfile start -o "-h localhost -S -d 5"
/usr/local/pgsql/bin/createdb emarketdb
/usr/local/pgsql/bin/createuser -s emarket
/usr/local/pgsql/bin/psql emarketdb
PostgreSQL Installation in Windows
- download "postgresql-x.x.x.zip" from http://www.postgresql.org/ftp/binary/
- unzip and install postgresql server.
- start server. click start - programs - postgresql - start service.
- start pgadmin. click start - programs - postgres - pgadmin.
( standard admin password is "potsgres" ) - right click on "login roles" and select "new login role".
create login "emarket", select "super user", "can create database users", "can create roles". - right click on databases and selct 'new database'.
create database "emarketdb" and keep "emarket" as the owner of the database.
Create tables
cd emarket/platform-ng/src/main/resources
psql -d emarketdb -U emarket -f create_tables_pgsql.sql
Start database
- check database is up and running.
Linux, UNIX, Mac OS X : psql -d emarketdb -U emarket
Windows : pgadmin - start the database if not running.
Windows :
start server. click start - programs - postgresql - start service.
Linux, UNIX, Mac OS X :
cd /emarket/data/pgsql
export PGDATA=/emarket/data/pgsql/emarketdb
export PGPORT=5432
export PGOPTS="-i"
pg_ctl -l logs/logfile start -o "-h localhost -S -d 5"