I have Sybase installed on my Linux box (to which I have "root" access). However I do not have the access details to Sybase, is there any way I can find the port Sybase is listening on, and also use linux root user to connect to the database.
You should check sybase interface file at the first.
Read f.e. this article about interface file structure.
http://www.outlands.demon.co.uk/sybase/index.html
After that copy env. variables from sybase user bash profile ant try to connect to database with isql utility (also explained in this article).
Related
"SELECT name FROM master.sys.databases WHERE name NOT IN ('master', 'tempdb', 'model', 'msdb')"
In SQL server this above command used to retrieve the database list.
similarly, what is the command to retrieve the database list in DB2 using python program?
db2 server platform : windows
database : catalogued
With Db2-LUW, you do not use SQL to detect which databases are available, instead that is done via commands, although other methods are available.
For Db2-LUW with catalogued databases, you can use python to read the database directory by parsing the output of the command db2 list db directory assuming that you have a Db2-client which includes the db2 command line processor.
Note that non-IBM (third party) Db2-clients might have other functionality, so this answer only concerns Db2 clients supplied from IBM that include the Db2 CLP program.
You will need to understand the legacy concepts of catalogued databases , all of which are explained in the free online Db2 Knowledge Centre. See commands (non-SQL) list database directory and catalog database and catalog tcpip node etc.
If your databases are not catalogued in the database directory, but instead are configured in XML file called db2dsdriver.cfg or equivalent, then you cannot use this method, although you can parse the XML file looking for DATABASE and DSN stanzas.
Additionally, if your databases are on i-series , then different considerations apply for IBM i access databases.
There is a sample code here, in the function query_sdb_dir (you can parse the output of the command db2 list db directory ). BUT this assumes that you have a Db2 client installed that includes the Db2 CLP (i.e on MS-Windows, that you have db2.exe on the PATH, this is the command line processor CLP). By default with Python ibm_db you do not get this executable because it is not part of the tiny footprint CLIDRIVER that comes by default with the python ibm_db module. But you can first install a Db2-driver that includes the CLP (db2.exe on MS-Windows), set environment variable IBM_DB_HOME to point to its installation location, then pip install ibm_db and it will use your pre-existing Db2-driver and will not install the default clidriver.
There are other ways, typically that involve a database connection and using the monitoring functionality. But the discovery action (without a database connection) seems to be the topic of your question.
The following statement (if you have permissions to use these table functions) returns a list of active databases managed by the same Db2 for LUW instance, which manages the database you are connected to.
-- Preferred method since Db2 9.7
SELECT DISTINCT DB_NAME
FROM TABLE (MON_GET_MEMORY_SET ('DATABASE', NULL, -2))
-- For Db2 versions before 9.7
SELECT DISTINCT DB_NAME
FROM TABLE (SNAP_GET_DB (NULL))
You won't see non-active databases (if any) in this list.
I have a website, which is powered by an SQLite database (essentially a db file). Sometimes it is required to look at my database from other machines (within the same local network). For that purpose I currently use sqlite-web which provides a mini SQL web viewer into my db file.
Since sqlite-web's functionality is quite limited, I am wondering whether there are ways to let other machines connect to my local db file via normal desktop applications (such as DataGrip). Similar to how one can connect to postgres via jdbc:postgresql://host:port. Or is this not possible with SQLite?
Edit: I would like to limit the access (e.g. via username + password or a generic PIN), as I don't want everyone in the network to be able to connect to my db.
Map the drive and then use the file path of the mapping.
Or use remote desktop to access directly
https://support.microsoft.com/en-us/windows/how-to-use-remote-desktop-5fe128d5-8fb1-7a23-3b8a-41e636865e8c
I've successfully installed the Pervasive 13's 64bit Client onto Ubuntu Server 18.04.
How can I now establish a connection to the Pervasive 13 server (which is installed on a Windows 2008 R2 server) and perform a sql query?
I'm extremely confused by the documentation, which directs me to the bcfg tool after client installation. I'm not clear if that tool is for configuring the server or for setting up the client connection. Ether way, the documentation is too abstract for my comprehension; I need concrete examples of someone successfully establishing a connection to (at least a hypothetical Pervasive server located at some hypothetical ip address) and NOT JUST abstract syntax that never shows an example of SQL statement being submitted from command line Linux.
Seriously, the documentation covers so much detail of stuff I don't immediately care about, that I can never seem to figure out my practical needs which are to simply establish a connection to the database, perform a SQL query, and get a result set.
The installation of the client should have sensible defaults, and the documentation, after installation, should focus on getting you connected and running sql statements as quickly as possible, instead of going on and on about details that are only of interest if the defaults aren't sensible. Let me connect first! Then if I have a problem, only then do I care to learn further detail about other aspects of configuring the connection.
Pervasive is such an obscure database server, that I'm left with only this documentation to figure this out. Any other database would probably have YouTube videos that show you how to install the client, and start making some SQL queries and getting result sets.
Someone at Actian, ought to be kind enough to make a quick start video for the client on Ubuntu Server that quickly covers installation and finishes where you're submitting sql queries and get result sets. After all, that's the purpose of database client.
Can someone please provide some concrete examples of how I can turn this successful installation into a relationship with the database server where I can submit SQL queries and receive result sets?
I'm not sure why the documentation points to bcfg.
If the Client is installed and didn't display any errors, you need to add an ODBC DSN using dsnadd (https://docs.actian.com/psql/PSQLv13/index.html#page/uguide%2Fuguide.dsnadd.htm%23ww68699). An example of creating a client side DSN pointing to a remote database is:
dsnadd -dsn=clientDemodata -db=Demodata -host=WindowsServerName
(where clientDemodata is the DSN created on the Linux box, Demodata is the PSQL database on the remote server called WindowsServerName).
Once the DSN has been added, you should be able to use isql or isql64 (https://docs.actian.com/psql/PSQLv13/index.html#page/uguide%2Fuguide.isql.htm%23ww138933) to execute a query.
Running isql / isql64 with just the DSN will let you execute SQL queries interactively:
isql64 clientDemodata
An example of running isql using a file as input for the SQL statement(s) is:
cat two-queries.sql | isql clientDemodata -b
If you've done all that, what errors or behavior are you seeing?
This is a general question that I can't seem to find any specific answer to. I am using a node module: https://www.npmjs.com/package/odbc
The module says to install a ODBC driver for the specified database and also have a properly configured odbc.ini and odbcinst.ini.
I am also using docker to run my node script.
My question is on my docker container, do I install each driver for the database? And then on the database server I have to configure the odbc.ini? Or on my node server I set this up? Or does it already come pre configured on some databases?
I keep getting the error: "Data source name not found, and no default driver specified"
Which I am guessing since I probably don't have the driver setup in my node container and the odbc.ini properly setup on my database server.
I am currently testing on a mysql database but want to be able to connect to any ODBC database.
Here is a link to setup mysql on ubuntu:
http://www.kaffeetalk.de/how-to-setup-and-configure-mysql-with-unixodbc-under-ubuntu-14-04/
odbc.ini contains DSN (Data Source Name) definitions, which are based on drivers registered in the odbcinst.ini, both found along with the drivers themselves on the ODBC data consuming host/environment (here, your docker container). These configuration files are typically (and optimally) respectively targeted by $ODBCINI and $ODBCINSTINI environment variables, but sometimes found at default locations like /etc/odbc.ini or ~/.odbc.ini.
You might look at some documentation, like the ODBC spec on MSDN, or developer guidance on iODBC.org. Do be sure to use ODBC's DBMS-agnostic SQL syntax for your queries, and not the DBMS-specific dialect for MySQL (or any other DBMS)!
I am connected remotely to a Sybase server that is on a UNIX machine. I am connected via isql GUI on a windows client. I do not have access to the UNIX server's interfaces file so I don't think I can set up my machine as a remote backup server. Can I use the following command to get a backup on my Windows machine?
dump database mydb to "C:\mydb.dmp"
Also what is the performance penalty? The database is about 9GB.
I suppose I should run this in the off hours if possible?
That won't work. Your best bet is probably to use the bcp utility, to export the data from each table.
Your windows machine should also:
1) have Sybase ASE AND Backup Service installed
2) define on both interfaces and sql.ini files in both instances.
Your command will then be:
dump database mydb to "C:\mydb.dmp" at wintel_bs
for more info:
http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc31644.1600/doc/html/san1371158725683.html