DB2 is a database management system from IBM. This tag should be used for questions about the 9.7 version of DB2. Please additionally tag your question with the generic "db2" tag. This version is currently deprecated from IBM support.
Questions tagged [db2-9.7]
18 questions
5
votes
3 answers
Split comma separated entries to rows
I have a table like this:
| ID | OtherID | Data
+--------+-----------+---------------------------
| 5059 | 73831 | 5103,5107
| 5059 | 73941 | 5103,5104,5107
| 5059 | 73974 | 5103,5106,5107,5108
And the result should return…
Yuri Marques
- 51
- 1
- 1
- 2
4
votes
1 answer
SQL20448N "05/09/2016" cannot be interpreted using format string "YYYY-MM-DD" for the TIMESTAMP_FORMAT function
I am getting below error in db2 when executing the sql query-
SQL20448N "05/09/2016" cannot be interpreted using format string
"YYYY-MM-DD" for the TIMESTAMP_FORMAT function.
here is my sql qyery-
SELECT DLR_CD,
FIN ,
…
user88416
3
votes
1 answer
How do I modify a stored procedure in IBM DB2?
I have a DB2 database and I'm using Control Center. I've found a procedure in the 'Stored Procedures' folder, which I need to modify. In MS SQL Server and Oracle you can accomplish this right from the DBMS.
Is there a way I can modify this…
ConfusedDeer
- 285
- 1
- 4
- 11
2
votes
1 answer
DB2: Column-Aliases with Line-Breaks
Using DB2 9.7, is it possible to produce a result set where the column-headers contain line-breaks? Something like:
select field_name as "Line1
Line2" from table_name I want the column-header to look like this: Line1 Line2 However, this is not…
Line2" from table_name I want the column-header to look like this: Line1 Line2 However, this is not…
Lonnie Best
- 143
- 1
- 11
2
votes
1 answer
Trying to restore a db2 database but stops at roll-forward with error 'SQL1265N'
I'm trying to restore a backup that is older than the current database.
The restore went ok, but the roll forward didn't giving the following error:
SQL1265N The archive log file ".LOG" is not associated with the
current log sequence for database…
davejal
- 236
- 3
- 17
2
votes
1 answer
DB2 doesn't start after change db2 hostname
After changing the hostname of my db2 server, the db2 services won't start anymore.
After reading the notes on how to rename the db2 hostname I understand what went wrong, some things should have been done before restarting the server.
What are my…
davejal
- 236
- 3
- 17
2
votes
0 answers
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…
vks
- 21
- 3
2
votes
1 answer
Check if encrpytion key is valid in DB2
I have a DB2 table where one of the columns is encrypted using the two parameter variant of ENCRYPT (so the password is supplied in the SQL itself). Unfortunately due to an ETL issue the column got populated by data with two different encryption…
SztupY
- 121
- 4
1
vote
0 answers
Steps to relocate the primary hadr database to a new server?
Currently we have several databases with a HADR configuration where the primary databases are on a Linux Server "A", with the standby all on Linux Server "B". DB2 version is 9.7.
We are attempting to relocate the primary database of one of these…
Ste Scott
- 11
- 1
1
vote
1 answer
Using same table in a UNION multiple times
I am given a query that is using the same table with same columns and filters multiple times and the only thing is changing is the Type which is given manually. I am thinking there must be a better way to do that.
Query statement is like below:
…
Nil R
- 113
- 1
- 4
1
vote
1 answer
DB2 SUM of MAX values, single table
I have looked through many of the questions asked and answered but can't seem to find my answer, even kludging the provided answers into my queries - most usually fail, the remainder provide garbage results.
NOTE THAT THIS IS FOR IBM DB2 v9.7! NOT…
Andrew Holko
- 13
- 4
1
vote
1 answer
DB2 LUW: how to influence query planner's choice of join
Suppose I have two tables, A and B. They "share" the same primary key, which is indexed in both tables. Table B also has a timestamp column which is separately indexed.
I do a subselect on B using the timestamp column (I give it a 24-hour interval…
user1071847
- 183
- 8
1
vote
2 answers
How to run db2pd -hadr in batch mode
I am trying to automate some things on DB2 and would like to use a batch file to do this. I create the following batch file test.bat:
db2cmd - -w "db2 -tvf test.db2"
I then try to do two commands in the test.db2 script, which work together in the…
ESP
- 121
- 4
1
vote
1 answer
Driver properties for db2jcc in Squirrell and MON_GET_CONNECTION table function
I'm trying to set driver properties like:
clientAccountingInformation
clientApplicationInformation
clientProgramId
clientProgramName
in Squirrell 3.6 (http://squirrel-sql.sourceforge.net/). See…
Lennart - Slava Ukraini
- 23,842
- 3
- 34
- 72
0
votes
1 answer
DB2 PURGE (old Online Backups and Archive logs) - some of the archive logs are not removed
DB is in Archive Mode.
We are creating full Online Backups every night at 23:00.
We set automatic removal of old online backups and archive logs.
AUTO_DEL_REC_OBJ ON
NUM_DB_BACKUPS 2
REC_HIS_RETENTN 2
In backup folder we have two online backups…
Dejan
- 695
- 7
- 20
- 34