Oracle has provided the “catcon.pl” perl script as a method to execute SQL scripts in a single container or all containers.
In the example below I used “catcon.pl” script to perform the “count.sql” script and install JAVA component from the “$ORACLE_HOME/rdbms/admin” drectory.
$ $ORACLE_HOME/perl/bin/perl $ORACLE_HOME/rdbms/admin/catcon.pl -u SYS/xxxxx -d /home/oracle/scripts -l /home/oracle/scripts/logs -b script_output count.sql catcon: ALL catcon-related output will be written to /home/oracle/scripts/logs/script_output_catcon_59455.lst catcon: See /home/oracle/scripts/logs/script_output*.log files for output generated by scripts catcon: See /home/oracle/scripts/logs/script_output_*.lst files for spool files, if any catcon.pl: completed successfully $ ls -litra total 100 520194 drwxr-xr-x 3 oracle oinstall 4096 May 8 09:45 .. 520199 -rw-r--r-- 1 oracle oinstall 410 May 8 09:47 script_output_catcon_59455.lst 520200 -rw-r--r-- 1 oracle oinstall 9605 May 8 09:47 script_output0.log 520201 -rw-r--r-- 1 oracle oinstall 9873 May 8 09:47 script_output1.log 520202 -rw-r--r-- 1 oracle oinstall 8241 May 8 09:47 script_output2.log 520203 -rw-r--r-- 1 oracle oinstall 8273 May 8 09:47 script_output3.log 520204 -rw-r--r-- 1 oracle oinstall 9733 May 8 09:47 script_output4.log 520205 -rw-r--r-- 1 oracle oinstall 8309 May 8 09:47 script_output5.log 520206 -rw-r--r-- 1 oracle oinstall 6719 May 8 09:47 script_output6.log 520207 -rw-r--r-- 1 oracle oinstall 6755 May 8 09:47 script_output7.log 520195 drwxr-xr-x 2 oracle oinstall 4096 May 8 09:47 .
Install JAVA component only in PDBCAT_DEV
$ORACLE_HOME/perl/bin/perl $ORACLE_HOME/rdbms/admin/catcon.pl -u SYS/xxxxx -n 8 -c 'PDBCAT_DEV' -e -b jvminstall.log $ORACLE_HOME/javavm/install/initjvm.sql
Validate installation
select comp_name, status, substr(version,1,10) as version from dba_registry where comp_name like '%JAVA%'; select object_name, object_type, status from dba_objects where status != 'VALID' order by object_type,object_name; @?/rdbms/admin/utlrp.sql
Oracle shows the following arguments available to “catcon.pl” [1]:
References
[1] Administering a CDB with SQL*Plus. Avalilable at: https://docs.oracle.com/database/121/ADMIN/cdb_admin.htm#ADMIN13606