#
Wiping out and re-creating an Earthworm DB

(last revised August 7, 2001)

The following procedure will remove all data from an existing DBMS, and re-load a clean set of tables and network names.

This procedure presumes an Windows2000-based Oracle8 server.

This procedure is to be executed from the keyboard of the server machine.

1. In a command window:

cd \orant\bin

2. Invoke the utility:

>svrmgr30

3. Execute the command

SVRMGR>connect internal/earthworm@service.usgs

where

"internal" is a reserved account, the equivalent of "superuser" in Unix.

"earthworm" is the internal password which was assigned during initial Oracle installation.

"service.usgs" is the service name assigned during initial Oracle installation.

4. Execute the commands

SVRMGR>shutdown immediate

SVRMGR>startup

SVRMGR>quit

This drops any connections to the server.

5. Open a second command window, and run the supplied script which will drop (delete) all tables and users:

cd earthworm\<version>\src\oracle\schema\sql_scripts

Invoke sqlplus and log is as sys, with the password and service name as above:

sqlplus sys/earthworm@service.usgs

Execute the removal script:

SQL>@ewdb_destroy_database.sql

SQL >quit

6. Shut down the server. In the first command window, execute:

>svrmgr30

SVRMGR>connect internal/earthworm@service.usgs

SVRMGR>shutdown immediate

7. From the second window, delete the operating system files containing the table space:

change to the drive and directory containing the files. These were specified in the initialization script. e.g.:

>del D:\orant\database\ew5\*.*

8. In the first window, create a default database:

SVRMGR>startup

9. In the second window (the one cd'd to the earthworm sql scripts), invoke the earthworm schema creation script. Make sure that the script has been edited for your local user, service name, and table space location.

>sqlplus sys/earthworm@service.usgs

substituting the correct password and service name as above.

SQL>@ewdb_create_database

SQL>quit

10. Load the author id's:

cd to the directory containing the script:> cd earthworm\<version>\src\oracle\data

Log in as the user specified in the schema installation script. e.g.:

>sqlplus ewdb_main/main@service.usgs

Execute the insertion script:

SQL>@instid_2_networkname

SQL>quit

11. Load the station lists:

stalist_hinv2ora stafile ewdb_main main service.usgs

where

stafile is a station list in hypoinverse format,

ewdb_main is the user,

main is the password, and

service.usgs is the service name

12. Load the response information. The following example assumes that the Poles-And-Zeros files are in SAC format:

sac_pz2ora pzfile ewdb_main main service.usgs

where

pzfile is the file containing the channel response in SAC format,

ewdb_main is the user,

main is the password, and

service.usgs is the service name