About Me

Database and GIS Consultant.

Sunday, May 31, 2020

Manually Install Oracle Spatial in Oracle 12c R2 Container Database


Manually Install Oracle Spatial in Oracle 12c Container Database 

Purpose: Manually Install Oracle Spatial in Oracle 12c Database in a Container / Pluggable Database.


Environment:

Database Software: Oracle 12c Release 2

Operating System: Windows Server 2012 R2 Standard - 64 Bit

 

Prerequisites: Already created a basic (container) database without any bells and whistles. A container database (with a ROOT and SEED PDBs) and created dictionary views and system stored procedures by running catcdb.sql, refer to my previous post.

 

Oracle spatial depends on other Oracle components (Oracle Java, Multimedia and Oracle XML Database), since XDB (Oracle XML Database) comes integrated with the core Oracle database, I will focus on installing Java and Multimedia.

 

List of components in my database before I start: -

 

SQL> select comp_id, control, schema, version, status, comp_name from dba_registry order by 1;

 



 





Step # 1: Install Java

 

Open a windows command prompt, set the environment variables (Make sure Oracle Home and Perl path is present).

 

> set ORACLE_SID=BABCDB

 

> set ORACLE_HOME=C:\Oracle12cR2_64Bit_DB\product

 

> set Path=C:\Oracle12cR2_64Bit_DB\product\bin;C:\Oracle12cR2_64Bit_DB\product\perl\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath; C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\...

 

> cd C:\Oracle12cR2_64Bit_DB\product\rdbms\admin

 

I created a folder called "C:\tmp\spatial" to direct the message files (like logs, errors) that gets generated while running different scripts during this installation. And the message files will have unique names for each script based on the value I provide for the “-b” parameter in the script.

 

Step # 1A - INITJVM.SQL

 

