<chapter id="ora2pgpro-installation-and-setup">
  <title>Installation and Setup</title>

    <sect1 id="ora2pgpro-install-oracle-instant-client">
     <title>Install Oracle Instant Client</title>

    <para>
      <literal>perl-DBD-Oracle</literal> and <literal>libdbd-oracle-perl</literal>
      packages shipped with <application>ora2pgpro</application> require Oracle
      Instant Client Package 12.1 (e.g.
      <literal>oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm</literal>).
      If you use Debian, note that the <literal>libdbd-oracle-perl</literal>
      package is not shipped with <application>ora2pgpro</application> as it
      is provided in the <literal>contrib</literal> section of the distribution.
      Its version for older systems (Debian 10, 11) uses the same version of
      Oracle Instant Client 12.1. The <literal>libdbd-oracle-perl</literal>
      package in Debian 12 requires Oracle Instant Client 21 or above (with
      package name
      <literal>oracle-instantclient-basic-xx.xx.x.x.x.x86_64.rpm</literal>).
      If you use a Debian-based system (Ubuntu, Astra Linux),
      you have to convert the RPM package to a Debian package
      using <application>alien</application>, and then install it using
      <application>dpkg</application>.
      You can download the packages
      <ulink url="https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html">here</ulink>
      or from a different source and follow the installation instructions.
    </para>
    </sect1>

    <sect1 id="ora2pgpro-connect-distribution">
     <title>Connect Distribution</title>

    <itemizedlist>
      <listitem>
      <para>
        Download the connection script
        <ulink url="https://repo.postgrespro.ru/ora2pgpro/keys/pgpro-repo-add.sh"><filename>pgpro-repo-add.sh</filename></ulink>.
        You can also do it using <application>wget</application>:
  <programlisting>
  $ wget --user your-username --ask-password https://repo.postgrespro.ru/ora2pgpro/keys/pgpro-repo-add.sh
  </programlisting>
      </para>
      </listitem>

      <listitem>
      <para>
        Run it with the rights of <literal>root</literal>.
        If your distribution is supported, the repository will be connected.
        Note that for a Debian-based system make sure to connect not only
        the <literal>main</literal> section but also
        the <literal>contrib</literal> section since it contains the required
        <literal>libdbd-oracle-perl</literal> package.
      </para>
      </listitem>
    </itemizedlist>
    </sect1>

    <sect1 id="ora2pgpro-install-package">
     <title>Install Package</title>

    <para>
      Install the <application>ora2pgpro</application> package using
      your package manager. Depending on your system, it can be one
      of the following:
      <itemizedlist spacing="compact">
        <listitem><simpara>
          <literal>apt-get</literal>: Debian, Ubuntu, Astra, AltLinux
        </simpara></listitem>
        <listitem><simpara>
          <literal>dnf</literal>: Red Hat Enterprise Linux (RHEL) systems
          and its derivatives: Red OS, Rosa
        </simpara></listitem>
        <listitem><simpara>
          <literal>yum</literal>: older Rosa versions
        </simpara></listitem>
        <listitem><simpara>
          <literal>zypper</literal>: SLES
        </simpara></listitem>
      </itemizedlist>
      In any case, specify the parameters for <command>install ora2pgpro</command>.
    </para>
    </sect1>

    <sect1 id="ora2pgpro-supported-distributions">
     <title>Supported Distributions</title>

     <para>
      <application>ora2pgpro</application> binary packages
      are available for the following Linux-based systems:
     </para>
     <itemizedlist spacing="compact">
      <listitem><simpara>
        Debian-based systems: Debian 11/12/13, Ubuntu
        22.04/24.04/26.04
      </simpara></listitem>
      <listitem><simpara>
        Red Hat Enterprise Linux (RHEL) systems and its derivatives: Red
        Hat Enterprise Linux 8/9/10, Red OS Murom 7.3/8, ROSA Chrome 2021.1
      </simpara></listitem>
      <listitem><simpara>
        ALT 10/11, ALT SP 8.2/10
      </simpara></listitem>
      <listitem><simpara>
        SUSE Linux Enterprise Server (SLES) 15/16
      </simpara></listitem>
      <listitem><simpara>
        MosOS 15
      </simpara></listitem>
     </itemizedlist>
    </sect1>
</chapter>
