Oracle Developers
Published in

Oracle Developers

Setup Oracle Graph on Cloud (DBCS)

I described the setup procedure for Oracle Graph using Autonomous Database in a previous article. Oracle Graph can be used with all Oracle Database editions (except 12.2 and later), both on-premises or on-cloud, so let me also share the setup procedure using Database Cloud Service (DBCS) here. As we did in the ADB article, we will use the Marketplace image for the Graph Server.

Autonomous Database (ADB) is included in Always Free Services on Oracle Cloud, so if you want to use it free of charge, please refer to the ADB article.

Create a DBCS instance

I won’t describe this step in detail, as there are no special settings for the DBCS related to Oracle Graph.

We can check the information to connect to the database from the Oracle Cloud console as below.

Let’s assume that both the DB system and hostname prefix are set as dbcs1, and the service name to connect to the database container is confirmed as follows.

$ ssh -i <private_key> opc@<public_ip_address>Example:$ ssh -i key.pem opc@203.0.113.14

Switch to oracle user.

$ sudo su - oracle

Connect to the PDB1 container in the database as SYS user via SQL*Plus.

$ sqlplus sys@<public_ip_address>:1521/<service_name> as sysdba
SQL>
Example:$ sqlplus \
sys@203.0.113.14:1521/dbcs1_pdb1.sub012345.vcn1.oraclevcn.com \
as sysdba
SQL>

You can also connect as follows using OS authentication.

$ sqlplus / as sysdba
SQL> alter session set container = DBCS1_PDB1;
SQL>

Exit from SQL*Plus.

SQL> exit

Apply a PL/SQL Patch

Get the Oracle Graph Client for PL/SQL from here. For version 22.2, the file V1020468–01.zip will be downloaded.

Copy the file to the DBCS instance.

$ scp -i <private_key> V1020468-01.zip opc@<public_ip_address>:Example:$ scp -i key.pem V1020468-01.zip opc@203.0.113.14:

Log in to the DBCS instance.

$ ssh -i <private_key> opc@<public_ip_address>

Unzip the file by oracle user.

$ sudo cp V1020468-01.zip /home/oracle/
$ sudo chown oracle:oinstall /home/oracle/V1020468-01.zip
$ sudo su - oracle
$ unzip V1020468-01.zip
$ unzip oracle-graph-plsql-22.2.0.zip -d oracle-graph-plsql

Connect to the database container as SYS user.

$ sqlplus / as sysdba
SQL> alter session set container = DBCS1_PDB1;

Apply the PL/SQL patch.

SQL> @oracle-graph-plsql/19c_and_above/opgremov.sql
SQL> @oracle-graph-plsql/19c_and_above/catopg.sql
SQL> exit

Create a User

Connect again as SYS user.

$ sqlplus / as sysdba
$ alter session set container = DBCS1_PDB1;

Create a new user, GRAPHUSER, and give necessary roles to it.

CREATE USER graphuser
IDENTIFIED BY WELcome123##
DEFAULT TABLESPACE users
TEMPORARY TABLESPACE temp
QUOTA UNLIMITED ON users;
GRANT
alter session
, create procedure
, create sequence
, create session
, create table
, create trigger
, create type
, create view
, graph_developer
TO graphuser;
exit

Make sure you can connect to the database as the new user and with the JDBC URL confirmed above.

$ sqlplus graphuser/WELcome123##@<public_ip_address>:1521/<service_name>Example:$ sqlplus graphuser/WELcome123##@203.0.113.14:1521/dbcs1_pdb1.sub01234567890.vcn1.oraclevcn.com

Create a network

Create a network for the Graph Server and open a necessary port. You can also use the network already created for a DBCS instance instead.

Go to Networking > Virtual Cloud Networks.

Use the wizard to create a new VCN. Start VCN Wizard > Create VCN with Internet Connectivity > Start VCN Wizard.

VCN NAME: vcn1
Other items: (No need to change)

Here, we create a VCN named vcn1.

Make port 7007 accessible. Go to Virtual Cloud Networks > vcn1 > Public Subnet-vcn1 > Default Security List for vcn1 > Add Ingress Rules, and create the following rules. In production use, restrict the IP addresses of clients for better security.

Source Type: CIDR
Source CIDR: 0.0.0.0/0
IP Protocol: TCP
Source Port Range: (All)
Destination Port Range: 7007
Description: For Graph Server

Create a Graph Server

Go to the Marketplace tab and search for “Graph Server and Client”.

In this example, we select the latest version (22.2.0), but the procedure is the same if you select other versions.

Stack Information does not need to be changed.

Set each item in Configure Variables.

Select the VCN and public subnet created earlier as the network.

For the Graph Server to connect to the database, specify the previously identified JDBC URL in the following format.

jdbc:oracle:thin:@<public_ip_address>:1521/<service_name>Example:jdbc:oracle:thin:@203.0.113.14:1521/dbcs1_pdb1.sub01234567890.vcn1.oraclevcn.com

Create a stack. This usually takes a few minutes.

Successfully created the stack.

At the end of the log, the IP address of the Compute instance and the URL of the graph visualization application are shown.

Open the Graph Viz app

Open https://<public_ip_for_compute>:7007/ui in a web browser.

The Marketplace image is provided with a self-signed SSL certificate, which must be changed to your own certificate for production use. If you keep using the self-signed SSL certificate, your web browser will display a warning.

In Chrome, typing thisisunsafe in the window (there is no textbox, but just type on the window) will take you to the Graph Viz screen.

In Firefox click Advanced > Accept the Risk and Continue.

Since the sample graph “hr” has already been loaded, press the Execute Query button and it will draw a subgraph taken from the database.

Setup is complete. Let’s experiment more with creating and visualizing different graphs in future articles!

Please learn more about Oracle Graph from:

--

--

--

Aggregation of articles from Oracle engineers, Groundbreaker Ambassadors, Oracle ACEs, and Java Champions on all things Oracle technology. The views expressed are those of the authors and not necessarily of Oracle.

Recommended from Medium

How to ensure all of our models and subsystems are centered on the screen and are at 100% zoom?

Very Interesting #1

Dev Day 62: Using WaitUntil to Delay a Coroutine in Unity3D

New Coder? Stop Thinking, Start Doing.

Cluster Governance — clean up resources periodically

Abstraction in Java

Replacing CryptoJS with Web Cryptography for AES

GitHub based airports API service

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Ryota Yamanaka

Ryota Yamanaka

Product Manager of Oracle Spatial and Oracle Graph. The views expressed here are my own, and the sample scripts in the articles are not supported.

More from Medium

Setup Oracle Graph on Cloud (ADB)

Building a Customized Kafka Connect Image

RedShift Get RealTime Alert When DDL Or Sensitive Queries Executed

Streaming data from DynamoDB to your Data Lake (Part- I)