dbaccess: Connect to Servers
Answered: green (solid confidence) — dbaccess takes its server list from the sqlhosts file (or INFORMIXSQLHOSTS); Khaled corrected the suggestion that the menu uses sysmaster:syssqlhosts, which is only an equivalent query after connecting. The asker thanked all.
Advisory only.
Posted in 2020
Saradhi Motamarri asked where the dbaccess Connection menu gets its list of servers. Paul Watson and Khaled Bentebal said it reads the sqlhosts file (or the one named by INFORMIXSQLHOSTS). Art Kagel suggested SELECT * FROM sysmaster:syssqlhosts; Khaled noted the menu does not use that, but Art said the query is easier for getting the same information. Answered.
Topics: Server Administration
Hi All,
In dbaccess when we traverse to 'Connection' tab, it lists a set of Informix Servers available.
From where does dbaccess picks up this available servers?
#Informix
AFAIR sqlhosts Paul Watson Oninit LLC +1-913-387-7529 www.oninit.com Oninit® is a registered trademark of Oninit LLC
It reads the sqlhosts file in the etc directory or the file indicated in the $INFORMIXSQLHOSTS environment variable if that is set -- Cordialement, Regards, Khaled Bentebal Email: khaled.bentebal@consult-ix.fr Site Web: www.consult-ix.fr
Saradhi:
SELECT * FROM sysmaster:syssqlhosts;Art
Art S. Kagel, President and Principal Consultant
ASK Database Management
www.askdbmgt.com
Blog:
http://informix-myview.blogspot.com/
Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves.
Hi Paul, Khaled and Art, Thank you.
Art:
The Connection menu option of dbaccess does not use the query:
SELECT * FROM sysmaster:syssqlhosts;The connection menu option uses the sqlhosts file since there is no connection yet at that point. Once you establish a connection(SID and TID), you can use an SQL query that will be analyzed by the sqlexec parser.
You need to first have a session in the SCB and a thread in the TCB in order for the sqlexec thread to execute an SQL instruction. The connection menu option always reads the sqlhosts file directly. Even if you do not have the sysmaster:syssqlhosts pseudo table (possible sometimes if the sysmaster is not there), the connection menu option works and lists the contents of the sqlhosts file.
It is true that the
SELECT * FROM sysmaster:syssqlhosts;reads the contents of the sqlhosts file after the connection is performed
-- Khaled Bentebal Email:
khaled.bentebal@consult-ix.fr
Site Web:
www.consult-ix.fr
Khaled:
Your point in valid and well taken, dbaccess menus do not use sysmaster but read in sqlhosts file itself. However, I think that Saradhi's question went to how he could get the same information and it is far easier to read sysmaster:syssqlhosts than to parse the file directly.
Art
Art S. Kagel, President and Principal Consultant
ASK Database Management
www.askdbmgt.com
Blog:
http://informix-myview.blogspot.com/
Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves.