Dokumentation  

Der Job führt SQLPlus Skripte aus. Parameter werden über eine "DEFINE"-Anweisung dem SQLPlus am Anfang des Skripts hinzugefügt.

Beispiel: Define-Anweisung, wenn der job den Parameter "foo=bar" hat.

DEFINE foo = bar (char)            
            

Beispiel: SQL+ Skript

WHENEVER SQLERROR EXIT SQL.SQLCODE
WHENEVER OSERROR EXIT FAILURE

column end_date new_value BCY_DATE
column period new_value PN_YEAR_PERIOD
column period_prev new_value PN_YEAR_PERIOD_PREV

select '0' as end_date from dual;
prompt SET end_date IS &BCY_DATE;
/
select '0' as period from dual;
prompt SET period IS &PN_YEAR_PERIOD;
/
select '0' as period_prev from dual;
prompt SET period_prev IS &PN_YEAR_PERIOD_PREV;
/
prompt SET end_date IS &BCY_DATE;

prompt SET new_foo IS &foo;
exit;            
            

Class Name/ Titel SOSSQLPlusJob  Start SQL*Plus client and execute sql*plus programs
  Auftragssteuerung Dieser Job kann durch Aufträge oder durch Job-Starts veranlasst ablaufen.
  Tasks unbounded
  Skript
  • Sprache: java
  • Name der Java-Klasse: sos.scheduler.db.SOSSQLPlusJobJSAdapterClass
  •  Ressource:
Konfiguration  

Dieser Job kann einzeln (eingenständig; stand-alone), außerhalb einer Job-Kette, oder auftragsgesteuert als Knoten innerhalb einer Jobkette verwendet werden. Die Parameter werden entsprechend als Job- oder Auftragsparameter von der Implementierung des Jobs interpretiert und verarbeitet.

Ein Job kann eine beliebige Anzahl Parameter haben, die vom JobSchedulder dem Job beim Job-Start an den Job übergeben werden. Parameter werden in der Konfigurationsdatei des Jobs bzw. des Auftrages oder über die entsprechenden API-Methoden definiert und mit Werten versorgt. Parameter sind entweder obligatorisch oder optional. Für einen Parameter kann ein Default-Wert vorgegeben sein. Der gilt dann, wenn der Parameter nicht angegeben wurde. Nicht alle Parameter haben einen Default-Wert.

Auftragsparameter überschreiben gleichnamige Job-Parameter.

  Parameter
ignore_ora_messages Default: ---
[optional] Datentyp: SOSOptionStringValueList in call_notes ignore_ora_messages

Als Wert dieses Parameters sind die Nummern der Oracle Fehlermeldungen, die nicht als Fehler interpretiert werden sollen, durch Semikolon getrennt, zu spezifizieren. Dabei ist der Text "ORA-" nicht anzugeben.

This parameter is introduced with version 1.3.12.2268

ignore_sp2_messages Default: ---
[optional] Datentyp: SOSOptionStringValueList in call_notes Zu ignorierende SQL*Plus Fehler

Als Wert dieses Parameters sind die Nummern der SQL*Plus Fehlermeldungen, die nicht als Fehler interpretiert werden sollen, durch Semikolon getrennt, zu spezifizieren. Dabei ist der Text "SP2-" nicht anzugeben.

This parameter is introduced with version 1.3.12.2268

shell_command Default: sqlplus.exe
[erforderlich] Datentyp: SOSOptionInFileName in call_notes Dateiname des SQL*Plus Clients

Der Wert dieses Parameters spezifiziert den Namen des SQL*Plus Clients, der für die Ausführung des SQL*Plus Codes verwendet werden soll.

Falls der Pfad-Name, in dem der Client installiert wurde, in der Path-Variablen enthalten ist, so kann die Angabe des Pfades entfallen. (Standard für eine Installation ist ${ORACLE_HOME}/bin).

sqlplus_script_file Default: ---
[optional] Datentyp: SOSOptionCommandString extdoc erkeannt langugage = de
db_url Default: ---
[erforderlich] Datentyp: SOSOptionString extdoc erkeannt langugage = de
variable_parser_reg_expr Default: ^SET\\s+([^\\s]+)\\s*IS\\s+(.*)$
[optional] Datentyp: SOSOptionRegExp extdoc erkeannt langugage = de
db_user Default: ---
[optional] Datentyp: SOSOptionUserName in call_notes Benutzer-ID des Datenbank-Benutzers Datenbank User
db_password Default: ---
[optional] Datentyp: SOSOptionPassword in call_notes Passwort des Datenbankbennutzers Datenbank Passwort
Command_Line_options Default: -S -L
[optional] Datentyp: SOSOptionString in call_notes Command_Line_options

Die Optionen, die das Verhalten des SQL*Plus Clients steuern, sind als Wert dieser Option anzugeben.

This parameter is introduced with version 1.3.12.2268

include_files Default: ---
[optional] Datentyp: SOSOptionString in call_notes IncludeFiles

Mit diesem Parameter können Code-Fragmente angegeben werden, die zusätzlich zum auszuführenden SQL*Plus Code, ausgeführt werden. Der SQL*Plus Code wird um den Code dieser Fragmente temporär vor der Ausführung erweitert. Es sind die Namen der Dateien anzugeben, durch Semikolon getrennt, die die Code-Fragmente enthalten. Der Inhalt der Dateien wird an den Anfang des SQL*Plus Codes eingefügt.

This parameter is introduced with version 1.3.12.2268

  Return Parameter
sql_error Default: ---
[optional] Datentyp: SOSOptionString in call_notes sql_error text

Kommt es bei der Ausführung des Codes zu einem (oder mehreren) Fehlern, so wird der Fehlertext auf dieser Variablen im Auftrag gespeichert. Ist kein Fehler aufgetreten so ist der Inhalt der Variablen leer.

This parameter is introduced with version

  Parameter
XML Code zur Konfiguration des Jobs
  <job
     title = "Start SQL*Plus client and execute sql*plus programs"
     order = "yes"  stop_on_error = "no" >

     <description>
       <include file = "jobs/SOSSQLPlusJob.xml" />
     </description>
    
     <params>
       <param name = "ignore_ora_messages" value = "" />
       <param name = "ignore_sp2_messages" value = "" />
       <param name = "shell_command" value = "sqlplus.exe" />
       <param name = "sqlplus_script_file" value = "" />
       <param name = "db_url" value = "" />
       <param name = "variable_parser_reg_expr" value = "" />
       <param name = "db_user" value = "" />
       <param name = "db_password" value = "" />
       <param name = "Command_Line_options" value = "-S -L" />
       <param name = "include_files" value = "" />
     </params>

     <script language   = "java"
             java_class = "sos.scheduler.db.SOSSQLPlusJobJSAdapterClass" >
     </script>
</job>
Releases 1.0 Version 1.7
2012-09-27 [ letzte Änderung 2012-09-27 ]
kb kb sos-berlin.com
Kommentar in call_notes Initiales Release
Ressourcen
Dateiname Typ OS Kommentar Source-Dokumentation
com.sos.scheduler-*.jar java all in call_notes

Source: com.sos.scheduler
com.sos.spooler-*.jar java all in call_notes

com.sos.settings-*.jar java all in call_notes

Klasse SOSProfileSettings

Source: com.sos.settings
com.sos.util-*.jar java all in call_notes
Klassen SOSFile, SOSSchedulerLogger
Source: com.sos.util
log4j-x.x.x.jar java all in call_notes

Apache log4j wird unter der Apache Lizenz 2.0 veröffentlicht und ist open source. Weitere Lizenzen der Apache Software Foundation finden Sie hier .

Die Dokumentation für dieses Paket ist zu finden unter logging.apache.org .

Copyright © 2011 The Apache Software Foundation. Licensed under the Apache Software License, Version 2.0.

Apache Extras Companion for Apache log4j, Apache log4j, Apache, the Apache feather logo, the Apache Logging Services project logo, the log4j logo, and the Built by Maven logo are trademarks of The Apache Software Foundation. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.

com.sos.VirtualFileSystem-*.jar java all in call_notes

Source: com.sos.VirtualFileSystem
com.sos.JSHelper-*.jar java all in call_notes

Source: JobSchedulerHelper

Documentation  

Der Job führt SQLPlus Skripte aus.

Class Name/ Title SOSSQLPlusJob  Start SQL*Plus client and execute sql*plus programs
  Order Control This job is triggered by orders or by standard job starts.
  Tasks unbounded
  Script
  • Language: java
  • Name of Java Class: sos.scheduler.db.SOSSQLPlusJobJSAdapterClass
  •  Resource:
Configuration  

This job can be used standalone, as a single job, or as an order driven job in a jobchain as a jobchain node. Parameters are respectively accepted as job- or as order-parameters.

A job can process multiple parameters that are analysed when the job starts. Parameters are defined in the configuration of the job or of the order. Parameters can be submitted by API methods, as well. Parameters are optional or mandatory and may contain default values.

  Parameters
ignore_ora_messages Default: ---
[optional] DataType: SOSOptionStringValueList in call_notes ignore_ora_messages

The value of this parameter are the numbers of the Oracle error messages that should not be interpreted as an error to specify. Multipe error numbers must be separated by a colon (;). Here the text "ORA-" is not specified.

This parameter is introduced with version 1.3.12.2268

ignore_sp2_messages Default: ---
[optional] DataType: SOSOptionStringValueList in call_notes Ignore SQL*Plus Errors

The value of this parameter are the numbers of the SQL*Plus error messages that should not be interpreted as an error to specify. Multipe error numbers must be separated by a colon (;). Here the text "SP2-" is not specified.

This parameter is introduced with version 1.3.12.2268

shell_command Default: sqlplus.exe
[required] DataType: SOSOptionInFileName in call_notes Name of the SQL*Plus Client executable

