Database
 sql >> Database >  >> RDS >> Database

Esegui script SQL in ambiente multitenant con catcon.pl

Oracle ha fornito lo script perl "catcon.pl" come metodo per eseguire script SQL in un singolo contenitore o in tutti i contenitori.

Nell'esempio seguente ho utilizzato lo script "catcon.pl" per eseguire lo script "count.sql" e installare il componente JAVA dalla directory "$ORACLE_HOME/rdbms/admin".

$ $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 .

Installa il componente JAVA solo 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

Convalida l'installazione

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 mostra i seguenti argomenti disponibili per “catcon.pl” [1]:

Riferimenti

[1] Amministrazione di un CDB con SQL*Plus. Disponibile su:https://docs.oracle.com/database/121/ADMIN/cdb_admin.htm#ADMIN13606