Note that unlike some of the other RDBMSes, SQL Anywhere does not have a "master database" so you cannot get a list of all databases that are on a computer. Once you are connected to a server you can get the list of all databases running on the server to which you are connected by using
See the documentation for more information. answered 04 Apr '11, 16:13 Mark Culp Awesome, thanks Mark, would work for me ! Must say this is thus far the fastest reply I got on any forum :)
(04 Apr '11, 16:24)
manish12
Replies hidden
I've tried this on our v10.0.1.3960 databases and all I get is the database I'm connected to, am I missing something obvious ?
(04 Apr '11, 16:54)
Daz Liquid
Replies hidden
Daz ,combination of these two queries works for me,via jdbc call
(04 Apr '11, 17:35)
manish12
I think Mark's select would do the same but show it in rows rather than columns (and without the risk of you trying to query a database that wasn't in the results from sa_db_list), the problem I have is sa_db_list() is only returning one database. Unless (as I said before) I'm missing something simple.
(04 Apr '11, 17:40)
Daz Liquid
The nice thing about this forum is that you can sign up to get an email anytime a new question is ask (or a number of other events). Hence it is easy to "monitor" the forum without actually doing anything since my email client will tell me when I get new email :-)
(04 Apr '11, 18:01)
Mark Culp
2
This will only show you databases running on the current engine/server. If you have multiple instances of SQL Anywhere running, they will need to be queried per-server.
(04 Apr '11, 18:55)
Tyson Lewis
doh, I'd forgotten you could start them up with one dbsrv, we've always used one database per dbsrv. Thanks Tyson.
(05 Apr '11, 03:51)
Daz Liquid
|
In addition to Mark's SQL query, the dblocate utility can show you everything that's visible on the network: This command... "%SQLANY12%bin32dblocate.exe" -dv -o dblocate.txt produced this file on my workstation... SQL Anywhere Server Enumeration Utility Version 12.0.1.3298 Server Name Address ----------- ------- benchmark Envy:2638 It is possible for servers to hide from dblocate by starting with the dbsrv12 -sb 0 option. answered 04 Apr '11, 16:34 Breck Carter Thanks Breck, will keep this one handy too.:)
(04 Apr '11, 16:40)
manish12
That's some fine silverware :-)
(04 Apr '11, 16:58)
Daz Liquid
Replies hidden
@Daz: ah, the joys of Family Tech Support :)
(05 Apr '11, 05:43)
Breck Carter
|