http://www.oracle.com/ is the home page for Oracle Corporation, one of the leaders in the [RDBMS] field. A book by the title: Exploring Oracle (2000) talks about Tcl with Oracle's [OEM] as well as mentions it in some other chapters. [[A Wiki page for this book is needed once more details are available.]] Authors: Lisa Lenos (ed) Publisher: Element K Press Publication date: 2000 There's also [BOOK Oracle and Open Source]. http://www.purl.org/NET/Tcl-FAQ/part2.html says: Full Oracle 9i documentation about Tcl can be found at http://download-west.oracle.com/otndoc/oracle9i/901_doc/em.901/a88771/chap4.htm#46268 (''[escargo] 21 Aug 2007'' - I got a 404 when I tried that link. I did a search and found this link, but it's probably not equivalent: http://download-east.oracle.com/docs/html/A95412_01/chap4.htm#46281) (but see also [Oracle Documentation] for other documents from OTN and Metalink) and later it mentions: o Tcl Database Developers Mailing List This mailing list is for discussion announcements, and general info for Tcl programmers using database APIs. This includes Oracle, Sybase, Ingres, and other commercial DB engines as well as PG95, miniSQL, and also "micro" DBs and pseudo-DBs. Please do not send WISQL or WOSQL bug reports to this list; it is for developer rather than end-user issues. To subscribe to this list send mail to mailto:tcldb-request@ucolick.org and in the body of the message write subscribe Follow the same procedure, but use the word unsubscribe, when you wish to leave the mailing list. Please remember to write to mailto:tcldb-owner@ucolick.org with problems about the list itself, or to mailto:postmaster@ucolick.org if you have difficulties getting through to the tcldb-owner address. Please do not send subscribe and unsubscribe messages to the list itself. This mailing list is for discussion announcements, and general info for Tcl programmers using database APIs. This includes Oracle, Sybase, Ingres, and other commercial DB engines as well as PG95, miniSQL, and also "micro" DBs and pseudo-DBs. Please do not send WISQL or WOSQL bug reports to this list; it is for developer rather than end-user issues. In http://www.purl.org/NET/Tcl-FAQ/part4.html we see: What: ArsDigita Community System Where: http://openacs.com/ http://arsdigita.com/ http://arsdigita.com/free-tools/oracle-driver.html http://www.arsdigita.com/bboard/q-and-a?topic%5fid=21&topic=web%2fdb http://www.arsdigita.com/acs-repository/ http://dev.arsdigita.com/acs40/ldap-authentication.html http://software.arsdigita.com/ http://photo.net/doc/ http://photo.net/wtr/thebook/community.html http://acspg.benadida.com/ http://www.ybos.net/ http://larsdigita.com/software/ldap-in-general.html http://larsdigita.com/tmp/adldap.tgz Description: An AOLserver/ORACLE based Tcl web application that provides users with forums and other web based applications. The ArsDigita Community System (ACS) is an database backed web collaboration tool originally written for Oracle and also ported to InterBase DBMS, release 4.0, available on Linux at no charge. ACS operates on top of AOLServer, a free HTTP server. Now includes the source for the Oracle driver as well as the nscache, nsrewrite, and nssha1 modules. Source is available and binaries for Redhat Linux and Solaris are available. A Windows version is being developed. Information regarding exporting of Tcl wrappers for OpenLDAP compliant libraries is available on arsdigita, with more info and code on larsdigita. The Ybos web page has new ArsDigita modules for group scoping, event planning and content management. A version based on PostgreSQL is available at benadida. ArsDigita has their own release of AOLserver (v3.2+ad10), as well as Oracle drivers, etc. See the acs-repository URL. Recently ArsDigita moved to a Java based distribution. However, the OpenACS project took over the Tcl based software from what I understand. OpenACS is at version 3.2.5 with a version 4 b2 in testing. Updated: 06/2001 Contact: mailto:acs-bugs@arsdigita.com What: C-Forge IDE Where: http://www.codeforge.com/ http://www.codeforge.com/linux/download.html Description: Multi-user integrated development environment with full project management, edit/compile/debug cycle support, abstraction of the makefile concept, and support for Ada, assembler, C/C++, FORTRAN, Java, Modula-2, Oracle ProC/C++, Objective C, Pascal, Perl, PHP, Python, Qt, and Tcl. Both a free and commercial version of this product is available. Available on Linux Intel and Alpha platforms, as well as DEC Tru64 and AIX. The latest version is 2.0 . Updated: 04/1999 Contact: mailto:consult@codeforge.com What: datavision Where: ftp://ftp.procplace.com/pub/tcl/sorted/packages-7.6/graphics/dv1.0b/dv1.0b.tar.gz Description: DataVision is a window surfaced table plotting program based on Tcl 7.3/Tk 3.6/tclX. Supports 2-D diagrams. Has been tested with Windowing Oracle SQL (wosql) v2.2 as well. Updated: 02/1997 Contact: mailto:boese@ipf.bau-verm.uni-karlsruhe.de (Michael Boese) What: ODDIS (Oracle Data Dictionary Information System) Where: ftp://ftp.informatik.uni-hannover.de/software/oddis-2.11.tar.gz Description: ODDIS shows most of the static information about the Oracle V7 Data Dictionary. When you click on a database object, the tool displays detailed information about it in a formatted output window. One can perform ANALYZE, EXPLAIN and other SQL commands in a gui window. One can create tables with information about physical devices. One can see constraints and comments. Execution of PL/SQL blocks is now supported. Display of user lists, all objects, free space summaries, tablespaces, rollback segments, data files, roles, etc. are available. Contact: mailto:oddis@informatik.uni-hannover.de (ODDIS team) What: Oracle wrap for Tcl/Tk Where: ftp://ftp.cad.gatech.edu/pub/tk/oracle.tar.Z Description: A simple ORACLE wrap that implements SQL commands in Tcl/Tk. Contact: mailto:mhale@cad.gatech.edu (Mark Andrew Hale) What: Sibylla Where: http://www.cib.unibo.it/guests/ariadne/sibylla/ Description: An application development framework for WWW based applications. Sibylla allows access to data stored in databases, indexed HTML files, or, in general to data management by a server-side application. Sibylla 2.0 supports BasisPlus, Informix, Ingres, Microsoft SQL Server, mSQL, Oracle, and Sybase. The WWW interface module for Sibylla is free. The various database modules have varying prices depending on the database. See the WWW site for details. Updated: 11/1996 Contact: mailto:ricotti@ariadne.it (Ing. M.Ricotti) What: StepTool Where: ftp://ce-toolkit.crd.ge.com/pub/tcl/step_tool.tar.Z Description: Lockheed Martin tracking software for development and test results of software systems. Uses Oracle. Updated: 08/1998 Contact: Unknown and http://www.purl.org/NET/Tcl-FAQ/part5.html What: [debbie] Where: http://www.davudsplace.net/debbie1.html Description: Oracle database extension with a Tclish orientation; contact indicates that it might be able to be abstracted for use with other DBMS. Updated: 09/2000 Contact: mailto:dmayx@intel.com What: nstcl Where: http://michael.cleverly.com/aolserver/nstcl Description: Tcl package that implements the AOLserver's ns_db API. The current version supports Oracle 8 (by wrapping calls to Oratcl 3.0), Postgres 7 (via pgtclsh), and Solid (via Soltcl). The current version (as of August 1, 2000) is 0.3 Updated: 08/2000 Contact: mailto:michael@cleverly.com (Michael A. Cleverly) [oratcl] What: Oracle extension to Tcl. Where: http://oratcl.sourceforge.net/ http://sourceforge.net/projects/oratcl/ ftp://ftp.procplace.com/pub/tcl/sorted/packages-7.6/databases/oratcl-2.5/oratcl-2.5.tar.gz ftp://ftp.procplace.com/pub/tcl/sorted/packages-8.0/distrib/cvs-oratcl.tar.gz http://people.a2000.nl/hkooiman/Oratcl http://technet.oracle.com/ Description: Provide access to a Oracle (versions through 6-11g) Database server from within Tcl. OraTcl 3 and up supports Tcl 8 (tclX recommended), and supports Tcl 8.x, includes Windows NT DLLs, cursor variables from PL/SQL, can bind Tcl variables to orafetch results, can bind Tcl variables to Oracle :bind variables, supports asynchronous SQL execution. It supports Tcl/Tk 8.x, Oracle 7/8/8i/9i/10g/11g, i18n data, and TEA/Stubs as well as Solaris and Windows NT. OraTcl 2.5 was the last version to support Tcl 7.6. The a2000 site has information relating to a Macintosh port of Oratcl. Oracle has released a version of its 8.0.5 database product for Linux at the oracle web site. Currently the version is 4.4 . Updated: 09/2001 Contact: mailto:thelfter@gmail.com (Todd M. Helfter) mailto:tpoindex@nyx.net (Tom Poindexter) What: RDB extension Where: ftp://ccfadm.eeg.ccf.org/pub/ctk/rdb.tar.Z Description: Tcl extension for the portable Relational Database Package. Based loosely on DBperl. Can support modules such as informix, oracle, ingres, etc. but only provides informix. Updated: 11/1996 Contact: mailto:andrewm@ccfadm.eeg.ccf.org (Martin Andrews) What: Tk login window Where: http://ftp.res.bbsrc.ac.uk/pub/tcl-tk/login.tcl http://ftp.res.bbsrc.ac.uk/pub/tcl-tk/password.tcl Description: A Login and Password proc for logging into ORACLE. Could be adapted for other types of login needs. Updated: Contact: mailto:Andy.Caiger@bbsrc.ac.uk (Andy Caiger) What: Explain Where: http://www.cpan.org/authors/id/ABURLISON/Explain-1.0.tar.gz Description: GUI tool to enable visualizing Oracle Query plans. Requires perl, DBI/DBD::Oracle and Tk 8. Updated: 03/1999 Contact: mailto:alan.burlison@UK.Sun.com (Alan Burlison) What: Orac Where: ftp://ftp.funet.fi/pub/languages/perl/CPAN/authors/id/A/AN/ANDYDUNC/ Description: pTk extension and program integrating databases and Perl/Tk. Requires perl 5.005_02, DBI-1.13, Tk800.015, relevant DBD drivers. Works with Oracle, Informix, Sybase, etc. Currently at v1-1-31. Updated: 09/1999 Contact: mailto:andy_j_duncan@yahoo.com (Andy Duncan) ----- [LV] Note that Oracle is now at version 11. Somewhere around version 10, they quit shipping a tcl component, but apparently still have some vestiges of tcl references in some of the materials. This is going to go away... ----- I want to capture the status of the Oracle Intelligent Agent in a Unix-Solaris server. When you issue the command: agentctl stat the following text shows on the server: tmefndr /export/home/oracle> agentctl stat DBSNMP for Solaris: Version 9.2.0.6.0 - Production on 19-AUG-2005 16:52:07 Copyright (c) 2003 Oracle Corporation. All rights reserved. Version : DBSNMP for Solaris: Version 9.2.0.6.0 - Production Oracle Home : /oracle_home/app/oracle/product/9.2.0 Started by user : oracle Agent is running since 08/19/05 07:50:34 I have the following TCL script but I don't know if it is correct or not. if {[catch {glob "agentctl stat"}] == 'Agent is running'} { puts YES puts -1 } else { puts NO puts 2 } When the Oracle Intelligent agent is not running on the server the following shows on the server after a "agentctl stat" command: tmefndr /export/home/oracle> agentctl stat DBSNMP for Solaris: Version 9.2.0.6.0 - Production on 19-AUG-2005 17:01:56 Copyright (c) 2003 Oracle Corporation. All rights reserved. Could not contact agent. It may not be running. [MG] The [glob] command actually returns a list of files in a folder, it doesn't check to see if a program is running, or run a program. I think something like this should work for you - the [exec] command here runs "agentctl stat", and the text it returns is saved into the "text" variable. set err [catch {exec "agentctl stat"} text] if { !$err && [string match "*Agent is running*" $text] } { # running puts "YES" puts "-1" } else { # not running puts "NO" puts "2" } [LC] The script you suggested failed with this error message: Event test "User Defined Event" failed: Failed to orasecureexec /oracle_home/app/oracle/product/9.2.0/network/agent/jobout/ude18 : Process launch failure:: Exec format error The script that failed is this: set err [catch {exec "agentctl stat"} text] if { !$err && [string match "*Agent is running*" $text] } { # running puts "YES" puts "-1" } else { # not be running puts "NO" puts "2" } What can be wrong ? - That doesn't look like a Tcl err mesg. The 'exec' appears to be being interpreted by the application. Did you include the [exec magic] to run the script in a Tcl interpreter? [RJ] - Thanks for the reply. I have run the script the script in the $ORACLE_HOME/bin directory and invoked the oratclsh interpreter which is a tcl interpreter from Oracle. Now it is returning the wrong result, see below: oratclsh[1]- set err [catch {exec magic "agentctl stat"} text] if { !$err && [string match "1 oratclsh[2]- *Agent is running*" $text] } { # running puts "YES" puts "-1" } else { # not be running puts "NO" puts "2" } NO 2 oratclsh[3]- tmefndr /oracle_home/app/oracle/product/9.2.0/bin> agentctl stat DBSNMP for Solaris: Version 9.2.0.6.0 - Production on 30-AUG-2005 10:42:47 Copyright (c) 2003 Oracle Corporation. All rights reserved. Version : DBSNMP for Solaris: Version 9.2.0.6.0 - Production Oracle Home : /oracle_home/app/oracle/product/9.2.0 Started by user : oracle Agent is running since 08/30/05 10:26:45---------------------------------> See - The Oracle agent is running tmefndr /oracle_home/app/oracle/product/9.2.0/bin> Mike's snippet works. I tested it by copying the above output to a file and [exec]ing a 'cat' of the file. The string match isn't matching in the example you give, so you have to play with it til it does. What is the number '1' doing in the string match, and why did the interpreter inject a prompt right after it in the middle of the command? Figure that out and the code will work fine. [RJ] - I have modify the script but it is still returning the wrong results, see below: oratclsh[1]- [set err [catch {exec magic "agentctl stat"} text] if { !$err && [string match "*is running since*" $text] } { # running puts "YES" puts "-1" } else { # not be running puts "NO" puts "2" }] NO 2 empty command name "" The oracle agent is running, see below: tmefndr /oracle_home/app/oracle/product/9.2.0/bin> agentctl stat DBSNMP for Solaris: Version 9.2.0.6.0 - Production on 31-AUG-2005 10:18:07 Copyright (c) 2003 Oracle Corporation. All rights reserved. Version : DBSNMP for Solaris: Version 9.2.0.6.0 - Production Oracle Home : /oracle_home/app/oracle/product/9.2.0 Started by user : oracle Agent is running since 08/30/05 11:43:17 [LC] - Ok, I have modified the script again and it function now, but........... I cannot get to start the oracle agent, can anyone help ? #!/oracle_home/app/oracle/product/9.2.0/bin/oratclsh set errMsg2 "" if {[catch {exec agentctl stat} errMsg2] == 0} { # running puts "YES" puts "-1" } else { # not be running puts "NO" puts "2" {exec magic agentctl start} } The result is the following : tmefndr /export/home/oracle> ./test.sh NO 2 invalid command name "exec magic agentctl start" - This I have tested also with {exec agentctl start} and also "exec agentctl start" , with no success. You don't need braces or quotes - just: exec agentclt start The braces were to make the command into a list for the [catch] command. By the way, "exec magic" is not a command. Click on this: [exec magic]. - I tested without the brace/quotes but it goes to a "limbo state" , it does nothing and it don't terminate either, it just stays there: set errMsg2 "" set agentrunning 0 while {!$agentrunning} { if {[catch {exec agentctl stat} errMsg2] == 0} { # running puts "YES" puts "-1" set agentrunning 1 } else { # not running puts "NO" puts "2" set agentrunning 0 exec agentctl start & ;#<===the ampersand char will start the agent in the background and free up your shell. sleep 5 ;#<===to give it time to start - if multiple agents start, increment this number } } Dude. Just copy/paste the above into your interpreter. ---- ''[escargo] 21 Aug 2007'' - The issue is muddied somewhat because Oracle also has a ''Transaction Control Language'' (so it's also abbreviated as TCL). (See http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28370/static.htm#BABICCHJ). [EMJ] Well, no it doesn't, really. That reference is only a short note about the statements used to control transactions in SQL or PL/SQL, i.e. transaction control language with no capitals! There is no specific language involved. I consider the section heading '''Transaction Control Language (TCL) Statements''' to be a documentation bug and I intend to raise it as such - the abbreviation should not be there. This is the only such use of it in the entire Oracle documentation set. ''[escargo]'' - I certainly don't mind if it's clarified, but searching through Oracle on-line docs for the right '''Tcl''' gets just a little harder when there is a clash like that. ---- [Category Database]