> perl catcon.pl -p 2 -u SYS/********** -l C:\tmp\spatial -b initjvm_install_babu C:\Oracle12cR2_64Bit_DB\product\javavm\install\initjvm.sql

 

C:\Oracle12cR2_64Bit_DB\product\rdbms\admin>perl catcon.pl -p 2 -u SYS/********** -l C:\tmp\spatial -b initjvm_install_babu C:\Oracle12cR2_64Bit_DB\product\javavm\install\initjvm.sql

catcon: ALL catcon-related output will be written to [C:\tmp\spatial/initjvm_install_babu_catcon_8984.lst]

catcon: See [C:\tmp\spatial/initjvm_install_babu*.log] files for output generated by scripts

catcon: See [C:\tmp\spatial/initjvm_install_babu_*.lst] files for spool files, if any

catcon.pl: completed successfully

 

Step # 1B - INITXML.SQL

 

> perl catcon.pl -p 2 -u SYS/********** -l C:\tmp\spatial -b initxml_install_babu C:\Oracle12cR2_64Bit_DB\product\xdk\admin\initxml.sql

 

C:\Oracle12cR2_64Bit_DB\product\rdbms\admin>perl catcon.pl -p 2 -u SYS/********** -l C:\tmp\spatial -b initxml_install_babu C:\Oracle12cR2_64Bit_DB\product\xdk\admin\initxml.sql

catcon: ALL catcon-related output will be written to [C:\tmp\spatial/initxml_install_babu_catcon_20368.lst]

catcon: See [C:\tmp\spatial/initxml_install_babu*.log] files for output generated by scripts

catcon: See [C:\tmp\spatial/initxml_install_babu_*.lst] files for spool files, if any

catcon.pl: completed successfully

 

Step # 1C - XMLJA.SQL

 

> perl catcon.pl -p 2 -u SYS/********** -l C:\tmp\spatial -b xmlja_install_babu C:\Oracle12cR2_64Bit_DB\product\xdk\admin\xmlja.sql

 

C:\Oracle12cR2_64Bit_DB\product\rdbms\admin>perl catcon.pl -p 2 -u SYS/********** -l C:\tmp\spatial -b xmlja_install_babu C:\Oracle12cR2_64Bit_DB\product\xdk\admin\xmlja.sql

catcon: ALL catcon-related output will be written to [C:\tmp\spatial/xmlja_install_babu_catcon_12644.lst]

catcon: See [C:\tmp\spatial/xmlja_install_babu*.log] files for output generated by scripts

catcon: See [C:\tmp\spatial/xmlja_install_babu_*.lst] files for spool files, if any

catcon.pl: completed successfully

 

Step # 1D - CATJAVA.SQL

 

> perl catcon.pl -p 2 -u SYS/********** -l C:\tmp\spatial -b catjava_install_babu C:\Oracle12cR2_64Bit_DB\product\rdbms\admin\catjava.sql

 

C:\Oracle12cR2_64Bit_DB\product\rdbms\admin>perl catcon.pl -p 2 -u SYS/********** -l C:\tmp\spatial -b catjava_install_babu C:\Oracle12cR2_64Bit_DB\product\rdbms\admin\catjava.sql

catcon: ALL catcon-related output will be written to [C:\tmp\spatial/catjava_install_babu_catcon_276.lst]

catcon: See [C:\tmp\spatial/catjava_install_babu*.log] files for output generated by scripts

catcon: See [C:\tmp\spatial/catjava_install_babu_*.lst] files for spool files, if any

catcon.pl: completed successfully

 

Step # 1E- CATEXF.SQL

 

> perl catcon.pl -p 2 -u SYS/********** -l C:\tmp\spatial -b catexf_install_babu C:\Oracle12cR2_64Bit_DB\product\rdbms\admin\catexf.sql

 

C:\Oracle12cR2_64Bit_DB\product\rdbms\admin>perl catcon.pl -p 2 -u SYS/********** -l C:\tmp\spatial -b catexf_install_babu C:\Oracle12cR2_64Bit_DB\product\rdbms\admin\catexf.sql

catcon: ALL catcon-related output will be written to [C:\tmp\spatial/catexf_install_babu_catcon_21300.lst]

catcon: See [C:\tmp\spatial/catexf_install_babu*.log] files for output generated by scripts

catcon: See [C:\tmp\spatial/catexf_install_babu_*.lst] files for spool files, if any

catcon.pl: completed successfully

 

SQL> select comp_id, control, schema, version, status, comp_name from dba_registry order by 1;












SQL> SELECT TABLESPACE_NAME,BYTES/1024/1024 "BYTES_MB",MAXBYTES/1024/1024 "MAX_BYTES_MB" FROM DBA_DATA_FILES order by TABLESPACE_NAME;






I will use SYSAUX tablespace for both (Multimedia and Spatial) as per Oracle's recommendation.

 

Step # 2A - ORDINST.SQL

 

> perl catcon.pl -p 2 -u SYS/********** -l C:\tmp\spatial -b ordinst_install_babu -a 1 C:\Oracle12cR2_64Bit_DB\product\ord\admin\ordinst.sql 1SYSAUX 1SYSAUX

 

C:\Oracle12cR2_64Bit_DB\product\rdbms\admin>perl catcon.pl -p 2 -u SYS/********** -l C:\tmp\spatial -b ordinst_install_babu -a 1 C:\Oracle12cR2_64Bit_DB\product\ord\admin\ordinst.sql 1SYSAUX 1SYSAUX

catcon: ALL catcon-related output will be written to [C:\tmp\spatial/ordinst_install_babu_catcon_20516.lst]

catcon: See [C:\tmp\spatial/ordinst_install_babu*.log] files for output generated by scripts

catcon: See [C:\tmp\spatial/ordinst_install_babu_*.lst] files for spool files, if any

catcon.pl: completed successfully

 

Step # 2A - CATIM.SQL

 

> perl catcon.pl -p 2 -u SYS/********** -l C:\tmp\spatial -b catim_install_babu C:\Oracle12cR2_64Bit_DB\product\ord\im\admin\catim.sql

 

C:\Oracle12cR2_64Bit_DB\product\rdbms\admin>perl catcon.pl -p 2 -u SYS/********** -l C:\tmp\spatial -b catim_install_babu C:\Oracle12cR2_64Bit_DB\product\ord\im\admin\catim.sql

catcon: ALL catcon-related output will be written to [C:\tmp\spatial/catim_install_babu_catcon_3020.lst]

catcon: See [C:\tmp\spatial/catim_install_babu*.log] files for output generated by scripts

catcon: See [C:\tmp\spatial/catim_install_babu_*.lst] files for spool files, if any

catcon.pl: completed successfully

 

SQL> set serverout on

SQL> execute validate_ordim;

Locator INVALID OBJECTS: /252088c1_ElocationPartitionpa - INVALID - JAVA CLASS

Locator INVALID OBJECTS: /296aa566_TrafficTimezoneUserD - INVALID - JAVA CLASS

Locator INVALID OBJECTS: /3d173f4c_TrafficDataValidator - INVALID - JAVA CLASS

Locator INVALID OBJECTS: /540dac42_ElocationPartition - INVALID - JAVA CLASS

Locator INVALID OBJECTS: /67a1229a_NDMTrafficWrapper - INVALID - JAVA CLASS

Locator INVALID OBJECTS: /b3a13448_TrafficUserDataGener - INVALID - JAVA CLASS

Locator INVALID OBJECTS: /d7dbd798_TrafficUserDataGener - INVALID - JAVA CLASS

Locator INVALID OBJECTS: /dbeb7075_TrafficUserDataGener - INVALID - JAVA CLASS

 

PL/SQL procedure successfully completed.

select comp_id, control, schema, version, status, comp_name from dba_registry order by 1;


SQL> @C:\Oracle12cR2_64Bit_DB\product\rdbms\admin\utlrp.sql

SQL> select comp_id, control, schema, version, status, comp_name from dba_registry order by 1;

 


SQL> exit;


Step # 3: Installing Oracle Spatial

 

Step # 3A - MDPRIVS.SQL

> perl catcon.pl -p 2 -u SYS/********** -l C:\tmp\spatial -b mdprivs_install_babu C:\Oracle12cR2_64Bit_DB\product\md\admin\mdprivs.sql

 

C:\Oracle12cR2_64Bit_DB\product\rdbms\admin>perl catcon.pl -p 2 -u SYS/********** -l C:\tmp\spatial -b mdprivs_install_b

abu C:\Oracle12cR2_64Bit_DB\product\md\admin\mdprivs.sql

catcon: ALL catcon-related output will be written to [C:\tmp\spatial/mdprivs_install_babu_catcon_16008.lst]

catcon: See [C:\tmp\spatial/mdprivs_install_babu*.log] files for output generated by scripts

catcon: See [C:\tmp\spatial/mdprivs_install_babu_*.lst] files for spool files, if any

catcon.pl: completed successfully

 

Step # 2B - MDINST.SQL

 > perl catcon.pl -p 2 -u SYS/********** -l C:\tmp\spatial -b mdinst_install_babu C:\Oracle12cR2_64Bit_DB\product\md\admin\mdinst.sql


C:\Oracle12cR2_64Bit_DB\product\rdbms\admin>perl catcon.pl -p 2 -u SYS/********** -l C:\tmp\spatial -b mdinst_install_babu C:\Oracle12cR2_64Bit_DB\product\md\admin\mdinst.sql

catcon: ALL catcon-related output will be written to [C:\tmp\spatial/mdinst_install_babu_catcon_18640.lst]

catcon: See [C:\tmp\spatial/mdinst_install_babu*.log] files for output generated by scripts

catcon: See [C:\tmp\spatial/mdinst_install_babu_*.lst] files for spool files, if any

catcon.pl: completed successfully


SQL> select comp_id, control, schema, version, status, comp_name from dba_registry order by 1;

 

SQL> SELECT TABLESPACE_NAME,BYTES/1024/1024 "BYTES_MB",MAXBYTES/1024/1024 "MAX_BYTES_MB" FROM DBA_DATA_FILES order by TABLESPACE_NAME;



 

 



Conclusion: These components not only got installed in ROOT PDB, but also in the SEED PDB, so future PDBs created using this SEED will inherit all the components installed so far. 


No comments: