From peter at fry-it.com Mon Jan 21 13:37:45 2008 From: peter at fry-it.com (Peter Bengtsson) Date: Mon Jan 21 13:37:13 2008 Subject: [egenix-users] unable to trace ODBC usage Message-ID: <4794A029.4060407@fry-it.com> I've got a DSN entry that looks like this in /etc/odbc.ini [VAUKLive_Dev] Driver = FreeTDS Description = Connecting to VAUKLive_dev Trace = Yes TraceFile = /tmp/vauklive_dev-freetds.log Server = 172.24.66.6 Database = VSODMS1_3 Pooling = No I've tried restarting Apache, restarting Zope and opening, closing, opening and using the connection object in Zope. Nothing starts the trace. The file /tmp/vauklive_dev-freetds.log is never written! To prove to myself that this is the right DSN and the right server and config file and everything I changed "Database = VSODMS1_3" to "Database = VSODMS1_3XXXXX" and then I get an obvious error when trying to open the connection. Any idea anyone? -- Peter Bengtsson, work www.fry-it.com home www.peterbe.com hobby www.issuetrackerproduct.com From mal at egenix.com Mon Jan 21 14:32:39 2008 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 21 14:32:43 2008 Subject: [egenix-users] unable to trace ODBC usage In-Reply-To: <4794A029.4060407@fry-it.com> References: <4794A029.4060407@fry-it.com> Message-ID: <47949EF7.6090409@egenix.com> On 2008-01-21 14:37, Peter Bengtsson wrote: > I've got a DSN entry that looks like this in /etc/odbc.ini > > [VAUKLive_Dev] > Driver = FreeTDS > Description = Connecting to VAUKLive_dev > Trace = Yes > TraceFile = /tmp/vauklive_dev-freetds.log > Server = 172.24.66.6 > Database = VSODMS1_3 > Pooling = No > > > I've tried restarting Apache, restarting Zope and opening, closing, > opening and using the connection object in Zope. Nothing starts the > trace. The file /tmp/vauklive_dev-freetds.log is never written! While ODBC drivers are supposed to use those config settings in the odbc.ini file, many of them don't. In those cases it is usually better to enable logging at the ODBC manager level: /etc/odbcinst.ini: [ODBC] Trace = On TraceFile= /tmp/sql.log You can also enable tracing in FreeTDS: /etc/freetds.ini: [global] ... # Whether to write a TDSDUMP file for diagnostic purposes # (setting this to /tmp is insecure on a multi-user system) dump file = /tmp/freetds.log debug level = 10 > To prove to myself that this is the right DSN and the right server and > config file and everything I changed "Database = VSODMS1_3" to > "Database = VSODMS1_3XXXXX" and then I get an obvious error when > trying to open the connection. > > > Any idea anyone? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 21 2008) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ :::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,MacOSX for free ! :::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 From peter at fry-it.com Mon Jan 21 16:09:18 2008 From: peter at fry-it.com (Peter Bengtsson) Date: Mon Jan 21 16:08:48 2008 Subject: [egenix-users] unable to trace ODBC usage In-Reply-To: <47949EF7.6090409@egenix.com> References: <4794A029.4060407@fry-it.com> <47949EF7.6090409@egenix.com> Message-ID: <4794C3AE.5040402@fry-it.com> M.-A. Lemburg wrote: > On 2008-01-21 14:37, Peter Bengtsson wrote: >> I've got a DSN entry that looks like this in /etc/odbc.ini >> >> [VAUKLive_Dev] >> Driver = FreeTDS >> Description = Connecting to VAUKLive_dev >> Trace = Yes >> TraceFile = /tmp/vauklive_dev-freetds.log >> Server = 172.24.66.6 >> Database = VSODMS1_3 >> Pooling = No >> >> >> I've tried restarting Apache, restarting Zope and opening, closing, >> opening and using the connection object in Zope. Nothing starts the >> trace. The file /tmp/vauklive_dev-freetds.log is never written! > > While ODBC drivers are supposed to use those config settings in > the odbc.ini file, many of them don't. > > In those cases it is usually better to enable logging at the ODBC > manager level: > > /etc/odbcinst.ini: > > [ODBC] > Trace = On > TraceFile= /tmp/sql.log Tried that too. Restarted Zope, restarted Apache and re-opened the connection inside Zope but nothing happens. Could it be that I'm lacking the program that does the actual tracing? What is it that causes a re-read of the configs in odbc.ini and odbcinst.ini? > > You can also enable tracing in FreeTDS: > > /etc/freetds.ini: > > [global] > ... > # Whether to write a TDSDUMP file for diagnostic purposes > # (setting this to /tmp is insecure on a multi-user system) > dump file = /tmp/freetds.log > debug level = 10 That worked at least but the trace wasn't very helpful. The file managed to grow to 2.5M on one test! -- Peter Bengtsson, work www.fry-it.com home www.peterbe.com hobby www.issuetrackerproduct.com From mal at egenix.com Mon Jan 21 17:36:56 2008 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 21 17:37:01 2008 Subject: [egenix-users] unable to trace ODBC usage In-Reply-To: <4794C3AE.5040402@fry-it.com> References: <4794A029.4060407@fry-it.com> <47949EF7.6090409@egenix.com> <4794C3AE.5040402@fry-it.com> Message-ID: <4794CA28.80705@egenix.com> On 2008-01-21 17:09, Peter Bengtsson wrote: > > > M.-A. Lemburg wrote: >> On 2008-01-21 14:37, Peter Bengtsson wrote: >>> I've got a DSN entry that looks like this in /etc/odbc.ini >>> >>> [VAUKLive_Dev] >>> Driver = FreeTDS >>> Description = Connecting to VAUKLive_dev >>> Trace = Yes >>> TraceFile = /tmp/vauklive_dev-freetds.log >>> Server = 172.24.66.6 >>> Database = VSODMS1_3 >>> Pooling = No >>> >>> >>> I've tried restarting Apache, restarting Zope and opening, closing, >>> opening and using the connection object in Zope. Nothing starts the >>> trace. The file /tmp/vauklive_dev-freetds.log is never written! >> >> While ODBC drivers are supposed to use those config settings in >> the odbc.ini file, many of them don't. >> >> In those cases it is usually better to enable logging at the ODBC >> manager level: >> >> /etc/odbcinst.ini: >> >> [ODBC] >> Trace = On >> TraceFile= /tmp/sql.log > > Tried that too. Restarted Zope, restarted Apache and re-opened the > connection inside Zope but nothing happens. > > Could it be that I'm lacking the program that does the actual tracing? > What is it that causes a re-read of the configs in odbc.ini and > odbcinst.ini? Are you using unixODBC or iODBC as ODBC manager ? They both have different locations where they look for an odbcinst.ini which also depends on the system you're using them on. To find out where they are looking for the file, it's best (but also very low-level) to do an strace and then search of the file name. >> You can also enable tracing in FreeTDS: >> >> /etc/freetds.ini: >> >> [global] >> ... >> # Whether to write a TDSDUMP file for diagnostic purposes >> # (setting this to /tmp is insecure on a multi-user system) >> dump file = /tmp/freetds.log >> debug level = 10 > > That worked at least but the trace wasn't very helpful. The file managed > to grow to 2.5M on one test! The ODBC log won't be a lot smaller. BTW: Why do you need to log the ODBC usage ? Are you having trouble with FreeTDS ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 21 2008) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ :::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,MacOSX for free ! :::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611