published by whitemice on Mon, 04/08/2019 - 16:10
The current database locks in an Informix engine are easily enumerated from the sysmaster database.
SELECT
TRIM(s.username) AS user,
TRIM(l.dbsname) AS database,
TRIM(l.tabname) AS table,
TRIM(l.type) AS type,
s.sid AS session,
l.rowidlk AS rowid
FROM sysmaster:syslocks l
INNER JOIN sysmaster:syssessions s ON (s.sid = l.owner)
WHERE l.dbsname NOT IN('sysmaster')
ORDER BY 1;
The results are pretty straight forward:
published by whitemice on Sat, 09/08/2018 - 16:05
Exporting records from an Informix table is simple using the UNLOAD TO command. This creates a delimited text file with a row for each record and the fields of the record delimited by the specified delimiter. Useful for data archive the files can easily be restored or processed with a Python script.
published by whitemice on Sun, 05/06/2018 - 16:23
I ran into an interesting issue when using SQLAlchemy 0.7.7 with the Informix dialect. In a rather ugly database (which dates back to the late 1980s) there is a table called "xrefr" that contains two types of records: "supersede" and "cross". What those signify doesn't really matter for this issue so I'll skip any further explanation. But the really twisted part is that while a single field distinquishes between these two record types - it does not do so based on a consistent value.
published by whitemice on Wed, 01/17/2018 - 15:56
It is possible using the dbinfo function to retrieve the engine's version information via an SQL command:
select dbinfo('version','full') from sysmaster:sysdual
which will return a value like:
IBM Informix Dynamic Server Version 12.10.FC6WE
published by whitemice on Thu, 09/15/2016 - 15:46
Determine the DATE of the first day of the current week.
(SELECT TODAY - (WEEKDAY(TODAY)) UNITS DAY FROM systables WHERE tabid=1)
Informix always treats Sunday as day 0 of the week. The WEEKDAY function returns the number of the day of the week as a value of 0 - 6 so subtracting the weekday from current day (TODAY) returns the DATE value of Sunday of the current week.
published by whitemice on Wed, 02/08/2012 - 00:00
Step#1 : Install the Informix SDK / Client
published by whitemice on Tue, 02/07/2012 - 06:29
Yesterday I posted about how to identify the hottest table in a PostgreSQL database. Pretty much the same functionality is available for administrators of Informix databases as well; this kind of information is found in the sysmaster database which is the database engine's own database.