How to know what was not committed to the bank

DBA Geral (instalação, configuração do banco, scripts do Sql*Plus, shell scripts, batch scripts, etc...)
Post Reply
feliperenz
Rank: Estagiário Pleno
Rank: Estagiário Pleno
Posts: 6
Joined: Tue, 17 Jan 2006 2:35 pm
Location: Porto Alegre \ RS
Felipe Renz
DBA Oracle

Good afternoon,

I have a doubt, for example Rodo n scripts in separate sessions, without giving commit, I would like to know how I can know what has not yet been commmy, is there?
Trevisolli
Moderador
Moderador
Posts: 2016
Joined: Wed, 12 Jan 2005 3:25 pm
Location: Araraquara - SP
Abraço,

Trevisolli
OCA Oracle PL/SQL Developer Certified Associate
OCP Oracle Forms Developer Certified Professional
Araraquara-SP

Brother,

Topic moved to the group DBA's so they can help you better.
User avatar
dr_gori
Moderador
Moderador
Posts: 5026
Joined: Mon, 03 May 2004 3:08 pm
Location: Portland, OR USA
Contact:
Thomas F. G

Você já respondeu a dúvida de alguém hoje?
https://glufke.net/oracle/search.php?search_id=unanswered

No, because Oracle has consistent reading, that is, the other sessions can only see what has already been committed.

But, you can make a type of log to solve this problem.
Something like this:
* You create a table with the following fields:
- SessionID
- End
- End
- OBS (optional)

Then, you create a Pragma AutoNomous Transaction procedure. (With this, this procedure is performed in a "separate session," you can start inside it that will not disturb the rest).

In this procedure, you receive as a parameter the session_id of your script. (see this [url=http://en.glufke.net/oracle/viewtopic.php?t=35]link Datafim. and commits after that.

That way, simply run this procedure at the beginning and at the end of each script. It will save on this log table the information you want.

To stay 100% even, you can still do a view from this table with the V $ session to see if the session continues alive. (Type: If by chance the program started - recorded in the log and then aborted In the middle ...

by V $ Session has to see if the sessions that do not have an end are still alive ...

: -O
feliperenz
Rank: Estagiário Pleno
Rank: Estagiário Pleno
Posts: 6
Joined: Tue, 17 Jan 2006 2:35 pm
Location: Porto Alegre \ RS
Felipe Renz
DBA Oracle

Personnel,

follows a solution found, this returns the ID, the DML transactions that did not suffer Commit or Rollback.

Select all

SELECT S.SID FROM V$TRANSACTION T, V$SESSION S WHERE S.SADDR = T.SES_ADDR;
User avatar
dr_gori
Moderador
Moderador
Posts: 5026
Joined: Mon, 03 May 2004 3:08 pm
Location: Portland, OR USA
Contact:
Thomas F. G

Você já respondeu a dúvida de alguém hoje?
https://glufke.net/oracle/search.php?search_id=unanswered

beleza, but in that case you will be looking at everything that is pending. Will have uncommited date of several people ...
will have to "pick" there in the middle what interests you: - /
Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest