Introduction

Tutorials

Reference

Installing WellSim

Managing databases

What is a database ?

In WellSim, a database is a file or a set of files where your geothermal data is stored on a computer's hard disk. The database can be on your computer, or, if you are on a network, the database can be on a server.

When you start WellSim, it asks you to select a database to use. As you work with WellSim, creating, changing and deleting geothermal data, WellSim automatically changes the data in that database accordingly. This means that you never need to tell WellSim to save data to the database, and you will not lose data if it stops unexpectedly.

You can close the current database and open another one. You only ever work with data in the one open database; you can not see data in any closed database.

WellSim comes with a database of typical geophysical data, called sample, for you to experiment with. You could, in principle, continue to use this database for ever, and store all your geothermal data in it. However, you should not do this, but instead you should create and use a separate database for each geothermal field you have. For example, if you have data from Atlantis and data from Valhalla, then create two databases, called Atlantis and Valhalla and store your data for each in each.

This section covers:

Maintaining your databases:

Creating, adding, deleting, removing databases:

You can also:

Note

If you are unsure about databases, ask your IT manager.

Access or SQL Server databases

A WellSim database can be either Microsoft Access or Microsoft SQL Server:

Access databases SQL Server databases
Easier to set up and manage More secure, better behaved and can be bigger
Grow bigger with use, needs compacting occassionally Does not need compacting
Is one file ending in .mdb Is a server and more than one file
Usually managed by a user Usually managed by an IT department
Ideal for a small user, or for quickly setting up a small, ad hoc database Ideal for a large, long-term user

Note

Opening the Database Manager window

Note:

Selecting an existing database to use

  1. Open the Database Manager window.

  2. Click the database to use, then click . Or double-click the database to use.


Maintaining your databases

This section covers:

Finding the version number of a database

  1. Open the Database Manager window.

  2. Click Version:

You see the versions down the right. For more on version numbers see here.

Finding where a database is stored on your PC

  1. Open the Database Manager window:

  2. Click the database name and then click Edit DB.

  3. Click the field Use Connection String and press Left arrow or Right arrow to scroll along the connection string until you find the path name that follows Data source=. You can select this path name and press Ctrl + C to copy it:

    • For an Access database, the path name is the database, for example Data Source=C:\Users\stan\AppData\Local\Gradient\GDMan\example\atlantis.mdb

    • For an SQL Server database, the path name is the name of the database server.

  4. Click Cancel.

Backing up a database

Access database

  1. Find where the database is on your PC see above.
  2. Use backup software or Windows Explorer to back up the database to an external disk or to the cloud.

SQL Server database

Use SQL Server Management Studio to backup.

Renaming an existing database

Renaming a database only changes WellSim's name for the database, it does not change the database file name.

  1. Open the database window and click the database to rename.

  2. Click Rename DB. Enter a new name for the database and click OK.

Compacting an Access database

An Access database will slowly grow bigger as you use it, filling up with empty gaps. Occasionally make it smaller again:

  1. Run Microsoft Access, the stand-alone database manager program. This is readily available, and you might find you have it on your PC already.

  2. Open the WellSim database in Microsoft Access.

  3. In the File tab, click Compact and repair database.

SQL server databases You don't haver to compact these.

Copying permissions from an SQL Server database to others

To apply the same permissions to more than one SQL Server database, set up the permissions on one database and use this command to copy the permissions to other SQL Server databases. Use this to:

You need to have GDM Admin or Power User permission to do this.

  1. Start GDM and select a SQL Server database with to copy the permissions from.

  2. In the Database menu, select Database permissions

  3. If required, edit existing permissions in this database or add new permissions - use New, Edit, Rename or Delete.

  4. Then, click Copy to copy these permissions to other SQL Server databases:

    Select the databases to copy these permissions to:

    • select or unselect databases by clicking the checkboxes
    • or click a database name and use Ctrl-Click or Shift-Click to select one or more databases
  5. Click OK to copy the permissions of the current database to all selected databases. WellSim notifies you when it has finished.


Creating, adding, deleting, removing databases


Overview

You can get a database by creating an empty one, or if a colleague sends you one. To use it in WellSim, you first need to add the database to WellSim.

If you don't want to use a database in WellSim any more, remove it from WellSim. Then, if you don't want it any more, delete it.

This section covers:

Creating a new Access database

This creates a new, empty Access database, then installs it in WellSim.

  1. In WellSim's home window, click File and then click Create New DB:

  2. Navigate to a folder to store the new database; enter a file name for the new database Click Save.

  3. WellSim then:

    • Creates a new WellSim Access database, containing all the appropriate tables but with no data

    • Adds the new database to the Database Manager

    • Opens the new, empty, database in WellSim.

  4. WellSim's name for the new database is the same as the database file name. To change WellSim's name see here.

Then

When you first select the new database in WellSim's Database Manager:

  1. WellSim asks for the mapping parameters for the new database's geothermal field see here

  2. If you have chosen that the database will have user permissions then set these up see here.

Creating a new SQL server database

There are two ways to create a new, empty SQL Server database and install it in WellSim:

  1. From within WellSim see here. This is usually the easiest way.

  2. Using SQL Server Management Studio see here.

