Identifier SDO_RDF.CREATE_RDF_NETWORK must be declared ORACLE 12c JENA - oracle

I am working with semantic (RDF/OWL) data and want to store it in Oracle 12c. I have installed all necessary softwares.
I have created a pluggable database PROJOWL and trying to create a table within that to store the RDF data.
The steps I follow are from HERE (go to 1.11)
Step 1: CREATE TABLESPACE rdf_users
DATAFILE 'rdf_users.dat' SIZE 128M REUSE
AUTOEXTEND ON NEXT 64M MAXSIZE UNLIMITED
SEGMENT SPACE MANAGEMENT AUTO;
Step 2: EXECUTE SEM_APIS.CREATE_SEM_NETWORK('rdf_users');
This is where I get the error
SQL> EXECUTE SDO_RDF.CREATE_RDF_NETWORK('rdf_users');
BEGIN SDO_RDF.CREATE_RDF_NETWORK('rdf_users'); END;
*
Error on line 1:
ORA-06550: line 1, column 7:
PLS-00201: Identifier SDO_RDF.CREATE_RDF_NETWORK must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
Not sure what to do to resolve this. I am new and trying to run the example in the documentation is the only way for me to get me understand write code for my data. Help would be appreciated.

Related

Why does this db link chain cause a "looping chain of synonyms" error only within an anonymous block?

I am in a position which requires I pull data to my primary database through a daisy chained dblink set up similar to what is described in this answer
DBLINK_SERVER2 -> SYNONYM -> DBLINK_SERVER3
The synonym is set up on server 2 like this:
CREATE OR REPLACE SYNONYM "MY_USER"."THE_VIEW" FOR "THE_VIEW"#"DBLINK_SERVER3"
When I run a simple select statement from server 1, it works fine and pulls back exactly what i'd expect from server 3's view:
SELECT COUNT(*) FROM THE_VIEW#DBLINK_SERVER2;
However, whenever I try to run code in an anonymous block any reference to the dblink will cause a "looping chain of synonyms" error.
DECLARE
testnum VARCHAR2(50);
BEGIN
SELECT COUNT(*) INTO testnum FROM THE_VIEW#DBLINK_SERVER2;
END;
/
Error report -
ORA-06550: line 2, column 22:
PL/SQL: ORA-01775: looping chain of synonyms
ORA-06550: line 2, column 1:
PL/SQL: SQL Statement ignored
06550. 00000 - "line %s, column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.
*Action:
There aren't any synonyms on server 1 that i can see which reference the view or dblink. If i run this same test on server 2 both the simple command and block work fine when i use the synonym. Any idea why the block fails on server 1 but not if i run the same thing outside of the block? Is this some kind of permissions problem?
*** Edit ***
We never determined what was causing this, but the DBA changed it so that we were referencing a view in server 2 instead of a symlink. That resolved our problem.
CREATE VIEW THE_VIEW AS SELECT * FROM THE_VEW#DBLINK_SERVER3

Oracle PLSQL: different behavior with two different DBs

I wrote myself a little PL/SQL utility. Executing it (using SQL-Developer) against one DB (an Oracle XE installation on my Windows 10 Laptop) it works perfectly fine, but executing it against an other DB (also Oracle XE but on a Linux server) I am getting compile errors in my script!?!? How can that be?
The errors I get are:
ORA-06550: line 17, column 35:
PLS-00491: numeric literal required
ORA-06550: line 18, column 35:
PLS-00491: numeric literal required
ORA-06550: line 19, column 35:
PLS-00491: numeric literal required
ORA-06550: line 20, column 35:
PLS-00491: numeric literal required
06550. 00000 - "line %s, column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.
The referenced locations are in this section at the begin of my script:
DECLARE
-- limits and boundaries
MAX_NAME_LENGTH CONSTANT NUMBER(3) := 30; -- for table and column names
MAX_VALUE_LENGTH CONSTANT NUMBER(5) := 10000; -- for column values
-- our starting point:
m_owner VARCHAR2(MAX_VALUE_LENGTH) := 'C##TEST';
m_start_table_name VARCHAR2(MAX_NAME_LENGTH) := 'XML_MELDUNG_QUEUE';
m_start_column_name VARCHAR2(MAX_NAME_LENGTH) := 'XML_MELDUNG_ID';
m_start_value VARCHAR2(MAX_VALUE_LENGTH) := '5647';
...
and the exact spot turned out to be the usages of the constants, i.e. the "...(MAX_....)"-clauses.
It seems as if on the second system the CONSTANT-definitions and the usage of these constants in further declarations does not work the same way as it does when targeting my local DB.
I am completely puzzled! What is the problem here? Why would such a PL/SQL declaration work using one Oracle XE DB but not when using another? I mean: I would understand, if some entity can not be found, but compile errors (or not) depending on the DB used???
Any idea or pointer?
Declaring variable lengths using constants is a feature added in Oracle Database 12.2.
So I suspect that your local installation of XE is 18c. And the other is 11.2.
You can verify this by running:
select * from v$version;

