Skip to content

Set up the Geoportal Database

zguo edited this page Sep 30, 2013 · 20 revisions

Note: Page in progress!

Set Up Geoportal Database in Oracle

In this section you will set up the tablespace and schema that will be used for the geoportal. The geoportal should run in its own tablespace and schema. Creating the geoportal database schema involves running two scripts:

  • A “grants” script that sets the user permissions for creating the geoportal schema.
  • A “create schema” script that creates the table structure, procedures and triggers and populates tables in the geoportal schema.
1. Setup the Geoportal tablespace
Open the command console (Start>Run>cmd) and run the following commands:
 CMD> sqlplus /nolog
 SQL> connect sys/sys as sysdba; 
 SQL> create tablespace geoportal datafile 'C:\oracle\oradata\geoportal.dbf' size 500M AUTOEXTEND ON;
 SQL> create user geoportal identified by geoportalpwd default tablespace geoportal temporary tablespace temp;
 SQL> commit;
 SQL> quit
2. Set up privileges for geoportal user
1. Open a command prompt window. Start>Run>cmd
2. Change directories to point to \Database Scripts\Oracle.
3. Run the grants_oracle.cmd file from the command prompt window as described below:
Usage: grants_oracle [sys username] [sys password] [geoportal username]
Where
[sys] is the username of the sys user in Oracle
[sys] is the password of the sys user in Oracle
[geoportal] is the geoportal user you are creating
Sample Input: grants_oracle sys sys geoportal
When the script finishes executing you will be returned back to the command prompt and a text file (grants.txt) will open. Check the grants.txt file for error messages.
Important: You must fix errors appearing in the grants.txt file; do not continue until the script runs without errors.

3. Create geoportal schema

1. Open a command window. Start>Run>cmd
2. Change the directory to the \Database Scripts\Oracle folder
3. Run the create_schema_oracle.cmd file from the command prompt window as described below:
Usage: create_schema_oracle [geoportal] [geoportal]
Where:
[geoportal] is the geoportal user you created earlier.
[geoportal] is the password of the geoportal user.
Sample Input: create_schema_oracle geoportal geoportalpwd
When the script finishes executing you will be returned back to the command prompt and a text file (GPT_Schema.txt) will open. Check the GPT_Schema.txt file for error messages. Error messages and warnings that state a table or view does not exist can be ignored. It simply means that the script was trying to delete a nonexistent table. Verify the following tables are corrected:
  • gpt_collection
  • gpt_collection_member
  • gpt_harvesting_history
  • gpt_harvesting_jobs_completed
  • gpt_harvesting_jobs_pending
  • gpt_resource
  • gpt_resource_data
  • gpt_search
  • gpt_user
Clone this wiki locally