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. Connect to the database as a user with DBA privileges and run the create_graph_roles.sql script.
    -- Connect as SYSDBA
    SQL> ALTER SESSION SET CONTAINER=<YOUR_PDB_NAME>;
    SQL> @create_graph_roles.sql

    Optionally, if you plan to work with property graph schema (PG Schema) graphs, then you must install the PL/SQL packages by performing the following steps:

    • Choose one of the following directories in the optional_pg_schema folder:
      • 18c_and_below: This applies only if you are working with Oracle Database 18c or below.
      • 19c_and_above: This applies only if you are working with Oracle Database 19c or above.
    • As a database user with DBA privileges, follow the instructions in the README.md file in the appropriate directory (that matches your database version). You must do this for every PDB where you will use the graph feature. For example:
      -- Connect as SYSDBA
      SQL> ALTER SESSION SET CONTAINER=<YOUR_PDB_NAME>;
      SQL> @opgremov.sql
      SQL> @catopg.sql

    See Using the Property Graph Schema for more information on PG Schema graphs.

  4. Connect as a database user with DBA privileges, create a user <graphuser>, and grant the following privileges:
    SQL> GRANT CREATE SESSION, CREATE TABLE, CREATE VIEW TO <graphuser>

    Optionally, if you plan to work with property graph schema (PG Schema) graphs, then grant the following privileges:

    SQL> GRANT CREATE SESSION, ALTER SESSION, CREATE TABLE, CREATE PROCEDURE, CREATE TYPE, CREATE SEQUENCE, CREATE VIEW, CREATE TRIGGER TO <graphuser> 
  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>