Oracle har tillhandahållit "catcon.pl" perl-skriptet som en metod för att exekvera SQL-skript i en enda behållare eller alla behållare.
I exemplet nedan använde jag "catcon.pl"-skriptet för att utföra "count.sql"-skriptet och installera JAVA-komponenten från "$ORACLE_HOME/rdbms/admin"-katalogen.
$ $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 .
Installera endast JAVA-komponenten i 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
Validera installationen
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 visar följande argument tillgängliga för “catcon.pl” [1]:
Referenser
[1] Administrera en CDB med SQL*Plus. Tillgänglig på:https://docs.oracle.com/database/121/ADMIN/cdb_admin.htm#ADMIN13606