Helpful Information
 
 
Category: DB2 Development
Scripts

Hi,

Can anyone direct me to a nice site where i can get scripts such as tablespace usage etc.

Thanks.

I don't know of any script sites myself though I'm sure someone out there has written some perl scripts to do what you are looking for. One that I was able to find rather quickly was: http://safariexamples.informit.com/0130463884/Scripts/tbs_usage.pl

But if you look at this script, all it does is call the "list tablespaces show detail" command and redisplay that information. There are a bunch of LIST and GET commands that provide a lot of information that would make either an external script unnecessary or make it easy to write your own if you wanted to rearrange the way the data was presented: http://publib.boulder.ibm.com/infocenter/db2help/index.jsp?topic=/com.ibm.db2.udb.doc/core/r0002004.htm

Hi,

yes there are a lot of scripts but most of them are for unix. in windows it is entirely different:

1. you have to connect to db2cmd and then run the db2 command
2. if you use any of the list commands it does not display on screen.

however i've kind a find a workaround using the build in function but and then using the dbd (which is mach better than the list).

Thanks,

Galit.

For Windows only there are a couple of interesting article on shell scripting on IBM's web site:

http://www-106.ibm.com/developerworks/db2/library/techarticle/0307fierros/0307fierros.html

http://www-106.ibm.com/developerworks/db2/library/techarticle/dm-0406fierros/

http://www-106.ibm.com/developerworks/db2/library/techarticle/dm-0311fierros/index.html

http://www-106.ibm.com/developerworks/db2/library/techarticle/0203yip/0203yip.html

Hi,

yes there are a lot of scripts but most of them are for unix. in windows it is entirely different:

1. you have to connect to db2cmd and then run the db2 command
2. if you use any of the list commands it does not display on screen.

however i've kind a find a workaround using the build in function but and then using the dbd (which is mach better than the list).

Thanks,

Galit.
Here is one way you can call a sql script from anywhere.
You can create a sql script (an example)

connect to your_dsn user your_username using your_password;
select * from some_schema.some_table;
connect reset;Then call the script through db2 -t -f scriptfile
So you could do something like c:\progra~1\SQLLIB\bin\db2cmd "db2 -t -f c:\path\to\scriptfile" and this will run the script.

Hi Joe,

Thanks for the input. i eventually used the function to do what the db2 show commands does.

ps.
nice dog. how old is he?

Thanks
The female (first picture) is 1 & 1/2 years old. The male (full picture) is 13 months.

Hi Joe,

- babies ... :)

Yep, they sure are. :D










privacy (GDPR)