473,790 Members | 2,437 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DB2 Daily Check Lists

Dear Friends

I am working as oracle and ms sql dba from last 4 years. My company
recently migrated to DB2 databases.

So i am very much new to db2 database

Can any one pls provide script to do daily db2 check lists.

The following colums i need in the daily check lists

Instance Name
Instance Status - if open means online, if not offline
Database Name
Database Status - if open means online, if not offline
Free space
error logs
Backup start
Backup end

Pls send me any similar scripts you are doing daily in ur routine life

Appreciate your help

Cheers
Satish

Apr 21 '06 #1
2 8800
Satish,

I am pointing to 2 articles, but they may not provide all the scripts
you are looking for.
http://www-128.ibm.com/developerwork...now/index.html
http://www-128.ibm.com/developerwork...e/dm-0509poon/

Thanks,
Kums
V_S_H_Satish wrote:
Dear Friends

I am working as oracle and ms sql dba from last 4 years. My company
recently migrated to DB2 databases.

So i am very much new to db2 database

Can any one pls provide script to do daily db2 check lists.

The following colums i need in the daily check lists

Instance Name
Instance Status - if open means online, if not offline
Database Name
Database Status - if open means online, if not offline
Free space
error logs
Backup start
Backup end

Pls send me any similar scripts you are doing daily in ur routine life

Appreciate your help

Cheers
Satish


Apr 21 '06 #2
V_S_H_Satish wrote:
The following colums i need in the daily check lists

Instance Name
Instance Status - if open means online, if not offline
Database Name
Database Status - if open means online, if not offline
Free space
error logs
Backup start
Backup end


Quite a few of these are probably covered by the GET HEALTH SNAPSHOT
command. Here's some example outputs from one of my test boxes which
just has a single instance (db2inst1) and a single almost empty
database (DOCTEST)...

When used with "FOR DATABASE MANAGER" you get info on the instances:

$ db2 GET HEALTH SNAPSHOT FOR DATABASE MANAGER

Database Manager Health Snapshot

Node type = Enterprise Server
Edition with local and remote clients
Instance name = db2inst1
Snapshot timestamp = 04/22/2006
01:03:08.563202

Number of database partitions in DB2 instance = 1
Start Database Manager timestamp = 04/04/2006
21:45:56.106610
Instance highest severity alert state = Attention

Health Indicators:

Indicator Name = db2.db2_op_stat us
Value = 0
Evaluation timestamp = 04/22/2006
01:00:57.263136
Alert state = Normal

Indicator Name = db2.sort_privme m_util
Value = 0
Unit = %
Evaluation timestamp = 04/22/2006
01:00:57.263136
Alert state = Normal

Indicator Name = db2.mon_heap_ut il
Value = 43
Unit = %
Evaluation timestamp = 04/22/2006
01:00:57.263136
Alert state = Normal

When used with "FOR ALL DATABASES" you get (unsurprisingly ) info on all
the databases:

$ db2 GET HEALTH SNAPSHOT FOR ALL DATABASES

Database Health Snapshot

Snapshot timestamp = 04/22/2006 01:03:27.617192

Database name = DOCTEST
Database path =
/var/db2inst1/NODE0000/SQL00004/
Input database alias =
Operating system running at database server= LINUX
Location of the database = Local
Database highest severity alert state = Attention

Health Indicators:

Indicator Name = db.db_op_status
Value = 0
Evaluation timestamp = 04/22/2006
01:00:57.263136
Alert state = Normal

Indicator Name = db.sort_shrmem_ util
Value = 0
Unit = %
Evaluation timestamp = 04/22/2006
01:00:57.263136
Alert state = Normal

[...lots more rather boring output snipped...]

Indicator Name = db.db_backup_re q
Value = 1
Evaluation timestamp = 04/21/2006
23:45:57.365087
Alert state = Attention

As you can see from the above there's quite clear indicator lines
beginning with "Alert state" which you could use for grepping through
the output. For example, from the above it shouldn't be too tricky to
bash together a little cron script which could periodically run the two
GET HEALTH SNAPSHOT commands above, and only mail you the result if
either contain "Alert state = Attention" (or better still "Alert state
= [anything other than normal]").

For descriptions of the indicators (e.g. "db.db_backup_r eq") use the
GET DESCRIPTION FOR HEALTH INDICATOR command:

$ db2 GET DESCRIPTION FOR HEALTH INDICATOR db.db_backup_re q

DESCRIPTION FOR db.db_backup_re q

This health indicator tracks the need for a backup on the database.
Backups should be taken regularly as part of a recovery strategy to
protect your data against the possibility of loss in the event of a
hardware or software failure.

This health indicator determines when a database backup is required
based on the time elapsed and amount of data changed since the last
backup. Refer to the DB2 Information Center for information about how
to update these settings.
[snip]

Next ... free space. Okay, the LIST TABLESPACES SHOW DETAIL command
should take care of that (though it's output is rather verbose, so you
might want to process it a bit ... I've got a shell script lying around
somewhere that tidied it up a bit, I'll see if I can dig it up):

$ db2 CONNECT TO DOCTEST

Database Connection Information

Database server = DB2/LINUX 8.2.4
SQL authorization ID = DAVE
Local database alias = DOCTEST

$ db2 LIST TABLESPACES SHOW DETAIL

Tablespaces for Current Database

[snip]
Tablespace ID = 2
Name = USERSPACE1
Type = Database managed space
Contents = Any data
State = 0x0000
Detailed explanation:
Normal
Total pages = 4096
Useable pages = 4064
[here's the interesting bit vvvv]
Used pages = 1824
Free pages = 2240
High water mark (pages) = 1824
[here's the interesting bit ^^^^]
Page size (bytes) = 8192
Extent size (pages) = 32
Prefetch size (pages) = 32
Number of containers = 1
[snip]

As shown above, an active database connection is needed for this, so
you'll need to write a little script which iterates over all the local
databases connecting to each, running the above command, and possibly
deciding whether to bother including the verbose output (e.g. if a
tablespace is getting full).

That said, with the introduction of AUTOMATIC STORAGE (i.e. automatic
expansion) for DMS tablespaces in whichever fixpak introduced it, this
is less of an issue than it used to be (if you're using AUTOMATIC
STORAGE you can probably get away with just checking the available
space on whatever partitions are home to your tablespaces).

Hmmm ... error logs. Not sure exactly what you're looking for here. I
guess db2diag.log might be worth a look (take a look at the db2diag
command in the Command Reference for more information:
http://tinyurl.com/fsgat)

Final item on the shopping list ... backup history. Easy one this: use
the LIST HISTORY BACKUP command. For example, to list all backups taken:

$ db2 LIST HISTORY BACKUP ALL FOR DB DOCTEST

List History File for DOCTEST

Number of matching file entries = 0

(yeah, it's a test database, so I've never backed it up)

Or to list backups since a particular date/time:

$ db2 LIST HISTORY BACKUP SINCE 20060417000000 FOR DB DOCTEST

The timestamp format is YYYYMMDDHHMMSS. Wouldn't be difficult to knock
together a little cron script that lists the backup history over the
last week, to be mailed to you. Though, the db.db_backup_re q health
parameter mentioned above may be enough for your purposes.
HTH,

Dave.

--

Apr 22 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
2674
by: Xah Lee | last post by:
Here's the belated Java solution. import java.util.List; import java.util.ArrayList; import java.lang.Math; class math { public static List range(double n) { return range(1,n,1); }
0
1568
by: Alex82 | last post by:
I can't use it....for example i have to create a column that accept values between 1 to 120...i can't enumerate all of them....or i have to accept a value different from NULL if an other column has a certain values, otherwise the first must be NULL, it's impossible to use enum to do this! ----- Original Message ----- From: "Michael Brunson" <brunson@intercosmos.com> To: "Alex82" <alex_82@tin.it> Cc: <mysql@lists.mysql.com> Sent: Tuesday,...
0
1698
by: Marcel - IDUG Europe 2005 | last post by:
Visit the IDUG Europe Conference Blog for Daily Updates and Conference Information IDUG 2005 - Europe Blog New for this year's conference, IDUG 2005 - Europe has created a blog to give you information on all aspects of the conference. Daily entries have already been posted to the blog, and updates will continue to be posted during the conference!
3
1538
by: dm1608 | last post by:
I have an Ecommerce application that uses mostly ASP and a bit of ASP.NET. Monitoring the servers memory via SNMP every 5 minutes would indicate that there is a memory leak somewhere within the application. Of course, the vendor says its a "Microsoft IIS" issue and tells us to reboot the server each day or kill the worker process for IIS. We're currently rebooting our server at 4 AM each night. This is a really lame idea, in my...
3
2453
by: VSH | last post by:
Dear Friends First i like to introduce myself. I am satish working as Oracle and Ms-SQL DBA from last 4yrs. My compnay recently introduced DB2 Database in one of our projects. I installed DB2 8.1 successfully. I have some doubts in DB2 Can any one of you pls provide the following
11
30727
by: SKBodner | last post by:
Hello, I'm stumped and I'm hoping someone could help me figure out the best way to track daily attendance for the next 6-4 months. I have a list of 80 or so participants who should be attended training on a daily basis and am tracking if they attended, have an unexcused absence, or are absence with an excuse. At the end of the month, I plan to print out reports on those who have missed more than one day with an unexcused absence. My...
2
551
by: V_S_H_Satish | last post by:
Hai Friends Quite a long time back i ask these questions but everybody send me some snapshot and functions names but i need select statements for the following stuff pls help me in this 1. instance name instance status from which table 2. db status and db name fro which table
6
2222
by: bmjnine | last post by:
Hi all, I am trying to setup a daily task in my .NET (1.1) application. The application is a project management tool, and the daily task I am trying to set up will check for overdue project deadlines, and send out email reminders. I have setup all the logic that checks deadlines & sends the emails, and that works great. However, automating it has been a problem.
1
1636
by: naveensrirangam | last post by:
We want to do a total 10 number of scheduled tasks daily. These tasks will run in certain time in daily and every task application developed in different technologies . Now we are looking to do a automation system for all the daily scheduled processes.what is the best approach to check and run the scheduled events / tasks.
0
9666
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9512
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10200
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9986
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7530
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6769
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4094
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.