How to solve Oracle 9i to 11g migration KOREAN_LEXER problems?

I currently work at migrating an Oracle 9i database (*.dmp file) to an Oracle 11g one.
To achieve this I use the exp and imp Oracle utilities command lines:
exp USERID=<user>/<password>#<database> FILE=<path> OWNER=<owner>
Then I create a skeleton.sql file which will create tables, index tables and finally indexes.
imp <user>/<password>#<database> FILE=<path> INDEXFILE="<path>\skeleton.sql" FROMUSER=<fromuser> TOUSER=<touser>
During this migration I am able to import most of the data correctly, and of course tablespaces are kept the same from one database to the other to avoid any conflicts.
But here comes the problem. In Oracle 11g, KOREAN_LEXER is no longer supported, instead you have to use the KOREAN_MORPH_LEXER. To do so I execute the following SQL commands:
call ctx_ddl.create_preference('korean_lexer','korean_morph_lexer');
call ctx_ddl.add_sub_lexer('global_lexer','korean','korean_lexer',null);
Then I import the skeleton.sql file in order to inject the data needed before the import:
sqlplus <user>/<password>#<database> #<path>\skeleton.sql
The creation of tables and index tables go smoothly until I get the following error for each of the 150+ indexes I created:
CREATE INDEX "<schema>"."WORKORDER_NDX16" ON "WORKORDER"
ERROR at line 1 :
ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
ORA-20000: Oracle Text error:
DRG-10502: WORKORDER_NDX16 index does not exist
DRG-13201: KOREAN_LEXER is no longer supported
ORA-06512: at "CTXSYS.DRUE", line 160
ORA-06512: at "CTXSYS.TEXTINDEXMETHODS", line 366
Indexes are still created, this message is just a warning.
I try to rebuild any of the broken indexes:
ALTER index WORKORDER_NDX16 REBUILD;
Which give me the following error again:
SQL Error : ORA-29874: warning in the execution of ODCIINDEXCREATE routine
ORA-29960: ligne 1,
DRG-10595: failure on ALTER INDEX WORKORDER_NDX16
DRG-50857: oracle error in drixmd.PurgeKGL
ORA-20000: Oracle Text error:
DRG-13201: KOREAN_LEXER is no longer supported
ORA-30576: ConText Option dictionary loading error
DRG-50610: internal error: kglpurge []
29874. 00000 - "warning in the execution of ODCIINDEXALTER routine"
*Cause: A waring was returned from the ODCIIndexAlter routine.
*Action: Check to see if the routine has been coded correctly
Check the user defined warning log tables for greater details.
In my skeleton.sql file, under the creation of each indexes, I have the following lines for each language:
ctxsys.driimp.set_object('LEXER','MULTI_LEXER',12);
...
ctxsys.driimp.set_sub_value('SUB_LEXER','8', NULL, NULL,'KO:KOREAN_LEXER:');
...
So far I am lost on what to do, this seems to be a simple issue to solve but my dba skills are too low to do this on my own.
If anyone could help me on this I would greatly appreciate it !
Thank you.
This looks like your database is using Oracle Text indexes, which are not the same as ordinary indexes. Have you followed completely Oracle Note 300172.1 (Obsolescence of KOREAN_LEXER Lexer Type)? It mentions this code below, which could help.
ALTER INDEX <[schema.]index> REBUILD
PARAMETERS('REPLACE LEXER ko_morph_lexer [MEMORY <size>]');
If all else fails, maybe consider trying to migrate your data into an Oracle 10g database and complete the korean_morph_lexer in 10g. If that works, it would be an easy Data Pump task to move it from 10g to 11g (or 12c).

Integrating PL/JSON with Oracle APEX 4.0

