| |

VerySource

 Forgot password?
 Register
Search
View: 1554|Reply: 8

How to record SQL statements that did not execute successfully

[Copy link]

1

Threads

5

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-3-3 13:30:01
| Show all posts |Read mode
That's it, I have this scenario:
There is an Oracle database. After the application runs for a period of time, which SQL statements are not successfully executed through the database, for example, the update statement sent to the database is not executed because of data errors.
Reply

Use magic Report

1

Threads

5

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

 Author| Post time: 2020-5-14 21:15:01
| Show all posts
note:
Can't change application

I tried to use the log file, but I couldn't find a way to worry about it. I read the Logminer manual, it seems that I can't achieve this function, that is: I only select the statement that was successfully executed, and the statement that was not successfully executed.
Reply

Use magic Report

1

Threads

5

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

 Author| Post time: 2020-5-15 09:15:01
| Show all posts
To add one more point, I want to implement such a function, that is to say, I am a database manager, and the database I manage is used by several applications. I now want to make a statistics to see which applications have been sent over a period of time. sql statements, which are executed successfully and which are not executed successfully
Reply

Use magic Report

0

Threads

71

Posts

50.00

Credits

Newbie

Rank: 1

Credits
50.00

 China

Post time: 2020-5-15 11:45:01
| Show all posts
alert.log
In the $ ORACLE_BASE / admin / instancename / bdump directory
Reply

Use magic Report

0

Threads

71

Posts

50.00

Credits

Newbie

Rank: 1

Credits
50.00

 China

Post time: 2020-5-15 14:30:01
| Show all posts
Or, change your own program, add exception handling, and record in the log table
Reply

Use magic Report

1

Threads

5

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

 Author| Post time: 2020-5-16 16:00:02
| Show all posts
to:
alert.log
In the $ ORACLE_BASE / admin / instancename / bdump directory
It seems that there is no sql statement saved in alert.log
Reply

Use magic Report

1

Threads

5

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

 Author| Post time: 2020-5-16 21:45:01
| Show all posts
to:
Or, change your own program, add exception handling, and record in the log table

=====================

Can not change the program, the program is already done, a very large program, which contains thousands of SQL statements.
Reply

Use magic Report

0

Threads

71

Posts

50.00

Credits

Newbie

Rank: 1

Credits
50.00

 China

Post time: 2020-5-19 00:30:01
| Show all posts
There is another way to audit the table.
The parameters of the init file must:
audit_trail = DB
such as:

Log in as user user. Plan to audit the insert operation of table user.test.
  The operation is as follows:
  audit insert on user.test;
  insert into test values ​​(....);
  select * from sys.aud $;
Reply

Use magic Report

1

Threads

7

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 Japan

Post time: 2020-7-16 17:00:01
| Show all posts
Can't the v$sql statement find out the executed sql statement and status?
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list