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

I am using MS SQL and have the following example setup.

Database - DB1
Table - Status
Field - Active

Database - DB2
Table - Events
Field - DateTime

Both tables have a common ID field - UID

What I am trying to achieve :

- Review all entries in Events in DB2
- Identify any entries that have a DateTime which is more than 12 hours older than the current time
- For any entries above that are older than 12 hours set the value of the Active field in the Status table in DB2 to "False"

I have found lots of HowTo info online for replicating a value from one table to another using JOIN but this is not replicating data. This is setting a value in one table in one DB based on values for an entirely different variable in another table in another DB.

I'm a t-sql novice and have been trying to work this out but with no success so far.

Any advice would be greatly appreciated.

TIA.
0
Important Lessons on Recovering from Petya
LVL 11
Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Is there any best option to export data from table to file using Db2 commands other than export command.
My table contains 46gb of data.
0
How to export 46 gb of table to file using cursor / stored procedures in Db2.?
Do we have any options exporting data to file from table other than export command.
0
I have a database in db2 that needs to be migrated to mysql. I ma expoting data from db2 to csv and then csv to msql. the data is in multiple langugaes like Chinese, French, Latin, Hebrew, etc. Due to character set issues, the data is converted into symbols. How shall I ensure that the import is done correctly without any changes in the data
0
Hi all

My Db2 DB (Disk type-Non TSM) backups are running slow.

I could see Memory is 60 percnt used and CPU is 50 % idle

I have seen disk utilization with topas and iostat but could make any concrete judgement that Disk utilization is slow.

But i have strong suspect-ion that there may be some problem with disk utilization.

It is a AIX machine.

Need some advice here

Thanks in advance!!!
0
Hi.... I need help on loading fixed length (NACHA format) file to DB2 table.  DO not need to process (i mean parsing or transformation) the file, but need to load it.

here is the file structure

5euqy euq 6767 CCD wqyeu
2 4545  435435 tert5656565
3 434 343 erer eerer 4545 e
4 fffds 5656 787 433 78888
6 wetwyty ghghuyuy wyeuy
7 6556 878 989 990
8 ywieyuwqyu
5euqy euq 6767 PPD wqyeu
2 4545  435435 tert5656565
3 434 343 erer eerer 4545 e
4 fffds 5656 787 433 78888
6 wetwyty ghghuyuy wyeuy
7 6556 878 989 990
8 ywieyuwqyu

file has 8 type of records, each record type has different lay out. Block 5...8 is repeating in the file.  class code (PPD, CCD) mentioned in record type 5. based on that value layout of record type 6 changes.

I need to load this file to db2 table. Please suggest how this can be done.
0
I am trying to run IBM Data Studio 4.1.2. I appear to be able to install it and have run for a day or so after which it errors out and references the attached log file. Any feedback would be appreciated.
1510240418889.log
0
i am not good with table relationships on primary foreign key and 1-n and n-1 etc relationships, data model diagram reading esp when there are 100 tables connecting one other? how do i go about digesting those diagrams.
shoe i take printout and using a pencil mark physically which table is talking to which super table and sub table.

please advise any good links, resources, training, free video tutorials on this.
this concept is same across any kind of database right?
0
Hi Experts,

If I use in SQLRPGLE the construction:

Exec SQL SET :VARF = 12345;

The RPG variable VARF will change to 12345.
Now I like to make the target-field also variable, so I tried:

SQLCMD = 'SET :'+ %TRIM(VARN) + '=' + %TRIM(VARV);
The value of SQLCMD is now : "SET :VARF=12345"

Exec SQL EXECUTE IMMEDIATE :SQLCMD;

But this will NOT assign a value to VARF,  
Why isn't that working?
0
Hello,

We have an index corruption Issue at (HADR environment ) founded into db2diag of primary caused crash , this corruption occurred on primary. I've decided to

1-takeover on standby as no page corruption there and deactivated primary to avoid this corruption moved to standby
2-backup (new primary ) and drop db on old primary
3-restore on old primary (standby) , then working successfully

but doesn't know what the root cause of this page corruption I faced this issue twice during 40 days. My suspect is maybe index not building at true bases, even db2support hadn't got particularity more details they said maybe application code

Is there any way to ensure an index is working fine or not?
As my understanding, there are many flavors of index-related corruption problems, for instance:

Unique index contains duplicates with different RID(s) or same RID(s)
Multiple index entries pointing to the same RID
Index key is out of place (wrong index key order)
Row exists, but index keys do not exist in any or some of the indexes
Index entry pointing to an empty data slot or unused data slot or RID is invalid
Incorrect previous or next index page pointers, incorrect high key or other corruptions on index pages

And if this happens again, is there any different method unless backup and restore?

I found This maybe can be a solution could you  please give me your thoughts  can i do this as a solution ???

REORG the corrupted indexes or mark the index as bad by …
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.