Sql Trace - data lost
Could a sql trace cause a database to loose data? While running a trace, we lost data for the same period the trace was running. Please advise.
Thanks
FOP14
Pardon my inexperience, could you explain the comment, "committed data?"
By committed data, I mean either an explicit COMMIT that successfully completed or a data modification statement that completed successfully without an explicit transaction. Data modifications should be durable in either of
these cases and won't be lost even in the event of a server crash or restart because the modifications are physically written to the transaction log.
In this situation, data was being added to the database - we printed reports, "proving" data was entered. These entries occurred during the trace on several occasions,
after the trace was completed, these transactions are no longer in the database. Even assigned "account id's" for new constituents disappeared - so then when you entered a new constituent the database assigned the "used" id as the "new" id. So
id #20571 was assigned during trace and after trace it was assigned to the next candidate as if it was not used previous.
The database support team assure us the database is stable and "NOONE" else has complained of this occurrence, but we lost data. It just doesn't make sense. The only
thing different was the trace. Thanks for your help.
As long as the report queries do not specify NOLOCK or READ UNCOMMITTED, I would expect the data shown on the reports to be in the database. How exactly are the IDs assigned? Are those IDENITY column values, SEQUENCE objects, or assigned via
some other method? I'm trying to figure out what may have happened as I can't think of how a SQL trace could cause data to disappear.
Dan Guzman, SQL Server MVP, http://www.dbdelta.com
Similar Messages
-
Sql Developer Data Modeler all domains lost after changing to version 3.0
I have two questions:
1. Sql Developer Data Modeler - is it still a separate product? Or is it only available as integrated within Sql Developer?
2. After opening a model created with Data Modeler 2.0 with the new integrated Data Modeler 3.0 I lost all my domain definitions. What can I do to avoid this? Any help would be appreciated.
Thanks in advance
HolgerHi Holger,
Sql Developer Data Modeler - is it still a separate product? Or is it only available as integrated within Sql Developer?Standalone version is here http://www.oracle.com/technetwork/developer-tools/datamodeler/overview/index.html
2. After opening a model created with Data Modeler 2.0 with the new integrated Data Modeler 3.0 I lost all my domain definitions. What can I do to avoid this? Any help would be appreciated.Copy file defaultdomains.xml from DM 2.0 installation to "sqldeveloper\sqldeveloper\extensions\oracle.datamodeler\types" directory (if you use version in SQL Developer) or to
"datamodeler\datamodeler\types" if you use standalone DM 3.0.
Location of this directory can be set in preferences - it's called system types directory there - it contains: default domains, RDBMS sites, logical types and custom scripts.
Philip -
Lock monitor, top sql and trace data viewer
can any one please tell me how can i access lock monitor, top sql and trace data viewer
i am also not sure whether these tools are installed on my machine or not, if they are please tell me how can i access them, if not please tell me how can i install them
thanks a lotHey,
You can launch OEM from a client machine and then:
- Log in as system for example;
- go to tools,
- then - Diagnostics Packs, then you will have:
a) Lock Monitor
b) Perfomance Manager
c) Performance Overview
d) Top Sessions
e) Top SQL.
I hope this can help you a little.
Regards,
Marcello -
How to look at the SQL trace in Oracle
Hi,
How do we look for the SQL trace in Oracle?
With SQL trace I mean all the SQL statements being executed in Oracle database ( including select ).
Thanks........Thanks for a quick reply nbellam. I wonder if there is a way to find out the date and time when the sql was executed?
-
What is SQL Trace and How to Use it .
Dear Experts .
1.) May You Please tell me What is the Purpose of SQL-Trace and How to use it ?
2.) What is purpose of T-codes SE30 and ST22 ?
Please it is urgent ...
Regards : RajneeshHi
SQL Trace transaction ST05: The trace list has many lines that are not related to the SELECT statement in the ABAP program. This is because the execution of any ABAP program requires additional administrative SQL calls. To restrict the list output, use the filter introducing the trace list.
The trace list contains different SQL statements simultaneously related to the one SELECT statement in the ABAP program. This is because the R/3 Database Interface - a sophisticated component of the R/3 Application Server - maps every Open SQL statement to one or a series of physical database calls and brings it to execution. This mapping, crucial to R/3s performance, depends on the particular call and database system. For example, the SELECT-ENDSELECT loop on a particular database table of the ABAP program would be mapped to a sequence PREPARE-OPEN-FETCH of physical calls in an Oracle environment.
The WHERE clause in the trace list's SQL statement is different from the WHERE clause in the ABAP statement. This is because in an R/3 system, a client is a self-contained unit with separate master records and its own set of table data (in commercial, organizational, and technical terms). With ABAP, every Open SQL statement automatically executes within the correct client environment. For this reason, a condition with the actual client code is added to every WHERE clause if a client field is a component of the searched table.
To see a statement's execution plan, just position the cursor on the PREPARE statement and choose Explain SQL. A detailed explanation of the execution plan depends on the database system in use.
Run time analysis transaction SE30 :This transaction gives all the analysis of an ABAP program with respect to the database and the non-database processing.
STEPS
Run time analysis transaction SE30
In Transaction SE30, fill in the transaction name or the program name which needs to be analyzed for performance tuning.
For our case, let this be ZABAP_PERF_TUNING
After giving the required inputs to the program, execute it. After the final output list has been displayed, PRESS the BACK button.
On the original SE30 screen, now click on ANALYZE button.
The percentage across each of the areas ABAP/ Database/System shows the percentage of total time used for those areas and load on these areas while running the program . The lesser the database load faster the program runs.
SQL Trace ST05
Starting the Trace:
To analyze a trace file, do the following:
Choose the menu path Test Performance Trace in the ABAP Workbench or go to Transaction ST05. The initial screen of the test tool appears. In the lower part of the screen, the status of the Performance Trace is displayed. This provides you with information as to whether any of the Performance Traces are switched on and the users for which they are enabled. It also tells you which user has switched the trace on.
Using the selection buttons provided, set which trace functions you wish to have switched on (SWL trace, enqueue trace, RFC trace, table buffer trace).
If you want to switch on the trace under your user name, choose Trace on. If you want to pass on values for one or several filter criteria, choose Trace with Filter.
Typical filter criteria are: the name of the user, transaction name, process name, and program name.
Now run the program to be analyzed.
Stopping the Trace:
To deactivate the trace:
Choose Test Performance Trace in the ABAP Workbench. The initial screen of the test tool appears. It contains a status line displaying the traces that are active, the users for whom they are active, and the user who activated them.
Select the trace functions that you want to switch off.
Choose Deactivate Trace. If you started the trace yourself, you can now switch it off immediately. If the performance trace was started by a different user, a confirmation prompt appears before deactivation-
Analyzing a Sample trace data: PREPARE: Prepares the OPEN statement for use and determines the access method.
OPEN: Opens the cursor and specifies the selection result by filling the selection fields with concrete values.
FETCH: Moves the cursor through the dataset created by the OPEN operation. The array size displayed beside the fetch data means that the system can transfer a maximum package size of 392 records at one time into the buffered area. -
OCCI/ODBC application sql trace failure...
Hi,
I was doing the sql*net trace for an OCCI/ODBC Application writen in c++. I have an InstantClient on my PC. I was trying to access the Oracle through my C++ program to
compare the performance of OCCI and ODBC.
I was using the Oracle 10g(ver10.2.0.1.0 ), Oracle instant cilent(win32-10.2.0.3-20061115), and VS 8.0.
TNSNAMES.ora:
ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = host_name)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ORCL)
(SID = ORCL)
LISTENER.ORA:(It was created by net manager.)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = ORCL)
(ORACLE_HOME = F:\oracle\product\10.1.0\Db_3)
(SID_NAME = ORCL)
LISTENER =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = HOST_NAME)(PORT = 1521))
The sqlnet.ora file was writen to trace the client sql. Fortunately, my C++ program can access the oracle and get my result back successfully. In the same time, the trace files
can be created, but when using the tkprof tool to explain it, it comes to the file with useless information.
One of the *.trc file explaind by tkprof tool:
Sort options: default
count = number of times OCI procedure was executed
cpu = cpu time in seconds executing
elapsed = elapsed time in seconds executing
disk = number of physical reads of buffers from disk
query = number of buffers gotten for consistent read
current = number of buffers gotten in current mode (usually for update)
rows = number of rows processed by the fetch or execute call
Trace file: ora21763.trc
Trace file compatibility: 8.00.04
Sort options: default
1 session in tracefile.
0 user SQL statements in trace file.
0 internal SQL statements in trace file.
0 SQL statements in trace file.
0 unique SQL statements in trace file.
327 lines in trace file.
Finally, I got TNS-12518 TNS-12564 error. I tried to add DIRECT_HANDOFF_TTC_LISTENER=OFF, but it didnt work. I traced the listener, the error occured in the listener.trc "
ntt2err: soc 464 error " and " nsbequeath: error reading REDIR/NSE msg".
I just cann't get the right trace file and cann't sovle the two errors(TNS-12518 TNS-12564). Can somebody give me some advices, please.Hi,
The TKPROF facility accepts as input an SQL trace file generated when SQL Trace has been turned on for the system or a session, not a SQL*NET trace file. A SQL*Net trace file is a dump of raw data packets and communications at the SQL*NET layer. If you want to get performance statistics from SQL beign executed by your application, then you need to turn on SQL Trace not SQL*MET tracing.
To enable SQL trace at the system level, you need to execute:
alter system set SQL_TRACE=TRUE
The NS-12518 TNS-12564 normally means you are running into some sort of resource deletion issue. This can be caused by various things. Make sure you are properly cleaning up and closing sessions in your application.
Are you performing some sort of stress test or have you just written a Multi-threaded test harness that executes different types of SQL with OCCI/ODBC?
HTH
J.B. -
Explain plan not displayed in sql trace file
Hello,
I don't understand why in sql trace file, after tkprof transformation, for several queries the explain plan is displayed and for several queries, no explain plan is displayed.
How can I have the explain plan for all queries?
Thanks for your help.Was this a trace started on an already running task? Was the trace stopped before the task completed? Did the trace file reach its set size limit before the task compled?
In all three cases above you would have cursors that were not closed and stats information not written to the trace file resulting in incomplete data for some SQL.
HTH -- Mark D Powell -- -
No insert Statements for EKKO EKPO in ST05 sql trace for transaction me21n
No insert Statements for EKKO EKPO in ST05 sql trace for transaction me21n.
IN ST05 I set a filter for ME21N and executed transaction to create a Purchase Order and then checked
ST05 but there is NO insert for EKKO or EKPO??
How Do I find in which columns of EKKO and EKPO data is inserted in ST05?
Edited by: DeepakNandikanti on Apr 28, 2010 8:27 AMHi,
I tried in my system and I can see INSERT statement on EKKO and EKPO tables. What exactly you are looking for? Some one else might have switched on the trace at the same time. Can you try again and see.
ST05=>Switch on trace
ME21N=>Create PO.
ST05=>Switch off and display trace.
In trace list search for EKKO and EKPO.
Column names are not shown in the trace list. It is the SQL trace and column list is generated dynamically like :A0, :A1....
@ Suhas,
That might be because the tables are updated via BAPIs ... Do you think SAP uses direct update statements on the DB tables ??
I didn't get above statement. Is there any other way of updation that happens when using BAPI? I believe that, even in case of BAPI there will be update task FMs called during database update. Please correct if i got it wrong.
Thanks,
Vinod. -
SQL TRACE for WEB deployed report
When I put
Alter Session Set sql_trace=TRUE
into the BEFORE Parameter Form trigger...
I get a trace file showing data on the one SQL in that trigger.
There is no TRACE output of the main query or any of the PL/SQL in the Program Units.
The report is invoked from company-wide intra-net.
I think it is Oracle Apps running in Linux server.
What am I doing wrong?
PS
I cannot execute this report from Report Builder.Hello,
Just a remark : if you are using Reports 9.0.4 / 10.1.2, you don't have to modify the reports , you can activate the SQL trace with the parameter SQLTRACE=YES
http://www.oracle.com/webapps/online-help/reports/10.1.2/topics/htmlhelp_rwbuild_hs/rwrefex/cmdline/common/cla_sqltrace.htm
Regards -
How to design SQL server data file and log file growth
how to design SQL DB data file and log file growth- SQL server 2012
if my data file is having 10 GB sizze and log file is having 5 GB size
what should be the size in MB (not in %) of autogrowth. based on what we have to determine the ideal size of file auto growth.It's very difficult to give a definitive answer on this. Best principal is to size your database correctly in advance so that you never have to autogrow, of course in reality that isn't always practical.
The setting you use is really dictated by the expected growth in your files. Given that the size is relatively small why not set it to 1gb on the datafile(s) and 512mb on the log file? The important thing is to monitor it on an on-going basis to see if that's
the appropriate amount.
One thing you should do is enable instant file initialization by granting the service account Perform Volume Maintenance tasks in group policy. This will allow the data files to grow quickly when required, details here:
https://technet.microsoft.com/en-us/library/ms175935%28v=sql.105%29.aspx?f=255&MSPPError=-2147217396
Also, it possible to query the default trace to find autogrowth events, if you wanted you could write an alert/sql job based on this
SELECT
[DatabaseName],
[FileName],
[SPID],
[Duration],
[StartTime],
[EndTime],
CASE [EventClass]
WHEN 92 THEN 'Data'
WHEN 93 THEN 'Log' END
FROM sys.fn_trace_gettable('c:\path\to\trace.trc', DEFAULT)
WHERE
EventClass IN (92,93)
hope that helps -
Hi ,
How to use SQL Tracer..(ST05).
Thanks,
SubbuHi,
ST05: SQL trace
1.create a small ABAP/4 program that contains only the select statement. Before proceeding, test it to ensure that it works.
2.Open that program in the editor so that it is ready and waiting to execute.
3.Open a new session using the menu path System->Create session.
4.Run transaction ST05 (enter /nst05-zero-five, not oh-five-in the Command field, or choose the menu path System->Utilities->SQL Trace). The Trace SQL Database Requests screen is displayed.
5.If the Trace SQL Status Information box reads Trace SQL is switched off, go to step 7.
6.At this point, the Trace SQL Status Information box contains Trace SQL switched on by, followed by the user id who turned on the trace and the date and time it was started. You must switch it off before you can proceed. If the trace was started within the past hour, it is possible that it is still being used. Contact the indicated user or try again later. If the trace was started hours or days ago, the user probably left it on by mistake and it can be safely turned off. To turn off the trace, press the Trace Off pushbutton. The message in the Trace SQL Status Information box should now read Trace SQL is switched off.
7.Press the Trace On pushbutton. The Trace SQL Database Requests dialog box is displayed. The DB-Trace for User field should contain your user ID. If your user ID is not in this field, enter it now.
8.Press the OK button. You are returned to the Trace SQL Database Requests screen and the status information reads Trace SQL switched on by, indicating that you turned on the trace.
9.Switch back to the window containing your editor session (the one with your program waiting to execute).
10.Press F8 to run your program. (Only press F8, do not do anything else, do not even press the Back button.)
11.When your program has run and the hourglass is no longer displayed, switch back to the trace window.
12.Press the Trace Off pushbutton. The status information reads Trace SQL is switched off.
13.Press the List Trace pushbutton. The Trace SQL Database Requests dialog box is displayed. The fields on this screen will already contain values.
14.Press the OK button. You might need to wait a little while, at most a couple of minutes. The Trace SQL: List Database Requests screen is displayed.
15.Type %sc in the Command field and press the Enter key. The Find dialog box is displayed.
16.Type the name of the table you are tracing in the Search For field. (This is the table named in the select statement in your ABAP/4 program.)
17.Press the Find button. A search results list should be displayed with your table name highlighted.
18.Click on the first highlighted table name. You are returned to the Trace SQL: List Database Requests screen. Your cursor is positioned on the first line containing your table name. To the right of it, in the Operation column, should be the word PREPARE, OPEN, or REOPEN.
19.Press the Explain SQL button on the Application toolbar. The Show Execution Plan for SQL Statement screen is displayed.
20.Scroll down to the execution plan. The index used will be displayed in blue.
Jogdand M B -
Reg : SQL Trace and ECAT
Hi Floks ,
Any body knowing The SQL trace analysis and Ecat tool .send me how to work on this issues .Please send me with snap shot it's will help to who don't know how to utilize this tools.
thanks,
sureshHi suresh,
Check these links.
SQL trace
http://www.sapdevelopment.co.uk/perform/perform_sqltrace.htm
Go to st05 and activate trace, go back and run your transaction or report again go to st05 deactivate trace and click display trace here you can find information with this you can performence analysis, database tables, fields etc.
ECAT
eCATT stands for extended Computer Aided Test Tool (eCATT) which is built is testing tool to test SAP system. By using testing tool we can test the entire business process, and we can also use this tool with a third party testing tool (I am not covering this topic). Execution of every test script ends with a log, which explains the results of the test script.
By using eCATT we can do following operations,
· Test transactions, reports, and scenarios
· Call BAPIs and function modules
· Test remote systems
· Check authorizations (user profiles)
· Test updates (database, applications, GUI)
· Test the effect of changes to customizing settings
· Check system messages
For more information go to
http://help.sap.com/saphelp_erp2004/helpdata/en/2a/121e3bd711bb04e10000000a114084/frameset.htm
To develop a test script in eCATT we need to follow the following steps,
1. Creating Test Scripts.
2. Creating Test Data Containers[16] .
3. Understanding System Data Containers[17] .
4. Executing Test Configurations.
There is a very good web blog on eCATT in sdn.com which explains eCATT with necessary screen shots.
To read document click here Blog on eCATT
http://www.sapdevelopment.co.uk/testing/ecatt.htm -
Hi all,
I want to run a SQL trace for processing of CREMAS IDOC's ( custom Functional module) and i want to see which all tables or SQL statement is taking more time .
Can you tell me procedure to run SQL trace.HI,
Here are the 2 good links
http://publib.boulder.ibm.com/tividd/td/ITMAN/SC32-9195-00/en_US/HTML/sap_add06.htm
http://help.sap.com/saphelp_webas610/helpdata/en/d1/8022e5454211d189710000e8322d00/content.htm
Well using SQL trace
like as follows:
Goto transaction ST05. Press TRACE ON.
Execute your transaction .
Come back to this screen and click TRACE OFF.
Then check the trace details.
You end up getting unnecessary details
Lets say you have to analyze your particular SQL query,
1. put a breakpoint at the select statement and execute the transaction , as it stops at your breakpoint , run SQL trace in seperate session.
2. Trace ON
3. Execute the select statement.
4. Trace OFF
5. Analyze.
In this way you can analyze your particular select query
Pls check links like:
http://help.sap.com/saphelp_nw04/helpdata/en/17/358df9c9fee2469105731e10756921/frameset.htm
http://help.sap.com/saphelp_bw30b/helpdata/en/d1/801f89454211d189710000e8322d00/frameset.htm
http://www.sapbrain.com/TOOLS/SQLTRACE/SQL_TRACE.html
SQL Trace
SQL trace (ST05) provides the developer with the ability to analyze database select statements. Simply execute ST05 to turn on SQL trace, then execute the statement/program you want to analyze. Now turn off SQL trace using ST05
And click on list trace to view the details.
Authorization trace analysis
1. Open two sessions
2. Execute transaction ST01 in one of the sessions
3. Select the authorization checkbox, note the other traces
you can perform (SQL, RFC, Table Buffer etc)
4. Click the 'Trace On' button
5. Within your other session execute the transaction/report
you want to trace or get the user in question to do it
6. Return to the session where you turned the trace on and
click on 'Trace Off' otherwise it will continue to record all authorization checks
7. Click on the 'Analysis' button
8. Enter appropriate data into selection screen such as
Username, type of trace records (i.e. Authorization check)
9. Click on the Execute button.
10. Report displaying trace results will now be displayed
GO THROUGH THIS
Tools provided for Performance Analysis
Following are the different tools provided by SAP for performance analysis of an ABAP object
Cheers,
Simha. -
Code inspector, SQL trace
Hi all,
Can anyone help me to analyse the output of sql trace and code inspector that we do for a program.
Thanks & regards,
Saroja.SQL trace(ST05) provides the developer with the ability to analyse database select statements. Simply execute ST05 to turn on SQL trace, then execute the statement/program you want to analyse. Now turn off SQL trace using ST05
and click on list trace to view the details.
If you notice performance issue, you can perform an SQL trace :
1 - ST05
2 - Activate trace
3 - Run your prog.
4 - Deactivate trace & display it !
You'll see accessed tables, with runtime, etc...
You can also perform traces on other items such as authorisation objects.
Authorisation trace analysis 1. Open two sessions
2. Execute transaction ST01 in one of the sessions
3. Select the authorisation checkbox, note the other traces
you can perform (SQL, RFC, Table Buffer etc)
4. Click the 'Trace On' button
5. Within your other session execte the transaction/report
you want to trace or get the user in question to do it
6. Return to the session where you turned the trace on and
click on 'Trace Off' otherwise it will continue to record
all athorisation checks
7. Click on the 'Analysis' button
8. Enter appropriate data into selection screen such as
Username, type of trace records (i.e. Authorization check)
9. Click on the Execute button.
10. Report displaying trace results will now be displayed
http://www.sapdevelopment.co.uk/perform/perform_sqltrace.htm
Code inspector is a static check on your code. This check highlights statements that MAY cause long run times or inconsistant results.
This is new as of 6.10, it can be installed on 4.6C or 4.6D systems.
Code inspector includes the checks from the earlier 'Extended program check', (also transaction SLIN). The transation code for 'Code inspector' is SCII.
Regards,
Amey
Message was edited by:
Amey Potale -
When I use sql trace and tkprof. After I use tkprof, I get the result statistics. However, I don't understand one point that I see many queries which I didn't run. I mean how come these queries executed? and by who?
thankssome could be recursive sql statemets run by oracle. Post some example what you are running and what you are seeing?
The SQL statements can be listed in a TKPROF report in the order of how much resource they used, if desired. Also, recursive SQL statements issued by the SYS user to manage the data dictionary can be included or excluded.
How to Use and Understand the TKPROF utility
Maybe you are looking for
-
I have a problem with my 4s camera which has come up recently. Everytime I take a picture and look it up via the 'Photos' app, it shows as blank. But when I click on edit on the blank picture, it comes up and I am able to save it back on my photo alb
-
Handling error in XI with CCMS and Alert Monitor
Hello, I have configured the CCMS for handling XI error and use the auto-reaction method CCMS_Send_Alert_to_ALM for sending an alert when i have for exemple a mapping error. The issues are : 1) When an alert is catched I can send an email or having a
-
Hi, I am having trouble in maintaining session in jsp frames. - Here is sample code parent.jsp <HTML> <HEAD> <LINK rel=stylesheet type="text/css" href="defaults.css"> <TITLE>abc</TITLE> <% String checkAmount = "100.00"; session.setAttr
-
This is perhaps just a discussion point, but when I creat a swf from a timeline in After Effects (easy enough to do: File > Export > Adobe Flash Player) and I insert it into PowerPoint, it will not play. But when I render an avi file, it won't open i
-
Importing Spreadsheets from Microsoft Works
Is there any way to import Microsoft Works spreadsheets into AppleWorks? The file extension of the files I'm trying to import is .wks. I'd rather not have to recreate these sheets if at all possible. The files were created on an old Dell PC several y