I am writing a wrapper shell or perl script which does open an oracle session using sqlplus and then execute some sql files by scanning a directory. So as part of this , lets say if we have multiple sql files in a directory, for eg: first.sql,second.sql,third.sql I am planning to create a single file(AllSqlFilesInDirectory.sql) with below content.
>cat AllSqlFilesInDirectory.sql @first.sql @second.sql @third.sql > Now I am planning to run the file AllSqlFilesInDirectory.sql by opening an oracle sqlplus session. After executing, I am planning to come out of the oracle sqlplus session and I am planning to search for any errors in the log file. If there are any errors, I would like to execute rollback. But I think as I am out of that sqlplus session, rollback is not possible. I am just concerned about the DML statements that were executed as part of those multiple sql files in the directory. So I have these doubts
- Can I simply ignore and not be concerned about rollback at all
- Can I do the rollback for a session which was already closed?
- If above is valid, then how can do it?
没有评论:
发表评论