Tag Info

New answers tagged

1

For an Update to the existing table, one solution would be: UPDATE t SET t.New_Column = CASE WHEN types.mintype = 'F' and types.maxtype = 'F' THEN 'FTW' WHEN types.mintype = 'N' and types.maxtype = 'N' THEN 'Non-FTW' WHEN types.mintype = 'F' AND types.maxtype = 'N' THEN 'Mixed' END FROM tbl t INNER JOIN ...


0

You can always clean them up manually or use a script to clean them up (maybe looking for files older than seven days or something).


0

Perhaps you wish to look into HADR on DB2. It actually does log shipping to the standby, so if there is a fail over you can either manually take over on the standby, or if you install TSA (Tivoli Systems Automation), then you can have it detect a failure and automatically fail over to the standby.


0

I came up with a solution for your data set based on some work that I was doing and some modifications to the solution posted by Serge Rielau and Rick Swagerman on IBM's developerWorks (https://www.ibm.com/developerworks/community/blogs/SQLTips4DB2LUW/entry/how_to_split_a_string_into_a_set_of_rows_anti_listagg12?lang=en). Data Setup queries: DECLARE GLOBAL ...


5

This is completely normal. Each of these directories are for each unique log chain. If you are familiar with software version control, each log chain is like a branch. A new log chain is created each time you restore a database and roll forward to a point in time other than end of logs. Here is why: You have a database, SAMPLE. It has reached the log ...


1

Indexes essentially duplicate data on disk. The idea though is the tradeoff in performance. Extra disk used, but faster response looking up data. But since indexes do cost extra disk, one should weigh carefully whether or not the index is actually needed. If not needed, it will cost that extra disk and may even cost you in terms of performance (especially ...


0

I had the same problem and solved it by adding domain admin user into the local Administrators group on local computer (where I installed DB2 DB).


3

Chances are that the reason your script runs from the command line but fails from cron is that your DB2 environment is already initialized (i.e. via your .profile) for the interactive session, where it is not when called by cron. Here's a suggested modification: #!/bin/bash # # Setup DB2 Environment . $HOME/sqllib/db2profile # Back up Database db2 ...


1

There are two ways to determine which logs to keep. One you write yourself. You would need to issue a db2 list history backup all for <db name>. This will show you the history file and locate the last backup and the last needed archive log. Anything prior to that can be deleted. Now you can add in automation. First step set db2 update db cfg using ...


1

When you restore an offline backup, you are not required to roll forward (although the database will be in ROLLFORWARD PENDING state at the end of the backup, which you can avoid by using the WITHOUT ROLLING FORWARD option for RESTORE DATABASE). This means that you can remove any archived log files. However, keep in mind that you may want to be careful ...


1

AUTO_DB_BACKUP means DB2 will take a backup based on when it feels it should do so. The things that influence the taking of a backup are: Never completed a full backup Time elapsed since the last full backup was a specified number of hours Transaction log space consumed (with archival logging enabled), since the last full backup is a specified size. In ...


1

You can use LIST TABLESPACES SHOW DETAIL to check the High Water Mark. If it still appears high, you can always issue an ALTER TABLESPACE <tablespace> REDUCE MAX (assuming you are on automatic storage). The commands for old-style DMS are a litte different. I have another answer where I list that information


1

I'm not familiar DB2, but if it allows using count as analytic function you can do select * from (select b.Store,b.order, rownumber() over (partition by b.store order by b.order) AS RNK , count(*) over (partition by b.store) cnt from Library.Table1 b ) tmp where tmp.cnt > 1 order by tmp.Store If not, the query ...


0

Run GET DB CFG with the SHOW DETAIL option, which will reveal any settings that are delayed (not yet active). Any difference between the "Current" and "Delayed" value indicates a DB CFG change that was made after the database was last activated. If the old path isn't showing up in any of the settings in the "Current" column of the database config, then ...


2

If you implement the process as a stored procedure, it can generate the dynamic SQL based on the rules in your base tables and then execute that dynamic statement. From the DB2 CLP, it's possible to write a query (probably containing one or more CTEs) that generates the SQL. The EXPORT utility can write the results of that query to a text file whose name is ...


1

I believe you are correct on the syntax. A few points to note. You cannot grant to yourself or revoke from yourself, so someone else may need to grant you the privileges you are after. You may need the DB level privileges CREATE_EXTERNAL_ROUTINE and/or CREATE_NOT_FENCED_ROUTINE granted to you. May may also need BINDADD granted to you as well. These ...


0

By default DB2 delegates all authentication to the operating system of the server, so the "host" is always the same -- the DB2 server host and the authenticated user ID does have the "host" component and all privileges are verified against the user ID only. Depending on what you are actually trying to achieve, you may be able to restrict access to certain ...



Top 50 recent answers are included