Q
Problem solve Get help with specific problems with your technologies, process and projects.

Which table gets inserted record?

One of my applications inserts a new record into Oracle Server. How do I know exactly which table is to be inserted/modified?
The INSERT statement will indicate which table will get the new row. For instance:

INSERT INTO employee VALUES ('Bob');

In the above example, the table following the INTO clause is the table that will receive the new row. If you have access to the application code, you can simply look for INSERT statements.

If you do not have access to the application code, then you will want to identify your session in V$SESSION. Find the SID and SERIAL# for your session. Then in another SQL*Plus session, issue the following command:

EXEC DBMS_SYSTEM.SET_SQL_TRACE_IN_SESSION(sid,serial#,TRUE);

Substitute the SID and SERIAL# you obtained from V$SESSION. Then run the application to insert the new data. A trace file will be generated in your database's USER_DUMP_DEST directory and will contain the INSERT statement the application issued.

Dig Deeper on Oracle database design and architecture

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide.com

SearchDataCenter

SearchContentManagement

SearchHRSoftware

Close