DB2

IBM DB2 is a family of relational database server products developed by IBM that have been extended to support object-relational features and non-relational structures like JSON and XML. There are three main products in the DB2 family: DB2 for Linux, UNIX and Windows (informally known as DB2 LUW), DB2 for z/OS (mainframe), and DB2 for i (formerly OS/400), plus a version for IBM's Virtual Storage Extended (VSE) operating system.

Share tech news, updates, or what's on your mind.

Sign up to Post

DB2 10.5 on Windows.
I did normal windows patching and reboot this morning and now I am getting this error in the DIAG Log.

2019-11-07-07.09.10.427000-360 I6616701F603         LEVEL: Severe
PID     : 1768                 TID : 9092           PROC : db2syscs.exe
INSTANCE: DB2                  NODE : 000
APPHDL  : 0-15306
HOSTNAME: DB03
EDUID   : 9092                 EDUNAME: db2agent (idle) 0
FUNCTION: DB2 UDB, base sys utilities, sqeAppServices::InterruptAppByIndex, probe:2861
MESSAGE : ZRC=0x80050810=-2147153904=SQLE_RC_INVALID_AGENT_INDEX
          "Agent index is invalid"
DATA #1 : String, 55 bytes
Ignoring user interrupt that targets system application
DATA #2 : unsigned integer, 2 bytes

Open in new window


When I google it I don't get any results.  Anyone have any thoughts?
0
OWASP: Forgery and Phishing
LVL 19
OWASP: Forgery and Phishing

Learn the techniques to avoid forgery and phishing attacks and the types of attacks an application or network may face.

What will happen in the following situation, I can't force this nor test this.

In a process a recordset is selected with SQL with a selection e.g. WHERE CODE = 1
(The result can contain a few hundred records.)
each record will be processed (within 15-30 seconds) and flagged as "CODE = 2"

Now a second job (same program) is started.
This program will also select a recordset with SQL with a selection e.g. WHERE CODE = 1.

What will happen when:
Job 1 select a records with code=1
(e.g result 250 records)

Job 2 select a records with code=1
(e.g result 240 records, 10 already processd by job 1)

Job 1 change value of a record to CODE = 2.
Is this record still in the recordset from Job 2?
0
I have a view in DB A. Then I have some settings in DB2. I'd like to change the view SELECT condition in DB A by DB2 settings. Is it possible? If not, how to generally solve this case?
0
db2 Express-C V10.5, RedHat Linux RHEL7. Installed without error.

db2 create db AMW907 on /home/mis/amw907 fails with

SQL1762N Unable to connect to database because there is not enough space to allocate active log files. SQLSTATE=08004

My disk space is good

Filesystem             Size  Used Avail Use% Mounted on
/dev/mapper/rhel-root   50G  9.6G   41G  20% /
devtmpfs                32G     0   32G   0% /dev
tmpfs                   32G  8.0K   32G   1% /dev/shm
tmpfs                   32G   28M   32G   1% /run
tmpfs                   32G     0   32G   0% /sys/fs/cgroup
/dev/sda2             1014M  163M  852M  17% /boot
/dev/sda1              200M  9.9M  191M   5% /boot/efi
/dev/mapper/rhel-home  1.8T   40G  1.7T   3% /home


I have checked permissions everywhere. Any thoughts would be appreciated.
0
How can I migrate the mage which is stored as BLOB in My Sql to DB2 BLOB.

Thanks for your help.
0
Hello All,

I have data in a well-formed xml file. I’d like to use the db2 load command load the data into a table. Would someone guide me on how to code the Load command to accomplish this task? Example:

    <Person gender="Male">
      <Name>
        <Last>Cool</Last>
        <First>Joe</First>
      </Name>
      <Confidential>
        <Age unit="years">5</Age>
        <Birthdate>2002-03-16</Birthdate>
        <SS>111-22-3333</SS> 
      </Confidential>
      <Address>5224 Rose St. San Jose, CA 95123</Address>
    </Person>

Open in new window




    LAST_NAME  FIRST_NAME  AGE  BIRTHDATE   ADDRESS
    Cool       Joe         5    2002-03-16  5224 Rose St...

 Environment:  Linux, DB2 V11

Thanks in advance for any help
0
DB2 10.5 on Windows 2008 R2

I have a database called "Orders" on Server1.  I want to take a backup of Orders and restore it as OrdersHistory on Server1.  I added a new drive for the OrdersHistory db.

I read a few blogs and the IBM docs and it seems like I should be able to generate a restore with redirect script by running this command.

RESTORE DATABASE ORDERS FROM X:\4531544\ORDERS.0.db2.DBPART000.20190324050206.001 TAKEN AT 20190324050206 REDIRECT GENERATE SCRIPT c:\temp\redirect.sql

Open in new window


But when I run this I get

SQL1005N  The database alias "ORDERS" already exists in either the local
database directory or system database directory.


So can I only do that on a new server?  how would I do Orders to OrdersHistory on same server?  The database uses auto managed tablespaces and there are about 58 tablespaces.  Three (data, index, lob) for each schema.

Any suggestions?

Jim
0
LEFT JOIN and the WHERE clause, how to work around?

We are running DB2.

I am working on a query that uses LEFT JOIN and a few parmeters in the form of WHERE clauses.  I am using a LEFT JOIN because there are records that will not have a match in TABLE B and we would like to retain them in the result set.  The issue occurs when the parameters are added in the form of a WHERE clause - essentially turning my LEFT JOIN into an INNER JOIN.  What is the best way to work around this limitation?


SELECT DISTINCT evecas, everef, evetyp, evesfc, eveplc, 
trim(evetrt) || '-' || (eveprg) as PGM,
evestf,
DATE(DIGITS(evefyr)||'-'||DIGITS(evefmm)||'-'||DIGITS(evefdd)) AS EVENTDATE,
(select stfnam from staffmstr where smmnum = evestf), 
lwsys.isodates(evefyr, evefmm, evefdd) AS DOSYYMD, 
evetim,
eveend,
TIMESTAMPDIFF(4,CHAR(TIMESTAMP(DATE(DIGITS(evefyr)||'-'||DIGITS(evefmm)||'-'||DIGITS(evefdd)), LWSYS.TIME_4(eveend))-TIMESTAMP(DATE(DIGITS(evefyr)||'-'||DIGITS(evefmm)||'-'||DIGITS(evefdd)), LWSYS.TIME_4(evetim)))) AS TOTAL_MINUTE_TIME
,
(select trim (cltfst) || ' ' || (cltlst) as CLIENT from cltmstpf where cltcas = evecas), 
evecnf, evesrv, evecpt, eveamt, evepun,
eveprc, status, lwsys.isodates(evepyr, evepmm, evepdd) AS PROCYYMD,
(case
when evesrv LIKE '%90832%' AND TIMESTAMPDIFF(4,CHAR(TIMESTAMP(DATE(DIGITS(evefyr)||'-'||DIGITS(evefmm)||'-'||DIGITS(evefdd)), LWSYS.TIME_4(eveend))-TIMESTAMP(DATE(DIGITS(evefyr)||'-'||DIGITS(evefmm)||'-'||DIGITS(evefdd)), 

Open in new window

0
Can we use "fetch first 1 rows only" criteria within NamedQuery? I used it but it does not filter resultset. It returns all records. But, when I use the same query in NativeNamedQuery, it works. It does filter the resultset and returns only 1 record from DB2. Can anyone confirm if this is expected behavior?
0
on linux centos 7 this: https://www.midvisioncloud.com/ibm-websphere-on-microsoft-azure/ibm-bpm-microsoft-azure/
i try to install DB2 Developer https://www.ibm.com/it-it/marketplace/ibm-db2-direct-and-developer-editions

I have configure GUI for server using this web resource: https://linuxconfig.org/how-to-install-gui-gnome-on-centos-7-linux-system

I install xrdp and I started server with GUI and xrdp server
I open firewall ports 3389 and I login in server with rdp access

when i try to install DB2 Developer setup i found:

[root@OpificioBPM server_dec]# ./db2setup
DBI1190I  db2setup is preparing the DB2 Setup wizard which will guide
      you through the program setup process. Please wait.


Exception in thread "main" java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
      at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:217)
      at java.awt.Window.<init>(Window.java:547)
      at java.awt.Frame.<init>(Frame.java:431)
      at java.awt.Frame.<init>(Frame.java:396)
      at LoadingGraphic.<init>(Unknown Source)
      at LoadingGraphic.main(Unknown Source)

The DISPLAY variable is not set properly.  Ensure that the DISPLAY variable is set properly and that permissions are set properly to open windows on the display specified, then rerun the command.

I try to set DISPLAY variable with this values:
export DISPLAY=IP SERVER:0.0
export DISPLAY=localhost:0.0
export DISPLAY=localhost:0
0
Bootstrap 4: Exploring New Features
LVL 19
Bootstrap 4: Exploring New Features

Learn how to use and navigate the new features included in Bootstrap 4, the most popular HTML, CSS, and JavaScript framework for developing responsive, mobile-first websites.

Any free tool or site like draw.me to sketch database entity relationship diagrams like many-many, one-many type of relationships between tables

please advise
0
Hi,

   In DB2, we can declare a temporary table in a Stored Procedure SP1 and use it in another stored procedure SP2, while calling SP1.

Is there a way to do it in Postgresql 9.7?
Please help with an example, if there's a way to it?
Thanks a lot!
0
db2 export with delimiter set explicit
I execute the db2 command on a windows machine in the db2 command line interpreter shell
I execute a SQL command against db2 and export the result in a delimited ascii file. I want to be able to set the delimiter, default is space with fixed column length.
I start the export with the following command

db2 -tvmf \\somePath\mySQLCommandToExecute.sql > \\somePath\ExportedResults.csv
and the mySQLCommandToExecute.sql file
CONNECT to MYDB USER MYUSER USING MYPW;
With MultipleReferences as(Select distinct coulnm1 , tb1.column2, column3, tb1.column4 from schema1.table1 tb1, schema1.table2 tb2 where column2 > 1 and column3 <> column4 AND COALESCE(tb2.column1,tb2.column2) = tb1.column1 ) select * from MultipleReferences where column4 in('somefilter1', 'somefilter2');
This is only a schematic example of my SQL. As the SQL command is huge (a lot of filters given by a excel sheet) I generate the sql command via a programm and want to have it in a separate file for execution.

As my SQLToExecute is very long I want to have it in a separate file and not directly entered on the db2 command line. So any suggestions like db2 export to test.del of del select tabname from syscat.tables where tabschema ='VSC';
are NOT applicable in my case.
Being able to execute a SQLQuery that is in a separate file is mandatory. Also solution like adding the delimiter explicitly in my SQL command like select a || ';' || b from mytable is not appicable

0
Hi All

I could see that SQL Data Replication is working fine under the same instance (db2inst1) between a source and target DB .

But i have the requirement to replicate the data between two different instances(db2inst1 and db2inst2) which are running on the same DB server, having source DB in db2inst1
and target DB in db2inst2.

May I know the reason why data is not being replicated.

Please let me know if federation is needed for this requirement between db2inst1 and db2inst2 (which are already on the same DB server) , for the SQL replication to become successful.

Kindly provide your inputs.
0
Hi ALL

Good Afternoon!!!

I am facing below error in ASNCLP  while trying to create the Subscription Set.  Below are the commands used and error messages reported:

Repl > SET SERVER CONTROL TO DB DB1

====
CMD: SET SERVER CONTROL TO DB DB1;
====

Repl > SET SERVER TARGET TO DB  DB2

====
CMD: SET SERVER TARGET TO DB DB2;
====

Repl > CREATE SUBSCRIPTION SET SETNAME SET00 APPLYQUAL AQ00 ACTIVATE YES TIMING INTERVAL 1 START DATE "2018-10-10" TIME "14:35:00.000000"

====
CMD: CREATE SUBSCRIPTION SET SETNAME SET00 APPLYQUAL AQ00 ACTIVATE YES TIMING INTERVAL 1 START DATE "2018-10-10" TIME "14:35:00.000000";
====


ASN1956I  ASNCLP : The program now generates the script for action: "CREATE SUBSCRIPTION SET".

ASN1955I  ASNCLP : The program will use the following files: "replcap.sql" for the Capture SQL script, "replctl.sql" for the control SQL script, "repltrg.sql" for the target SQL script, and "replmsg.log" for the log file.

--- ASNCLP Version 10.05.07 Build date 2015-12-21 11:26:45

ASN1550E  The replication action "Create Subscription Set" ended in error. The value for the input parameter "source server information" is missing.

ASN1954E  ASNCLP : Command failed.


Do I need to have and source and target DB names(DB1 and DB2) should have same name to resolve this issue ?

Please kindly provide your inputs.

Thanks in advance!!!
0
Hi All

Which snapshot is recommended to analyze the performance issue of Procedure which is doing an update on a table.

Do i need to go for snapshot of application or snapshot of DB.

Please provide me your valuable inputs.

Thanks in advance!!!
0
Hi All

Greetings!!!

I have 2 instances ( db2inst1 and db2inst2) on the same machine. Each instance is having one DB each. I need to copy the data of a set of tables (for example 20 tables) from
instance1 (db2inst1) to instance2 (db2inst2).  This frequency of data copy should be daily once. Every time only Delta data need to be copied from source to target.

What are the possible ways of achieving this.
0
Hi All

Greetings.

I am facing the below Error message in the Application logs:

 Not able to get a Connection for db2Pool

Some few orders are failing with above message.

Below are my DBM configurations.
 Priority of agents                           (AGENTPRI) = SYSTEM                    
 Agent pool size                        (NUM_POOLAGENTS) = AUTOMATIC(100)            
 Initial number of agents in pool       (NUM_INITAGENTS) = 0                          
 Max number of coordinating agents     (MAX_COORDAGENTS) = AUTOMATIC(200)            
 Max number of client connections      (MAX_CONNECTIONS) = AUTOMATIC(MAX_COORDAGENTS)

Can you please give inputs to resolve this Problem.
0
Hi All

Greetings.
Can any one help me to interpret the below Informational message which I found in my diag log file.

2018-08-25-06.03.16.668279-300 I10046620E503         LEVEL: Info
PID     : 1144                 TID : 14068592123456 PROC : db2sysc 0
INSTANCE: db2inst1             NODE : 000            DB   : SAMPLE
APPHDL  : 0-8                  APPID: *LOCAL.DB2.180531042846
HOSTNAME: hostname2
EDUID   : 80                   EDUNAME: db2redom (SAMPLE) 0
FUNCTION: DB2 UDB, base sys utilities, sqeLocalDatabase::HdrKickPooledAgents, probe:20
DATA #1 : <preformatted>
Waiting for last disassociation from the db

I am not able to interpret it.

Please help me to understand what is the meaning of above message
0
Starting with Angular 5
LVL 19
Starting with Angular 5

Learn the essential features and functions of the popular JavaScript framework for building mobile, desktop and web applications.

I need to get guidance on proper storage of an as400. I believe it is running system 38 (or 36).

Regards, George
0
Hi All

Greeting!!!

in my WCS DB, some of the transactions are failing and throwing the exceptions for the following SQL statement:

INSERT INTO XORDERS (ORDERS_ID, PICKUPPERSON, PICKUPPRSNCNT, DELIVERYTYPE, GRTSTDATEINDI, SHIPPINGMETHOD, MAILSTATUSINDI, STATUS, OPTCOUNTER, LANDMARK, SELLERSTORE, STORESEQUENCENUMBER, FIELD1, FIELD2, FIELD3, ALLSHPCHRG, STORETRREQQTY, STKSHPCHRG, SPLSHPCHRG, MSIBIN) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)

Probably it might be due to primary or foreign key constraint errors or may be invalid data (Data with wrong data Type ) is received from Application.

My DIAG Level is 3, How to capture the whole transaction details(with actual values) in DB2 so that I can analyze the case more better.


Please kindly provide me inputs on this.
0
HI ALL

Greetings!!!

what is the best approach to copy a schema to a new schema with in same Data Base if I have LOB , CLOB and XML data Types.

I also have generated columns in my schema.

In IBM documentation, it is clear that it (ADMIN_COPY_SCHEMA utility) does not support XML Data , as below.

https://www.ibm.com/support/knowledgecenter/en/SSEPGG_10.5.0/com.ibm.db2.luw.sql.rtn.doc/doc/r0022035.html 
(Please refer the heading Restrictions )

How to handle this case of copying the schema.
0
Hi All

Greetings!!!

Hope you are well.

I need to copy a Schema from one machine to other machine,

Both machines have Db2 instance of same version (10.5)

But Schema is having data of LOB data type.

Which method is simple to copy the entire schema with structure and data.

I know ADMIN_COPY_Schema only supports on same machine and under same instance .

But db2move utility does not support LOB data type (I think).

Any inputs on this Please.

Thanks in Advance!!!!
0
Hi All

Greetings!!!!

Hope you are doing well.                      

I need a mail alert whenever a DML  (INSERT,UPDATE,DELETE)  statement is executed in my DB2 Data Base.

Do we have any feature in DB2,  through which I can achieve my requirement.

Thanks a lot in advance!!!!
0
TABLE1
store_ID
Relation_ID
Store_Open
Store_Close
Trans_Date


TABLE2
Relation_ID
Relation_Name

TABLE3
Store_ID
Store_Name

TABLE1 is transactional, table 2 is static as is table 3
I need to find all the stores and their names from TABLE3 where the stores opened in 2016. Also all the names where they closed in 2017. But only for a Relation_Name = "MyStore"
I have a query that, without using the transaction dates, gives results, but I'm sure its wrong.  I need to only use the Max record previous to the end of 2016.
(I know the date syntax can change from platform to platform - this is for DB2, or oracle)

The query that almost works is:
Select distinct(A.Store_ID)
,A.Store_Name
from TABLE3 A
join TABLE2 B on A.Relation_ID= B.Relation_ID
join TABLE3 C on A.Store_ID = B.Store_ID
where B.Relation_Name = "MyStore"
and C.Store_Open < '01/01/2017'
and C.Store_Close > '01/01/2017'

How do I only use the Max records of TABLE1 in 2016?
0

DB2

IBM DB2 is a family of relational database server products developed by IBM that have been extended to support object-relational features and non-relational structures like JSON and XML. There are three main products in the DB2 family: DB2 for Linux, UNIX and Windows (informally known as DB2 LUW), DB2 for z/OS (mainframe), and DB2 for i (formerly OS/400), plus a version for IBM's Virtual Storage Extended (VSE) operating system.

Top Experts In
DB2
<
Monthly
>