Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Sergio Peres could not get exclusive database access because dirty-read and sysmaster sessions lingered. Art Kagel suggested running RENAME DATABASE from sysmaster with SET LOCK MODE TO WAIT so the rename runs once locks clear, then renaming back after the work. Sergio confirmed it worked perfectly. David Williams added using onstat -g opn to find sessions with the partitions open.
Auto-generated by Claude from the posts below — may be imperfect; read the full thread.
Sergio Peres — source: IBM Community (ConnectedCommunity.org) Informix forum
Hi,
I am having trouble making changes to some databases, I use a procedure that searches through syssessions and terminates all connections.
However I have noticed that some dirty reads sessions and also sometimes connections to sysmaster:sysdatabases remain.
If I run database <db> exclusive on my connection I get an error??!!
I would appreciate some help, as I have servers with multiple databases and putting the engine in single user mode is causing some problems.
Thanks in advance,
SP
------------------------------
Sergio Peres
AIRC
Coimbra
------------------------------
#Informix
↪ replying to Sergio Peres
Art Kagel — source: IBM Community (ConnectedCommunity.org) Informix forum
Do this in a single script:
dbaccess sysmaster - <<EOF
SET LOCK MODE TO WAIT; -- infinite waitRENAME DATABASE mydatabase TO mydatabase_locked;
EOF
Voila! As soon as all locks are removed from 'mydatabase' the rename will execute and you can do whatever you need to do before renaming it back.
------------------------------
Art S. Kagel, President and Principal Consultant
ASK Database Management Corp.
www.askdbmgt.com
------------------------------
↪ replying to Art Kagel
Sergio Peres — source: IBM Community (ConnectedCommunity.org) Informix forum
Thanks for help Art, it works perfect.
Best regards,
SP
------------------------------
Sergio Peres
AIRC
Coimbra
------------------------------
↪ replying to Sergio Peres
David Williams — source: IBM Community (ConnectedCommunity.org) Informix forum
Hi,
Use onstat -g opn to find sessions with relevant partitions open.
Regards,
David.
------------------------------
David Williams
------------------------------
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.