Showing posts with label space. Show all posts
Showing posts with label space. Show all posts

Monday, 29 June 2020

Proactive Sybase DB space

Monitoring the total space occupied by sybase database only,doesn't answer below question.

  • 1 year of DB growth is available for analysis. 
  • Is data continuously growing and is it predictable that database runs out of space?
* The below practical steps only applicable for the Sybase Ase version 16 SP03 and above.

1. Login to ASE DB and execute the below command.

Hostname:/sybase/<sid> >dataserver - v


Result of the above command:

DB version. 

2. ASE Database system should be integrated in DBA Cockpit.

 
Practical steps:


1. Enter hostname in the DBA Cockpit search.
2. Click on the system search.
3.click on new database opened with system name
4.click on space tab
5.click on databases in the space drop-down.
6.select the database name(Sid).
7.click on show Growth option.
8.select time frame.
9.select Granularity
10.click on Apply selection.
11.Click on Chart tab.
12.Click on summary tab.
13.Click on Details tab.
14. Download report in Excel.


Supporting sap note: 2564157

Tuesday, 10 March 2020

Check file system space script


Method - 1:

Disk Space Check
=================
# Check the filesystem
df -h
# Remove un-wanted rows
df -h | egrep -v "Filesystem|tmpfs"
# Get 5th and 6th column
df -h | egrep -v "Filesystem|tmpfs" | awk '{print $5, $6}'
df -h | egrep -v "Filesystem|tmpfs" | awk '{print $5}' | cut -d'%' -f1`
--------------------------------------------
First For loop script
vi checkdisk
#!/bin/bash
a=`df -h | egrep -v "tmpfs|devtmpfs" | tail -n+2 | awk '{print $5}' | cut -d'%' -f1`
for i in $a
do
        if [ $i -ge 50 ]
        then
        echo Check disk space $i `df -h | grep $i`
        fi
done
--------------------------------------------


Method - 2:


#!/bin/sh
df -H | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{print $5,$1}' | while read output
do
        usep=$(echo $output | awk '{print $1}' | cut -d'%' -f1  )
        partition=$(echo $output | awk '{print $2}' )
       
        if [ $usep -ge 90 ]
        then
        echo "Running out of space \"$partition ($usep%)\" on $(hostname) as on $(date)"
        fi
done
--------------------------------------------


Method - 3 (simple method):
#Write a script to awk only those rows with the value

#!/bin/sh
df -h | awk '0+$5 >= 10 {print}'
To make it presentable
echo
echo Following is the disk space status
echo
df -h | awk '0+$5 >= 10 {print}' | awk '{print $5, $6}'