> For the complete documentation index, see [llms.txt](https://docs.pentaho.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pentaho.com/install/9.3-install/pentaho-installation-overview-cp/archive-installation/archive-installation-process/use-postgresql-as-your-repository-database-archive-installation/initialize-postgresql-pentaho-repository-database/step-2-run-sql-scripts-postgresql-archive.md).

# Step 2: Run SQL scripts

To use PostgreSQL as the database for your Pentaho Repository, you must initialize the Jackrabbit, Quartz, Hibernate, and Operations Mart components used by the Pentaho Repository to work with PostgreSQL. You can run SQL scripts developed by Pentaho to create and initialize these components.

Perform the following steps to run the PostgreSQL-specific initialization SQL scripts provided in the Pentaho Data Integration and Analytics software distribution.

**Note:** You may need administrator permissions to run these scripts on the host OS server.

1. Backup your data. See [Back up your existing Pentaho products and install Pentaho 9.3](https://docs.pentaho.com/install/9.3-install/pentaho-upgrade-cp/use-the-pentaho-upgrade-installer-to-upgrade-archive-installation/back-up-your-pentaho-products-and-install-pentaho-9.1-pentaho-upgrade.md).
2. If the Pentaho Server is currently running, stop it. See [Start and stop the Pentaho Server for configuration](https://docs.pentaho.com/install/9.3-install/pentaho-configuration/tasks-to-be-performed-by-an-it-administrator/configure-the-pentaho-server/start-and-stop-the-pentaho-server-for-configuration.md).
3. Make sure that your PostgreSQL instance is up and running.
4. Open a PSQL Console window from a terminal and run the following SQL creation scripts in the order shown:

   1. `<*your pentaho directory*>pentaho-server/data/postgresql/create_quartz_postgresql.sql`
   2. `<*your pentaho directory*>pentaho-server/data/postgresql/create_jcr_postgresql.sql`
   3. `<*your pentaho directory*>pentaho-server/data/postgresql/create_repository_postgresql.sql` to initialize Hibernate
   4. `<*your pentaho directory*>pentaho-server/data/postgresql/pentaho_mart_postgresql.sql`

   The Jackrabbit, Quartz, Hibernate, and Pentaho Operations Mart components are created.
5. Start the Pentaho Server.

You have initialized PostgreSQL to be used as the database for the Pentaho Repository.

**Note:** You unpacked the Pentaho Operations Mart SQL file while preparing your environment for the archive installation process. Depending on your environment, see [Prepare your Windows environment for an archive install](https://github.com/pentaho/documentation/blob/main/PDIA/9.3/Install/Pentaho%20installation/Pentaho%20Installation%20\(overview%20cp\)/Archive%20installation/Archive%20installation%20process/Prepare%20your%20Windows%20environment%20for%20an%20archive%20install=GUID-B3F10607-0F15-48A2-9000-586C36CE7811=2=en=.md) or [Prepare your Linux environment for an archive install](https://docs.pentaho.com/install/9.3-install/pentaho-installation-overview-cp/archive-installation/archive-installation-process/prepare-your-linux-environment-for-an-archive-install.md) for details.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.pentaho.com/install/9.3-install/pentaho-installation-overview-cp/archive-installation/archive-installation-process/use-postgresql-as-your-repository-database-archive-installation/initialize-postgresql-pentaho-repository-database/step-2-run-sql-scripts-postgresql-archive.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