A - Creating a new SQL Server database from within WellSim

Requirements: Access to the SQL Server data server.

  1. In Database Manager, Click New DB and select Create and build database (SQL Server)

  2. Wait while WellSim finds your SQL data server, then displays the SQL Server connection:

    1. Enter a server name Select your SQL data server from the dropdown list.

    2. Log on Usually use Windows NT integrated security.

    3. Database name Enter a name using letters or numbers only. No spaces. Ususlly enter the geothermal field name.

    4. Click OK.

  3. WellSim asks if you have the right to create an SQL Server database:

    Click OK if you have the right.

  4. WellSim checks the database name you entered above:

    • If the name has characters other than letters or numbers, WellSim strips them from the name. For example, if you entered Hulu Lais%, WellSim will change this to HuluLais and tell you:

    • If there is already a database with that name, WellSim shows an error and returns for you to enter a new name.

  5. WellSim now asks for a description for the new database. You can enter any characters here. You might type the database name with a space Hulu Lais:

    Click OK.

  6. WellSim creates the new database with empty WellSim tables:

Then

When you first select the new database in WellSim's Database Manager:

  1. WellSim asks for the mapping parameters for the new database's geothermal field see here

  2. If you have chosen that the database will have user permissions then set these up see here.

B - Creating a new SQL Server database using SQL Server Management Studio

Requirements: SQL Server, SQL Server Management Studio

  1. Start SQL Server Management Studio. We recommend you use Windows Authentication:

  2. Click Connect. Right-click Databases and select New Database:

  3. Enter a database name; this should be the name of your geothermal prospect, Akiira in this example.

  4. SQL Server creates an empty SQL Server database. Click OK and exit SQL Server Management Studio. Ensure WellSim can access the new database.

  5. Now start WellSim and at the database manager window, click New DB:

  6. The Create new database window appears. Follow the procedure to install an SQL server database.

Then

When you first select the new database in WellSim's Database Manager:

  1. WellSim asks for the mapping parameters for the new database's geothermal field see here

  2. If you have chosen that the database will have user permissions then set these up see here.

Adding an existing database to WellSim

The database must be a WellSim database, created by the current version or an earlier version of WellSim. You might add an existing database to the Database Manager if a colleague gives you a WellSim database or if you earlier removed the database from the Database Manager and now want to use it again.

  1. Ensure the database is on your computer system where WellSim can access it.

  2. Now start WellSim and at the database manager window, click Add DB:

    The Add database window appears.

  3. To add an access database, follow this procedure.

    To add an SQL server database, follow this procedure.

Update the connection to a database in WellSim if you move the database to a different place on your computer, or if you rename a database file.

  1. Open the Database Manager window.

  2. Click Edit DB:

  3. To update to an access database, follow this procedure.

    To update to an SQL server database, follow this procedure.

Removing a database from WellSim

When you remove a database it only removes the database name from the Database Manager. It does not delete the database or any of your data in the database. You can add the database back to the Database Manager later.

  1. Open the Database Manager window.

  2. Click Remove DB.

  3. Click Yes.

Deleting a database

Note:

To delete an Access database

  1. Find the location of the database on your PC.

  2. The database is one file, ending in .mdb. Use Windows Explorer to delete the file.

To delete an SQL Server database

Use SQL Server Management Studio to delete the database.


Installing an Access database

This procedure is common to several database procedures above.

  1. In the Create new database or Add database or Edit database window:

    Click Build.

  2. If you are creating or adding a database, the Provider tab opens:

    Click Microsoft Jet 4.0 OLE DB Provider, and click Next >>.

  3. The Connection tab opens:

    Enter the database name: the full database file path (.mdb file):

    • either type or paste the path if you know it,

    • or click , navigate to the folder with the .mdb file, click the file and click OK.

  4. Click Test Connection to ensure WellSim can find the database:

  5. Click OK to return to the Create new database or Add database or Edit database window again:

  6. Click OK:

  7. Enter a WellSim name for the database; this does not change the underlying name. Click OK:

WellSim will now create all the tables in the database, populate some tables with system values, add the database to the Database Manager and return to the Database Manager. This might take a while.


Installing an SQL Server database

This procedure is common to several database procedures above.

  1. In the Create new database or Add database or Edit database window:

    Click Build.

  2. If you are creating or adding a database, the Provider tab opens:

    Click Microsoft OLE DB Provider for SQL Server, and click Next >>.

  3. The Connection tab opens:

    Click Use Windows NT Integrated security. Select the database (Akiira in this example) from the drop-down list.

  4. Click Test Connection to ensure WellSim can find the database:

  5. Click OK to return to the Create new database or Add database or Edit database window again:

  6. Click OK:

  7. Enter a WellSim name for the database; this does not change the underlying name. Click OK:

  8. WellSim will now ask if you have dbo rights, necessary to create a new database:

    Warning. You must have Admin permission plus either be a dbo user or you and other GeoData Manager users must all be members of a db_owner role for this database read more. If you have these rights and permissions, click OK.

WellSim will now create all the tables in the database, populate some tables with system values, add the database to the Database Manager and return to the Database Manager. This might take a while.