[Spacewalk-list] Oracle XE reached 4GB Limit

Flaherty, Patrick pflaherty at wsi.com
Thu Oct 14 15:23:13 UTC 2010



> -----Original Message-----
> From: spacewalk-list-bounces at redhat.com [mailto:spacewalk-list-
> bounces at redhat.com] On Behalf Of Sabuj Pattanayek
> Sent: Wednesday, October 13, 2010 9:08 AM
> To: spacewalk-list at redhat.com
> Subject: Re: [Spacewalk-list] Oracle XE reached 4GB Limit
> 
> How did you know you hit the 4gb limit?
> 
> On Wed, Oct 13, 2010 at 7:56 AM, Rampersad, Shaun
> <Shaun.Rampersad at rmb.co.za> wrote:
> >
> > Rampersad, Shaun wrote:
> >>> Hi all
> >>>
> >>>
> >>>
> >>> I've been using spacewalk to manage my centos servers. I have a
mix
> of
> >>> Centos 4 and 5, both 32 and 64 bit. I have created channels for
> each one
> >>> of them and have over 100 servers registered.
> >>>
> >>>
> >>>
> >>> The problem is that the Oracle XE DB has reached its 4GB limit.
How
> can
> >>> I get around this? Do I need to delete all "old" packages from the
> >>> repository and then delete the channel and upload?
> >>
> >>I do not have any solutions to offer other than trying to trim/purge
> old
> >>system profiles and packages.
> >
> > I have deleted the Centos4 i386 channels since I only had 6 servers
> registered on this. I have also deleted about 3000 orphaned packages
on
> spacewalk under "Manage Software Packages" but I still cannot load
> newer packages on Centos 5 channel. Its as if the delete did not free
> up the DB space and it is still on 4GB
> >
> > Anything else I can try? I wanted to delete the Centos4 x86_64 bit
> channel as well but if it has no effect then its pointless.
> >
> > Thanks
> > Shaun
> >
> >>
> >>
> >>> Are there any alternatives to Oracle XE? Has there been any
> progress on
> >>> Postgres? I see that this is scheduled for release on spacewalk
> 2.0.
> >>
> >>Postgres is progressing, slowly, but we have achieved a point where
> it
> >>can install and some very basic functionality seems to work, but it
> is
> >>not even in an alpha state. More information:
> >>
> >>https://www.redhat.com/archives/spacewalk-devel/2010-
> October/msg00017.html
> >>
> >>Spacewalk nightly can be installed without Oracle bits (developers
> only)
> >>
> >>NOTE: developers only...
> >>
> >>Cliff
> >
> > This e-mail is subject to a disclaimer, available at
> http://www.rmb.co.za/web/elements.nsf/online/disclaimer-
> communications.html
> >

I got this nagios check for free space. I'm very thankful to whoever
wrote it, learning oracle is almost as damaging as getting an MBA.
Change the variables for your spacewalk database username and password,
and call the script with your warning and critical arguments.

Patrick




#!/bin/bash

SPACEWALK_USER=" YourSpacewalkDB_Username"
SPACEWALK_PASS="YourSpacewalkDB_Password"
SPACEWALK_SID="XE"
WARNING_PERCENTAGE=$1
CRITICAL_PERCENTAGE=$2

if [[ ! `which sqlplus` ]]; then
 echo "CRITICAL - sqlplus command not found"
 exit 2
fi

SPACEWALK_DB_USED="$(echo "select trunc(sum(bytes)/1024/1024, 2) MB from
dba_segments where owner = '${SPACEWALK_USER}';" | sqlplus -s
${SPACEWALK_USER}/${SPACEWALK_PASS}@${SPACEWALK_SID} | awk '$1 ~
/[0-9]+/{print $1}')"

if [[ $? != 0 ]]; then
 echo "CRITICAL - could not get space used data from oracle"
 exit 2
fi

SPACEWALK_DB_FREE="$(echo "scale=2; 4096-${SPACEWALK_DB_USED}" | bc)"

SPACEWALK_DB_USED_PERCENT="$(echo "scale=2;
(${SPACEWALK_DB_USED}/4096)*100" | bc)"

SPACEWALK_DB_FREE_PERCENT="$(echo "scale=2;
100-${SPACEWALK_DB_USED_PERCENT}" | bc)"

if (( `echo "${SPACEWALK_DB_FREE_PERCENT} <= ${CRITICAL_PERCENTAGE}" |
bc` )); then
  echo "CRITICAL - Less than ${CRITICAL_PERCENTAGE}% space left |
DB_USED=${SPACEWALK_DB_USED}MB;DB_FREE=${SPACEWALK_DB_FREE}MB;DB_USED_PE
RCENT=${SPACEWALK_DB_USED_PERCENT};DB_FREE_PERCENT=${SPACEWALK_DB_FREE_P
ERCENT}"
  exit 2
 elif (( `echo "${SPACEWALK_DB_FREE_PERCENT} <= ${WARNING_PERCENTAGE}" |
bc` )); then
  echo "WARNING - Less than ${WARNING_PERCENTAGE}% space left |
DB_USED=${SPACEWALK_DB_USED}MB;DB_FREE=${SPACEWALK_DB_FREE}MB;DB_USED_PE
RCENT=${SPACEWALK_DB_USED_PERCENT};DB_FREE_PERCENT=${SPACEWALK_DB_FREE_P
ERCENT}"
  exit 1
 elif (( `echo "${SPACEWALK_DB_FREE_PERCENT} > ${WARNING_PERCENTAGE}" |
bc` )); then
  echo "OK - Spacewalk DB size within limits |
DB_USED=${SPACEWALK_DB_USED}MB;DB_FREE=${SPACEWALK_DB_FREE}MB;DB_USED_PE
RCENT=${SPACEWALK_DB_USED_PERCENT};DB_FREE_PERCENT=${SPACEWALK_DB_FREE_P
ERCENT}"
  exit 0
 else
 echo "UNKNOWN - was unable to compare DB space values |
DB_USED=${SPACEWALK_DB_USED}MB;DB_FREE=${SPACEWALK_DB_FREE}MB;DB_USED_PE
RCENT=${SPACEWALK_DB_USED_PERCENT};DB_FREE_PERCENT=${SPACEWALK_DB_FREE_P
ERCENT}"
 exit 3
fi





More information about the Spacewalk-list mailing list