cancel
Showing results for 
Search instead for 
Did you mean: 

Crontab Script to monitor tablespace

former_member182921
Participant
0 Kudos

Hi SAP Experts ,

In our project we regularly face an issue of Table space  Full.

I want to create a crontab script for HPUX and Linux .

Can anybody help me on This .

Regards ,

Abhishek

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Abishek,

Just an idea, instead of monitoring the Tablespace full, you can make all Tablespaces and Datafiles AUTOEXTEND, then you create a big datafiles in advance with initial like 2GB or so, then you only have to make sure you have enough room on your filesystems (LUN´s). This way you don't have to monitor extensively (once or twice per month) and it shifts to capacity-management, instead of problem-management.

And you don't have to worry about maintaining a script.

I hope this will help you.

Regards,

Andre

Former Member
0 Kudos

Hi,

Do you have solution manager?

Why don't you activate the CCMS monitoring for the Table space check.

Ok now to see the table space you can used the below command to see the table space.

brspace -f dbshow -c tsinfo

what you need to have in the crontab is

ss hh * * * . /location of the script/tablespacecheck.sh

vi tablespacecheck.sh

you need to write a code to call the below command when you are at SQL prompt.

This query will help you to find the table space free size

SELECT /* + RULE */df.tablespace_name AS "Tablespace",df.bytes / (1024 * 1024 * 1024) AS "Size (GB)",Trunc(fs.bytes / (1024 * 1024 * 1024)) AS "Free (GB)" FROM(SELECT tablespace_name,Sum(bytes) AS bytes FROM dba_free_space GROUP BY tablespace_name) fs, ( SELECT tablespace_name,SUM(bytes) AS bytes FROM dba_data_files GROUP BY tablespace_name) df WHERE fs.tablespace_name = df.tablespace_name ORDER BY 3 desc

Hope this helps.

Thanks

Rishi Abrol