I am trying to use PL/JSON in my Oracle APEX application but get the following errors when I attempt to run a Hello, world example (which works fine when I run the example from SQL*PLUS as sys):
ORA-06550: line 2, column 20:
PLS-00905: object MY_SCHEMA.JSON is invalid
ORA-06550: line 2, column 20:
PL/SQL: Item ignored
ORA-06550: line 5, column 5:
PLS-00320: the declaration of the type of this expression is incomplete or malformed
ORA-06550: line 5, column 5:
PL/SQL: Statement ignored
ORA-06550: line 7, column 26:
PLS-00201: identifier 'JSON_EXT.GET_VARCHAR2' must be declared
ORA-06550: line 7, column 5:
PL/SQL: Statement ignored
The version of Oracle database that I am using is 10g XE.
I am guessing that I haven't granted execute privileges correctly on the packages: JSON_EXT, JSON_PRINTER, and JSON_PARSER. I have tried granting execute privileges on the 3 packages to public and APEX_PUBLIC_USER but to no avail. I would really appreciate it if someone could point me in the right direction. I have Google searched for several hours and have yet to come across a post/page that answers my problem or helps explain what is wrong and how I can go about resolving my problem.
Thanks in advance!
If you do a DESC JSON_EXT, there isn't a GET_VARCHAR2 function (at least in version 0.9.2). There is a GET_STRING function that returns a VARCHAR2.
The page you link to uses PL/JSON version 0.8.6, and it looks like they've done some biggish changes in 0.9
Version: 0.9.0
WARNING: You cannot do an easy upgrade because of changes in the API
Rewrote the API to increase speed and simplicity
Try out the examples in the latest version of the package.

Continuous problems setting up oracle

I am currently embroiled in a battle of wills regarding the installation and setup of oracle 10.2.0.
I am following this guide. Having received errors at every step of the way I've finally got to the very end of the guide only to receive this error message after running catproc.sql:
PL/SQL procedure successfully completed.
Package body created.
No errors.
Package body created.
BEGIN
*
ERROR at line 1:
ORA-01652: unable to extend temp segment by 128 in tablespace TEMP
ORA-06512: at "SYS.DBMS_STATS", line 13210
ORA-06512: at "SYS.DBMS_STATS", line 13517
ORA-06512: at "SYS.DBMS_STATS", line 15859
ORA-06512: at "SYS.DBMS_STATS", line 15901
ORA-06512: at line 1
ORA-06512: at "SYS.DBMS_REGISTRY", line 560
ORA-06512: at "SYS.DBMS_REGISTRY", line 612
ORA-06512: at line 4
SQL>
To get this far I had to modify my init.ora file with the following settings:
control_files = (C:\oracle\product\10.2.0\oradata\ora10\control01.ora,
C:\oracle\product\10.2.0\oradata\ora10\control02.ora,
C:\oracle\product\10.2.0\oradata\ora10\control03.ora)
undo_management = auto
db_name = ora10
db_block_size = 8192
db_cache_size=67108864
large_pool_size=1048576
shared_pool_size=117440512
My 'create database' command is the same as listed at 1 but with my datafiles in C and not D.
And please remember I am not a DBA and these values are simply plucked from various problems others have had around the 'net.
I recommend you create the database with the Oracle Database Creation Assistant due to your lack of knowledge on Oracle database creation. It's good enough for most cases.
The problem in the link you provide is that ALL the settings are vey low. Sooner or later you'll see other problems regarding UNDO segment because of the little datafiles.
Anyway, the sentence says:
default temporary tablespace temp
tempfile 'c:\oracle\databases\ora10\temp.dbf'
size 10M;
It's saying that the TEMPFILE tablespace is 10MB with no extend. You can try to add the autoextend on to become:
default temporary tablespace temp
tempfile 'c:\oracle\databases\ora10\temp.dbf'
size 10M autoextend on;
Or because you have already created the tablespace you can execute:
alter tablespace temp
add tempfile 'c:\oracle\databases\ora10\temp02'.dbf' SIZE 10M AUTOEXTEND ON
With this sentence you are saying: add another tempfile to the TEMP tablespace with size 10M (very little!) and make it bigger as needed.
From your link, also be careful with:
The character set WE8ISO8859P1, I recommend you to use UTF8.
The logfiles sizes can do the database very very slow they have to be bigger.
The parameter db_cache_size is only 67MB, very very little. The others too.
Anyway, the best way to start is using the Oracle Database Creation Assistant.

Resources