Segmentation fault calling an oracle db status script
HI,
I have a problem on a OEL 5 cluster with an Oracle 10.2.0.3 in active/passive environment (not RAC).
When the Oracle Cluster service script checks the status of the service sometimes I have segmentation fault error.
The script is:
#!/bin/sh
# Cluster service script to start, stop, and check status of oracle
set -xv
case $1 in
start)
su - oracle -c /home/oracle/startdb.sh
RetVal=$?
stop)
su - oracle -c /home/oracle/stopdb.sh
RetVal=$?
status)
su - oracle -c /home/oracle/statusdb.sh
RetVal=$?
esac
set +xv
exit $RetVal
The error log of the executing the "status" part of the script is:
+ case $1 in
+ su - oracle -c /home/oracle/statusdb.sh
/usr/local/sbin/oraclust.sh: line 16: 6779 Segmentation fault su - oracle -c /home/oracle/statusdb.sh
+ RetVal=139
This script is executed every 30 seconds but I have the error once every 10 hours.
What could it be?
Many thanks.
hi,
here is the script /home/oracle/statusdb.sh:
#!/bin/sh
# Script to CHECK the Oracle Database Server Status.
ORACLE_RELEASE=10.2.0
export ORACLE_SID=mysid
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/${ORACLE_RELEASE}/db_1
export LD_LIBRARY_PATH=${ORACLE_HOME}/lib:$LD_LIBRARY_PATH
export PATH=$PATH:${ORACLE_HOME}/bin
${ORACLE_HOME}/bin/sqlplus / as sysdba << EOF
whenever sqlerror exit sql.sqlcode;
whenever oserror exit failure;
set pagesize 0;
set feedback off;
set wrap off;
set heading off;
UPDATE clustmon.clst_chk_tbl SET status = 'ok';
commit;
quit;
EOF
exit $?
thanks.
Similar Messages
-
Segmentation fault while install Grid 11.2.0.3
Hi guys.
I try to install a stand alone oracle Database 11.2.0.3 with ASM over a RedHat 6.4 x86_64 Vmware server.
Hardware
4 cores
32 GB RAM
Vmware server 5.1.0
Operating System
RedHat 6.4 x86_64, 2.6.32-358.6.2.el6.x86_64 (update today with yum update).
All needs packages installeds (i think so).
Vmware tools installed and updated.
Software
p10404530_112030 software packages.
Disk are mapping with udev/multipath, not ASM.
Installing steps.
1.- Execute enviroment shell.
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_SID=+ASM; export ORACLE_SID
ORACLE_HOME=/u01/app/11.2.0.3/grid; export ORACLE_HOME
PATH=$PATH:$ORACLE_HOME/bin:$BASE_PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
2.- Execute Grid runInstall
3.- Chose Configurarion Grid for Standalone server.
4.- ASM disk are founded, listed and selected.
5.- Requirement validator only warning pdksh package, but Redhat 6 has ksh package (and it's installed). So, i ignored that warning and continue.
6.- Install process start fine.
7.- Install process want executed root scripts
[root@oraclepruebas ~]# /u01/app/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete.
[root@oraclepruebas ~]# /u01/app/11.2.0.3/grid/root.sh
Performing root user operation for Oracle 11g
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/11.2.0.3/grid
Enter the full pathname of the local bin directory: [/usr/local/bin]:
Copying dbhome to /usr/local/bin ...
Copying oraenv to /usr/local/bin ...
Copying coraenv to /usr/local/bin ...
Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Using configuration parameter file: /u01/app/11.2.0.3/grid/crs/install/crsconfig_params
Creating trace directory
LOCAL ADD MODE
Creating OCR keys for user 'oracle', privgrp 'oinstall'..
Operation successful.
LOCAL ONLY MODE
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
Failure with signal 11 from command: /u01/app/11.2.0.3/grid/bin/crsctl pin css -n oraclepruebas
Pin node (/u01/app/11.2.0.3/grid/bin/crsctl pin css -n oraclepruebas) ... failed
So, if i execute crsctl command, i have a nice Segmentation fault error, but if i try to execute another grid command, everyting is fine.
[root@oraclepruebas oracle]# /u01/app/11.2.0.3/grid/bin/crsctl
Segmentation fault
[root@oraclepruebas oracle]#
[root@oraclepruebas oracle]# /u01/app/11.2.0.3/grid/bin/ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 92
Available space (kbytes) : 262028
ID : 756593197
Device/File Name : /u01/app/11.2.0.3/grid/cdata/localhost/local.ocr
Device/File integrity check succeeded
Device/File not configured
Device/File not configured
Device/File not configured
Device/File not configured
Cluster registry integrity check succeeded
Logical corruption check succeeded
This is weird, because i has installed a RAC 11.2.0.3 databases and standalone databases (all with grid) over Vmware and RedHat 6.4 and works fine. I have even compared the rpm packages between a functionally installation with this server and matched all !!!.
I think that i am making a mistake, but i can't see it. I wan't reinstall or clone a funcionally virtual machine, because i want to learn with my mistake.
I has googled too much and i searched into metalink but i can't find something similar.
I apreciate your help, suggestions, anything.I had similar issue while installing 32bit version by mistake. Just to checkyou have x86-64 in the filenames of oracle software distribution
p10404530_112030_Linux-x86-64_1of7.zip
p10404530_112030_Linux-x86-64_2of7.zip
p10404530_112030_Linux-x86-64_3of7.zip
Regards
Ed
http://erudans.blogspot.com -
Call SQLGLM creates core dump segmentation fault in oracle 9i database
Hi,
I am doing call to SQLGLM to get description of error message. This always worked in oracle 9i 32 bit but it does not work with 64 bit installation. I get core dump and segmentation fault.
Please help.
Altafwow.. I just upgraded glibc to 2.3.2... and everything works!
:D -
Oracle 8i, SUSE Linux, Segmentation fault
When I hit the ./runInstaller it just bombs out with
segmentation fault at line 34. It looks like the runInstaller
script is running runInstaller (again?).
nullIs Suse using Glibc 2.1? Oracle requires glibc 2.1 and a seg
fault might be an indication your machine does not have this
capability.
Either install glibc 2.1 on your machine, or move to a distro
that is glibc 2.1 native (RedHat 6.0).
Best of Luck,
--Bryan
nick lockyer (guest) wrote:
: When I hit the ./runInstaller it just bombs out with
: segmentation fault at line 34. It looks like the runInstaller
: script is running runInstaller (again?).
null -
Segmentation fault when calling gpctr function from matlab mex file
I am trying to write a simple mex file for square wave generation using counter1 of PCI-6035E. I am using matlab's native compiler to compile and link with the nidaq32 library, ver.6.9.3, with no errors. When the mex function is called from a matlab script, however, the program crashes at the first call, to reset the counter. (I can generate a square wave with the test panel.)
Sorry for the delay in responding. I got caught up in other stuff. I am attaching my little program as requested. As you can see, I have just wrapped a mexFunction call round the example code for square wave generation. After I posted this, I tracked down a copy of BorlandC++, installed it on my computer and recompiled using that compiler and *b.* libraries. And would you know it, the program works. The question remains, though, why it doesn't work with Matlab's native lcc compiler. Plus, I have limited disk space, so if I can do without BorlandC, I can use the extra room. The runtime error was a Segmentation fault that I traced to the first call to GPCTR_Control.
Attachments:
pulsegen.c 4 KB -
Segmentation fault when calling dbms_alert.register() procedure from OCCI
I am trying to call the dbms_alert.register() from the OCCI but I get segmentation fault when I run the program, here is the code snippet. I am gettin segmentation fault immediately after calling setSQL() method.
Environment *occiEnvironment_;
Connection *occiConnection_ ;
string userName("SCOTT");
string userPasswd("tiger");
string url("");
occiEnvironment_ = Environment::createEnvironment();
try{
occiConnection_ = occiEnvironment_->createConnection(userName,userPasswd,url);
Statement *occiStatement1;
cout << "Before setSQL" << endl;
occiStatement1->setSQL("BEGIN dbms_alert.register(:1); END;");
cout << "After setSQL" << endl;
string alert1("MY_ALERT");
occiStatement1->setString(1,alert1);
occiStatement1->execute();
catch (SQLException ea)
cout << ea.what();
}Thanks for the reply, now I dont see segmentation fault.
I tried to exted the code further to wait for the registered events, I added the following code, I do get and event but then get the exception:
Statement *occiStatement1 = occiConnection_->createStatement();
Statement *occiStatement2 = occiConnection_->createStatement();
string alert, msg;
int status;
occiStatement1->setSQL("BEGIN dbms_alert.register(:1); END;");
string alert1("MY_ALERT");
occiStatement1->setString(1,alert1);
occiStatement1->execute();
occiStatement2->setSQL("BEGIN dbms_alert.waitany(:alert,:msg,:status); END;");
occiStatement2->registerOutParam(1, OCCICHAR, sizeof(alert));
occiStatement2->registerOutParam(2, OCCICHAR, sizeof(msg));
occiStatement2->registerOutParam(3, OCCIINT, sizeof(int));
occiStatement2->execute();
===========================================================
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "SYS.DBMS_ALERT", line 252
ORA-06512: at line 1
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "SYS.DBMS_ALERT", line 252
ORA-06512: at line 1
*** glibc detected *** free(): invalid pointer: 0x08619c48 ***
Aborted -
Limitation on number of roles in oracle menu or segmentation fault in menu
Hi All,
Is there any limitation on the number of roles we can have in oracle menu? We are having around 300 roles created in our menu and after that if we try to add new role we are not able to compile the menu file. In the windows the form builder closes abruptly and in Linux it gives us segmentation fault error. Did anyone face the problem? Also if there is any solution then please provide the same.
Please let me know.
Thanks in advance!
AshishI just wonder how many forms do you have that you needed to create 300 roles. We normally create a role for one set of users. It means you've 300 different set of users for your application !!.
-
Error during up2date oracle-validated gives segmentation fault
Hi all,
I am trying to run the up2date oracle-validated command for Oracle Enterprise Linux 5 64 bit and it
fails on memory dump errors.
[root@tstdb01]# up2date oracle-validated
Fetching Obsoletes list for channel: el5_x86_64_latest...
Fetching rpm headers...
Segmentation fault
Any ideas how to resolve this?
Edited by: 783904 on Aug 19, 2010 9:09 AM# cat /etc/sysconfig/rhn/up2date
# Automatically generated Red Hat Update Agent config file, do not edit.
# Format: 1.0
enableRollbacks[comment]=Determine if up2date should create rollback rpms
enableRollbacks=0
noSSLServerURL[comment]=Remote server URL without SSL
noSSLServerURL=http://linux-update.oracle.com/XMLRPC
useNoSSLForPackages[comment] =Use the noSSLServerURL for package, package list, and header fetching
useNoSSLForPackages=0
debug[comment]=Whether or not debugging is enabled
debug=0
noReplaceConfig[comment]=When selected, no packages that would change configuration data are automatically installed
noReplaceConfig=1
retrieveOnly[comment]=Retrieve packages only
retrieveOnly=0
keepAfterInstall[comment]=Keep packages on disk after installation
keepAfterInstall=0
systemIdPath[comment]=Location of system id
systemIdPath=/etc/sysconfig/rhn/systemid
serverURL[comment]=Remote server URL
serverURL=https://linux-update.oracle.com/XMLRPC
pkgSkipList[comment]=A list of package names, optionally including wildcards, to skip
pkgSkipList=kernel*;
pkgsToInstallNotUpdate[comment]=A list of provides names or package names of packages to install not update
pkgsToInstallNotUpdate=kernel;kernel-modules;kernel-devel;
adminAddress[comment]=List of e-mail addresses for update agent to communicate with when run in batch mode
adminAddress=root@localhost;
storageDir[comment]=Where to store packages and other data when they are retrieved
storageDir=/var/spool/up2date
fileSkipList[comment]=A list of file names, optionally including wildcards, to skip
fileSkipList=;
removeSkipList[comment]=A list of package names, optionally including wildcards that up2date will not remove
removeSkipList=kernel*;
enableProxy[comment]=Use a HTTP Proxy
enableProxy=0
retrieveSource[comment]=Retrieve source RPM along with binary package
retrieveSource=0
versionOverride[comment]=Override the automatically determined system version
versionOverride=
httpProxy[comment]=HTTP proxy in host:port format, e.g. squid.redhat.com:3128
httpProxy=
useGPG[comment]=Use GPG to verify package integrity
useGPG=1
gpgKeyRing[comment]=The location of the gpg keyring to use for package checking
gpgKeyRing=/etc/sysconfig/rhn/up2date-keyring.gpg
noBootLoader[comment]=To disable modification of the boot loader (lilo, silo, etc)
noBootLoader=0
noReboot[comment]=Disable the reboot actions
noReboot=0
networkRetries[comment]=Number of attempts to make at network connections before giving up
networkRetries=5
updateUp2date[comment]=Allow up2date to update itself when possible
updateUp2date=1
disallowConfChanges[comment]=Config options that can not be overwritten by a config update action
disallowConfChanges=noReboot;sslCACert;useNoSSLForPackages;noSSLServerURL;serverURL;disallowConfChanges;
sslCACert[comment]=The CA cert used to verify the ssl server
sslCACert=/usr/share/rhn/ULN-CA-CERT
[root@tstdb01 up2date]# *up2date --show-channels*el5_x86_64_latest -
How to call a oracle procedure with in/out parameter frm unix shell script?
Hi,
I need to call an oracle stored procedure from unix script. The procedure has 1 input parameter and 2 output parameter. Please send me the syntax for the same. Based on the output values of procedure, I have to execute some more commands in unix script.
Thanks and regards
AAn example :
TEST@db102 SQL> select ename, job from emp
2 where empno = 7902;
ENAME JOB
FORD ANALYST
TEST@db102 SQL> create or replace procedure show_emp (
2 v_empno in number,
3 v_ename out varchar2,
4 v_job out varchar2 )
5 is
6 begin
7 select ename, job into v_ename, v_job
8 from emp
9 where empno = v_empno;
10 end;
TEST@db102 SQL> /
Procedure created.
TEST@db102 SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
[ora102 work db102]$ IN=7902
[ora102 work db102]$ set `sqlplus -s test/test@db102 << !
var out1 varchar2(30);
var out2 varchar2(30);
set pages 0
set feed off
exec show_emp($IN,:out1,:out2);
print
exit
`[ora102 work db102]$ echo $1 $2
FORD ANALYST
[ora102 work db102]$ -
How we can call or execute a SHELL script through Oracle forms or Reports
How we can call or execute a SHELL script through Oracle forms or Reports.Its urgent.......
Use HOST command.
-
Can I call host file ( Unix Shell script ) from Oracle 10g trigger
Hi,
I am new to Oracle 10g. Can I call host file ( unix shell script ) from Oracle 10g trigger ?. I know it is possible. Pl explain me with small example
thanks & regards
paraguser12009546 wrote:
Hi,
I am new to Oracle 10g. Can I call host file ( unix shell script ) from Oracle 10g trigger ?. I know it is possible. Pl explain me with small example
thanks & regards
paragIf you are in 10g, you can simple call shell script from DBMS_SCHEDULER:
BEGIN
DBMS_SCHEDULER.CREATE_JOB (
job_name => 'TEST_SCRIPT',
job_type => 'EXECUTABLE',
job_action => 'PATH_OF_YOUR_SCRIPT',
start_date => SYSDATE,
repeat_interval => 'FREQ=MINUTELY; INTERVAL=1',
enabled => TRUE,
comments => 'Shell script from Oracle'
END;
/ -
[solved] Segmentation fault with bash script
I have a bash script that checks if it has to do something, if not it sleeps 15 secs and checks again. It works great except that after ~6hrs of just checking and sleeping it seg faults. I upped the stack limit with ulimit -s and it goes ~12hrs before it seg faults. I have a similar script that I have been using for ages that works for 24hrs no problem and I can't pinpoint where the problem is.
The check it does is to see if a file exists, if it's empty and if not, read the first line of a file and do some date comparisons. It doesn't matter if the file is empty or not the seg fault always happens.
Here's the seg fault causing script - it starts at the bottom
#!/bin/bash
# User defines
declare -i DVB_DEVICE_NUM="0"
declare CHANNELS_CONF="${HOME}/Mychannels.conf"
declare SAVE_FOLDER="${HOME}/TV/tele"
declare SCHED_FILE="$HOME/.sched-tv"
declare ZAP_COMMAND="tzap"
declare -i SLEEP=15
# Program defines
declare -i DAY="0"
declare -i START="0"
declare -i FINISH="0"
declare CHAN="0"
declare NAME="0"
declare -i MINUTES="0"
declare -i REC_START="0"
declare -i REC_HOURS="0"
declare -i REC_MINS="0"
declare -i howlong="0"
declare -i PIDOF_AZAP=0
declare -i PIDOF_CAT=0
red='\033[1;31m'
green='\033[1;32m'
yell='\033[1;33m'
cyan='\033[1;36m'
white='\033[1;37m'
reset='\033[0m'
function remove_entry {
if [ "$NAME" == "" ]; then
sed "/$DAY $START $FINISH $CHAN/d" $SCHED_FILE > /tmp/dummy
else
sed "/$DAY $START $FINISH $CHAN $NAME/d" $SCHED_FILE > /tmp/dummy
fi
mv /tmp/dummy $SCHED_FILE
function record_entry {
${ZAP_COMMAND} -a ${DVB_DEVICE_NUM} -f ${DVB_DEVICE_NUM} -d ${DVB_DEVICE_NUM} \
-c $CHANNELS_CONF -r ${CHAN} >/dev/null 2>&1 &
PIDOF_AZAP=$!
if [ "$PIDOF_AZAP" == "" ]; then
printf "$red\tError starting ${ZAP_COMMAND}.\n\tFAILED: $CHAN $START\n"
remove_entry
exit 1
fi
printf "$green\tSET CHANNEL$cyan ${CHAN}\n"
REC_MINS=$((${START}%100))
REC_HOURS=0
MINUTES=0
REC_START=$(($START-$REC_MINS))
while [ $((${REC_START}+${REC_HOURS}+${REC_MINS})) -lt $FINISH ]; do
((REC_MINS++))
((MINUTES++))
if [ ${REC_MINS} -ge 60 ]; then
REC_MINS=0
((REC_HOURS+=100))
fi
done
if [ "$NAME" == "" ]; then
declare FILE_NAME="${SAVE_FOLDER}/TV-`date +%Y%m%d-%H%M`-ch.${CHAN}-${MINUTES}.min.mpg"
else
declare FILE_NAME="${SAVE_FOLDER}/TV-${NAME}-${MINUTES}.min.mpg"
fi
dd if=/dev/dvb/adapter${DVB_DEVICE_NUM}/dvr${DVB_DEVICE_NUM} \
of=${FILE_NAME} conv=noerror &
PIDOF_CAT=$!
if (( ${PIDOF_CAT} == 0 )); then
printf "$red\tError Starting Recording.\n\t/dev/dvb/adapter${DVB_DEVICE_NUM}/dvr${DVB_DEVICE_NUM} Unavailable\n"
kill ${PIDOF_AZAP}
remove_entry
exit 1
fi
printf "$yell\tRECORDING TO :$cyan ${FILE_NAME}\n"
sleep ${MINUTES}m
kill ${PIDOF_CAT} && wait ${PIDOF_CAT} 2> /dev/null
# pkill $ZAP_COMMAND # && wait ${PIDOF_AZAP} 2> /dev/null
kill ${PIDOF_AZAP} && wait ${PIDOF_AZAP} 2> /dev/null
printf "$yell\tFINISHED REC :$cyan ${FILE_NAME}\n$reset"
remove_entry
waiting 1
function check_action {
[ -e "$SCHED_FILE" ] || waiting $SLEEP
[ "`cat $SCHED_FILE`" == "" ] && waiting $SLEEP
DAY="0"; START="0"; FINISH="0"; CHAN="0"; NAME="0"
TODAY=`date +%Y%m%d`
NOW=`date +%k%M`
while read -r DAY START FINISH CHAN NAME; do
#printf "$DAY $START $FINISH $CHAN $NAME\n"
break
done < $SCHED_FILE
if [ $DAY == $TODAY ] && [ $START -lt $NOW ]; then
printf "$red\tOld Entry : Removing $CHAN $START\n"
remove_entry
waiting 1
fi
if [ $DAY == $TODAY ] && [ $START == $NOW ]; then
record_entry
else
waiting $SLEEP
fi
function waiting {
howlong=$1
sleep $howlong && check_action
check_action
exit 0
And the script that has been working fine 24hrs at a time
#!/bin/bash
echo alarm uses a twelve hour clock
echo Type the time for the alarm to sound as 00-00-?m
echo e.g. 05-35-pm for 5:35pm :: 05-35-am for 5:35am
read TIME
function play {
A="$(date +%I-%M-%P)"
if [ $A = $TIME ]; then
for i in {1..10}; do
$(aplay -c 1 /home/$USER/alarm/chime.wav); done
exit
else
wait
fi
function wait {
sleep 15 && play
play
I was hoping to have this script idling away in screen with rtorrent, always ready to do something if need be but that's not going to happen unless I can get a clue on what part of the script I need to change to not hit any limits. My websearches are failing me on this...
Last edited by moetunes (2012-06-24 21:41:52)Thanks falconindy. I changed to using a while loop.
#!/bin/bash
set -o nounset
shopt -s huponexit
# User defines
declare -i DVB_DEVICE_NUM="0"
declare CHANNELS_CONF="${HOME}/Mychannels.conf"
declare SAVE_FOLDER="${HOME}/TV/tele"
declare SCHED_FILE="$HOME/.sched-tv"
declare ZAP_COMMAND="tzap"
declare -i SLEEP=15
# Program defines
declare -i DAY="0"
declare -i START="0"
declare -i FINISH="0"
declare CHAN="0"
declare NAME="0"
declare -i MINUTES="0"
declare -i REC_START="0"
declare -i REC_HOURS="0"
declare -i REC_MINS="0"
declare -i howlong=$SLEEP
declare -i PIDOF_AZAP=0
declare -i PIDOF_CAT=0
red='\033[1;31m'
green='\033[1;32m'
yell='\033[1;33m'
cyan='\033[1;36m'
white='\033[1;37m'
reset='\033[0m'
function remove_entry {
if [ "$NAME" == "" ]; then
sed "/$DAY $START $FINISH $CHAN/d" $SCHED_FILE > /tmp/dummy
else
sed "/$DAY $START $FINISH $CHAN $NAME/d" $SCHED_FILE > /tmp/dummy
fi
mv /tmp/dummy $SCHED_FILE
function record_entry {
${ZAP_COMMAND} -a ${DVB_DEVICE_NUM} -f ${DVB_DEVICE_NUM} -d ${DVB_DEVICE_NUM} \
-c $CHANNELS_CONF -r ${CHAN} >/dev/null 2>&1 &
PIDOF_AZAP=$!
if [ "$PIDOF_AZAP" == "" ]; then
printf "$red\tError starting ${ZAP_COMMAND}.\n\tFAILED: $CHAN $START\n"
remove_entry
exit 1
fi
printf "$green\tSET CHANNEL$cyan ${CHAN}\n"
REC_MINS=$((${START}%100))
REC_HOURS=0
MINUTES=0
REC_START=$(($START-$REC_MINS))
while [ $((${REC_START}+${REC_HOURS}+${REC_MINS})) -lt $FINISH ]; do
((REC_MINS++))
((MINUTES++))
if [ ${REC_MINS} -ge 60 ]; then
REC_MINS=0
((REC_HOURS+=100))
fi
done
if [ "$NAME" == "" ]; then
declare FILE_NAME="${SAVE_FOLDER}/TV-`date +%Y%m%d-%H%M`-ch.${CHAN}-${MINUTES}.min.mpg"
else
declare FILE_NAME="${SAVE_FOLDER}/TV-${NAME}-${MINUTES}.min.mpg"
fi
dd if=/dev/dvb/adapter${DVB_DEVICE_NUM}/dvr${DVB_DEVICE_NUM} \
of=${FILE_NAME} conv=noerror &
PIDOF_CAT=$!
if (( ${PIDOF_CAT} == 0 )); then
printf "$red\tError Starting Recording.\n\t/dev/dvb/adapter${DVB_DEVICE_NUM}/dvr${DVB_DEVICE_NUM} Unavailable\n"
kill ${PIDOF_AZAP}
remove_entry
exit 1
fi
printf "$yell\tRECORDING TO :$cyan ${FILE_NAME}\n"
sleep ${MINUTES}m
kill ${PIDOF_CAT} && wait ${PIDOF_CAT} 2> /dev/null
# pkill $ZAP_COMMAND # && wait ${PIDOF_AZAP} 2> /dev/null
kill ${PIDOF_AZAP} && wait ${PIDOF_AZAP} 2> /dev/null
printf "$yell\tFINISHED REC :$cyan ${FILE_NAME}\n$reset"
remove_entry
while true; do
sleep $howlong
howlong=$SLEEP
[ -e "$SCHED_FILE" ] || continue
[ "`cat $SCHED_FILE`" == "" ] && continue
TODAY=`date +%Y%m%d`
NOW=`date +%k%M`
while read -r DAY START FINISH CHAN NAME; do
#printf "$DAY $START $FINISH $CHAN $NAME\n"
break
done < $SCHED_FILE
if [ $DAY == $TODAY ] && [ $START -lt $NOW ]; then
printf "$red\tOld Entry : Removing $CHAN $START\n"
remove_entry
howlong=1
continue
fi
if [ $DAY == $TODAY ] && [ $START == $NOW ]; then
record_entry
fi
done
exit 0
I think that should be ok now. -
Calling DbEnv- remove after DbEnv- close results in a segmentation fault
I have two classes of database files: definitions that change slowly, and instances that are transient and change quickly.
What I'm trying to do is this:
close databases, environment
back up files
remove instance databases
open new environment, existing definitions and create new instances
This keeps returning ENOENT errors, but not consistently. The results are unpredictable and will sometimes hang. It seems to me that this is due to something in the environment not being cleared correctly. So I tried adding a remove after a close, and I get a regular and consistent segment fault as the unwrap function in cxx_env.cpp returns a NULL environment.
This behaviour is consistent in versions 4.3, 4.5, and 4.7 on Solaris 10 and RHEL 5.
So my question is twofold: Is there a better way to do what I'm tying to do, on that will work reliably, and shouldn't the remove operation work, even if ther's nothing to remove? I've had this problem for quite some time so any pointers would be appreciated.
TIA,
DaveSorry. I had a major attack of the stupids. I was using old code that unlinked the underlying files instead of using a db->remove. It works much better now.
-
Segment fault (Core dump)
Hi
when i run the following Pro*c file in Unix Environment im getting the SEGMENTATION FAULT(CORE DUMP) error. I used DBX to debug the code. I couldnt find out the proper reason for this error form the dbx output.
This is the output i got from DBX.
*signal SEGV (no mapping at the fault address) in _doprnt at 0xfb98736c*
*0xfb98736c: _doprnt+0x2798: stb %o0, [%o1]*
I did the showmemuse and show leaks, the output for this commands :
(dbx) showmemuse
Checking for memory use...
Blocks in use report (blocks in use: 575 total size: 328086 bytes)
Total % of Num of Avg Allocation call stack
Size All Blocks Size
======= ==== ====== ====== =======================================
134876 41% 30 4495 kpummapg < kghgex
18098 5% 1 18098 lxldlbb < lxlinit < kpummpin < kpupin < sqgctx < sqgrct < sqlcmex < sqlcxt
16552 5% 4 4138 kogmapg < kghgex
16516 5% 4 4129 kogmapg < kogmasg
12288 3% 6 2048 nlhtnsl < nlhthnew
10350 3% 5 2070 calloc < nsbGetBFS
9688 2% 1 9688 kouogini < kouoini < kpuinit0 < kpuinit < sqgctx < sqgrct < sqlcmex < sqlcxt
8200 2% 1 8200 findbuf < doprnt < _fprintf < main
8120 2% 4 2030 sqlrlc < sqlcopydfn
8080 2% 1 8080 kpuinit0 < kpuinit < sqgctx < sqgrct < sqlcmex < sqlcxt < main
7168 2% 1 7168 calloc < nsgbliuc < nsgblini < niotns < nigcall < osncon < kpuadef < upiini
7168 2% 3 2389 lxldlod < lxdlobj
5976 1% 4 1494 sqlrlc < sqlcopydfn
4640 1% 1 4640 sqlrlc < sqldrl < sqlexp < sqlcmex < sqlcxt < get_pub_dates < main
4640 1% 1 4640 sqlrlc < sqlbrl < sqlexp < sqlcmex < sqlcxt < get_pub_dates < main
4128 1% 1 4128 calloc < nsgbliuc < nsgblini < niotns < nigcall < osncon < kpuadef < upiini
4024 1% 1 4024 sqlrlc < sqlbrl < sqlexp < sqlcmex < sqlcxt < get_pub_dates < main
3408 1% 1 3408 sqlrlc < sqldrl < sqlexp < sqlcmex < sqlcxt < get_pub_dates < main
2452 <1% 8 306 calloc < nsmal
2156 <1% 7 308 calloc < nlemfins
(dbx) showleaks
Checking for memory leaks...
Actual leaks report (actual leaks: 1 total size: 30 bytes)
Total Num of Leaked Allocation call stack
Size Blocks Block
Address
====== ====== ========== =======================================
30 1 0x9c9c8 getOutFileName < main
Possible leaks report (possible leaks: 0 total size: 0 bytes)
i know its because of Pad pointer and something related to Pointer or array overflow. But i couldnt find out where exactly happening....
Following is my Code, please help me to find out the error and what i need to change in my code:
#ifndef ORA_PROC
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <ctype.h>
#include <math.h>
#else
typedef struct FILE FILE;
#endif
/*** Added by TCS Begins ***/
char getOutFileName(char );
char getEnvVar(char );
void prepare_declare_oracle_cursors();
void get_calendar_dates();
void get_issues();
void get_master_cusip_no();
void get_run_date_finish();
void get_payments();
int get_pub_dates();
void get_rights();
void get_s_h_meetings();
void get_special_codes();
void get_agents();
void get_currency();
void get_payment_codes();
void get_issue_codes();
void get_standard_footnotes();
void get_index_codes();
void get_exchanges();
void get_tax_codes();
void get_tenders();
int check_if_holiday(int );
void sql_error(int , int , char *);
void login_error();
void no_pub_dates();
void no_cal_dates();
void no_finish_date();
void save_payment_footnote(char , char [3],int , char );
void save_issue_footnote(char );
int print_footnotes();
int print_foreign_tax();
int get_partial_run_time();
void save_rght_footnotes();
int print_supplimental();
int convert_tender_price(char *);
void pad_s_h_meetings();
int strip_out_codes(char *);
char *getSqlLogonString();
/**** TCS ADD Ends ****/
EXEC SQL INCLUDE sqlca;
EXEC SQL INCLUDE ddr_create_all_tapes.h;
#define TRUE 1
#define ORA_NOT_FOUND ( sqlca.sqlcode == 1403 )
/* The Definitions of SUCCESS and FAILURE were switched to test the
idea that SUCCESS should be Zero and FAILURE should be Non-Zero
#define SUCCESS 1
#define FAILURE 0
#define SUCCESS 0
#define FAILURE -1
#define SYSOK 0
#define SYSERR 1
#define DEBUGGING 0
#define DEBUG_LEVEL 0
/* #define DEBUGGING 1
#define DEBUG_LEVEL 2
int first_cal_date;
int footnote_count;
int foreign_count;
int last_cal_date;
int total_records;
int which_tape = 0;
char cusip_table_name[30];
char field_type_code;
char final_cusip_number[10];
/**** char footnote_text[300][300];
char foreign_text[60][100]; **** Commented by TCS as per the change request ****/
/*** Added by TCS as per the change request ***/
char footnote_text[200][300];
char foreign_text[200][300];
/*** TCS Add Ends ***/
char freq_type_code;
char init_cusip_number[10];
char rec_type_code;
char payment_where_clause[600];
char rights_where_clause[600];
char tenders_where_clause[600];
char s_h_meet_where_clause[600];
char last_run_time[18];
char supp_info_buffer[321];
int call_flag;
int tenders_flag;
int rights_flag;
int s_h_meet_flag;
int rght_foot_pos;
double hold_double;
int hold_int;
char hold_char[100];
int i=0;
FILE *fp;
FILE pfp; / this is used for a report file to correspond to
the partial tape file */
int main(int argc, char argv[]) / Modified by TCS */
char ddr_tape_name[100];
char ddr_partial_rpt[100];
char copyright_notice[100];
long file_position;
char *logname;
/* READ IN PARAMETERS AND SET UP VARIABLES */
memset (oracle_uid.arr, 0, sizeof(oracle_uid.arr));
memset (oracle_pwd.arr, 0, sizeof(oracle_pwd.arr));
strcpy (oracle_uid.arr, argv[1]);
oracle_uid.len = strlen(oracle_uid.arr);
strcpy (oracle_pwd.arr, argv[2]);
oracle_pwd.len = strlen(oracle_pwd.arr);
printf("Calling getSqlLogonString");
logname = getSqlLogonString();
which_tape = atoi(argv[1]);
memset (last_run_time, 0, sizeof(last_run_time));
if ( ( DEBUGGING ) && ( DEBUG_LEVEL > 1 ) )
printf ("Oracle username: %s\n", oracle_uid.arr);
printf ("Oracle password: %s\n", oracle_pwd.arr);
printf ("Oracle username/password@database: %s\n", logname); /** Added by TCS **/
printf ("Which Tape: %d\n", which_tape);
hold_double = 0.0;
hold_int = 0;
memset (hold_char, ' ', sizeof(hold_char));
EXEC SQL WHENEVER SQLERROR DO login_error();
/* EXEC SQL CONNECT :oracle_uid IDENTIFIED BY :oracle_pwd; */
EXEC SQL CONNECT :logname ;
printf ("Connected to ORACLE... \n");
EXEC SQL WHENEVER SQLERROR continue;
get_pub_dates();
memset (ddr_tape_name, 0, sizeof(ddr_tape_name));
memset (ddr_partial_rpt, 0, sizeof(ddr_partial_rpt));
memset (cusip_table_name, 0, sizeof(cusip_table_name));
memset (payment_where_clause, 0, sizeof(payment_where_clause));
memset (rights_where_clause, 0, sizeof(rights_where_clause));
memset (tenders_where_clause, 0, sizeof(tenders_where_clause));
memset (s_h_meet_where_clause, 0, sizeof(s_h_meet_where_clause));
/* SET UP VARIABLES BASED ON THE DIFFERENT FREQUENCY OF TAPE */
switch (which_tape)
case 0:
get_partial_run_time();
/*sprintf (ddr_tape_name,
"idb_tape$out:ddr_partial%1d.asc", p_count); ** Comented by TCS **/
sprintf (ddr_tape_name,"%s%1d.%s",getOutFileName("DDR_PARTIAL"),p_count,getEnvVar("DDR_PARTIAL_EXT_ASC")); /* Added by TCS */
strcpy (cusip_table_name,
"IDB.DDR_PARTIAL_TAPE_TABLE");
/*sprintf (ddr_partial_rpt,
"idb_tape$out:ddr_partial%1d.rpt", p_count); ** Commented by TCS **/
sprintf (ddr_partial_rpt,"%s%1d.%s",getOutFileName("DDR_PARTIAL"),p_count,getEnvVar("DDR_PARTIAL_EXT_RPT")); /* Added by TCS */
get_calendar_dates();
freq_type_code = '0';
sprintf (payment_where_clause,
"AND PYMT_PUB_DATE IS NULL \
AND ((PYMT_ADD_DATE_TIME >= TO_DATE('%15.15s', 'DD-MON-RR HH24:MI') \
AND PYMT_ADD_DATE_TIME < TO_DATE('%15.15s', 'DD-MON-RR HH24:MI')) \
OR (PYMT_UPD_DATE_TIME >= TO_DATE('%15.15s', 'DD-MON-RR HH24:MI') \
AND PYMT_UPD_DATE_TIME < TO_DATE('%15.15s', 'DD-MON-RR HH24:MI')))",
p_from.arr, p_to.arr, p_from.arr, p_to.arr);
sprintf (rights_where_clause,
"AND RGHT_PUB_DATE IS NULL \
AND ((RGHT_ADD_DATE_TIME >= TO_DATE('%15.15s', 'DD-MON-RR HH24:MI') \
AND RGHT_ADD_DATE_TIME < TO_DATE('%15.15s', 'DD-MON-RR HH24:MI')) \
OR (RGHT_UPD_DATE_TIME >= TO_DATE('%15.15s', 'DD-MON-RR HH24:MI') \
AND RGHT_UPD_DATE_TIME < TO_DATE('%15.15s', 'DD-MON-RR HH24:MI')))",
p_from.arr, p_to.arr, p_from.arr, p_to.arr);
sprintf (tenders_where_clause,
"AND TNDR_PUB_DATE IS NULL \
AND ((TNDR_ADD_DATE_TIME >= TO_DATE('%15.15s', 'DD-MON-RR HH24:MI') \
AND TNDR_ADD_DATE_TIME < TO_DATE('%15.15s', 'DD-MON-RR HH24:MI')) \
OR (TNDR_UPD_DATE_TIME >= TO_DATE('%15.15s', 'DD-MON-RR HH24:MI') \
AND TNDR_UPD_DATE_TIME < TO_DATE('%15.15s', 'DD-MON-RR HH24:MI')))",
p_from.arr, p_to.arr, p_from.arr, p_to.arr);
sprintf (s_h_meet_where_clause,
"AND SMTG_PUB_DATE IS NULL \
AND ((SMTG_ADD_DATE_TIME >= TO_DATE('%15.15s', 'DD-MON-RR HH24:MI') \
AND SMTG_ADD_DATE_TIME < TO_DATE('%15.15s', 'DD-MON-RR HH24:MI')) \
OR (SMTG_UPD_DATE_TIME >= TO_DATE('%15.15s', 'DD-MON-RR HH24:MI') \
AND SMTG_UPD_DATE_TIME < TO_DATE('%15.15s', 'DD-MON-RR HH24:MI')))",
p_from.arr, p_to.arr, p_from.arr, p_to.arr);
break;
case 3:
/* PARTIAL 5 */
get_partial_run_time();
p_count = 5;
/**sprintf (ddr_tape_name,
"idb_tape$out:ddr_partial%1d.asc", p_count); ** Comented by TCS **/
sprintf (ddr_tape_name,"%s%1d.%s",getOutFileName("DDR_PARTIAL"),p_count,getEnvVar("DDR_PARTIAL_EXT_ASC")); /* Added by TCS */
/* for testing only I am using seperate TABLE */
/**strcpy (cusip_table_name,
"IDB.DDR_PARTIAL5_TAPE_TABLE"); ** Commented by TCS **/
strcpy (cusip_table_name,
"IDB.DDR_PARTIAL_TAPE_TABLE");
/*sprintf (ddr_partial_rpt,
"idb_tape$out:ddr_partial%1d.rpt", p_count); ** Commented by TCS **/
sprintf (ddr_tape_name,"%s%1d.%s",getOutFileName("DDR_PARTIAL"),p_count,getEnvVar("DDR_PARTIAL_EXT_RPT")); /* Added by TCS */
get_calendar_dates();
freq_type_code = '3';
sprintf (payment_where_clause,
"AND ( (PYMT_ADD_DATE_TIME >= TO_DATE('%15.15s', 'DD-MON-RR HH24:MI')) \
OR (PYMT_UPD_DATE_TIME >= TO_DATE('%15.15s', 'DD-MON-RR HH24:MI')))",
p_to.arr, p_to.arr);
sprintf (rights_where_clause,
"AND ((RGHT_ADD_DATE_TIME >= TO_DATE('%15.15s', 'DD-MON-RR HH24:MI')) \
OR (RGHT_UPD_DATE_TIME >= TO_DATE('%15.15s', 'DD-MON-RR HH24:MI')))",
p_to.arr, p_to.arr);
sprintf (tenders_where_clause,
"AND ((TNDR_ADD_DATE_TIME >= TO_DATE('%15.15s', 'DD-MON-RR HH24:MI')) \
OR (TNDR_UPD_DATE_TIME >= TO_DATE('%15.15s', 'DD-MON-RR HH24:MI')))",
p_to.arr, p_to.arr);
sprintf (s_h_meet_where_clause,
"AND ((SMTG_ADD_DATE_TIME >= TO_DATE('%15.15s', 'DD-MON-RR HH24:MI')) \
OR (SMTG_UPD_DATE_TIME >= TO_DATE('%15.15s', 'DD-MON-RR HH24:MI')))",
p_to.arr, p_to.arr);
break;
case 1:
/**strcpy (ddr_tape_name,
"idb_tape$out:ddr_daily_tape.asc"); ** Commented by TCS **/
sprintf (ddr_tape_name,"%s",getOutFileName("DDR_DAILY_TAPE_ASC")); /* Added by TCS */
strcpy (cusip_table_name,
"IDB.DDR_DAILY_TAPE_TABLE");
get_calendar_dates();
freq_type_code = '1';
sprintf (payment_where_clause, "AND (PYMT_PUB_DATE \
= TO_DATE('%s','DD-MON-RR') OR PYMT_PUB_DATE IS NULL)", pub_to_date.arr);
sprintf (rights_where_clause, "AND (RGHT_PUB_DATE \
= TO_DATE('%s','DD-MON-RR') OR RGHT_PUB_DATE IS NULL)", pub_to_date.arr);
sprintf (tenders_where_clause, "AND (TNDR_PUB_DATE \
= TO_DATE('%s','DD-MON-RR') OR TNDR_PUB_DATE IS NULL)", pub_to_date.arr);
sprintf (s_h_meet_where_clause, "AND (SMTG_PUB_DATE \
= TO_DATE('%s','DD-MON-RR') OR SMTG_PUB_DATE IS NULL)", pub_to_date.arr);
break;
case 5:
/*strcpy (ddr_tape_name,
"idb_tape$out:ddr_weekly_tape.asc"); ** Commented by TCS **/
sprintf (ddr_tape_name, "%s",getOutFileName("DDR_WEEKLY_TAPE_ASC")); /* Added by TCS */
strcpy (cusip_table_name,
"IDB.DDR_WEEKLY_TAPE_TABLE");
get_calendar_dates();
freq_type_code = '2';
sprintf (payment_where_clause, "AND (PYMT_PUB_DATE \
BETWEEN to_date('%s','DD-MON-RR') AND to_date('%s','DD-MON-RR') OR PYMT_PUB_DATE IS NULL)",
pub_from_date.arr, pub_to_date.arr);
sprintf (rights_where_clause, "AND (RGHT_PUB_DATE \
BETWEEN to_date('%s','DD-MON-RR') AND to_date('%s','DD-MON-RR') OR RGHT_PUB_DATE IS NULL)",
pub_from_date.arr, pub_to_date.arr);
sprintf (tenders_where_clause, "AND (TNDR_PUB_DATE \
BETWEEN to_date('%s','DD-MON-RR') AND to_date('%s','DD-MON-RR') OR TNDR_PUB_DATE IS NULL)",
pub_from_date.arr, pub_to_date.arr);
/* ram - 6/28/95 - reverted back to original criteria: */
/* include on weekly tape based on pub-date, regardless of */
/* whether in calendar or not */
sprintf (s_h_meet_where_clause, "AND (SMTG_PUB_DATE \
BETWEEN to_date('%s','DD-MON-RR') AND to_date('%s','DD-MON-RR') OR SMTG_PUB_DATE IS NULL)",
pub_from_date.arr, pub_to_date.arr);
break;
case 12:
/* ram - 7/13/95 */
/* changed monthly "6" to "12" */
/*strcpy (ddr_tape_name,
"idb_tape$out:ddr_monthly_tape.asc"); ** Commented by TCS **/
sprintf (ddr_tape_name, "%s", getOutFileName("DDR_MONTHLY_TAPE_ASC")); /* Added by TCS */
strcpy (cusip_table_name,
"IDB.DDR_MONTHLY_TAPE_TABLE");
freq_type_code = '3';
sprintf (payment_where_clause, "AND (PYMT_PUB_DATE \
BETWEEN to_date('%s','DD-MON-RR') AND to_date('%s','DD-MON-RR') OR PYMT_PUB_DATE IS NULL)",
pub_from_date.arr, pub_to_date.arr);
sprintf (rights_where_clause, "AND (RGHT_PUB_DATE \
BETWEEN to_date('%s','DD-MON-RR') AND to_date('%s','DD-MON-RR') OR RGHT_PUB_DATE IS NULL)",
pub_from_date.arr, pub_to_date.arr);
sprintf (tenders_where_clause, "AND (TNDR_PUB_DATE \
BETWEEN to_date('%s','DD-MON-RR') AND to_date('%s','DD-MON-RR') OR TNDR_PUB_DATE IS NULL)",
pub_from_date.arr, pub_to_date.arr);
break;
case 8:
/*strcpy (ddr_tape_name,
"idb_tape$out:ddr_quarterly_tape.asc");** Commented by TCS **/
sprintf (ddr_tape_name,"%s",getOutFileName("DDR_QUARTERLY_TAPE_ASC")); /* Added by TCS */
strcpy (cusip_table_name,
"IDB.DDR_QUARTERLY_TAPE_TABLE");
freq_type_code = '3';
sprintf (payment_where_clause, "AND (PYMT_PUB_DATE \
BETWEEN to_date('%s','DD-MON-RR') AND to_date('%s','DD-MON-RR') OR PYMT_PUB_DATE IS NULL)",
pub_from_date.arr, pub_to_date.arr);
sprintf (rights_where_clause, "AND (RGHT_PUB_DATE \
BETWEEN to_date('%s','DD-MON-RR') AND to_date('%s','DD-MON-RR') OR RGHT_PUB_DATE IS NULL)",
pub_from_date.arr, pub_to_date.arr);
sprintf (tenders_where_clause, "AND (A.TNDR_TENDER_DATE \
= TO_DATE('%s','DD-MON-RR'))", pub_to_date.arr); break;
case 9:
/*strcpy (ddr_tape_name,
"idb_tape$out:ddr_annual_tape.asc"); ** Comented by TCS **/
sprintf (ddr_tape_name,"%s", getOutFileName("DDR_ANNUAL_TAPE_ASC")); /* Added by TCS */
strcpy (cusip_table_name,
"IDB.DDR_ANNUAL_TAPE_TABLE");
freq_type_code = '4';
sprintf (payment_where_clause, "AND (PYMT_PUB_DATE \
BETWEEN to_date('%s','DD-MON-RR') AND to_date('%s','DD-MON-RR') \
OR PYMT_PUB_DATE = TO_DATE('29-OCT-1929','DD-MON-YYYY'))",
pub_from_date.arr, pub_to_date.arr);
sprintf (rights_where_clause, "AND (RGHT_PUB_DATE \
BETWEEN to_date('%s','DD-MON-RR') AND to_date('%s','DD-MON-RR') OR RGHT_PUB_DATE IS NULL)",
pub_from_date.arr, pub_to_date.arr);
sprintf (tenders_where_clause, "AND (A.TNDR_TENDER_DATE \
= TO_DATE('%s','DD-MON-RR'))", pub_to_date.arr); break;
case 15:
/*strcpy (ddr_tape_name,
"idb_tape$out:ddr_general_tape.asc"); ** Commented by TCS **/
sprintf (ddr_tape_name,"%s", getOutFileName("DDR_GENERAL_TAPE_ASC")); /* Added by TCS */
strcpy (cusip_table_name,
"IDB.DDR_GENERAL_TAPE_TABLE");
freq_type_code = '3';
sprintf (payment_where_clause, "AND (PYMT_PUB_DATE \
BETWEEN to_date('%s','DD-MON-RR') AND to_date('%s','DD-MON-RR') OR PYMT_PUB_DATE IS NULL)",
pub_from_date.arr, pub_to_date.arr);
sprintf (rights_where_clause, "AND (RGHT_PUB_DATE \
BETWEEN to_date('%s','DD-MON-RR') AND to_date('%s','DD-MON-RR') OR RGHT_PUB_DATE IS NULL)",
pub_from_date.arr, pub_to_date.arr);
sprintf (tenders_where_clause, "AND (A.TNDR_TENDER_DATE \
= TO_DATE('%s','DD-MON-RR'))", pub_to_date.arr); break;
default:
exit (printf ("Invalid tape option: %d\n", which_tape)); /*** %s changed by TCS to %d ***/
break;
if ((fp = fopen(ddr_tape_name, "w+")) == NULL)
exit (printf ("Unable to open asc <%s> file for write access\n",
ddr_tape_name));
/* GR. Partial 5
if (which_tape == 0 || which_tape == 3 )
if ((pfp = fopen(ddr_partial_rpt, "w+")) == NULL)
exit (printf ("Unable to open asc <%s> file \
for write access\n", ddr_partial_rpt));
/* WRITE THE HEADER RECORD ON THE TAPE */
memset (copyright_notice, 0, sizeof(copyright_notice));
sprintf (copyright_notice, "COPYRIGHT (c) %.4s STANDARD & POOR'S \
CORPORATION. ALL RIGHTS RESERVED", year.arr);
fprintf (fp, "%-80.80sDIVIDEND%8d%17.17s ",
copyright_notice, control_date, run_date_start.arr);
file_position = ftell(fp);
fprintf (fp, "\n");
total_records = 0;
/* GET THE SPECIAL CATEGORY RECORDS */
get_special_codes();
/* SELECT FROM THE DRIVER TABLE TO GET ALL THE OTHER RECORDS */
get_master_cusip_no();
printf("After get_master_cusip_no()");
get_run_date_finish();
printf("After get_run_date_finish()");
if ( DEBUGGING )
printf ("initial cusip = %s\n", init_cusip_number);
printf ("final cusip = %s\n", final_cusip_number);
printf ("record type is %c\n", rec_type_code);
/* WRITE THE TRAILER RECORD */
fprintf (fp, "%8d%-17.17s%07d%-9.9s1%-9.9s%c\n", control_date,
run_date_finish.arr, total_records, init_cusip_number , final_cusip_number,
rec_type_code);
/* re-wind and add to the header record ... */
rewind(fp);
fseek(fp, file_position - 33, 0);
fprintf (fp, "%07d%-9.9s1%-9.9s%c", total_records, init_cusip_number,
final_cusip_number, rec_type_code);
fclose(fp);
/* GR Partial 5
if (which_tape == 0 || which_tape == 3 )
fclose(pfp);
printf ("\nDONE: %07d%-9.9s1%-9.9s%c\n", total_records, init_cusip_number,
final_cusip_number, rec_type_code);
return (0); /*** Added by TCS ***/
void prepare_declare_oracle_cursors() /* Modified by TCS */
/* We'll us dynamic sql to get the appropriate where clause but use */
/* a bind variable for the master cusip number. So we prepare and */
/* declare get_issues, get_payments, get_tenders, get rights, and */
/* get_s_h_meetings cursors only once, outside the driving loop. */
EXEC SQL BEGIN DECLARE SECTION;
/**** TCS Comment begins as per the change request ****
VARCHAR sql_stmt1[1500];*/ /* issues */
/*VARCHAR sql_stmt2[3000]; *//* payments */
/*VARCHAR sql_stmt3[500]; *//* tenders */
/*VARCHAR sql_stmt4[500]; *//* rights */
/*VARCHAR sql_stmt5[500]; *//* s_h_meetings */
/**** TCS Add begins as per the change request ****/
VARCHAR sql_stmt1[2000]; /* issues */
VARCHAR sql_stmt2[4000]; /* payments */
VARCHAR sql_stmt3[1000]; /* tenders */
VARCHAR sql_stmt4[1000]; /* rights */
VARCHAR sql_stmt5[1000]; /* s_h_meetings */
/**** TCS Add ends ****/
EXEC SQL END DECLARE SECTION;
/* prepare and declare the get_issues cursor */
memset (sql_stmt1.arr, 0, sizeof(sql_stmt1.arr));
sprintf (sql_stmt1.arr, "SELECT \
A.ISSU_PAR_VALUE, \
DECODE (A.ISSU_MARKET_SYMBOL||A.ISSU_NASDAQ,'OTCY','NASD', A.ISSU_MARKET_SYMBOL), \
A.ISSU_C_RATE, A.ISSU_C_FREQ, A.ISSU_C_NEW_AMOUNT, A.ISSU_C_NEW_Q1, \
A.ISSU_C_NEW_Q2, A.ISSU_C_NEW_Q3, A.ISSU_C_OLD_AMOUNT, A.ISSU_C_OLD_Q1, \
A.ISSU_C_OLD_Q2, A.ISSU_C_OLD_Q3, A.ISSU_CURRENCY, \
A.ISSU_UPD_HIS, A.ISSU_COMMENT, A.TAX_EXEMPT_FLAG,\
B.SEC_TYPE_CODE, B.ACQ_BY_IND, B.ACQ_ISSUER_NO, \
rtrim(substr(B.ACQ_ISSUER_DESCR,1,30)), \
B.INDEX_CODE, B.TRFR_AGT_CODE, B.NY_AGT_CODE, B.TICKER_SYMBOL, \
B.TICKER_SYMBOL2, \
rtrim(substr(C.ISSR_DDR_ISSUER_DESCR,1,60)), \
rtrim(substr(E.ISSUE_DESCR,1,30)), \
rtrim(substr(D.ISSUER_DESCR1,1,30)), \
F.TRFR_DAYS \
FROM IDB.DDR_ISSUES A, IDB.DDR_ISSUES_2 B, IDB.DDR_ISSUERS C, \
BLIS.CUSIP_ISSUERS D, BLIS.CUSIP_ISSUES E, IDB.DDR_TRANSFER F \
WHERE A.ISSU_CUSIP_NO = :master_cusip_no \
AND A.ISSU_CUSIP_NO = B.ISSU_CUSIP_NO(+) \
AND SUBSTR(A.ISSU_CUSIP_NO, 1, 6) = C.ISSR_ISSUER_NO(+) \
AND SUBSTR(A.ISSU_CUSIP_NO, 1, 6) = D.ISSUER_NO \
AND A.ISSU_CUSIP_NO = E.CUSIP_NO \
AND A.ISSU_TRANSFER_CODE = F.TRFR_TR_CD(+) ");
sql_stmt1.len = strlen(sql_stmt1.arr);
EXEC SQL PREPARE ISSUES FROM :sql_stmt1;
if (sqlca.sqlcode)
sql_error (SYSERR, sqlca.sqlcode,
"Error in preparing ISSUES");
EXEC SQL DECLARE ISSUES_C CURSOR FOR ISSUES;
if (sqlca.sqlcode)
sql_error (SYSERR, sqlca.sqlcode,
"Error in declaring ISSUES");
/* now the get_payments cursor */
memset (sql_stmt2.arr, 0, sizeof(sql_stmt2.arr));
sprintf (sql_stmt2.arr, "SELECT \
a.PYMT_RP_DIV, \
a.PYMT_RP_DEC, \
a.PYMT_RP_EXD, \
a.PYMT_RP_REC, \
a.PYMT_RP_PAY, \
a.PYMT_RP_DUE, \
a.PYMT_RP_TAX, \
a.PYMT_RP_ANN, \
a.PYMT_PRP_DIV, \
a.PYMT_PRP_DEC, \
a.PYMT_PRP_EXD, \
a.PYMT_PRP_REC, \
a.PYMT_PRP_PAY, \
a.PYMT_PRP_DUE, \
a.PYMT_PRP_TAX, \
a.PYMT_PRP_ANN, \
NVL(a.PYMT_SEQ_NO,0), \
TO_CHAR(a.PYMT_DECLARED, 'YYMMDD'), \
TO_CHAR(a.PYMT_EX_DATE, 'YYMMDD'), \
TO_CHAR(a.PYMT_STK_REC, 'YYMMDD'), \
TO_CHAR(a.PYMT_TRANSFER_DATE, 'YYMMDD'), \
TO_CHAR(a.PYMT_PAYABLE, 'YYMMDD'), \
a.PYMT_CODES, \
NVL(a.PYMT_CASH_DIVD,0.0), \
NVL(b.ORDINARY_INCOME,0.0), \
NVL(b.CAP_GAINS,0.0), \
NVL(b.SHORT_TM_CAP_GAINS,0.0), \
NVL(b.LONG_TM_CAP_GAINS,0.0), \
NVL(b.RETURN_OF_CAPITAL,0.0), \
b.STK_DIVD_IND, \
NVL(a.PYMT_STK_DIVD,0), \
b.FRAC_IN_CASH_STK_IND, \
NVL(b.FRAC_IN_CASH_PRICE,0.0), \
NVL(a.PYMT_SPLIT_NEW,0), \
NVL(a.PYMT_SPLIT_OLD,0), \
TO_CHAR(a.PYMT_DB_DATE, 'YYMMDD'), \
NVL(b.ARREARS_PAID,0.0), \
NVL(b.ARREARS_DUE,0.0), \
b.SPINOFF_IND, \
b.SPINOFF_ISSUE_NO, \
b.SPINOFF_ISSUER_DESCR, \
b.SPINOFF_ISSUE_DESCR, \
NVL(b.TAX_CODE,0), \
NVL(b.TAX_CODE_2,0), \
NVL(b.OLD_SEQ_NO,0), \
b.ORDINARY_INCOME_CODE, \
b.CAP_GAINS_CODE, \
b.SHORT_TM_CAP_GAINS_CODE, \
b.LONG_TM_CAP_GAINS_CODE, \
b.RETURN_OF_CAPITAL_CODE, \
TO_CHAR(b.CALL_DATE, 'YYMMDD'), \
NVL(b.CALL_PRICE,0.0), \
b.CALL_PRICE_CURRENCY, \
b.CALL_AGT_NO, \
b.ACCRUED_DIVD_IND, \
TO_CHAR(a.PYMT_DB_DATE, 'YYMMDD'), \
a.PYMT_DB_TEXT, \
a.PYMT_DVD_TEXT, \
a.PYMT_YEAR, \
TO_CHAR(a.PYMT_STK_REC, 'fmMon dd'), \
TO_CHAR(a.PYMT_DB_DATE, 'fmMon dd'), \
b.NY_CALL_AGT_NO, \
NVL(b.FOREIGN_TAX_RATE, 0.0), \
NVL(b.NET_RATE, 0.0), \
NVL(b.FEE, 0.0), \
NVL(b.COMMISSION, 0.0), \
a.PYMT_CASH_DIVD_FNS, \
a.PYMT_STK_DIVD_FNS, \
a.PYMT_DECLARED_FNS, \
a.PYMT_EX_DATE_FNS, \
a.PYMT_STK_REC_FNS, \
a.PYMT_PAYABLE_FNS, \
a.PYMT_SPLIT_FNS, \
NVL (TO_NUMBER (TO_CHAR(a.PYMT_PUB_DATE, 'YYYYMMDD')), 0), \
NVL (TO_NUMBER (TO_CHAR(a.PYMT_TRANSFER_DATE, 'YYYYMMDD')), 0), \
NVL (TO_NUMBER (TO_CHAR(a.PYMT_STK_REC, 'YYYYMMDD')), 0), \
NVL (TO_NUMBER (TO_CHAR(a.PYMT_DB_DATE, 'YYYYMMDD')), 0) \
FROM IDB.DDR_PAYMENTS A, IDB.DDR_PAYMENTS_2 B \
WHERE A.PYMT_CUSIP_NO = :master_cusip_no \
AND A.PYMT_CUSIP_NO = B.PYMT_CUSIP_NO (+) \
AND A.PYMT_SEQ_NO = B.PYMT_SEQ_NO (+) \
AND NVL(INSTR(A.PYMT_CODES,'CO'),0) NOT IN (1,3,5,7,9,11) ");
strcat (sql_stmt2.arr, payment_where_clause);
sql_stmt2.len = strlen(sql_stmt2.arr);
EXEC SQL PREPARE PAYMENTS FROM :sql_stmt2;
if (sqlca.sqlcode)
sql_error (SYSERR, sqlca.sqlcode,
"Error in preparing PAYMENTS");
EXEC SQL DECLARE PAYMENTS_C CURSOR FOR PAYMENTS;
if (sqlca.sqlcode)
sql_error (SYSERR, sqlca.sqlcode,
"Error in declaring PAYMENTS");
/* now the get_tenders cursor */
memset (sql_stmt3.arr, 0, sizeof(sql_stmt3.arr));
/* FXL ADD SUBSTR to tndr_price_qual: substr(A.TNDR_PRICE_QUAL,1,14), 3/23/99,
to to_number 3/29/99 */
sprintf (sql_stmt3.arr, "SELECT \
B.TNDR_AGT_NO, \
B.NY_AGT_NO, \
TO_CHAR(A.TNDR_TENDER_DATE, 'YYMMDD'), \
A.TNDR_PRICE, \
to_number(A.TNDR_PRICE_QUAL), \
A.TNDR_TE_SIZE, \
TNDR_TE_TEXT_1 \
FROM IDB.DDR_TENDERS A, IDB.DDR_TENDERS_2 B \
WHERE TNDR_CUSIP_NO = :master_cusip_no \
AND TNDR_CUSIP_NO = TNDR_ISSUE_NO(+) \
AND A.TNDR_TENDER_DATE = B.TNDR_TENDER_DATE(+) ");
strcat (sql_stmt3.arr, tenders_where_clause);
sql_stmt3.len = strlen(sql_stmt3.arr);
EXEC SQL PREPARE TENDERS FROM :sql_stmt3;
if (sqlca.sqlcode)
sql_error (SYSERR, sqlca.sqlcode,
"Error in preparing TENDERS");
EXEC SQL DECLARE TENDERS_C CURSOR FOR TENDERS;
if (sqlca.sqlcode)
sql_error (SYSERR, sqlca.sqlcode,
"Error in declaring TENDERS");
/* now the get_rights cursor */
memset (sql_stmt4.arr, 0, sizeof(sql_stmt4.arr));
/* ADD TO_CHAR(A.RGHT_DB_DATE, 'YYMMDD') */
sprintf (sql_stmt4.arr, "SELECT \
B.NO_RIGHTS_ISSUED, \
B.SHS_REQ_FOR_PURCH, \
B.RGHTS_REQUIRED, \
B.QTY_SHS_PURCHASED, \
B.TYPE_SHS_ELIGIBLE, \
B.NEW_SHS_CUSIP_NO, \
B.NEW_CO_ISSUER_DESCR, \
TO_CHAR(A.RGHT_RECORD, 'YYMMDD'), \
TO_CHAR(A.RGHT_EX_DATE, 'YYMMDD'), \
TO_CHAR(B.NYC_RECORD_DATE, 'YYMMDD'), \
TO_CHAR(A.RGHT_EXPIRE, 'YYMMDD'), \
TO_CHAR(A.RGHT_DB_DATE, 'YYMMDD'), \
A.RGHT_PRICE, \
NVL(A.RGHT_RECORD_FNS,' '), \
NVL(A.RGHT_EXPIRE_FNS,' '), \
NVL(A.RGHT_EX_DATE_FNS,' '), \
NVL(A.RGHT_PRICE_FNS,' '), \
NVL(A.RGHT_BASIS_FNS,' '), \
A.RGHT_FOOTNOTE, \
B.US_INELIGIBILITY_IND, \
B.RGHT_TRFR_IND \
FROM IDB.DDR_RIGHTS A, IDB.DDR_RIGHTS_2 B \
WHERE RGHT_CUSIP_NO = :master_cusip_no \
AND RGHT_CUSIP_NO = RGHT_ISSUE_NO(+) \
AND A.RGHT_RECORD = B.RGHT_RECORD_DATE(+) ");
strcat (sql_stmt4.arr, rights_where_clause);
sql_stmt4.len = strlen(sql_stmt4.arr);
EXEC SQL PREPARE RIGHTS FROM :sql_stmt4;
if (sqlca.sqlcode)
sql_error (SYSERR, sqlca.sqlcode,
"Error in preparing RIGHTS");
EXEC SQL DECLARE RIGHTS_C CURSOR FOR RIGHTS;
if (sqlca.sqlcode)
sql_error (SYSERR, sqlca.sqlcode,
"Error in declaring RIGHTS");
/* ram - added logic on 7/18/95 */
/* for the standard footnotes cursor */
EXEC SQL DECLARE STANDARD_FOOTNOTES_C CURSOR
FOR
SELECT SFTN_S_F_TEXT, SFTN_S_F_TYPE
FROM IDB.DDR_STANDARD_FOOTNOTES
WHERE SFTN_S_F_TYPE = :standard_footnote_type;
if (sqlca.sqlcode)
sql_error (SYSERR, sqlca.sqlcode,
"Error in declaring STANDARD_FOOTNOTES");
/* now the issue footnotes cursor */
EXEC SQL DECLARE ISSUE_FOOTNOTES_C CURSOR
FOR
SELECT FTNT_F_TEXT, FTNT_F_TYPE
FROM IDB.DDR_FOOTNOTES
WHERE FTNT_CUSIP_NO = :master_cusip_no
AND FTNT_SYMBOL = :footnote_symbol
AND FTNT_YEAR IS NULL;
if (sqlca.sqlcode)
sql_error (SYSERR, sqlca.sqlcode,
"Error in declaring ISSUE_FOOTNOTES");
/* now the payment footnotes cursor */
EXEC SQL DECLARE PAYMENT_FOOTNOTES_C CURSOR
FOR
SELECT FTNT_F_TEXT, FTNT_F_TYPE
FROM IDB.DDR_FOOTNOTES
WHERE FTNT_CUSIP_NO = :master_cusip_no
AND FTNT_SYMBOL = :footnote_symbol
AND FTNT_YEAR = :footnote_year;
if (sqlca.sqlcode)
sql_error (SYSERR, sqlca.sqlcode,
"Error in declaring PAYMENT_FOOTNOTES");
/* now the get_s_h_meetings cursor */
/* ONLY for certain tape types. */
/* GR PARTial 5
if (which_tape == 0 || which_tape == 3 || which_tape == 1 || which_tape == 5)
memset (sql_stmt5.arr, 0, sizeof(sql_stmt5.arr));
/* ram - 6/15/95 - changed ORigunal to smtg */
/* TO_CHAR(ORIGINAL_REC_DATE, 'YYMMDD'), \ */
sprintf (sql_stmt5.arr, "SELECT \
TO_CHAR(SMTG_MTG_DATE, 'YYMMDD'), \
TO_CHAR(SMTG_REC_DATE, 'YYMMDD'), \
SMTG_FOOTNOTE \
FROM IDB.DDR_S_H_MEETINGS \
WHERE SMTG_CUSIP_NO = :master_cusip_no ");
strcat (sql_stmt5.arr, s_h_meet_where_clause);
sql_stmt5.len = strlen(sql_stmt5.arr);
EXEC SQL PREPARE S_H_MEET FROM :sql_stmt5;
if (sqlca.sqlcode)
sql_error (SYSERR, sqlca.sqlcode,
"Error in preparing S_H_MEET");
EXEC SQL DECLARE S_H_MEET_C CURSOR FOR S_H_MEET;
if (sqlca.sqlcode)
sql_error (SYSERR, sqlca.sqlcode,
"Error in declaring S_H_MEET");
} /* end of if (which_tape == 0 || which_tape == 1 || which_tape == 5) */
/* replaced get_calendar_dates function with use of PLSQL - ram - 5/24/95 */
void get_calendar_dates() /* Modified by TCS */
/* put first and last calendar dates into global ints */
/* first_cal_date and last_cal_date (YYYYMMDD) using */
/* ddr package function get_business_days. */
/* The package object ddr is owned by idb, so I'll */
/* specify this, just in case accounts other than idb */
/* run this code. (EXECUTE priviledge is granted to */
/* "idb_user" role.) */
EXEC SQL BEGIN DECLARE SECTION;
int cal_start;
int cal_end;
int return_val;
EXEC SQL END DECLARE SECTION;
/* initialize destination globals */You actually need to run it with "check -access"; memuse and leaks won't help with the crash, which happens because of illegal memory access. Hopefully, "check -access" will help you to locate the bad guy, but that's not panacea either.
To be precise:
- start dbx
$ dbx <your app>
- issue
(dbx) check -access
(dbx) run
and wait for dbx to stop and report suspicious memory access. -
Root.sh failure during Grid install - segmentation fault for clscfg
Hi anyone got any idea how to resolve the following error during execution of root.sh on second node of a RAC installation. I see there is a failure when clscfg -localadd is run - perhaps this is the start of the issue. I have no idea what this command is doing
Any help appreciated
Installing verison 11.2.0.2 on RHEL 5
ntpd was NOT running - I ignored this during the pre-reqs at the end of the runInstaller - perhaps this is the issue and i need to start fresh and make sure its running before running root.sh ?
root.sh....
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Using configuration parameter file: /opt/app/11.2.0/grid/crs/install/crsconfig_params
Failure with signal 11 from command: 1 /opt/app/11.2.0/grid/bin/clscfg -localadd
OLR initialization - successful
Adding daemon to inittab
ACFS-9200: Supported
ACFS-9300: ADVM/ACFS distribution files found.
ACFS-9307: Installing requested ADVM/ACFS software.
ACFS-9308: Loading installed ADVM/ACFS drivers.
ACFS-9321: Creating udev for ADVM/ACFS.
ACFS-9323: Creating module dependencies - this may take some time.
ACFS-9327: Verifying ADVM/ACFS devices.
ACFS-9309: ADVM/ACFS installation correctness verified.
CRS-2672: Attempting to start 'ora.mdnsd' on 'coden-ota-odc'
CRS-2676: Start of 'ora.mdnsd' on 'coden-ota-odc' succeeded
CRS-2672: Attempting to start 'ora.gpnpd' on 'coden-ota-odc'
CRS-2676: Start of 'ora.gpnpd' on 'coden-ota-odc' succeeded
CRS-2672: Attempting to start 'ora.cssdmonitor' on 'coden-ota-odc'
CRS-2672: Attempting to start 'ora.gipcd' on 'coden-ota-odc'
CRS-2676: Start of 'ora.cssdmonitor' on 'coden-ota-odc' succeeded
CRS-2676: Start of 'ora.gipcd' on 'coden-ota-odc' succeeded
CRS-2672: Attempting to start 'ora.cssd' on 'coden-ota-odc'
CRS-2672: Attempting to start 'ora.diskmon' on 'coden-ota-odc'
CRS-2676: Start of 'ora.diskmon' on 'coden-ota-odc' succeeded
CRS-2676: Start of 'ora.cssd' on 'coden-ota-odc' succeeded
Start of resource "ora.ctssd" failed
CRS-2672: Attempting to start 'ora.ctssd' on 'coden-ota-odc'
CRS-2674: Start of 'ora.ctssd' on 'coden-ota-odc' failed
CRS-4000: Command Start failed, or completed with errors.
Cluster Time Synchronisation Service start in exclusive mode failed at /opt/app/11.2.0/grid/crs/install/crsconfig_lib.pm line 6455.
/opt/app/11.2.0/grid/perl/bin/perl -I/opt/app/11.2.0/grid/perl/lib -I/opt/app/11.2.0/grid/crs/install /opt/app/11.2.0/grid/crs/install/rootcrs.pl execution failed
I executed the /opt/app/11.2.0/grid/bin/clscfg to see what the result was and it returns a Segmentation Fault to std err
Edited by: 787789 on Nov 10, 2010 6:58 AMHi,
here is one document you can go for work around but it is on windows platform but similar error as you posted *CRS Installation Failed with "failed to configure Oracle Cluster Registry with CLSCFG, ret 9" [ID 851742.1]*
Thanks
Maybe you are looking for
-
Won't open from desktop, start menu or anywhere else since I got the newest version.
For the last few weeks, since I got the newest version of Firefox, I've been experiencing more an more problems with it. Now, I can't even get to open from the desktop or the start menu. I never had problems with it before the new version, now I've h
-
Hi Is there any way to get rid of Oracle Logo on Forms Look And Feel? Thanks Isha
-
Moving Master Images after Facebook Upload
I'm using a fully updated version of Aperture 3 and ran into a problem today moving master images that I have not experienced before. My normal workflow is to batch import images from my camera every few days in one large import, so I often have mul
-
Insert workflow for a particular Business requirement
Hi, We have a requirement wherein we do not have SSHR and people are assigned to enter the absences of the employees. But still we need an approval from manager. As per my understanding, we will have to create a new workflow and the same should be ca
-
QUESTION: Essbase data extraction and Installing ODI Agent??
For extracting data from Essbase cubes, ODI has "LKM Hyperion Essbase DATA to SQL". We can use (1). ReportScript, or (2). MDX-query, or (3). CalcScript For data-extraction using CalcScript, ODI Agent must be running on the same server as the Essbase