New answers tagged db2
DB2 won't store your username and password - neither the server, nor the client. What you could do is set up an ODBC setting in Windows. (I am assuming you are using Windows given you mention Excel, though I could be incorrect in that). The ODBC setting allows you to store the username and password on that Windows system. Do be careful with that though as ...
You may wish to use the SYSTOOLS tables that come with DB2 to check up on table sizes. You first need to create the tables running the following stored procedure: db2 call create_storagemgmt_tables('SYSTOOLSPACE') This will create the tables. If you find you don't need them, you can always drop them later using db2 call drop_storagemgmt_tables() Once ...
You can only use SQL statements in a trigger. RUNSTATS and REORG are not SQL statements; they are DB2 CLP commands, and only the command line processor understands them. You can try using the system stored procedure ADMIN_CMD() to invoke those utilities, however, 1) it still may not work because of the nature of the utilities and 2) even it does work it ...
a temporary table always has this problem. It would consume a lot of CPU resources. If you do an explain, it will show you access type of 'R' or table scan. I don't think, you could improve it better. Good luck!
the issue lies in an overlooked option setting at the start of the script. set -e
I guess it has something to do with the fact, that db2 will return an error code of 1 when no records were found.
You should be able to create a stored procedure that executes your query to get the table names. Then you loop over the results and execute your effective date query for each table individually. You might even be able to do this without wrapping it into an stored procedure.
You cannot migrate the database online. You can use InfoSphere DR or any other replication software for migration with minimal downtime, however, if your application itself does not support transparent connection failover you will still experience a brief outage. The process in brief would look like so: Install DB2 10.5. Create a new database in a DB2 ...
As Heinz Z. did, I discovered the problem. One of your function parameters is char, while you pass the string literal 'ANY', which is considered a varchar. The database engine looks for an overloaded version of the function with varchar parameters, but doesn't find it. Solution is either changing function parameter to varchar or cast parameter to char in ...
Since most of the stuff you're monitoring (locks, bufferpools, SQL performance, etc.) is database-specific you will still need to connect to each database to fetch the information, so I don't see what's wrong with using one of these connections to get instance- or server-wide monitoring information as well.
This is the classic question / fight over whether monitoring should have a monitoring agent installed on each server, or if it should be "agentless". With an agent installed on each server, a process/script/etc. wakes up every so often, collects data, and reports it back to a central location (i.e. monitoring server). With an agentless solution, the ...
First, wondering if you could create a user to SET SESSION USER into for querying this? Or create a service account that can only connect and run these? Second, have you also considered the db2mtrk command? This can be run at the command prompt without a database connection. See Information Center.
Three unlock table commands are COMMIT ROLLBACK DISCONNECT
There is no UNLOCK TABLE statement in DB2. Locks are released automatically upon commit or rollback.
Top 50 recent answers are included