I need a SQL-type interface for an existing DB2 database, similar to SQLPlus for Oracle (I actually use Golden for Oracle) on windows.
Can someone recommend something?
I've actually installed a 32-bit DB2 client from work which installed many programs but I have no idea which of these programs - if any - is the right one. Installed were: command editor, command line processor plus, command line processor, command window - administrator, command window, control center, journal, license center, replication center, task center, information center v9.7, activity monitor, event analyzer, health center, indoubt transaction manager, memory visualizer, configuration assistant, default db2 and database client selection wizard (no this isn't it, I thought it would be) and first steps.
All I want is a simple client to run SQL statements.
Beginning with DB2 for LUW 9.7 a new command line processor called Command Line Processor Plus, or CLPPlus is included, which is designed to be somewhat compatible with the Oracle's SQL*Plus -- it supports all typical DB2 commands as well as the majority of SQL*Plus commands, so it may be a better choice for you.
More info in the manual.
The command line equivalent to that would be db2
You can use it in two ways
IF you issue the command db2 with no arguments, a shell console will start, letting you connect to a DB2 instance, and then you can execute your SQL commands.
elk /home/melnyk>db2
db2 => connect to sample
Database Connection Information
Database server = DB2/6000 8.2.0
SQL authorization ID = MELNYK
Local database alias = SAMPLE
db2 => select * from org
DEPTNUMB DEPTNAME MANAGER DIVISION LOCATION
10 Head Office 160 Corporate New York
15 New England 50 Eastern Boston
20 Mid Atlantic 10 Eastern Washington
38 South Atlantic 30 Eastern Atlanta
42 Great Lakes 100 Midwest Chicago
51 Plains 140 Midwest Dallas
66 Pacific 270 Western San Francisco
84 Mountain 290 Western Denver
8 record(s) selected.
db2 => terminate
DB20000I The TERMINATE command completed successfully.
elk /home/melnyk>
Alternatively, you can use db2 using arguments directly from command line if you don't want to abandon your current shell.
db2 connect to sample
db2 select * from org
db2 terminate
Both methods will provide the same results, so you can choose the method that fits better to you.
You can find more information about this, on the official IBM DB2 documentation
Related
The previous DB2 Express-C versions were working fine over the years, but the basic commands not running on no cost Db2 Community Edition 11.5.5 (latest) .
after installing the Db2 Community Edition 11.5.5, when running the db2level command, it gives the error:
SQL1022C There is not enough memory available to process the command.
and below links didn't help:
https://www.ibm.com/support/pages/error-sql1022c-there-not-enough-memory-available-process-command-after-changing-hostname-db2-server
https://www.ibm.com/support/pages/running-db2level-db2-command-window-returning-sql1022c
Some my findings are:
db2set' not working - DBI1302E Invalid parameter detected.
'db2set -all' working - DB2_EXTSECURITY=YES
'db2level' - SQL1022C There is not enough memory available to process the command.
'db2start' not working - SQL1390C The environment variable DB2INSTANCE is not defined or is invalid.
DB2 icon not presented on taskbar
db2 get dbm cfg | find "SYSADM" - not working (no output)
db2 get dbm cfg - DB21018E A system error occurred. The command line processor could not continue processing.
db2 update dbm cfg using sysadm_group DB2ADMNS - DB21018E A system error occurred. The command line processor could not continue processing.
Followed the same recommended steps (for DB2 installation) as being following since DB2 9.7 version (on WIN 8.1 machine + RAM 8 GB).
My logged-in user is machine administrator
The supplied user is 'db2admin'
Now on the problem machine, OS is Windows 10 Pro + RAM 8 GB.
Ran the setup.exe after extracting the downloaded zip
From the DB2 Setup Launchpad > Install a Product > DB2 Version 11.5.5.0 Server Editions > Install Now > then installed with all default settings
DB2 setup installed successfully but DB2 commands not working as explained above
I had the same issue but after installing db2 with administrator privileges (starting setup.exe as an admin) the issues were gone and everything was set up as expected.
There is a postgres 9 with database AAA that is used by my application. I use pgadmin 4 to manage it manually.
I would like to check what queries are executed by this application on database AAA in real time.
I did a research about monitoring options in pgadmin in vain.
Is is possible to do that by using just pgadmin4? Or is it necessary to use another tool (if yes - what is he name of this tool)?
When I point pgAdmin4 at a 9.6 server, I see a dashboard by default which shows every session (done by querying pg_stat_activity). You can then drill down in a session to see the query. If a query last for less time than the monitoring interval, then you might not see it if the sample is taken at the wrong time.
If that isn't acceptable, then you should probably use a logging solution (like log_statemnt='all') or maybe the pg_stat_statements extension, rather than sample-based monitoring. pg_stat_statements doesn't integrate with the dashboard in pgAdmin4, but you can select from the view from an SQL window just like you can run any other SQL. I don't believe pgAdmin4 offers a built-in way to monitor the database server's log files, the way pgAdmin3 did.
I want to configure IBM DB2 on iseries AS400. The issue is I'm not getting the proper tool for AS400 and I've already installed Data Studio for configure DB2.
I don't have any knowledge regarding AS400 and I'm fresher for IBM technology.
I have already ODBC drivers of iseries. Please help me to find out iseries AS400 setup tool.
DB2 is integrated into OS/400 and all of it's following OS's. To configure DB2 on these platforms, perform a power-on maneuver. If it is already turned on, then DB2 is configured.
BTW, you probably don't have an AS400 but something newer. The hardware is likely Power System or Pure System, and the OS is likely IBM i.
Once you get a SQL connection to the AS400 aka system i aka iseries. Configure the DB by executing this SQL statement in Studio.
create collection myas400SQL
This will create an as400 library named MYAS400SQL that has the mumbo jumbo journal automatically added meaning this will work like every other SQL database with commit rollback transactions...
Lets try it.
CREATE TABLE myas400sql.mytable (myfield char(1))
Table mytable can handle commits and rollbacks like any other db you may have used.
Happy Friday.
The iSeries DB2 is very different from the Windows/Linux DB2. We need to know which because we have selects to retrieve the metadata (table names, etc.) and those selects are dependent on what DB2 we're talking to.
Is there a way, after we have a connection, to determine what DB2 product we're hitting?
thanks - dave
There is a property on the ADO.NET connection object (DB2Connection), ServerType, that returns a different value based on which product you're connected to.
I haven't been able to find an exhaustive list of what the values correspond to, but the ones I've personally run into are the following:
DB2 - z/OS DB2
DB2/LINUXX8664 - DB2 for Linux/Unix/Windows running on 64-Bit Linux
DB2/NT - DB2 for Linux/Unix/Windows running on Windows (32 bit?)
DB2/NT64 - DB2 for Linux/Unix/Windows running on Windows (64 bit)
May by whith db2 connect or db2 lelvel
check this
select catalog_name from qsys2/catalog_name
It's a one liner that returns a name.
I have a client with FileMaker Pro 11 Advanced.
I need to be able to connect to the filemaker database via SQL. I am using MS SQL Server 2008 R2, or Server 2012 can be used.
These are the steps I have tried
0) Turned on ODBC/JDBC sharing in File -> Sharing on FileMaker Pro 11 Advanced for "All Users"
1) installed the FileMaker OBDC driver included on the filemaker disc
2) odbcad32.exe in C:\Windows\SysWOW64 and added a new filemaker System DSN and directed it to the filemaker database.
3) Attempted to add a linked server to SQL using Provider Microsoft OLE DB Provider for OBDC Drivers and the System DSN name i created for Data Source. I left all other fields blank.
I get this error:
Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "FILEMAKER2".
OLE DB provider "MSDASQL" for linked server "FILEMAKER2" returned message "[Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application". (Microsoft SQL Server, Error: 7303)
FILEMAKER2 is the what i called the System DSN.
What am I doing wrong/What do I need to correct in order to connect to filemaker with SQL?
Is there a connection string to put in for Provider String?
I have the same mismatch error trying to do a test connect with access.
Thank you for any help.
The error you're getting is because of the driver installed is a 32bit driver propably on a 64bit system.
Look in the downloads of FM for the correct xbit driver.
I've connected to FM using ODBC from PHP apps to do basic inserts, updates, deletes of data. I haven't worked with it like you're attempting to do, though, and like #ted said, FM really wasn't built as a SQL platform.
Their answer to this was to go the other way around. You can setup External SQL sources within FileMaker, and bind your SQL database to FM so that those tables show up in FM the same as regular FM tables. These tables can then be used within FM scripts accordingly, so you could setup any data sync steps necessary there. You could create scripts to move data from FM layouts into the SQL DB layouts at given intervals throughout the day, for example.
Hope that helps.
FileMaker 11 only comes with a 32 bit ODBC driver. The error you got happens when you use a 32 bit driver with the 64 bit ODBC admin utility. Set up your DSN using the 32 bit utility, found here:
C:\Windows\SysWOW64\odbcad32.exe
...and it will work fine.