This page contains information about connecting Looker to SAP HANA and SAP HANA 2+.

## Encrypting network traffic

It is a best practice to encrypt network traffic between the Looker application and your database. Consider one of the options that are described on the [Enabling secure database access](https://docs.cloud.google.com/looker/docs/enabling-secure-db-access.md.txt) documentation page.

## Creating the Looker user

Create a Looker database user with a secure password.

    CREATE USER LOOKER PASSWORD <SOME_PASSWORD>

### Granting permissions

Grant read permissions on the schema(s) that you would like to use in Looker.

    GRANT SELECT ON SCHEMA <YOUR_SCHEMA> TO LOOKER

### Setting up a PDT schema

If using PDTs, create a scratch schema for PDTs to be written into.

    CREATE SCHEMA LOOKER_SCRATCH OWNED BY LOOKER

## Creating the Looker connection to your database

In the **Admin** section of Looker, select **Connections** , and then click **Add Connection**.

Fill out the connection details. The majority of the settings are common to most database dialects. See the [Connecting Looker to your database](https://docs.cloud.google.com/looker/docs/connecting-to-your-db.md.txt) documentation page for information. Some of the settings are described next:

- **Name**: The name of the connection. This is how you will refer to the connection in LookML projects.
- **Dialect** : **SAP HANA** or **SAP HANA 2+**.
- **Port**: The database port. The default port is 30015.
- **Host**: Hostname.
- **Database**: The name of your database.
- **Username**: The database username.
- **Password**: The user password.
- **Schema**: The default schema to use when none is specified. Entering a schema is optional.
- **Enable PDTs** : Use this toggle to enable [persistent derived tables (PDTs)](https://docs.cloud.google.com/looker/docs/derived-tables.md.txt#persistent-derived-tables). This reveals additional PDT fields and the [**PDT Overrides**](https://docs.cloud.google.com/looker/docs/connecting-to-your-db.md.txt#pdt-overrides) section for the connection.
- **Temp Database**: Schema to use for PDTs.
- **Additional JDBC parameters** : Add any additional JDBC parameters. See the [Supported JDBC parameters](https://docs.cloud.google.com/looker/docs/db-config-sap-hana.md.txt#jdbc-supported) section on this page for the list of parameters that Looker supports. See the [SAP HANA JDBC connection properties](https://help.sap.com/viewer/0eec0d68141541d1b07893a39944924e/2.0.02/en-US/109397c2206a4ab2a5386d494f4cf75e.html) documentation for details.
- **Maintenance Schedule** : A [`cron`](https://en.wikipedia.org/wiki/Cron#CRON_expression) expression that indicates when Looker should check [datagroups](https://docs.cloud.google.com/looker/docs/caching-and-datagroups.md.txt#specifying_caching_policies_with_datagroup_parameters) and PDTs. Read more about this setting in the [Maintenance Schedule](https://docs.cloud.google.com/looker/docs/connecting-to-your-db.md.txt#pdt_maintenance_schedule) documentation.
- **SSL**: Check to enable SSL.
- **Verify SSL**: Check to enforce strict hostname verification.
- **Max connections per node** : The default is 25. This value can be left at the default value initially. Read more about this setting in the [Max connections per node](https://docs.cloud.google.com/looker/docs/connecting-to-your-db.md.txt#max_connections) section of the **Connecting Looker to your database** documentation page.
- **Connection Pool Timeout**: The default is 120 seconds.
- **SQL Runner Precache** : To cause SQL Runner not to preload table information and to load table information only when a table is selected, clear this option. Read more about this setting in the [SQL Runner Precache](https://docs.cloud.google.com/looker/docs/connecting-to-your-db.md.txt#sql_runner_precache) documentation.
- **Database Time Zone** : Specify the time zone used in the database. Leave this field blank if you do not want time zone conversion. See the [Using time zone settings](https://docs.cloud.google.com/looker/docs/using-time-zone-settings.md.txt) documentation page for more information.

To verify that the connection is successful, click the **Test Connection** button in the **Status details** section at the bottom of the **Connections Settings** page.

If Looker displays **Can Connect** , press **Connect** to create the connection.

Your database connection is then added to the list on the Looker [**Connections**](https://docs.cloud.google.com/looker/docs/admin-panel-database-connections.md.txt) **Admin** page.

Test the connection in SQL Runner. Navigate to [SQL Runner](https://docs.cloud.google.com/looker/docs/sql-runner-basics.md.txt), select your connection and schema, and then [check if you can see your database tables](https://docs.cloud.google.com/looker/docs/sql-runner-manage-db.md.txt#getting_table_information).

## Supported JDBC parameters

For SAP HANA, Looker supports the following JDBC parameters in the [**Additional JDBC parameters**](https://docs.cloud.google.com/looker/docs/connecting-to-your-db.md.txt#additional_jdbc_parameters) field for the connection. See the documentation for your database for information on these parameters.

- `autocommit`
- `communicationTimeout`
- `compress`
- `connectTimeout`
- `currentSchema`
- `databaseName`
- `distribution`
- `encrypt`
- `hostNameInCertificate`
- `instanceNumber`
- `isolation`
- `locale`
- `packetSize`
- `password`
- `proxyPassword`
- `proxyPort`
- `reconnect`
- `SESSIONVARIABLE:APPLICATIONUSER`
- `user`
- `validateCertificate`

## Feature support

For Looker to support some features, your database dialect must also support them. The following sections show the feature support for [SAP HANA](https://docs.cloud.google.com/looker/docs/db-config-sap-hana.md.txt#sap_hana) and [SAP HANA 2+](https://docs.cloud.google.com/looker/docs/db-config-sap-hana.md.txt#sap_2_hana).

### SAP HANA

SAP HANA supports the following features as of Looker 26.22:

| Feature | Supported? |
|---|---|
| Looker (Google Cloud core) | No |
| Symmetric aggregates | Yes |
| Derived tables | Yes |
| Persistent SQL derived tables | Yes |
| Persistent native derived tables | Yes |
| Stable views | Yes |
| Query killing | Yes |
| SQL-based pivots | No |
| Time zones | No |
| SSL | Yes |
| Subtotals | No |
| JDBC additional params | Yes |
| Case-sensitive | Yes |
| Location type | Yes |
| List type | No |
| Percentile | No |
| Distinct percentile | No |
| SQL Runner Show Processes | Yes |
| SQL Runner Describe Table | Yes |
| SQL Runner Show Indexes | No |
| SQL Runner Select 10 | Yes |
| SQL Runner Count | Yes |
| SQL Explain | No |
| OAuth 2.0 credentials | No |
| Context comments | Yes |
| Connection pooling | No |
| HLL sketches | No |
| Aggregate awareness | Yes |
| Incremental PDTs | No |
| Milliseconds | Yes |
| Microseconds | Yes |
| Materialized views | No |
| Period-over-period measures | No |
| Approximate count distinct | No |
| In-database analytic models | No |
| Custom calendars | Yes |


### SAP HANA 2+

SAP HANA 2+ supports the following features as of Looker 26.22:

| Feature | Supported? |
|---|---|
| Looker (Google Cloud core) | Yes |
| Symmetric aggregates | Yes |
| Derived tables | Yes |
| Persistent SQL derived tables | Yes |
| Persistent native derived tables | Yes |
| Stable views | Yes |
| Query killing | Yes |
| SQL-based pivots | No |
| Time zones | No |
| SSL | Yes |
| Subtotals | No |
| JDBC additional params | Yes |
| Case-sensitive | Yes |
| Location type | Yes |
| List type | No |
| Percentile | No |
| Distinct percentile | No |
| SQL Runner Show Processes | Yes |
| SQL Runner Describe Table | Yes |
| SQL Runner Show Indexes | No |
| SQL Runner Select 10 | Yes |
| SQL Runner Count | Yes |
| SQL Explain | No |
| OAuth 2.0 credentials | No |
| Context comments | Yes |
| Connection pooling | No |
| HLL sketches | No |
| Aggregate awareness | Yes |
| Incremental PDTs | No |
| Milliseconds | Yes |
| Microseconds | Yes |
| Materialized views | No |
| Period-over-period measures | No |
| Approximate count distinct | No |
| In-database analytic models | No |
| Custom calendars | Yes |

## Next steps

After completing the database connection, [configure authentication options](https://docs.cloud.google.com/looker/docs/getting-started-with-users.md.txt).