# Connection to Oracle Database 12.2c

Before you start, you have to install Java on your local server in order to create a connection to the Database later on. You will find a recent Java JRE here: [http://www.oracle.com/technetwork/java/javase/downloads/index.html](https://www.oracle.com/java/technologies/downloads/?er=221886)&#x20;

After that, install your Oracle Database.

&#x20;&#x20;

<figure><img src="https://aquawiki.andagon.com/pictures/drex_connection_to_oracle_database_12_2c_custom.png" alt=""><figcaption></figcaption></figure>

When downloaded, please start the installer program. Press Next, read the licence agreement and accept that. Press Next again, choose the default path for installation, and press Next. Now enter SYS Password, click Next and finish the setup by clicking Install.&#x20;

### **Setting up a new database** <a href="#setting_up_a_new_database" id="setting_up_a_new_database"></a>

Open SQL Developer. You can download it here: [http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/index.html](https://docs.oracle.com/en/database/oracle/sql-developer/19.2/)&#x20;

Create a new connection and enter the following names:&#x20;

Username: SYSTEM

Password: Your SYS Password

Hostname: localhost

SID: xe &#x20;

<figure><img src="https://aquawiki.andagon.com/pictures/drex_connection_to_oracle_database_12_2c_custom_2.png" alt=""><figcaption></figcaption></figure>

Click on login, open file **CreateDatabase.sql** and execute the script. After that, open a Windows Command Prompt and 'cd' into the folder, where aqua dump file is located. In this location enter the following command: imp AQUA/AQUA ignore=Y log=aqua\_imp.log file=aqua\_3.2.3.0.dmp&#x20;

<figure><img src="https://aquawiki.andagon.com/pictures/drex_connection_to_oracle_database_12_2c_custom_3.png" alt=""><figcaption></figcaption></figure>

<figure><img src="https://aquawiki.andagon.com/pictures/drex_connection_to_oracle_database_12_2c_custom_4.png" alt=""><figcaption></figcaption></figure>

&#x20;The next step is to create a new connection in your Oracle SQL Developer.&#x20;

&#x20;

<figure><img src="https://aquawiki.andagon.com/pictures/drex_connection_to_oracle_database_12_2c_custom_5.png" alt=""><figcaption></figcaption></figure>

Finally, we have to configure our license file in database. For that we open our license file with a text editor (e.g. Notepad), copy value of tag **CustomerAccount**,  paste it into our query and apply it to the database.&#x20;

`UPDATE CUSTOMER SET ACCOUNT = '`**`CustomerAccount`**`'`&#x20;

Your aqua Database is now installed.&#x20;

### **Configuring Database Connection** <a href="#configuring_database_connection" id="configuring_database_connection"></a>

In the following steps, we connect your aqua system to the database. First, we replace the **`hibernate.cfg.xml`** into `C:\Programm Files\andagon GmbH\aqua for IIS\Web\Webservice\bin.`

After that, we open the Web.config in folder `C:\Programm Files\andagon GmbH\aqua` for `IIS\Web\Webservice`.&#x20;

Replace row

```q
 <add key="Database" value="Data Source=X; User Id=Y;Password=Z;"/>
```

&#x20;with:

{% code overflow="wrap" %}

```q
<add key="Database" value="Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=$HOST)(PORT=$PORT)))(CONNECT_DATA=(SERVER=DEDICATED)(SID=$SID)));User Id=$USER;Password=$PASSWORD;"/>
```

{% endcode %}

&#x20;Replace&#x20;

```q
$HOST,$PORT,$SID,$USER and  $PASSWORD 
```

with your data

{% code overflow="wrap" %}

```q
<add key="Database" value="Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SID=XE)));User Id=AQUA;Password=AQUA;"/>
```

{% endcode %}

\
After that, we configure our Oracle Version. For that we open folder `C:\app\Administrator\product\11.2.0\client_1\ODP.NET\bin\2.x`, open file `Ora-ProvCfg` and identify the version. This version has to be inserted into the Web.config file. &#x20;

<figure><img src="https://aquawiki.andagon.com/pictures/drex_connection_to_oracle_database_12_2c_custom_6.png" alt=""><figcaption></figcaption></figure>

&#x20;  &#x20;

<figure><img src="https://aquawiki.andagon.com/pictures/drex_connection_to_oracle_database_12_2c_custom_7.png" alt=""><figcaption></figcaption></figure>

Now we have to disable 32-Bit Applications in IIS. For that we open the IIS, open context-menu on **`aquaAPIPool`** and select **`Set Application Pool Defaults`**. Here we set **`Enable 32-Bit Applications`** on **`False`**.

&#x20;

<figure><img src="https://aquawiki.andagon.com/pictures/drex_connection_to_oracle_database_12_2c_custom_8.png" alt=""><figcaption></figcaption></figure>

&#x20;

<figure><img src="https://aquawiki.andagon.com/pictures/drex_connection_to_oracle_database_12_2c_custom_9.png" alt=""><figcaption></figcaption></figure>

### **Installing ODP driver** <a href="#installing_odp_driver" id="installing_odp_driver"></a>

aqua requires an ODP.NET driver to successfully connect to an Oracle database. This driver can be retrieved from [http://www.oracle.com/technetwork/database/windows/downloads/index-090165.html](https://www.oracle.com/database/technologies/odac-downloads.html).&#x20;

{% hint style="warning" %}
Be careful: download the right version (e.g. ODAC121024Xcopy\_x64.zip)!
{% endhint %}

Extract the downloaded files, open a command prompt, change directory to the extraction target and execute the following command:

```batch
install.bat odp.net2 c:\odac odac
```

Finally, you can install your aqua client by installing aqua.msi and start the client. The default login data is as follows:&#x20;

Username: Administrator

Password: default

Server: localhost

&#x20; &#x20;

<figure><img src="https://aquawiki.andagon.com/pictures/drex_connection_to_oracle_database_12_2c_custom_10.png" alt=""><figcaption></figcaption></figure>

Your aqua system should be ready to use!
