RE: High Performance Loader HELP
Posted in 1998
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------ =_NextPart_000_01BDF1E7.9D0E3D9C
Content-Type: text/plain;
charset="iso-8859-1"
Attached is a script I use to remove onpload jobs. Please see the
"Usage at the front of the script". If you choose to remove "ALL" jobs
at one time, the script looks for jobs ending in "U or L". You will
have to modify this to pick up all your onpload job names.
<<delete_ploads.ksh>>
Herbert Yates
Database Administrator
Herbert.yates@cibavision.novartis.com
(770)418-3322
-----Original Message-----
From: BEATRIZ ROCHA [SMTP:BEATRICE.ROCHA@worldnet.att.net]
Sent: Tuesday, October 06, 1998 6:26 PM
To: informix-list@iiug.org
Subject: High Performance Loader HELP
Attached is a script I use to remove onpload jobs. Please see
the "Usage at the front of the script". If you choose to remove "ALL"
jobs at one time, the script looks for jobs ending in "U or L". You
will have to modify this to pick up all your onpload job names.
I have been using the High performance loader (HPL ) version 7.2
on an HP-UX 10.20. It has worked fine in most cases, but when I have
to create a large project it gives me an error and creates a core dump.
I spent a great deal of time with the Informix technical support person
who was very helpful and it seems that the problems that I got are
reported errors in this version.
My question is if some body has an SQL script that will remove a
project with all its jobs and dependency tables from the onpload
database. I can not remove the projects from the ipload GUI because I
get an error and a core dump (these were the projects that I had
problems with).
Otherwise could I just drop the entire onpload informix database
and
re-create my two projects that do work?
Thank You very much
------ =_NextPart_000_01BDF1E7.9D0E3D9C
Content-Type: application/octet-stream;
name="delete_ploads.ksh"
Content-Disposition: attachment;
filename="delete_ploads.ksh"
#!/bin/ksh
#---------------------------------------------------------------------------#
# Title: delete_ploads.ksh
# Author: Herbert Yates
# Date: 06/29/98
# Remarks: Deletes all jobs from onpload database which end in U or L, or
# a single job if you supply the name. Your must enter 'ALL' or
# the jobname
# Dirs:
# Usage $0 "jobname or ALL" PROJECT
#---------------------------------------------------------------------------#
umask=000
export HOMEDIR="/home/it/yateshe1"
export NAME=$1
[ -z "${NAME}" ] && {
echo "Usage $0 jobname_or_ALL PROJECT"
echo "You must enter the jobname or ALL"
exit 1
}
export PROJECT=$2
#[ -z "${PROJECT}" ] && {
# echo "Usage $0 jobname_or_ALL PROJECT"
# echo "You must enter the onpload PROJECT"
# exit 2
#}
export TMP=/tmp
if [[ -z ${INF} ]];then
INF=${INFORMIXSERVER}fi
export DB=onpload
typeset -L18 PROJNAME
typeset -L18 PNAME
# -----------------------------------------------------------------------------#
get_projects()
{
dbaccess sysmaster <<! 2>>/dev/null
output to ${TMP}/$$.c
without headings
select name from sysdatabases
where name not in ("sysmaster","sysutils","stores7","stores2");!
sed -e '/^$/d' ${TMP}/$$.c>${TMP}/$$.d
export PROJECTLIST="${TMP}/$$.d"
}
# --------------------------------------------------------------------------#
cr_lists() {
dbaccess ${DB} <<! 2>>/dev/null
output to ${TMP}/$$.a without headings
select name from formats
where projectid=${PID}
and (name like "%L" or
name like "%U");!
cat ${TMP}/$$.a |sed '/^$/d' >${TMP}/$$.b
}
# -----------------------------------------------------------------------------#
get_projectid() {
typeset -i PROJECTID
export PROJECTID=$(dbaccess onpload<<! 2>/dev/null |sed '/^$/d'|grep -v project
select projectid from project
where name = "${PROJECT}"!
)
[ "${PROJECTID}" ] || {
echo "PROJECT: ${PROJECT} not found in onpload DB"
exit 1
}
export PID=${PROJECTID}
}
# -----------------------------------------------------------------------------#
delete_jobs() {
dbaccess onpload<<! 1>/dev/null 2>&1
delete from formatitem where formid in
(select formid from formats where name = "${PJOB}");
delete from mapitem where formid in
(select formid from maps where name = "${PJOB}");
delete from device where name = "${PJOB}";
delete from formats where name = "${PJOB}"
and projectid=${PID};
delete from maps where name = "${PJOB}"
and projectid=${PID};
delete from query where name = "${PJOB}"
and projectid=${PID};
delete from session where name = "${PJOB}"
and projectid=${PID};!
}
# -----------------------------------------------------------------------------#
continue_job() {
TOTCNT=$(cat ${TMP}/$$.b|wc -l)
[ "${TOTCNT}" -gt 0 ] && {
echo "---------- Total number to delete from ${PROJECT}: ${TOTCNT}"
# print -n "Delete? yes_or_no: "
# read DEL
# case $DEL in
# yes|YES) echo "Continuing with the deletes" ;;
# *) return ;;
# esac
}
}
# -----------------------------------------------------------------------------#
# MAIN
# -----------------------------------------------------------------------------#
if [[ -z "${PROJECT}" ]];then
get_projects
else
echo ${PROJECT}>${TMP}/$$.d
PROJECTLIST="${TMP}/$$.d"
fi
for PROJECT in $(cat ${PROJECTLIST});do
get_projectid
if [[ "${NAME}" = "ALL" ]];then
cr_lists
else
echo "${NAME}U" > ${TMP}/$$.b
echo "${NAME}L" >>${TMP}/$$.b
fi
PROJNAME=${PROJECT}
continue_job
DELCNT=0
for PJOB in $(cat ${TMP}/$$.b);do
PNAME=${PJOB}
delete_jobs
let "DELCNT = ${DELCNT} + 1"
let "GRNCNT = ${GRNCNT} + 1"
echo "${PNAME} ${PROJNAME} pid=${PID} deleted: ${DELCNT} of ${TOTCNT}"
done
echo "${DELCNT} jobs removed from project ${PROJECT}"
done
echo ;echo "Grand total removed: ${GRNCNT}"
rm ${TMP}/$$.[a-z]
exit 0
------ =_NextPart_000_01BDF1E7.9D0E3D9C--