Oracle trace files and dump commands detailed __oracle

Source: Internet
Author: User
Tags rollback

One, Oracle trace File
Oracle trace files are grouped into three categories:

One is the background alarm log file that records the activity of the background process during startup, shutdown, and running of the database , such as table space creation, rollback segment creation, some alter commands, log switches, error messages, and so on. When a database fails, the file should be viewed first, but the information in the file is not necessarily associated with any error status. The background alarm log file is saved in the directory specified by the Background_dump_dest parameter, and the file format is SIDALRT.LOG.

Another type is a background trace file created by background processes such as DBWR, LGWR, and Smon. Background tracking files are generated according to the background process, and the background trace files are saved in the directory specified by the Background_dump_dest parameter, the file format is SIDDBWR.TRC, SIDSMON.TRC, etc.

There is also a type of user process that is connected to Oracle (Serverprocesses) The generated user trace file. These files are generated only when an error is encountered during a user session. In addition, the user can generate the class file by performing an Oracle trace event (see later), which is saved in the directory specified by the User_dump_dest parameter in the file format oraxxxxx.trc,xxxxx as the process number (or thread number) for creating the file.Second, Oracle tracking events
Oracle provides a class of commands to dump (dump) information contained within Oracle's various internal structures into trace files so that users can resolve various failures based on the contents of the file. There are two ways to set up trace events, one of which is to set up events in the Init.ora file, so that after the open database, all sessions will be affected. Set the format as follows:
event= "Eventnumber trace Name EventName [Forever,] [level Levelnumber]: ..."
With: Symbols, you can set multiple events consecutively, or you can set multiple events by using the event continuously.
Another approach is to use the ALTER session SET EVENTS command during a conversation and only affect the current session. Set the format as follows:
Alter session SET Events ' [Eventnumber|immediate] Trace name eventname [Forever] [, Level Levelnumber]: ... '
By: Symbols, you can set up multiple events consecutively, or you can set multiple events by using the ALTER session set events continuously. Format Description: Eventnumber refers to the event number that triggers the dump, the event number can be an Oracle error number (trace the specified event when the corresponding error occurs) or the Oralce internal event number, which is between 10000 and 10999 and cannot be used with the immediate keyword.
After the immediate keyword indicates that the command is issued, dump the specified structure immediately into the trace file, which is used only in the ALTER session statement and cannot be used with eventnumber, forever keywords.
Trace name is a keyword.
EventName refers to the event name (see later), which is the actual structure name to be dump. If the eventname is the context, the tracking is based on the internal event number.
The Forever keyword indicates that the event remains in effect during the instance or session cycle and cannot be used with immediate.
Levels are event-level keywords. However, there is no level at the dump error stack (errorstack).
Levelnumber represents event level numbers, typically from 1 to 10, 1 for Dump structure header information, and 10 for all information about the dump structure. 1. Buffers Event: DB buffer structure in the dump SGA buffer
Alter session SET Events ' immediate trace name buffers Level 1 '; --Represents the head of the dump buffer. 2, Blockdump event: Dump data file, index file, rollback segment file structure
Alter session SET Events ' immediate trace name blockdump level 66666 '; --Represents a block of data with a dump block address of 6666.
After Oracle 8 The command has been changed to:
Alter system dump datafile Block 9; --Represents the 9th block of data in the Dump data file Number 11. 3, Controlf event: Dump control file structure
Alter session SET Events ' immediate trace name Controlf level 10 '; --Represents all the contents of the dump control file. 4, Locks event: Dump LCK process Lock information
Alter session SET Events ' immediate Trace name locks Level 5 '; 5, REDOHDR event: Dump Redo Log Header information
Alter session SET Events ' immediate trace name REDOHDR Level 1 '; --A control file entry that represents the header of the dump redo log.
Alter session SET Events ' immediate trace name REDOHDR Level 2 '; --The common file header that represents the dump redo log.
Alter session SET Events ' immediate trace name REDOHDR level 10 ';    --Represents the full file header of the dump redo log. Note: The content dump of the redo log can take the following statement:
alter system dump logfile ' logfilename '; 6, Loghist event: The log history item in the dump control file
Alter session SET Events ' immediate trace name loghist Level 1 '; --Represents the earliest and latest log history entries for the dump.
Levelnumber is greater than or equal to 2 o'clock, representing the Levelnumber log history entry for 2.
Alter session SET Events ' immediate trace name loghist level 4 '; --Represents a dump of 16 log history items. 7, File_hdrs event: Dump all data file header information
Alter session SET Events ' immediate trace name File_hdrs Level 1 '; --A control file item that represents the head of all data files on dump.
Alter session SET Events ' immediate trace name File_hdrs Level 2 '; --Represents a common file header for all data files in dump.
Alter session SET Events ' immediate trace name File_hdrs level 10 '; --Represents the full file header for all data files in dump. 8, Errorstack event: Dump error stack information, usually when Oracle error, the foreground process will get an error message, but in some cases can not get the error message, this is the way to get Oracle errors.
Alter session SET Events ' 604 Trace name Errorstack forever '; --Represents the dump error stack and the process stack when a 604 error occurs. 9, systemstate event: Dump all system State and process state
Alter session SET Events ' immediate trace name systemstate level 10 '; --Represents dump all system state and process state. 10, coalesec event: Dump specified table space in the free range
When Levelnumber is in hexadecimal, the two High-order bytes represent the number of free intervals, and the two Low-order bytes represent tablespace numbers, such as 0x00050000 representing 5 free intervals in the dump system tablespace, converted to decimal 327680, namely:
Alter session SET Events ' immediate trace name coalesec level 327680 '; 11. Processsate Event: Dump process status
Alter session SET Events ' immediate trace name processsate level 10 '; 12, Library_cache event: Dump Library cache information
Alter session SET Events ' immediate trace name Library_cache level 10 '; 13, Heapdump event: Dump PGA, SGA, UGA information
Alter session SET Events ' immediate trace name heapdump Level 1 '; 14. Row_cache Event: Information in the Dump data dictionary buffer
Alter session SET Events ' immediate trace name Row_cache Level 1 ';
Iii. Internal Event number1, 10013: for monitoring transactionsRecovery2, 10015: Dump Undo Segment Head
event = "10015 Trace name Context Forever" 3, 10029: Used to give login information during a session 4, 10030: Log off information during a session 5, 10032: Dump sort Statistics 6, 10033: Dump sort growth Statistics 7, 10045: Tracking freelist Management operations 8, 10046: TrackingSQLStatement
Alter session SET Events ' 10046 Trace name Context forever, Level 4 '; --Tracking SQL statements and displaying bound variables
Alter session SET Events ' 10046 Trace name Context forever, Level 8 '; --track SQL statements and display wait Events 9, 10053: Dump optimization policies 10, 10059: Create and purge errors in the impersonation redo log 11, 10061: Block Smon processes from clearing temporary segments at startup 12, 10079: Dumping sql*net Statistics 13, 10081: Dump high water mark Change 14, 10104: Dump Hash Connection Statistics 15, 10128: Dump partition rest Information 16, 10200: Dump consistency Read information 17, 10201: Dump consistency read undo application 18, 10209: Allow impersonation of error 19, 10210 in control file: Trigger block Check Event
event = "10210 Trace name Context forever, Level 10" 20, 10211: Triggering index Check event 21, 10213: Impersonation crashes after write control file 22, 10214: Simulate write error in control file
Levelnumber from 1-9 The block number that generated the error, greater than or equal to 10, each control file will be faulted 23, 10215: Simulate read errors in the control file 24, 10220: Dump undo head Change 25, 10221; dump undo Change 26, 10224: Partitioning and deletion of the dump index 27, 10225: Dumps based on dictionariesManagementChanges in Interval 28, 10229: Simulate I/O errors on the data file 29, 10231: Set to ignore the corrupted data block when full table scan
Alter session SET Events ' 10231 Trace name context off '; --Block check during session shutdown
event = "10231 Trace name Context forever, Level 10"-checks the data blocks read into the SGA by any process 30, 10232: will be set to soft damage (Dbms_repair package settings or Db_block_check Data block dump to trace file 31, 10235, set when ING is true: for memory heap checking
Alter session SET Events ' 10235 Trace name Context forever, Level 1 '; 32, 10241: Dump remote SQL Execution 33, 10246: Trace Pmon Process 34, 10248: Trace Dispatch Process 35, 10249: Track MTS Process 36, 10252: Simulate write Data file header error 37, 10253: Analog Write redo log file Error 38, 10262: Memory leak when allowing connection
Alter session SET Events ' 10262 Trace name Context forever, Level 300 '; --Allow 300 bytes of memory leak 39, 10270: Dump shared cursors 40, 10285: Analog control file head damage 41, 10286: Analog control File Open error 42, 10287: Analog archive Error 43, 10357: Debug Direct path mechanism 44, 10500: Tracking Smon Process 45, 10608: Tracking bitmap index creation 46, 10704: Tracking enqueues 47, 10706: Tracking Global enqueues 48, 10708: TrackingRACBuffer Cache 49, 10710: Track access to bitmap indexes 50, 10711: Trace Bitmap Index merge Operations 51, 10712: Trace bitmap index or Operations 52, 10713: Trace Bitmap Index and Operations 53, 10714: Tracking bitmap index minus operations 54, 10715: Tracking bitmap Index to ROWID transformation 55, 10716: Tracking bitmap index compression and decompression 56, 10719: Tracking bitmap Index Modifications 57, 10731: Tracking cursor declarations 58, 10928: Tracking Pl /sql execution 59, 10938: Dump Pl/sql Execution statistics because the version is different, the syntax may change, but most of them are still available.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.