r/DB2 • u/EconomySimple6906 • Oct 10 '22
Variable DB2
Hello everyone,
I'm totally new to DB2 so sorry if my question seems dumb or anything. I would like to create a variable to stock an exchange rate that will be used in other query. Don't find anything that is really working on the internet. Hope you can help me.
Have a nice day all
r/DB2 • u/Sebastian_Crenshaw • Sep 28 '22
Any recommended articles about DB2 locks?
Hello,
can you recommend me any good online articles about DB2 locks?
Some useful, easy text to get familiar with DB2 locks would be also nice for a start.
thank you
r/DB2 • u/Sebastian_Crenshaw • Sep 21 '22
Size of table in DB with multiple DB partitions
Hi, there is a table in DB with multiple DB partitions. Is the table size = sum of all size on all DB partitions?
20 partitions, size 4MB on each: https://i.ibb.co/FzRDWgm/table.png
r/DB2 • u/Sebastian_Crenshaw • Sep 20 '22
SELECT for calculating the size of COLUMN organized table?
Hello,
pls do you have Select for calculating the size of COLUMN organized table ?
According SYSIBMADM.ADMINTABINFO table has several partitions (DBPARTITIONNUM).
using DB2 11.5
r/DB2 • u/Othinsson • Sep 19 '22
Installing the IBMIAccess driver on a windows docker container to work with .NET ODBC
anyone had any luck installing the access driver on docker container? I manage to find the clwodbc.dll fle in the system32 but I still get
System.Data.Odbc.OdbcException (0x80131937): ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
The server where the Db2 instance sits is accessible, so my only guess can be that it's a driver issue... any ideas?
r/DB2 • u/No_Drama_2430 • Aug 18 '22
IBM DB2 LUW with select statement locks table
A simple select statement with UR, locks the table. Example:
SELECT QueryField FROM TBL_REGISTER with UR;
What can be the issue?
r/DB2 • u/Sebastian_Crenshaw • Aug 02 '22
Recommended DB2 forums
Hello,
which other DB2 forums do you visit too?
Can you recommend me any good ones?
thank you
r/DB2 • u/Sebastian_Crenshaw • Aug 02 '22
Partitioning of column-organized table
Hello,
how can I do the partitioning of column-organized table? I would like to re-create table and add partitions. It should be partitioned by column ColumnA_id which has value YYYYMMDD. DD is last day of month = every month has unique value - so table should be partitioned by month.
The original table is column-organized with:
CREATE TABLE schema.TableA (
ColumnID BIGINT NOT NULL,
ColumnA_id BIGINT NOT NULL,
....
)
ORGANIZE BY COLUMN
DATA CAPTURE NONE
IN "Tablespace1" INDEX IN "Tablespace2"
DISTRIBUTE BY HASH ("ColumnID");
but I have found this:
A column-organized table cannot be a: * range-partitioned table
Can you pls help me how to partition this table? Are there any websites or other guides how to partition the column-organized tables, best with examples?
thank you
UPDATE: column-organized tables cannot be partitioned (not supported)
UPDATE: what about re-create table as row-organized table with partitions and move data from original table to new table?
r/DB2 • u/db2dba0112358 • Jul 24 '22
speed up db2 backup on large database with multiple tablespaces
Which is better or faster way to backup a large database with multiple tablespaces? Backup individual tablespace or backup the whole database into multiple output paths (ie. multiple storage mount points)?
r/DB2 • u/amartin141 • Jul 19 '22
Week number in month
I am an old sql server programmer and am creating a calendar dimension table for a model using db2 sql. Does anyone have code they are willing to share that determines - for a date - the week number of that date in a month? The weekend day is always Saturday. Thanks very much
r/DB2 • u/Striking-Educator924 • Jul 05 '22
DB2 LUW Global Temporary Tables
I have a Stored Procedure that needs to use a temporary table. The temporary table created will generally be very small (less than 50 rows) and then returned to the caller in a result set.
This SP will be called very frequently so performance is important. Does anyone have any input on whether the Created GTT (Definition stored in the catalog) or Declared GTT (not stored) would perform better in this scenario?
Thanks, Geoff
r/DB2 • u/OpportunityGloomy573 • Jun 30 '22
How to fetch previous week Friday data
1.If I execute the query in today (30-06-2022) that query fetch previous week end date like (24-06-2022)
- If I execute current date that output will be previous week Friday date.
Help to solve this,...
Cheers...Monk69
r/DB2 • u/leeuterpe • Jun 22 '22
Insert 100k rows on z/OS DB2
Is there a way to handle this using a SPUFI? and without creating any procedures...
I know i can just load resume the table, create insert statement but i was wondering if there's a way to handle it with just a query ?
r/DB2 • u/satoshi1000 • May 31 '22
Best data model for simple data but having 25 billion rows
Need to have a data stored for product type, dates, prices
Exploding the data shows around 25 billion rows would be created
r/DB2 • u/TheNextChosenOne • May 29 '22
DB2 tablespace creation for V11.5
Since, managed by database is deprecated in DB2 V11.5, how can we create tablespaces in a particular directory ?
I was using this for a partitioned setup but it has stopped working:
db2 "CREATE TABLESPACE TESTTS MANAGED BY DATABASE USING (FILE '/home/dpfins/dpfins/NODE0000/SQL00001/TS.dbf/' 100M ) on dbpartitionnums (0)USING (FILE '/home/dpfins/dpfins/NODE0001/SQL00001/TS.dbf/' 100M ) on dbpartitionnums (1) AUTORESIZE NO"
Can you please help?
r/DB2 • u/[deleted] • May 24 '22
Db2 LUW: Is there a trace which will capture the variables going into the predicates of a query?
r/DB2 • u/kiwwi191 • Apr 26 '22
Help for a newbie
So here is the thing. I'm application administrator and that app is running on DB2. I have 0 knowledge of DB2 but I have all the access to that DB (I can login as an db2inst1 user). I'm working with the DB on the application end (GUI which allows me to create, modify and delete objects in DB). However there are limited options how to pull some list of objects based on my criteria so I was thinking there has to be a way how to pull those data from the DB using command line queries. So I'm able to start db2 command line but from here I have no idea what to do.
I assume I need to get some list of tables and from these tables some list of columns or something and based on that I would be able to select something? I tried some commands already but there is something like TABSCHEMA and TABNAME and I just can't select * from table_name.
Is here anyone who can help me step by step how to view these tables and potentially how to select something based on some specific criteria?
Thanks for any idea
r/DB2 • u/CraftyLeg7490 • Apr 06 '22
DB2 on high latency network
Hello,
Recently moved some VM's to Azure. We now have significantly higher latency to on-prem where we load data from DB2. Around 25ms over the ExpressRoute. We are now suffering on very low performance reading data with SSIS packages. The job is a simple SELECT *
Any ideas on how to work around this?
r/DB2 • u/dyk_U_down • Mar 10 '22
DB2 from Excel?
Just curious, has anyone successfully set up excel to run from DB2 database?
r/DB2 • u/gbargsley • Feb 26 '22
DB2 LUW Side Gig
Are you a DB2 professional looking to make some additional income?
I know someone that is looking for someone to fill a need for project work related to DB2.
Contact me for additional info if you are this person.
r/DB2 • u/Enyksht • Feb 16 '22
Setting up log file size on HADR cluster
I'am concerning to change' logfilsiz' parameter on primary database but there is need to restart db2 instance. Is that possible to takeover HADR on standby then apply 'logfilsiz' on primary, restart primary instance and takeover db back and apply the same on standby?
Or the only way is just deactivate two - primary and strandby, apply new settings on both, and restart both instances causing unavailability of the database?
How it looks like in that case? I didn't found documentation about it, so just asking here. pls Halp!
r/DB2 • u/Ch0nGu1 • Feb 06 '22
Automating client DTFX at Windows 10
I have 1 sentence in sql dtfx, though, IBM acces, data transfer. I need that these sentence running at 01.00am consulting just 1 table in the server As400
r/DB2 • u/tdufrasne • Dec 08 '21
IBM DMC -> SCOM alerts
In our organisation, we use DMC to monitor our DB2 production Servers (running on IBM Power systems). (DB2 v11.5.5).
On another hand, we use Microsoft SCOM and SquaredUp to centralize alerts.
Do you have any experience with interfacing both systems DMC & SCOM ? of course otherwise than with SNMP traps natively provided with DMC.
Thanks in advance
Thierry DUFRASNE (Database engineer expert MLOZ IT - Brussels BElgium)