sqlplus_script_file Default: ---
[optional] DataType: SOSOptionCommandString extdoc erkeannt langugage = en SQL*Plus Script

The value of the parameter contains one or more lines ot text, which together describe an (SQL*Plus) script. Alternatively, the name of a file can be specified that contains the script.

db_url Default: ---
[required] DataType: SOSOptionString extdoc erkeannt langugage = en SID of the database connection

The database connection is formed with the parameters db_url, db_user and db_password: db_user/db_password@db_url, e.g.

               sys/sys_admin@localhost as sysdba
               
               scheduler/scheduler@scheduler
        
variable_parser_reg_expr Default: ^SET\\s+([^\\s]+)\\s*IS\\s+(.*)$
[optional] DataType: SOSOptionRegExp extdoc erkeannt langugage = en variable_parser_reg_expr

Die Ausgabe des SQLPLUS-Skript wird mit dem hier angegebene Ausdruck parsiert und die Treffer als Auftrag-Parameter zu Verfügung gestellt.

  • Der reguläre Ausdruck muss zwei Gruppen enthalten.
  • Die erste Gruppe bildet die Parameternamen und die zweite die Parameterwerte.

Der 'prompt'-Befehl im SQL+ liefert die Ausgabe. Hier ein Beispiel:


Set Echo on
WHENEVER SQLERROR EXIT SQL.SQLCODE
WHENEVER OSERROR EXIT FAILURE
prompt ready;
prompt foo = bar;
prompt SET hello IS world;
exit;

               
db_user Default: ---
[optional] DataType: SOSOptionUserName in call_notes User-ID of the database user database user
db_password Default: ---
[optional] DataType: SOSOptionPassword in call_notes Password of the database user database password
Command_Line_options Default: -S -L
[optional] DataType: SOSOptionString in call_notes Command_Line_options

The value of this parameter contains the options which are available for the SQL*PLUS client on the command-line.

This parameter is introduced with version 1.3.12.2268

include_files Default: ---
[optional] DataType: SOSOptionString in call_notes Include Code Fragments

This parameter can be specified for code fragments, which are additional to execute the SQL*Plus code. The SQL*Plus code is temporary extendes by these fragments. You must specify the names of files, separated by a semicolon, which contain the code fragments. The contents of the files will be temporaryl inserted at the beginning of the SQL*Plus codes.

This parameter is introduced with version 1.3.12.2268

  Return Parameters
sql_error Default: ---
[optional] DataType: SOSOptionString in call_notes sql_error text

If during the execution of the code one (or more) errors occurs, the error-text will be stored on this variable in the order. If no error occurs then the contents of the variable will remain empty.

This parameter is introduced with version

  Parameters
XML Code to configurate the job
  <job
     title = "Start SQL*Plus client and execute sql*plus programs"
     order = "yes"  stop_on_error = "no" >

     <description>
       <include file = "jobs/SOSSQLPlusJob.xml" />
     </description>
    
     <params>
       <param name = "ignore_ora_messages" value = "" />
       <param name = "ignore_sp2_messages" value = "" />
       <param name = "shell_command" value = "sqlplus.exe" />
       <param name = "sqlplus_script_file" value = "" />
       <param name = "db_url" value = "" />
       <param name = "variable_parser_reg_expr" value = "" />
       <param name = "db_user" value = "" />
       <param name = "db_password" value = "" />
       <param name = "Command_Line_options" value = "-S -L" />
       <param name = "include_files" value = "" />
     </params>

     <script language   = "java"
             java_class = "sos.scheduler.db.SOSSQLPlusJobJSAdapterClass" >
     </script>
</job>
Releases 1.0 Version 1.7
2012-09-27 [ Last Changes 2012-09-27 ]
kb kb sos-berlin.com
Comment in call_notes Initial Release
Resources
Filename Type OS Comment Source documentation
com.sos.scheduler-*.jar java all in call_notes

Source: com.sos.scheduler
com.sos.spooler-*.jar java all in call_notes

com.sos.settings-*.jar java all in call_notes

Class SOSProfileSettings, processing of init-files

Source: com.sos.settings
com.sos.util-*.jar java all in call_notes
Classes SOSFile, SOSSchedulerLogger
Source: com.sos.util
log4j-x.x.x.jar java all in call_notes

Apache log4j is licenced under the Apache License 2.0 and is open source. More infos about the licencing model of ASF (Apache Software Foundation) is available here .

Copyright © 2011 The Apache Software Foundation. Licensed under the Apache Software License, Version 2.0.

Apache Extras Companion for Apache log4j, Apache log4j, Apache, the Apache feather logo, the Apache Logging Services project logo, the log4j logo, and the Built by Maven logo are trademarks of The Apache Software Foundation. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.

com.sos.VirtualFileSystem-*.jar java all in call_notes

Source: com.sos.VirtualFileSystem
com.sos.JSHelper-*.jar java all in call_notes

Source: JobSchedulerHelper