Here is how to use what you have:

As database superuser (often postgres, but check for your system), do the following:

INSTALLATION

1.  Load PL/Perlu into your database.  See the createlang documents
for details on how to do this;

2.  Make shure that DBI is installed on your Perl system and that the DBD of
the database you choose is also installed;

3. Load the database driver:
        - On PostgreSQL:
                # psql -d <database> -h <host> -U <user> -f ./drivers/pg/snapshot.sql
        - On Oracle, inside SQL+:
                SQL> @./drivers/oracle/snapshot.sql

4.  On the PostgreSQL::Snapshots root, execute:
        # ./Makefile.sh

5.  Loas the pgsnapshots.sql file:
        # psql -d <database> -h <host> -U <user> -f pgsnapshots.sql

6.  Use the underlying methods aka functions as needed.

AVAILABLE FUNCTIONS

1. create_dblink (implementation of "CREATE DBLINK")
	This function creates a link between databases. It takes the name of the DBLINK to be created and the necessary parameters do establish the remote connection.
	
	Syntax:
	create_dblink(dblinkname text, username text, password text, datasource text, attributes text)
	dblinkname = name of the DBLINK to be created
	username = NAME of the remote database user
	password = PASSWORD of the remote database user
	datasource = Perl:DBI CONNECTION string to the remote database
	attributes = connection ATTRIBUTES, like AutoCommit, RaiseErrors, etc.

2. drop_dblink (implementation of "DROP DBLINK")
	This function removes a link between databases taking only the DBLink name as a parameter.
	
	Syntax:
	drop_dblink(dblinkname text)
	dblinkname = name of the DBLINK to be removed

3. create_snapshot (implementation of "CREATE SNAPSHOT" or "CREATE
MATERIALIZED VIEW")
	This function creates a materialized view or snapshot based on a query. The query can be referencing a database link or not.
	
	Syntax:
	create_snapshot(schemaname text, snapshotname text, query text, dblink text, refresh_method text)
	schemaname: name of the schema where the snapshot will be created
	snapshotname: name of the snapshot to be created
	query: SQL query that will be executed at the remote database and
which result will fill the snapshot
	dblink: optional parameter that take the name of the DBLink to be used. If the value is NULL, the query will be executed by the local database.
	refresh_method: can be "COMPLETE", "FAST" or "FORCE".

	IMPORTANT: the table will not be filled by this function.

4. drop_snapshot (implementation of "DROP SNAPSHOT" or "DROP MATERIALIZED VIEW")
	This function removes a materialized view or snapshot taking the schema name and the snapshot name as parameters.
	
	Syntax:
	drop_snapshot (schemaname text, snapshotname text)
	schemaname: name of the schema where the snapshot resides
	snapshotname: name of the snapshot to be removed

5. create_snapshot_log (implementation of "CREATE MATERIALIZED VIEW LOG" or "CREATE SNAPSHOT LOG")
	This function creates a log table bound to a master table. This log
table allows the creation of fast refreshing snapshot(FAST REFRESH).

        Syntax:
        create_snapshot_log (schemaname text, mastername text)
        schemaname: name of the schema where the master table resides
        mastername: name of the master table

6. drop_snapshot_log (implementation of "DROP MATERIALIZED VIEW LOG" or "DROP
SNAPSHOT LOG")
        This function removes a log table previously bound to a master table.

        Syntax:
        drop_snapshot_log (schemaname text, mastername text)
        schemaname: name of the schema where the master table resides
        mastername: name of the master table

5. refresh_snapshot (implementation of "DBMS_SNAPSHOTS.REFRESH")
	This function refreshes the data on a materialized view or snapshot taking the schema and snapshot names as parameters.
	
	Syntax:
	refresh_snapshot (schemaname text, snapshotname text)
	schemaname: name of the schema where the snapshot resides
	snapshotname: name of the snapshot to be refreshed

