Using oid.sh to resolve corruptions in CODB Print

  • 0

From time to time, an anomaly may occur that causes the BlueOnyx underlying CODB database to become corrupted.  When this happens, symptoms can include the inability to start cced.init service, or failing to add/modify/remove users and sites on the server.

Finding corruption in the BlueOnyx CODB database can be aided with the "oid.sh" script created by Michael Stauber.  This information is largely provided from information located at [BlueOnyx:10463] on the BlueOnyx Users Mailing List.

  1. As root via your BlueOnyx server's CLI, create a new file on your BlueOnyx server called "oid.sh" and paste the code within the lines below.
    .
  2. Make the script executeable ("chmod 700 /root/oid.sh") and run it. CCEd does NOT have to run for this test.
    .
  3. It will generate output similar to this:
    [root@server ~]# /root/oid.sh
    1-51,56-59,65-114,127-135,149-153,160-175,181-201,204-207,219-229,231-257,260-291,328-329,337-347,363-367,377-382,392-397
    /usr/sausalito/codb/codb.oids reports:
    1-51,56-59,65-114,127-135,149-153,160-175,181-201,204-207,219-229,231-257,260-291,328-329,337-347,363-367,377-382,392-397
     
    The lines with the numbers are what we are looking for. They MUST be identical. If they are not, then that is the problem, and you should proceed to the next step.  If the lines are identical, then this is not the source of your trouble.  Do not proceed to the next step.
    .
  4. Edit /usr/sausalito/codb/codb.oids and remove everything in it. Then copy the first numbered line into that file.
    .
  5. restart CCEd with this command:
    /etc/init.d/cced.init restart

Code for oid.sh:


#!/bin/bash
LAST=-1
MIN=-1

for X in `ls /usr/sausalito/codb/objects/ | sort -n`
do
  MYNEXT=$(( $LAST + 1 ))
  if [ $MYNEXT -eq $X ]
  then
    LAST=$X
  else
    if [ $LAST -ge 1 ]
    then
      if [ $MIN -eq $LAST ]
      then
        echo -n $LAST,
      else
        echo -n $MIN-$LAST,
      fi
    fi
    LAST=$X
    MIN=$X
  fi
done
if [ $MYNEXT -lt $X ]
then
  echo -n $LAST
else
  echo -n $MIN-$LAST
fi

echo ""
echo "/usr/sausalito/codb/codb.oids reports:"
cat /usr/sausalito/codb/codb.oids
echo ""


Was this answer helpful?

« Back