1.2.3 Installing PL/SQL Packages in Oracle Database

Oracle Graph Server and Client will work with Oracle Database 12.2 onward. However, you must install the updated PL/SQL packages that are part of the Oracle Graph Server and Client download.

Note:

You can skip this section if you are using Graph Server and Client with Oracle Autonomous Database. You only need to create roles and assign permissions by executing step-5 and step-6 in Basic Steps for Using an Oracle Database for Authentication. You can run these steps using Database Actions in Oracle Cloud Infrastructure Console.

  1. Download the Oracle Graph PL/SQL patch component, which is a part of the Oracle Graph Server and Client download from Oracle Software Delivery Cloud.
  2. Unzip the file oracle-graph-plsql-<ver>.zip into a directory of your choice.
    <ver> denotes the version downloaded for the Oracle Graph PL/SQL Patch for PL/SQL.
  3. Install the PL/SQL packages:
    1. There are two directories, one for users with Oracle Database 18c or below, and one for users with Oracle Database 19c or above. As a database user with DBA privilges, follow the instructions in the README.md file in the appropriate directory (that matches your database version). This has to be done for every PDB you will use the graph feature in. For example:
      -- Connect as SYSDBA
      SQL> ALTER SESSION SET CONTAINER=<YOUR_PDB_NAME>;
      SQL> @opgremov.sql
      SQL> @catopg.sql
  4. Create a database user in the database for working with graphs:
    1. As a database user with DBA privileges, create a user <graphuser>, and grant the necessary privileges.
      1. If you plan to use a three-tier architecture (graph queries and analytics executed in the in-memory graph server (PGX), then grant privileges as described in the following command:
        SQL> GRANT CREATE SESSION, CREATE TABLE, CREATE VIEW TO <graphuser>
      2. If you plan to use a two-tier architecture and run graph queries in the database, then grant privileges as described in Required Privileges for Database Users:
        SQL> GRANT CREATE SESSION, ALTER SESSION, CREATE TABLE, CREATE PROCEDURE, CREATE TYPE, CREATE SEQUENCE, CREATE VIEW, CREATE TRIGGER TO <graphuser> 
    2. As a <graphuser> in the database, check that the PL/SQL update is successful:
      SQL> CONNECT <graphuser>/<password>
      SQL> SELECT opg_apis.get_opg_version() FROM DUAL;
           -- Should return 21.2 if you are using 
           -- Graph Server and Client 21.2
  5. Grant the appropriate roles (GRAPH_DEVELOPER or GRAPH_ADMINISTRATOR), to the database user created in step 4 for working with the graphs.

    Note:

    
    SQL> GRANT GRAPH_DEVELOPER to <graphuser>
    SQL> GRANT GRAPH_ADMINISTRATOR to <adminuser>