I use the following command to find out if file descriptor is opened:
/usr/sbin/lsof -a -c sqlplus -u ${USER} | grep -l "${FILE_NAME}”
If it is not, I perform some actions. The file is a log spooled from sqlplus
.
Sometimes lsof
tells that file descriptor is not opened, but then I find some new data in this file. It happens very seldom, so I cannot reproduce it.
- What can be the reason?
- How does sql spool work? Does it keep open file descriptor from the SPOOL file command till the SPOOL OFF comand or does it open and close file descriptor several times?