afiedt.buf not found

stanlip
stanlip used Ask the Experts™
on
I am trying to run a cron job in AIX connecting to
a oracle 734 database using the sqlplus -S option.
I keep receiving a message 'afiedt.buf' not found.
The first hting I do in the shell script is to run
the profile for the oracle user id.

What am I doing wrong
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
AT the begining of SQL session you can set

SQL>SET EDITFILE /home/rajesh/afiedt.buf

Or Any other directory where you have permissions

-- rajeXsh

Commented:
Can you post the shell script, so we can take a look?
What do you mean by "run the profile for the oracle user id"?

Author

Commented:
Here is the shell script I run

. /home/dba/etc/sls_batch.prof
sqlplus -s system/******* @/home/dba/adhoc/ins_sls_user.sql
exit ;

Here is what is in the profile sls_batch.prof


# #############################################################################
# AIX specific
# #############################################################################
PATH=usr/bin:/etc:/usr/sbin:/ucb:$HOME/bin:/usr/bin/X11:/sbin:.:/usr/lpp/X11/lib/R5/Motif1.2:\
:/usr/lbin:/home/dba/bin:/home/dba/etc:/ora734/app/oracle/product/734/bin:\
/ora734/app/oracle/product/734/sqlplus/admin:.
export PATH

#PRINTER=DMP
#export PRINTER


# #############################################################################
# ORACLE specific
# #############################################################################

ORACLE_SID=sls
export ORACLE_SID

export ORACLE_HOME=/ora734/app/oracle/product/734


Thanks
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Commented:
This looks fine. I guess it's something in the SQL script which causes the error... Can you post that?

Author

Commented:
spool /home/dba/log/ins_sls_users.log
insert into system.sls_users
 select a.username,a.osuser
  from v$session a
   Where a.osuser not in
    (select b.osuser from system.sls_users b)
;
spool off

Commented:
Do you get the same error when you run the shell script manually or only when you run it from cron?
I really don't see what the reason for the error might be...

Author

Commented:
I can run the whole shell manually without any errors.
I can run the sql script without any errors from sqlplus
this only happens when I am running from cron. I suspect
it has something to do with running the os-user profile
in AIX
Commented:
What is your cron entry? Is it just the shell script or you run several things?
I believe that when a job is run from the cron it does execute any profile. That's should be the only difference with the case when you run it manually. When you run it you have already connected, thus run your own profile which might be setting something which prevents the error.
You can try running your profile before running the script from cron. Example:
5 5 5 5 * . ~your_user/.profile; the_script.ksh
It looks really strange, but there should be some reason for the error. You can also try what rajeXsh sujested - adding the SET EDITFILE command as a first line in your sql script.
Hope that helps!

Author

Commented:
The problem was in my crontab entry my entry looked like
this

00,15,30,45 * * * * * /path/script.sh >/path/log/script.log

It shoud have been and now is


00,15,30,45 * * * * /path/script.sh >/path/log/script.log

Thanks for your help

Commented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Accept pennnn's comment as answer
Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
jpkemp
EE Cleanup Volunteer

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial