# Prerequisites

## Deployment Options

* **On Premise**: Can be deployed on local virtual machine or local server
* **On OpsHub Cloud**: Can be deployed on Azure environment provided by OpsHub. This will come at an additional cost, which can be discussed with your point of contact in the support or sales team.
* **On Customer Cloud**: Can be deployed on cloud service hosted by customer. Supported cloud service on which it can be deployed are:
  * Amazon EC2
  * Azure

Following are the Operating System (OS) and hardware pre-requisites for server or VM where <code class="expression">space.vars.SITENAME</code> is installed.

## Supported Operating Systems

### Windows

* Windows Server 2008 R2 and above (64 bit)
* For Windows specific configuration, refer [Windows specific configuration](#windows-specific-configuration)

### Linux

* RHEL 5.2 and above (64 bit)
  * RHEL includes Cent OS and Fedora
* Ubuntu 22.04 and above

## Hardware Prerequisites

1. RAM - 8 GB & above
2. Disk space - 50 GB (Recommended)
3. Database Disk Space - 15 GB (Recommended)
4. Cores - Quadcore (Recommended)

## Database Prerequisites

<code class="expression">space.vars.SITENAME</code> can be deployed with an embedded database; however, for production deployment or anything other than functional testing, our experts highly recommend using an external database. <code class="expression">space.vars.SITENAME</code> supports the following database.

### 1. MySQL Server

* **Supported versions:** From 5.7.18 or above
* **Wait time for connection pool** should be set to 8 hours.

**User permission pre-requisites list:**

| **Privileges**          | **Context**                           | **Installation** | **Upgradation** | **Running** |
| ----------------------- | ------------------------------------- | ---------------- | --------------- | ----------- |
| Alter                   | Tables                                | Yes              | Yes             |             |
| Alter Routine           | Stored routines                       | Yes              | Yes             |             |
| Create                  | Databases, tables, or indexes         | Yes              | Yes             |             |
| Create routine          | Stored routines                       | Yes              | Yes             |             |
| Create tablespace       | Server administration                 | Yes              | Yes             |             |
| Create temporary tables | Tables                                | Yes              | Yes             |             |
| Create view             | Views                                 | Yes              | Yes             |             |
| Delete                  | Tables                                | Yes              | Yes             | Yes         |
| Drop                    | Databases, tables, or views           | Yes              | Yes             |             |
| Execute                 | Stored routines                       | Yes              | Yes             | Yes         |
| File                    | File access on server host            | Yes              | Yes             |             |
| Grant option            | Databases, tables, or stored routines | Yes              | Yes             |             |
| Index                   | Tables                                | Yes              | Yes             |             |
| Insert                  | Tables or columns                     | Yes              | Yes             | Yes         |
| Lock tables             | Databases                             | Yes              | Yes             | Yes         |
| References              | Databases or tables                   | Yes              | Yes             |             |
| Select                  | Tables or columns                     | Yes              | Yes             | Yes         |
| Show view               | Views                                 | Yes              | Yes             | Yes         |
| Update                  | Tables or columns                     | Yes              | Yes             | Yes         |

Once the installation/up-gradation is complete for normal running of OIM, permissions required only for installation and upgradation can be revoked.

**SQL script to grant/validate/revoke User permission:**

| **Operation** | **When OIM installation/upgaradation is responsible for database creation**                                                                                                                                                                                                                                                                                         | **When database is created manually**                                                                                                                                                                                                                                                                                                                    |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Grant         | <p><code>GRANT ALTER, ALTER ROUTINE, CREATE, CREATE ROUTINE, CREATE TEMPORARY TABLES ,CREATE TABLESPACE, FILE, CREATE VIEW, DELETE, DROP, EXECUTE, GRANT OPTION, INDEX, INSERT, LOCK TABLES, REFERENCES, SELECT, SHOW VIEW, UPDATE ON *.* TO 'username'@'localhost';</code><br><br><code>GRANT CREATE TABLESPACE, FILE ON *.* TO 'username'@'localhost';</code></p> | <p><code>GRANT ALTER, ALTER ROUTINE, CREATE, CREATE ROUTINE, CREATE TEMPORARY TABLES, CREATE VIEW, DELETE, DROP, EXECUTE, GRANT OPTION, INDEX, INSERT, LOCK TABLES, REFERENCES, SELECT, SHOW VIEW, UPDATE ON database\_name.\* TO 'username'@'localhost';</code><br><br><code>GRANT CREATE TABLESPACE, FILE ON *.* TO 'username'@'localhost';</code></p> |
| Validate      | `SHOW GRANTS FOR 'username'@'localhost';`                                                                                                                                                                                                                                                                                                                           | `SHOW GRANTS FOR 'username'@'localhost';`                                                                                                                                                                                                                                                                                                                |
| Revoke        | `REVOKE ALTER, ALTER ROUTINE, CREATE, CREATE ROUTINE, CREATE TEMPORARY TABLES, CREATE TABLESPACE, FILE, CREATE VIEW, DROP, GRANT OPTION, INDEX, REFERENCES ON *.* FROM 'username'@'localhost';`                                                                                                                                                                     | <p><code>REVOKE ALTER, ALTER ROUTINE, CREATE, CREATE ROUTINE, CREATE TEMPORARY TABLES, CREATE VIEW, DROP, GRANT OPTION, INDEX, REFERENCES ON database\_name.\* FROM 'username'@'localhost';</code><br><br><code>REVOKE CREATE TABLESPACE, FILE ON *.* FROM 'username'@'localhost';</code></p>                                                            |

### 2. MS SQL/Azure SQL Server

> **Note**: Azure SQL is an alias for MS SQL on cloud.

* **Supported versions:** 2012 or above
* MS SQL version should support TLS v1.2 protocol or above, as it is recommended to use MS SQL with TLSv1.2 enabled. Refer [this link](https://support.microsoft.com/en-us/topic/kb3135244-tls-1-2-support-for-microsoft-sql-server-e4472ef8-90a9-13c1-e4d8-44aad198cdbe) to upgrade MS SQL server to enable support for TLSv1.2 or above.
* Enable Client protocols **TCP/IP** and **Named pipes** on MSSQLSERVER instance

**User permission pre-requisites list:**

| **Db operation**       | **Privilege**                         | **Installation** | **Upgradation** | **Running** |
| ---------------------- | ------------------------------------- | ---------------- | --------------- | ----------- |
| Create Database/Schema | Create Database, Create Schema        | Yes              |                 |             |
| Update Database/Schema | Alter Database, Alter Schema or Alter | Yes              | Yes             | Yes         |
| Create Table           | CREATE TABLE                          | Yes              | Yes             |             |
| Select in Table        | SELECT                                | Yes              | Yes             | Yes         |
| Insert in Table        | INSERT                                | Yes              | Yes             | Yes         |
| Update table data      | UPDATE                                | Yes              | Yes             | Yes         |
| Delete table data      | DELETE                                | Yes              | Yes             | Yes         |
| Alter Table            | ALTER                                 | Yes              | Yes             | Yes         |
| Drop Table             | ALTER                                 | Yes              | Yes             |             |
| Create View            | CREATE VIEW                           | Yes              | Yes             |             |
| Read View              | SELECT                                | Yes              | Yes             | Yes         |
| Alter View             | ALTER                                 | Yes              | Yes             |             |
| Drop View              | ALTER                                 | Yes              | Yes             |             |
| Create References      | REFERENCES                            | Yes              | Yes             |             |
| Update References      | REFERENCES                            | Yes              | Yes             |             |
| Drop References        | REFERENCES                            | Yes              | Yes             |             |
| Create Procedure       | CREATE PROCEDURE                      | Yes              | Yes             |             |
| Update/Alter Procedure | ALTER                                 | Yes              | Yes             |             |
| Execute Procedure      | EXECUTE                               | Yes              | Yes             | Yes         |
| Drop Procedure         | ALTER                                 | Yes              | Yes             |             |

> **Note**: **ALTER** privilege also required along with other privileges for operation such as create table, create view, drop table/view/procedure, references, etc.

Once the installation/up-gradation is complete for normal running of OIM, permissions required only for installation and upgradation can be revoked.

**SQL script to grant/validate/revoke User permission:**

| **Operation** | **When OIM installation/upgaradation is responsible for database creation**                                                                                                                                                                                                              | **When database is created manually**                                                                                                                                                                                                                                                            |
| ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Grant         | <p><code>USE master;</code><br><code>grant Create Database, Create Schema, ALTER, CREATE TABLE, SELECT, INSERT, UPDATE, DELETE, CREATE VIEW, REFERENCES, CREATE PROCEDURE, EXECUTE to username;</code></p>                                                                               | <p><code>USE database\_name;</code><br><code>GRANT Create Schema, ALTER, CREATE TABLE, SELECT, INSERT, UPDATE, DELETE, CREATE VIEW, REFERENCES, CREATE PROCEDURE, EXECUTE TO username;</code></p>                                                                                                |
| Validate      | <p><code>USE master;</code><br><code>SELECT pr.principal\_id, pr.name , pr.type\_desc, pe.state\_desc, pe.permission\_name FROM sys.database\_principals AS pr JOIN sys.database\_permissions AS pe ON pe.grantee\_principal\_id = pr.principal\_id WHERE pr.name='username';</code></p> | <p><code>USE database\_name;</code><br><code>SELECT pr.principal\_id, pr.name , pr.type\_desc, pe.state\_desc, pe.permission\_name FROM sys.database\_principals AS pr JOIN sys.database\_permissions AS pe ON pe.grantee\_principal\_id = pr.principal\_id WHERE pr.name='username';</code></p> |
| Revoke        | <p><code>USE master;</code><br><code>REVOKE Create Database, Create Schema, CREATE TABLE, CREATE VIEW, REFERENCES, CREATE PROCEDURE FROM username;</code></p>                                                                                                                            | <p><code>USE database\_name;</code><br><code>REVOKE Create Schema, CREATE TABLE, CREATE VIEW, REFERENCES, CREATE PROCEDURE FROM username;</code></p>                                                                                                                                             |

### 3. Oracle

* **Supported versions:** 11g (Release 2), 12c and 19c

**User permission pre-requisites list:**

**System Privilege**

| **Privilege**        | **Installation**         | **Upgrading** | **Running** |
| -------------------- | ------------------------ | ------------- | ----------- |
| CREATE SESSION       | Yes \[WITH ADMIN OPTION] | Yes           | Yes         |
| EXECUTE ANY TYPE     | Yes \[WITH ADMIN OPTION] | Yes           | Yes         |
| CREATE ANY PROCEDURE | Yes \[WITH ADMIN OPTION] | Yes           |             |
| CREATE USER          | Yes                      |               |             |
| CREATE ANY TABLE     | Yes \[WITH ADMIN OPTION] | Yes           |             |
| CREATE ANY VIEW      | Yes \[WITH ADMIN OPTION] | Yes           |             |
| QUERY REWRITE        | Yes \[WITH ADMIN OPTION] | Yes           | Yes         |
| SELECT ANY TABLE     | Yes \[WITH ADMIN OPTION] | Yes           | Yes         |
| GLOBAL QUERY REWRITE | Yes \[WITH ADMIN OPTION] | Yes           | Yes         |
| ALTER ANY TABLE      | Yes \[WITH ADMIN OPTION] | Yes           |             |
| DROP ANY TABLE       | Yes \[WITH ADMIN OPTION] | Yes           |             |
| CREATE ANY INDEX     | Yes                      | Yes           |             |
| INSERT ANY TABLE     | Yes                      | Yes           | Yes         |
| UPDATE ANY TABLE     | Yes                      | Yes           | Yes         |
| DELETE ANY TABLE     | Yes                      | Yes           | Yes         |
| DROP ANY VIEW        | Yes \[WITH ADMIN OPTION] | Yes           |             |
| ALTER ANY PROCEDURE  | Yes \[WITH ADMIN OPTION] | Yes           |             |
| LOCK ANY TABLE       |                          | Yes           |             |
| DROP ANY INDEX       |                          | Yes           |             |
| DROP ANY PROCEDURE   | Yes \[WITH ADMIN OPTION] | Yes           |             |
| CREATE ANY DIRECTORY | Yes \[WITH ADMIN OPTION] | Yes           |             |

* For seamless running of <code class="expression">space.vars.SITENAME</code>, the permissions mentioned for installation and upgrade only can be revoked.
* The default installation of <code class="expression">space.vars.SITENAME</code> with Oracle:
  * Two users are created by <code class="expression">space.vars.SITENAME</code>: `opshub` and `reportsdb`.
  * The user through which the database is connected will perform the following:
    * Create these users. Hence, `CREATE USER` permission is required at the installation time.
    * Grant certain permissions to these users (`opshub` and `reportsdb`) to connect with their database and create the required data in their database. Hence, `WITH ADMIN OPTION` is required.
    * Perform certain operations on the resources of these two users. Hence, it requires `ANY*` permissions.
* In the advanced installation, if <code class="expression">space.vars.SITENAME</code> is going to be installed with the option of the [manual creation of the database](https://docs.opshub.com/upcoming-release/installation#manual-creation-of-the-databases), then:
  * One of the users (`opshub` or `reportsdb`) can be used to connect with the Oracle database and perform all the operations.
  * In this case, `CREATE USER` privilege can be omitted, and only `SELECT ANY TABLE` privilege would require `WITH ADMIN OPTION` during installation.
* It is recommended to create a database manually for a high-security environment. The credentials are used as input to create two new users during the installation, so `CREATE USER` permission is required.\
  If any permission regarding creating a user is missing, then <code class="expression">space.vars.SITENAME</code> will print the password through SQL query.\
  'Create schema' approach was considered, but as Oracle doesn't allow creating schemas alone, we have to go with the 'Create User' approach.
* If installation is to be done in the **cdb$root container of CDB instance**, then the connection user should have the commonly granted `CREATE USER` permission.\
  To achieve this, the `container=ALL` clause needs to be used while granting the permission.\
  The sample query for creating the user:

  `CREATE USER c##username IDENTIFIED BY password container=ALL;`
* After the user is created, the permission should be verified with the following query:\
  `SELECT * FROM USER_SYS_PRIVS;`
* Find the below screenshot which shows correct permission for CREATE USER privilege:

  <div align="center"><img src="https://3729341606-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1yI7gLypIVjJdBgxy9pM%2Fuploads%2Fgit-blob-bb8012374c9c50760e6b05ac3d1e4748c546cae6%2FOracleCreateUserPermission.png?alt=media" alt="" width="900"></div>

***

#### **SQL script to grant/validate/revoke User permission:**

| **Operation** | **SQL Queries**                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Grant**     | <p><code>GRANT CREATE SESSION, EXECUTE ANY TYPE, CREATE ANY PROCEDURE, CREATE ANY TABLE, CREATE ANY VIEW, QUERY REWRITE, SELECT ANY TABLE, GLOBAL QUERY REWRITE, ALTER ANY TABLE, DROP ANY TABLE, DROP ANY VIEW, ALTER ANY PROCEDURE, DROP ANY PROCEDURE, CREATE ANY DIRECTORY TO username WITH ADMIN OPTION;</code><br><br><code>GRANT CREATE USER, CREATE ANY INDEX, INSERT ANY TABLE, UPDATE ANY TABLE, DELETE ANY TABLE, LOCK ANY TABLE, DROP ANY INDEX TO username;</code></p> |
| **Validate**  | `SELECT * FROM USER_SYS_PRIVS;`                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **Revoke**    | `REVOKE CREATE ANY PROCEDURE, CREATE USER, CREATE ANY TABLE, CREATE ANY VIEW, ALTER ANY TABLE, DROP ANY TABLE, CREATE ANY INDEX, DROP ANY VIEW, ALTER ANY PROCEDURE, LOCK ANY TABLE, DROP ANY INDEX, DROP ANY PROCEDURE, CREATE ANY DIRECTORY FROM username;`                                                                                                                                                                                                                       |

### 4. PostgreSQL Server

* **Supported versions:** From 15 or above
* The user must have **CREATEDB** permission for creating database.

In the advanced installation, if <code class="expression">space.vars.SITENAME</code> is installed with the option of the [manual creation of the database](https://docs.opshub.com/upcoming-release/installation#manual-creation-of-the-databases), then:

* The user must have permission for **CREATE ON SCHEMA** for both the schemas (`opshub` and `reportsdb`) for creating tables, index, references, and views.
* The manually created database and schema should only contain **lowercase alphanumeric characters**, with `$`, `_` and **no spaces**.

> **Note**: If default connection timeout parameter is changed for any database server, then it must be confirmed that sufficient connection timeout has been set. For example, for MySQL the default server-side connection timeout is 8 hours. If it is changed and set to, say, 5 minutes, then the default server-side connection timeout must be updated accordingly. <code class="expression">space.vars.SITENAME</code> maintains connection pools that keep connections alive for 8 hours. Based on the need, this parameter can be tuned at both the application and database-server levels.**Generally, the recommended timeout is between 6-8 hours.**

## Download Database Connector jar

| Database Type  | Database Version | Download Link                                                                                                               |
| -------------- | ---------------- | --------------------------------------------------------------------------------------------------------------------------- |
| **MySQL**      | All              | [MySQL Connector/J](https://dev.mysql.com/downloads/connector/j)                                                            |
| **MSSQL**      | 2012 and lower   | [Download Link](https://www.microsoft.com/en-in/download/details.aspx?id=11774)                                             |
|                | 2014 onward      | [Release Notes](https://learn.microsoft.com/en-us/sql/connect/jdbc/release-notes-for-the-jdbc-driver?view=sql-server-ver16) |
| **Oracle**     | 11g              | [Oracle JDBC 11g](https://www.oracle.com/jp/technical-resources/articles/features/jdbc/jdbc.html)                           |
|                | 12c              | [Oracle JDBC 12c](https://www.oracle.com/technetwork/database/features/jdbc/jdbc-drivers-12c-download-1958347.html)         |
|                | 19c              | [Oracle JDBC 19c](https://www.oracle.com/database/technologies/appdev/jdbc-ucp-19c-downloads.html)                          |
| **PostgreSQL** | All              | [PostgreSQL JDBC](https://jdbc.postgresql.org/download/)                                                                    |

## HostName for <code class="expression">space.vars.SITENAME</code>

* If machine/instance where <code class="expression">space.vars.SITENAME</code> deployed is binded with any hostname (Net, Host, Gateway, or Domain name) then please make sure the hostname (Net, Host, Gateway, or Domain name) is a text string up to 24 characters drawn from the alphabet (A-Z), digits (0-9), minus sign (-), and period (.). Note that periods are only allowed when they serve to delimit components of "domain style names". For more details, read the memo [RFC-921](https://tools.ietf.org/html/rfc921) and [RFC-952](https://tools.ietf.org/html/rfc952).

Once you have downloaded the application and configured the pre-requisite, click [Installation Steps](https://docs.opshub.com/upcoming-release/getting-started/installation) to see how to get started.

## Port Prerequisites

For successful installation/upgradation of <code class="expression">space.vars.SITENAME</code>, following ports are required to be available as per the chosen configuration and database.

### Connection Protocol Selection

Choosing the right protocol depends on your network environment and security needs.

1. **HTTP (Port 8989)**
   * **Usage:** Supported mainly for on-premise deployments where the <code class="expression">space.vars.SITENAME</code> is hosted within a trusted, customer-controlled network and protected by internal firewall rules or a reverse proxy.
   * **Security Consideration:** Network isolation, firewall enforcement, and controlled access are expected to be in place to mitigate exposure risks and vulnerable attacks.
2. **HTTPS (Port 8443) – Recommended**
   * **Usage:** Required for cloud-based, or internet-facing public deployments of <code class="expression">space.vars.SITENAME</code>.
   * **Security Benefit:** HTTPS provides encrypted communication, ensuring data confidentiality, integrity, and authenticity.

### Database Port

* **9001**: If you are installing <code class="expression">space.vars.SITENAME</code> with HSQL database.

> **Note**: Apart from the above ports, some connectors require certain ports to be available. Please refer the [Connectors](https://docs.opshub.com/upcoming-release/connectors) section to check ports used by specific connectors.

## Appendix

### Windows specific configuration

During the installation of <code class="expression">space.vars.SITENAME</code>, few temporary files are placed/copied in the TEMP directory \[i.e., the path which is specified in TEMP environment variable]. This directory path should not contain ";" as well as none of the directory/folder names should end with "!" in this path.

* Example: "C:\Users\xyz!\AppData\Local\Temp" or "C:\Users\xy;z\AppData\Local\Temp" as Temp environment variable value/path is not allowed.
* In such case, the installation will fail with error. Please refer [here](https://docs.opshub.com/upcoming-release/help-center-index/troubleshooting-index/errors-index/installer-error-solutions/ops-005) for more details on this error and steps for its resolution. To check how to set TEMP environment variable, please refer below.

### Setup environment variable

* Open "Edit the system environment variables" from Start.
* Click the "Environment Variables" button.
* Click on environment variable required to be edited.
* Click on Edit button and change the path.
