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

Kør SQL-scripts i Multitenant-miljø med catcon.pl

Oracle har leveret "catcon.pl" perl-scriptet som en metode til at udføre SQL-scripts i en enkelt container eller alle containere.

I eksemplet nedenfor brugte jeg "catcon.pl"-scriptet til at udføre "count.sql"-scriptet og installere JAVA-komponenten fra "$ORACLE_HOME/rdbms/admin"-biblioteket.

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

Installer kun JAVA-komponent 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

Valider 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 viser følgende argumenter tilgængelige for "catcon.pl" [1]:

Referencer

[1] Administrere en CDB med SQL*Plus. Tilgængelig på:https://docs.oracle.com/database/121/ADMIN/cdb_admin.htm#ADMIN13606


  1. Sådan bruger du visninger i en MySQL-database

  2. Beregning af InnoDB-bufferpoolstørrelse til din MySQL-server

  3. Forskellen mellem en bruger og et skema i Oracle?

  4. 2 eksempeldatabaser til SQLite