2021年3月23日星期二

Rollback after coming out of the session in Oracle plsql

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

  1. Can I simply ignore and not be concerned about rollback at all
  2. Can I do the rollback for a session which was already closed?
  3. If above is valid, then how can do it?
https://stackoverflow.com/questions/66775015/rollback-after-coming-out-of-the-session-in-oracle-plsql March 24, 2021 at 12:59PM

没有评论:

发表评论