Database Administrators
Q&A for database professionals who wish to improve their database skills
Latest Questions
0
votes
1
answers
538
views
Apply DB2 logs from production to DR
Is it possible to Apply DB2 9.5 logs files from Production site to DR site? Or do I have to do Backup/Restore and rollforward ...? I copied log files from production site to DR and issued the following command: `rollforward db DBNAME to end of logs and stop overflow log path (/home/db2inst1/logs) no...
Is it possible to Apply DB2 9.5 logs files from Production site to DR site? Or do I have to do Backup/Restore and rollforward ...?
I copied log files from production site to DR and issued the following command:
rollforward db DBNAME to end of logs and stop overflow log path (/home/db2inst1/logs) noretrieve
Got the error:
> DB is not in Rollforward Pending
Mehdi
(1 rep)
May 8, 2014, 09:07 AM
• Last activity: Dec 12, 2016, 01:12 PM
1
votes
1
answers
1185
views
Error in loading data using DB2 load command in DB2 10.5
I have a IBM DB2 database in our application. We have a monthly Java batch process which loads data in the tables using "load Replace" sql command. Around millions of record will be updated every month in this batch process. The batch was running fine without any issues in the DB2 version 9.5 . Rece...
I have a IBM DB2 database in our application. We have a monthly Java batch process which loads data in the tables using
"load Replace"
sql command. Around millions of record will be updated every month in this batch process.
The batch was running fine without any issues in the DB2 version 9.5 . Recently the database was updated to DB2 Version V10.5. After the upgrade , we face the following issues in the batch process. (No change in the code)
There is an Interrupted Exception occurring in the middle of the process.
com.ibm.db2.jcc.am.SqlException: DB2 SQL Error: SQLCODE=-952, SQLSTATE=57014, SQLERRMC=null, DRIVER=3.69.24
The data in which the data gets loaded is also getting slow after some time. At first the data ets loaded in around 50,000 rows /sec. After some time it is getting loaded at the rate of 1000 rows/second.
TheCPU utilization is also getting increased gradually as the load starts.
We select data from the input tables using Java JDBC connection.Then we process the data and store the data in temporary files. From the files we insert data in the utput tables using the load command. Is there any upgrade issue or enhancement in DB2 10.5, that does not support this. Will using cursor solve this issue. I am also not sure if there is any connection problems in the new version of Db2.
Any help is highly appreciated. Please comment for any additional information required.
user84191
(19 rep)
Jan 8, 2016, 05:23 PM
• Last activity: Jun 25, 2016, 10:26 AM
2
votes
0
answers
76
views
Need to read the DB2 DAS parameters
I need to read the DB2 DAS Parameters via any method other than DB2 Command "get admin configuration". I need to read the parameters like EXEC_EXP_TASK or SCHED_ENABLE from file or database. I cannot find any reference of any files on DB2 where these parameters would be available or any table from w...
I need to read the DB2 DAS Parameters via any method other than DB2 Command "get admin configuration".
I need to read the parameters like EXEC_EXP_TASK or SCHED_ENABLE from file or database.
I cannot find any reference of any files on DB2 where these parameters would be available or any table from where I can fetch these parameters via select query.
Any Pointers?
vks
(21 rep)
Oct 20, 2015, 11:45 AM
1
votes
2
answers
3232
views
DB2 9.5 - Shrink Tablespace
I'm trying to run the following: `db2 alter tablespace TABLESPACE1 reduce` I keep getting errors. As you can see, I have around 50% free pages. I'd like to shrink it in order to reclaim OS disk space. Tablespace ID = 281 Name = TABLESPACE1 Type = Database managed space Contents = All permanent data....
I'm trying to run the following:
db2 alter tablespace TABLESPACE1 reduce
I keep getting errors. As you can see, I have around 50% free pages. I'd like to shrink it in order to reclaim OS disk space.
Tablespace ID = 281
Name = TABLESPACE1
Type = Database managed space
Contents = All permanent data. Large table space.
State = 0x0000
Detailed explanation:
Normal
Total pages = 8943720
Useable pages = 8943696
Used pages = 4559696
Free pages = 4384000
High water mark (pages) = 8914736
Page size (bytes) = 32768
Extent size (pages) = 8
Prefetch size (pages) = 24
Number of containers = 3
Minimum recovery time = 2014-12-09-16.28.18.000000
Container ID = 0
Name = /data/db2dat_10/sida1/TABLESPACE1_01.dbf
Type = File
Total pages = 2981240
Useable pages = 2981232
Accessible = Yes
Container ID = 1
Name = /data/db2dat_11/sida1/TABLESPACE1_02.dbf
Type = File
Total pages = 2981240
Useable pages = 2981232
Accessible = Yes
Container ID = 2
Name = /data/db2dat_12/sida1/TABLESPACE1_03.dbf
Type = File
Total pages = 2981240
Useable pages = 2981232
Accessible = Yes
DB2DBAZ
(41 rep)
Dec 15, 2014, 03:13 PM
• Last activity: Jan 7, 2015, 09:02 PM
0
votes
2
answers
6290
views
create a stored procedure if it doesnt exist using a ddl in db2
My requirements are, I want to create a ddl script which will check if a stored procedure exists on DB, if yes then drop it and recreate it. What I tried is, IF EXISTS (select procname into Migration_procname from sysibm.sysprocedures where procname like 'GIAM_PRIVILEGE_MIGRATION') THEN DROP PROCEDU...
My requirements are,
I want to create a ddl script which will check if a stored procedure exists on DB, if yes then drop it and recreate it.
What I tried is,
IF EXISTS (select procname into Migration_procname from sysibm.sysprocedures where procname like 'GIAM_PRIVILEGE_MIGRATION') THEN
DROP PROCEDURE ITIMUSER.GIAM_PRIVILEGE_MIGRATION;
ELSE
CREATE PROCEDURE ITIMUSER.GIAM_PRIVILEGE_MIGRATION()
SPECIFIC ITIMUSER.GIAM_PRIVILEGE_MIGRATION
LANGUAGE SQL
BEGIN
......
......
update/select statements
......
END
@
which didn't work.
so I even tried with creating another procedure which is doing same task still no success.
The error message was
> DB21034E The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned: SQL0104N An unexpected token "IF EXISTS (select procname" was found following "BEGIN-OF-STATEMENT". Expected tokens may include: "". SQLSTATE=42601
Any pointers will be helpful.
NOTE: I am using DB2/LUW 9.5
Nachiket Kate
(101 rep)
Jun 5, 2014, 08:49 AM
• Last activity: Aug 15, 2014, 05:09 PM
1
votes
2
answers
14030
views
INSERT INTO with SELECT subquery db2 9.5
I have the following query that takes 4 seconds to execute: SELECT TX.* FROM TABLE_X TX INNER JOIN TABLE_Y TY ON TY.VALUE_ID = VALUE_ID_IN AND TY.PROD_ID = TX.PROD_ID WHERE (TX.PLACE_ID1 = VAR_PLACE_ID OR TX.PLACE_ID2 = PLACE_ID) AND (TX.DATE > TY.FIRST_DATE) AND (TX.TYPE_ID != VAR_TYPE_ID1_IN AND T...
I have the following query that takes 4 seconds to execute:
SELECT TX.* FROM TABLE_X TX
INNER JOIN TABLE_Y TY
ON TY.VALUE_ID = VALUE_ID_IN
AND TY.PROD_ID = TX.PROD_ID
WHERE (TX.PLACE_ID1 = VAR_PLACE_ID OR TX.PLACE_ID2 = PLACE_ID)
AND (TX.DATE > TY.FIRST_DATE)
AND (TX.TYPE_ID != VAR_TYPE_ID1_IN AND TX.TYPE_ID != VAR_TYPE_ID2_IN)
AND (TX.COL1 != COL1_IN OR TX.COL2 != COL2_IN)
However, I want to store it in a
TEMPORARY TABLE
. When I execute the following query it takes 50 seconds:
INSERT INTO SESSION.TEMP_TABLE_X /*new line to store result*/
SELECT TX.* FROM TABLE_X TX
INNER JOIN TABLE_Y TY
ON TY.VALUE_ID = VALUE_ID_IN
AND TY.PROD_ID = TX.PROD_ID
WHERE (TX.PLACE_ID1 = VAR_PLACE_ID OR TX.PLACE_ID2 = PLACE_ID)
AND (TX.DATE > TY.FIRST_DATE)
AND (TX.TYPE_ID != VAR_TYPE_ID1_IN AND TX.TYPE_ID != VAR_TYPE_ID2_IN)
AND (TX.COL1 != COL1_IN OR TX.COL2 != COL2_IN)
TABLE_X = 300 000 rows
TABLE_Y = 90 000 rows
How can I reduce the 50 seconds running time?
The server is running DB2 v9.5.
Logar314159
(123 rep)
Nov 5, 2013, 12:12 AM
• Last activity: Dec 12, 2013, 08:04 AM
Showing page 1 of 6 total questions