Importing osvdb into postgresql

sql# create database osvdb;

sql# create user osvdb password 'yourpasswordhere';

unix# wget http://www.osvdb.org/OSVDB-tables.sql

unix# psql osvdb osvdb < OSVDB-tables.sql
Password:


unix# wget http://www.osvdb.org/OSVDB-views.sql

unix# psql osvdb osvdb < OSVDB-views.sql
Password:

unix# wget http://www.osvdb.org/OSVDB-procedures.sql


unix# find /usr/local/pgsql/ | grep plpgsql.so
/usr/local/pgsql/lib/plpgsql.so

edit OSVDB-procedures.sql

change:

     10 CREATE FUNCTION plpgsql_call_handler () RETURNS language_handler
     11     AS '/usr/lib/postgresql/plpgsql.so', 'plpgsql_call_handler'
     12     LANGUAGE c;
     13 CREATE PROCEDURAL LANGUAGE plpgsql HANDLER plpgsql_call_handler;
     

to :

     10 CREATE FUNCTION plpgsql_call_handler () RETURNS language_handler
     11     AS '/usr/local/pgsql/lib/plpgsql.so', 'plpgsql_call_handler'
     12     LANGUAGE c;
     13 CREATE PROCEDURAL LANGUAGE plpgsql HANDLER plpgsql_call_handler;
     

OBS: Using the postgres user for root access here!

unix# psql osvdb postgres < OSVDB-procedures.sql

Now the schemas should be created, time for importing some data: (for external viewers, remember to agree to the license)

unix# wget http://www.opensecurityfoundation.org/exports/OSVDB.pgdump-Current.tgz

unix# psql osvdb osvdb < osvdb_stable.pgsql
Password:

Now the database should be imported, have fun!
Dette indlæg blev udgivet i Knowledge Base, Linux, Old Base. Bogmærk permalinket.

Skriv et svar