X

Oracle Spatial and Graph – technical tips, best practices, and news from the product team

Oracle's Property Graph Database in Shining Armor (3)

Alan Wu
Architect

This is the third installment of the series "Oracle's Property Graph Database in Shining Armor." In this blog, I am going to talk about configuring the database so that it is ready to run property graph functions. Click here for creating the database on OCI Bare Metal. 

  • Step 1: Login, sudo to become "oracle", enable 32K (extended max string) support. Note that I am assuming the PDB is "PDB1" in the following script.

$ ssh -i <your_key_file_here> opc@<YOUR_IP_HERE>

Last login: Mon Mar 19 16:49:28 2018 from
<YOUR_IP_HERE>
[opc@g ~]$
[opc@g ~]$ sudo su - oracle
[oracle@g ~]$

[oracle@g ~]$ cat /etc/oratab
#
db1:/u01/app/oracle/product/12.2.0.1/dbhome_2:N

[oracle@g dbhome_2]$ tcsh
[oracle@g dbhome_2]$ source bin/coraenv
ORACLE_SID = [oracle] ? db1
The Oracle base has been set to /u01/app/oracle

sqlplus / as sysdba

alter system set max_string_size=extended scope=spfile;
alter session set container=PDB1;
alter system set max_string_size=extended scope=spfile;
shutdown immediate;
conn / as sysdba
shutdown immediate;
startup upgrade
purge recyclebin;
@?/rdbms/admin/utl32k.sql
alter session set container=PDB1;
startup upgrade
purge recyclebin;
@?/rdbms/admin/utl32k.sql
shutdown immediate;
conn / as sysdba
shutdown immediate;
startup 

 

  • Step 2: Create a user 'PG'

alter session set container=PDB1;
CREATE bigfile TABLESPACE pgts DATAFILE '+DATA/pgts.data' SIZE 2G REUSE AUTOEXTEND ON next 128M maxsize unlimited EXTENT MANAGEMENT LOCAL ;
create user pg identified by <YOUR_PASSWORD_HERE>;
alter user pg  default tablespace pgts;
grant connect, resource, alter session to pg;
grant unlimited tablespace to pg;

 

  • Step 3: Create a test PG graph using PL/SQL API

[oracle@g dbhome_2]$ sqlplus pg/<YOUR_PASSWORD_HERE>@db122
SQL*Plus: Release 12.2.0.1.0 Production on Fri Apr 6 23:50:54 2018
Copyright (c) 1982, 2016, Oracle.  All rights reserved.

Connected to:
Oracle Database 12c EE Extreme Perf Release 12.2.0.1.0 - 64bit Production

SQL> exec opg_apis.create_pg('my_first_pg',4,4,'PGTS', null);

PL/SQL procedure successfully completed.

SQL> desc my_first_pgVT$;
 Name                       Null?    Type
 ----------------------------------------- -------- ----------------------------
 VID                       NOT NULL NUMBER
 K                            NVARCHAR2(3100)
 T                            NUMBER(38)
 V                            NVARCHAR2(15000)
 VN                            NUMBER
 VT                            TIMESTAMP(6) WITH TIME ZONE
 SL                            NUMBER
 VTS                            DATE
 VTE                            DATE
 FE                            NVARCHAR2(4000)
 

Note that if you encounter an "ORA-28353: failed to open wallet" exception, you can do the following. 

tcsh 

setenv ORACLE_UNQNAME <YOUR_DB_UNIQUE_NAME> 

sqlplus / as sysdba
alter system set encryption wallet open identified by <YOUR_PASSWORD>;

SQL> conn / as sysdba
alter session set container=PDB1;
administer key management set keystore open identified by
<YOUR_PASSWORD> ;
 

Cheers,

Zhe

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.