Topic: SQL*Plus and PL/SQL >> How to find the sql statements running in the DB is DDL or DML statement ?
|
Disclaimer: The purpose of all dbapool forums including OCP and Other Oracle Certification forums is to help each other with specific issues but not to share dump and copyrighted exam content, materials or intellectual property.
You may review the entire Oracle Certification Program Candidate Agreement online Here.
|
|
|
|
| Title: How to find the sql statements running in the DB is DDL or DML statement ? |
| KS |
Posted: Jun 05, 2007 12:22:36 PM |
Total Post: 65
Joined: Nov, 2006
|
Hi,
My requirement is to find who are all executing the DDL or DML commands in the DB.So kindly tell me how can I find whether the statement running currently is DDL or DML?
Thanks in advance.
- Srini |
|
|
Nand |
| Posted: Jun 11, 2007 04:36:41 AM | |
|
Total Post: 22
Joined: Jun, 2007
|
You can query v$sqltext and v$sql_plan joining on sql_id. v$sql_plan has operation, object_owner, obkect_name column. While the v$sqltext has sql_text column. Give your criteria and get the output.
Nand
|
|
|
|
|
KS |
| Posted: Jun 14, 2007 11:26:41 AM | |
|
Total Post: 65
Joined: Nov, 2006
|
Thanks for your reply.
I got it by joining the V$SQL and AUDIT_ACTIONS table.
The V$SQL table has a column named COMMAND_TYPE ,which we can join with AUDIT_ACTIONS table to get the desired output.
Thanks,
Sri.
|
|
|
|
|
| Time Zone: EDT |
Send this thread to your friend |
|
|
|
|
Forum Rules & Description
Who Can Read The Forum? Any registered user or guest
Who Can Post New Topics? Any registered user
Who Can Post Replies? Any registered user
|
| |
Get FREE Magazines
|
Top 10 Forum User
|
| Murtuja Khokhar | 857 |
| Mohammed Taj | 746 |
| positive fanatic | 483 |
| Jayanta Sur | 479 |
| Vigyan Kaushik | 386 |
| Gopu Gopi | 327 |
| Gitesh Trivedi | 322 |
| Vinoth Kumar | 264 |
| neeraj sharma | 258 |
| Ramesh Jois | 246 |
|
|