How to install Oracle Database Options like Spatial, Label Security etc After DB Creation Mustafa, 2022-03-032022-03-11 Hi, yes, I am aware that title is a little bit long and too informative but I believe it is necessary because terms are complicated according to me. When you say “option” it could be many thinks like “advanced compression” option in EE or Spatial option or Partitioning option and not all of these are the same “option”. they have different backgrounds and structures. some times they called “components” too but in the documentation they always mentioned as options. I want to write about “options” like Spatial, Jserver, Label Security, Data Vault, Olap… Do you see where I am going to? These are the “options” in dbca utility that you choose while installing the database (only if you choose “custom database” not general purposes or dw as db type) but also I will talk about partitioning and RAT (real application testing) option because their namespaces intersect in some “options” (ok, I will stop putting double quotes around the option). I didn’t care about options much until now and I wanted to learn how to install/uninstall after db creation or what options do we have. Started to dig the documentations and I realized that it is a little bit more complicated than I thought. What I focused was the options on dbca as I said: here they are. So instead searching docs and google first, I use a small trick and check the option “Generate Script” at the last page of dbca and I looked for the scripts. fortunately, Oracle puts every options creation into a script so it is really easy to find them but before talking about the scripts I want to talk about the option types. Shared Objects & DLLs Some options are made of just simple scripts but some of them are deeper! For example, if you want to install Spatial option (to use geographic coordinates in your db) you just need to run an sql script but for OLAP, you need to “link” some objects into Oracle kernel and then run some scripts. What does it mean? some options are not just tables/packages etc, they need some special C functions in oracle kernel but not everything is in the kernel. Shared Objects in Linux and (mostly known) DLL files in windows are widely used to add or remove functionalities to your application. In the end Oracle is an application and uses those dynamic libraries. I am not a software engineer so this part is a little bit above my paygrade but I will try to explain. In Linux if you want to add a functionality to your application via shared objects (dlls in windows os) you must “link” them to your application by “make” command. For example, to use OLAP it must be linked to your oracle binaries in Linux, as such necessary DLLs must be available in windows. Remember this operation is not per database but Oracle Home. When you do this, all current and future databases in this Oracle Home will be or will not be able to use these options. Of course, it is not that easy π some options must be linked to Oracle binaries but they don’t need to run an sql script. So, if we group the options by their installation types, we have 3 different types: SQL Scripts (for ex: spatial) Linking Binaries (for ex: unified auditing) Linking Binaries & SQL Scripts (for ex: OLAP) To install Spatial you just need to run $ORACLE_HOME/md/admin/mdinst.sql script as a sysdba user. That is it. This script will create MDSYS user and necessary objects to use spatial option. To enable “unified audit” option in database you must just link some binaries but you don’t need to know everything of course. you can check this post of mine: https://mustafakalayci.me/2021/09/08/enable-unified-audit-on-linux-and-windows/ spoiler: cd $ORACLE_HOME/rdbms/lib make -f ins_rdbms.mk uniaud_on ioracle and To install OLAP, first you must link OLAP module first and then then run $ORACLE_HOME/olap/admin/olap.sql script as sysdba. Linking Binaries & chopt for linking operation Oracle provides as a simple tool called chopt short for Change Option. Instead of running “make” command you can use chopt and disable and enable “some” options from Oracle Kernel. it is basically just calling “make” command itself. It does support very few option: Oracle PL/SQL oracle@Linux7 CDB $ chopt usage: chopt <enable|disable> <option> options: oaa = Oracle Advanced Analytics olap = Oracle OLAP partitioning = Oracle Partitioning rat = Oracle Real Application Testing e.g. chopt enable rat 12345678910111213 oracle@Linux7 CDB $ chopt usage: chopt <enable|disable> <option> options: oaa = Oracle Advanced Analytics olap = Oracle OLAP partitioning = Oracle Partitioning rat = Oracle Real Application Testing e.g. chopt enable rat as you see, you can enable/disable OLAP, Advanced Analytics, Partitioning and RAT.Β I want to repeat again, when you use chopt, you are linking/unlinking some binaries. So, this will add or remove some components from Oracle kernel and currently available and future databases will be or will not be able to use these options. usege of chopt is very easy: Oracle PL/SQL oracle@Linux7 ~ $ chopt enable olap Writing to /u01/app/oracle/product/19c/dbhome_2/install/enable_olap_2022-03-03_21-14-20PM.log... /usr/bin/make -f /u01/app/oracle/product/19c/dbhome_2/rdbms/lib/ins_rdbms.mk olap_on ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_2 /usr/bin/make -f /u01/app/oracle/product/19c/dbhome_2/rdbms/lib/ins_rdbms.mk ioracle ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_2 12345 oracle@Linux7 ~ $ chopt enable olap Writing to /u01/app/oracle/product/19c/dbhome_2/install/enable_olap_2022-03-03_21-14-20PM.log.../usr/bin/make -f /u01/app/oracle/product/19c/dbhome_2/rdbms/lib/ins_rdbms.mk olap_on ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_2/usr/bin/make -f /u01/app/oracle/product/19c/dbhome_2/rdbms/lib/ins_rdbms.mk ioracle ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_2 if you run it on Windows, it will just rename a DLL (to enable option, it will rename it to correct name and to disable, rename it to something else) Oracle PL/SQL C:\app\musta\admin\orcl2\scripts\noncdb_general_purp>chopt enable olap Writing to C:\app\musta\product\19c\dbhome_1/install/enable_olap_2022-03-03_12-25-08PM.log... movefile C:\app\musta\product\19c\dbhome_1\bin\oraolapop19.dll.dbl C:\app\musta\product\19c\dbhome_1\bin\oraolapop19.dll 1234 C:\app\musta\admin\orcl2\scripts\noncdb_general_purp>chopt enable olap Writing to C:\app\musta\product\19c\dbhome_1/install/enable_olap_2022-03-03_12-25-08PM.log...movefile C:\app\musta\product\19c\dbhome_1\bin\oraolapop19.dll.dbl C:\app\musta\product\19c\dbhome_1\bin\oraolapop19.dll chopt has different options from version to version. for example in old version there a module called DM (data mining) but in 19c it is under the Advanced Analytics so if you want to enable/disable data mining you must use chopt enable/disable oaa command. Also, you can see that “partitioning” is an option too. if you don’t have a partitioning license you can disable partitioning option so that non of developers create a partitioned table and caused (maybe) thousands of dollars cost. Only use the options you need! Nothing more. Consider that unnecessary options will increase db upgrade timings too. Also, as in partitioning example, some options are licensed options which means you have to pay to use them. if you don’t have the license then disable it. As far as I understand, there is a historical development in this. for example, in old versions, Spatial was an option that needed to be linked too. sdo_on and sdo_off was used to enable/disable the Spatial. Oracle PL/SQL oracle@Linux7 CDB $ /usr/bin/make -f /u01/app/oracle/product/19c/dbhome_1/rdbms/lib/ins_rdbms.mk sdo_off ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_1 Warning: sdo is always turned on. sdo_off is disabled. /usr/bin/ar cr /u01/app/oracle/product/19c/dbhome_1/rdbms/lib/libknlopt.a /u01/app/oracle/product/19c/dbhome_1/rdbms/lib/kxmwsd.o 123 oracle@Linux7 CDB $ /usr/bin/make -f /u01/app/oracle/product/19c/dbhome_1/rdbms/lib/ins_rdbms.mk sdo_off ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_1Warning: sdo is always turned on. sdo_off is disabled./usr/bin/ar cr /u01/app/oracle/product/19c/dbhome_1/rdbms/lib/libknlopt.a /u01/app/oracle/product/19c/dbhome_1/rdbms/lib/kxmwsd.o as you see, when you try to turn it off now, warns us about “sdo_off is disable”. it is always on anymore. here is some examples to enable/disable options in Oracle kernel but some of them (like Label security) is deprecated. Product/Component Enable Switch Disable Switch Automated Storage Management asm_on asm_off Oracle Data Mining dm_on dm_off Database Vault dv_on dv_off Oracle OLAP olap_on olap_off Oracle Label Security lbac_on lbac_off Oracle Partitioning part_on part_off Real Application Cluster rac_on rac_off Real Application Testing rat_on rat_off Also, please consider that if you disable an options like OLAP using chopt (or make command) it will be disabled in dbca too. you won’t be able to choose it: WARNING: before use chopt or make commands, always close all services in the oracle home first (database, listener etc). for windows servers, also stop the related Oracle Services in Windows Services (like OracleServiceOrcl…) Dbca Options Options that you can install into a database (might required binary linking). you saw them at the screenshot above. Every each of them has some unique features (I won’t go detail the purposes of the options) and some of them depends to others. So, basic hierarchy is like this: Oracle JVM OLAP Multimedia Oracle Text Spatial APEX Label Security Database Vault Extension for .NET to be able to install Multimedia you must have Oracle JVM first or you can install APEX or Label security without installing anything else. What are the scripts to install? you should always check the documentation or support to achieve this but as an example I wanted to write them in 19.13 version. DO NOT run them directly!Β Always check the documentation first, scripts might be changed! those samples are taken from dbca generated scripts. Oracle JVM $ORACLE_HOME/javavm/install/initjvm.sql; $ORACLE_HOME/xdk/admin/initxml.sql; $ORACLE_HOME/xdk/admin/xmlja.sql; $ORACLE_HOME/rdbms/admin/catjava.sql; connect “SYS”/”&&sysPassword” as SYSDBA $ORACLE_HOME/rdbms/admin/catxdbj.sql; OLAP $ORACLE_HOME/olap/admin/olap.sql SYSAUX TEMP; Multimedia $ORACLE_HOME/ord/im/admin/iminst.sql; Oracle Text $ORACLE_HOME/ctx/admin/catctx.sql Xbkfsdcdf1ggh_123 SYSAUX TEMP LOCK; alter user CTXSYS account unlock identified by “CTXSYS”; connect “CTXSYS”/”CTXSYS” $ORACLE_HOME/ctx/admin/defaults/dr0defin.sql “AMERICAN”; connect “SYS”/”&&sysPassword” as SYSDBA alter user CTXSYS password expire account lock; $ORACLE_HOME/rdbms/admin/dbmsxdbt.sql; Spatial $ORACLE_HOME/md/admin/mdinst.sql; Apex $ORACLE_HOME/apex/catapx.sql Xbkfsdcdf1ggh_123 SYSAUX SYSAUX TEMP /i/ NONE; Label Security $ORACLE_HOME/rdbms/admin/catols.sql; Database Vault $ORACLE_HOME/rdbms/admin/catmac.sql SYSAUX TEMP; Extension for .NET $ORACLE_HOME/rdbms/admin/dbmsclr.plb (in windows only) How to Install Dbca Options Well, I pointed out the scripts and you can run them (for the same version, and always check the documentations first) but of course it is not that simple π This is very important! Installation method depends on whether you are using a Container database or Non Container database! if you are not using container database (old design which is not supported anymore by starting 21c), you can run the scripts by connecting a sysdba user but for a container database it is more complicated. for a container database, most of those options must be run in cdb$root and then all the pdbs but this is a hard job and opens for mistakes. instead of this, use catcon.pl perl file to automate this. spatial sample creation script taken from dbca generated scripts: Oracle PL/SQL sqlplus / as sysdba host /u01/app/oracle/product/19c/dbhome_1/perl/bin/perl \ /u01/app/oracle/product/19c/dbhome_1/rdbms/admin/catcon.pl -n 1 -l \ /u01/app/oracle/admin/orcl7/scripts -v -b mdinst -c 'PDB$SEED CDB$ROOT' \ -U "SYS"/"&&sysPassword" \ /u01/app/oracle/product/19c/dbhome_1/md/admin/mdinst.sql; 1234567 sqlplus / as sysdba host /u01/app/oracle/product/19c/dbhome_1/perl/bin/perl \/u01/app/oracle/product/19c/dbhome_1/rdbms/admin/catcon.pl -n 1 -l \/u01/app/oracle/admin/orcl7/scripts -v -b mdinst -c 'PDB$SEED CDB$ROOT' \ -U "SYS"/"&&sysPassword" \/u01/app/oracle/product/19c/dbhome_1/md/admin/mdinst.sql; it seems complicated but mostly paths makes it longer. simply call a perl script and as a parameter it passes the original script of the necessary option. Always use catcon.pl to install/uninstall an option in a container database. How to Check Which Options are Installed This is (as always) not that simple π Some options are “registered options” so you can list them via dba_registry data dictionary view: Oracle PL/SQL sqlplus / as sysdba SQL> set linesize 200 SQL> set pagesize 100 SQL> column comp_name format a50 SQL> column comp_id format a10 SQL> select comp_id, comp_name, status from dba_Registry order by 1 ; COMP_ID COMP_NAME STATUS ---------- -------------------------------------------------- ---------------- APEX Oracle Application Express VALID APS OLAP Analytic Workspace VALID CATALOG Oracle Database Catalog Views VALID CATJAVA Oracle Database Java Packages VALID CATPROC Oracle Database Packages and Types VALID CONTEXT Oracle Text VALID DV Oracle Database Vault VALID JAVAVM JServer JAVA Virtual Machine VALID OLS Oracle Label Security VALID ORDIM Oracle Multimedia VALID OWM Oracle Workspace Manager VALID RAC Oracle Real Application Clusters OPTION OFF SDO Spatial VALID XDB Oracle XML Database VALID XML Oracle XDK VALID XOQ Oracle OLAP API VALID 16 rows selected. 12345678910111213141516171819202122232425262728 sqlplus / as sysdba SQL> set linesize 200SQL> set pagesize 100SQL> column comp_name format a50SQL> column comp_id format a10SQL> select comp_id, comp_name, status from dba_Registry order by 1 ; COMP_ID COMP_NAME STATUS---------- -------------------------------------------------- ----------------APEX Oracle Application Express VALIDAPS OLAP Analytic Workspace VALIDCATALOG Oracle Database Catalog Views VALIDCATJAVA Oracle Database Java Packages VALIDCATPROC Oracle Database Packages and Types VALIDCONTEXT Oracle Text VALIDDV Oracle Database Vault VALIDJAVAVM JServer JAVA Virtual Machine VALIDOLS Oracle Label Security VALIDORDIM Oracle Multimedia VALIDOWM Oracle Workspace Manager VALIDRAC Oracle Real Application Clusters OPTION OFFSDO Spatial VALIDXDB Oracle XML Database VALIDXML Oracle XDK VALIDXOQ Oracle OLAP API VALID 16 rows selected. These rows do not match to an option exactly. OLAP option is listed as 2 rows, “Oracle OLAP API” and “OLAP Analytic Workspace”. Also, some options are installed by default like “Oracle Workspace Manager”. is that all? of course not. these are registered options (components) but also there are options in Oracle kernel like unified auditing. it is not depend on an sql script. for all options in the kernel use V$OPTION view: Oracle PL/SQL sqlplus / as sysdba SQL> column parameter format a30 SQL> column value format a8 SQL> select * from v$option where parameter in ('Partitioning', 'Real Application Clusters', 'Spatial', 'Automatic Storage Management','Java','Unified Auditing','OLAP', 'Basic Compression','SecureFiles Encryption'); PARAMETER VALUE CON_ID ------------------------------ -------- ---------- Partitioning TRUE 0 Real Application Clusters FALSE 0 Spatial TRUE 0 Automatic Storage Management FALSE 0 Java TRUE 0 OLAP TRUE 0 Basic Compression TRUE 0 SecureFiles Encryption TRUE 0 Unified Auditing FALSE 0 9 rows selected. 1234567891011121314151617181920212223 sqlplus / as sysdba SQL> column parameter format a30SQL> column value format a8SQL>select * from v$option where parameter in ('Partitioning', 'Real Application Clusters', 'Spatial','Automatic Storage Management','Java','Unified Auditing','OLAP','Basic Compression','SecureFiles Encryption'); PARAMETER VALUE CON_ID------------------------------ -------- ----------Partitioning TRUE 0Real Application Clusters FALSE 0Spatial TRUE 0Automatic Storage Management FALSE 0Java TRUE 0OLAP TRUE 0Basic Compression TRUE 0SecureFiles Encryption TRUE 0Unified Auditing FALSE 0 9 rows selected. I just listed some of the rows because it is a long list. Uninstall an Option Uninstalling and option is not that easy because some of the options create specific objects in different schemas (like sys) and to uninstall it either you must find every object that used by the option or use some scripts again that either Oracle Support provide or exist under the oracle home directory. To Uninstall Spatial, for instance, you can simply just drop MDSYS schemaΒ but there might be some tables which uses spatial data types, indexes etc. you must find and drop them first. even if it seems easy there is always a catch. So, be careful and always follow support documents about it. In Conclusion So, it is a deep topic and probably there are much more. I said this before but again; remove all unused options from your database. They will be a burden to your system. So far these are what I understand and learn… I hope, these are useful and helpful to you while understanding the db options. As always, wish you healthy days, NO WAR in anywhere, all life in this planet matters. 18c 19c 21c Administration Uncategorized choptdb optionsenable disable optionhow to check option is enabledinstall option after creating dbinstall oracle jvminstall spatiallabel securitylinking binariesolaporacle database optionsregistered optionsspatial
Thanks for the article! Today I tried to create a test DB using CREATE DATABASE statement and then install all the optional components and almost failed miserably π And you’re my savior! I should note that I should have paid more attention while running this scripts. I used the create db example from docs and didn’t fix the temporary tablespace name (for some reason it was TEMPTS, not the “default” TEMP). Because of that I had problems installing some of the components which require explicit specification of temporary tablespace name. And its hell trying to cleanup after failed failed install and reinstalling once again. Reply
Hello @elfcheg, I am so happy to hear that π a simple “thank you” is motivated me more than anything and I am so motivated right now π cheers π edit: sorry for approving late your comments, somehow I missed the notificaiton. Reply
Hi, for a 19c standard edition: is it for the installation of spatial also necessary to execute the installation script mentioned abvove? (non container) $ORACLE_HOME/md/admin/mdinst.sql; Are there any other steps necessary, or is spatial installed by default in a new installation? We could not activate the spatial button during installation. Thanks, Thorsten Reply
Hi, sorry for late reply, there might be other steps. these options should be enabled as far as I know: SQL> select comp_id,version,status from dba_registry where comp_id in (‘JAVAVM’,’ORDIM’,’XDB’); also MDSYS user should be exist: create user MDSYS identified by default tablespace SYSAUX account lock; and privileges: @?/md/admin/mdprivs.sql I didn’t test this so you should π edit: there is a support document for this: Doc ID 270588.1 you should check that. Reply