home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / database / sybase / 570 < prev    next >
Encoding:
Internet Message Format  |  1992-12-26  |  3.7 KB

  1. Path: sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!spool.mu.edu!agate!ucbvax!mtxinu!sybase!ben
  2. From: ben@sybase.com (Benjamin von Ullrich)
  3. Newsgroups: comp.databases.sybase
  4. Subject: Re: Recovering from a log segment full condition (why you may have to
  5. Message-ID: <27460@sybase.sybase.com>
  6. Date: 26 Dec 92 14:28:20 GMT
  7. References: <1992Dec16.205611.19776@spectrum.xerox.com> <dave.724703604@rincon>
  8. Sender: news@Sybase.COM
  9. Organization: sybase, inc., emeryville-across-from-SF, ca
  10. Lines: 64
  11.  
  12. In article <dave.724703604@rincon> dave@ema.rockwell.com (Dave Emde) writes:
  13. >I've had the same problem myself.  Using dump tran database with no_log
  14. >works will but there have been several instances where I dumped my transaction
  15. >log only to find that I still received the "out of space in syslogs" message.
  16. >
  17. >In this case you need to shutdown and restart the server and then issue
  18. >another dump with no_log.  This fixed my problem. If you have the Sybase
  19. >Troubleshooting Guide they have a good writeup about this type of problem. 
  20.  
  21. i think it's worthwhile to point out here why this is the case.
  22. due to the sequential nature of the log, only the inactive portion of the log
  23. may be truncated by any DUMP TRANSACTION command.  the inactive portion of the
  24. log runs from the "beginning" to the page which has the BEGIN XACT record for
  25. the oldest *active* (uncommitted) transaction.  pages which follow this oldest
  26. active transaction in the log are considered active for the purposes of DUMP
  27. TRANSACTION, since they may depend on changes made (yet to be committed or
  28. still to be rolled back) by this transaction.  recovery (at LOAD TRAN or system
  29. startup time) replays transactions as committed or rolled back in the
  30. exact order in which they appear in the log, so portions appearing in
  31. the log after an uncommitted transaction may not be removed.
  32.  
  33. the implication here is that given a large enough or long-running enough
  34. transaction, one can hold up the entire log (from dumping, not from continued
  35. logging!) while the transaction is still pending.  if your log fills up, and
  36. you have a very old transaction that started at the beginning of the log,
  37. no DUMP TRAN command can or will clear it until the transaction COMMITs or is
  38. ROLLed BACK.
  39.  
  40. the only things you can do in this case are:
  41. ALTER DATABASE to add more space to the log, hopefully allowing enough
  42. space & time for your old transaction(s) to commit (find that user who
  43. typed BEGIN TRAN ... UPDATE/INSERT/DELETE ...  and the went to lunch!).
  44.  
  45. KILL the long-running process/transaction.
  46.  
  47. shut down the sql server to terminate the long-running/old transaction.
  48.  
  49. these last two effectively terminate the transaction without a COMMIT, making
  50. it get rolled back upon recovery.
  51. this is a fairly drastic action to kill a process to clear a log.... if you
  52. can issue a COMMIT TRAN in the open session, or type ^C to abort from the same,
  53. please do so to achieve a cleaner and easier return to normal processing.
  54.  
  55. long-term, it is best to avoid long/log-intensive transactions to begin with:
  56.  
  57. >It recommends breaking up large deletes into smaller parts by adding a where 
  58. >clause.
  59. [...]
  60.  
  61. this advice on use of a WHERE clause to break up DELETEs into chunks applies
  62. the same to UPDATEs, and similarly for INSERT.
  63.  
  64. if your problem transaction is to delete all rows in a table, consider using the
  65. TRUNCATE TABLE command.  this command uses a miniscule porportion of log vs.
  66. a DELETE of all rows, as it merely logs the deallocation of pages for
  67. the table, not the image of every row deleted.  for this reason, it is also
  68. MUCH faster than DELETE for most good-sized tables.
  69.  
  70.  
  71. --
  72. ..ben
  73. ------
  74. Benjamin von Ullrich         only i do the talking here -- not my employer.
  75. ben@sybase.com                   {pyramid,pacbell,sun,lll-tis}!sybase!ben
  76.