home *** CD-ROM | disk | FTP | other *** search
/ ftp.pasteur.org/FAQ/ / ftp-pasteur-org-FAQ.zip / FAQ / databases / sybase-faq / part7 < prev    next >
Encoding:
Internet Message Format  |  2004-04-21  |  7.6 KB

  1. Path: senator-bedfellow.mit.edu!dreaderd!not-for-mail
  2. Message-ID: <databases/sybase-faq/part7_1082468590@rtfm.mit.edu>
  3. Supersedes: <databases/sybase-faq/part7_1074677126@rtfm.mit.edu>
  4. Expires: 2 Aug 2004 13:43:10 GMT
  5. References: <databases/sybase-faq/part1_1082468590@rtfm.mit.edu>
  6. X-Last-Updated: 2003/03/02
  7. From: dowen@midsomer.org (David Owen)
  8. Newsgroups: comp.databases.sybase,comp.answers,news.answers
  9. Subject: Sybase FAQ: 7/19 - ASE Admin (4 of 7)
  10. Reply-To: dowen@midsomer.org (David Owen)
  11. Followup-To: comp.databases.sybase
  12. Distribution: world
  13. Organization: Midsomer Consultants Inc.
  14. Approved: news-answers-request@MIT.EDU
  15. Keywords: FAQ, DATABASES, SYBASE, ASA, ASE, REP
  16. Originator: faqserv@penguin-lust.MIT.EDU
  17. Date: 20 Apr 2004 13:45:05 GMT
  18. Lines: 183
  19. NNTP-Posting-Host: penguin-lust.mit.edu
  20. X-Trace: 1082468705 senator-bedfellow.mit.edu 565 18.181.0.29
  21. Xref: senator-bedfellow.mit.edu comp.databases.sybase:106205 comp.answers:56951 news.answers:270291
  22.  
  23. Archive-name: databases/sybase-faq/part7
  24. URL: http://www.isug.com/Sybase_FAQ
  25. Version: 1.7
  26. Maintainer: David Owen
  27. Last-modified: 2003/03/02
  28. Posting-Frequency: posted every 3rd month
  29.    A how-to-find-the-FAQ article is posted on the intervening months.
  30.  
  31.                             General Troubleshooting                            
  32.                                                                                
  33.  
  34.  
  35.  1. How do I turn off marked suspect on my database?
  36.  2. On startup, the transaction log of a database has filled and recovery has
  37.     suspended, what can I do?
  38.  3. Why do my page locks not get escalated to a table lock after 200 locks?
  39.  
  40. Performance and Tuning Advanced Administration ASE FAQ
  41.  
  42. -------------------------------------------------------------------------------
  43.  
  44. 1.4.1 How do I turn off marked suspect on my database?
  45.  
  46. -------------------------------------------------------------------------------
  47.  
  48. Say one of your database is marked suspect as the SQL Server is coming up. Here
  49. are the steps to take to unset the flag.
  50.  
  51.     Remember to fix the problem that caused the database to be marked suspect
  52.     after switching the flag.
  53.    
  54. System 11
  55.  
  56.  1. sp_configure "allow updates", 1
  57.  2. select status - 320 from sysdatabases where dbid = db_id("my_hosed_db") -- 
  58.     save this value.
  59.  3. begin transaction
  60.  4. update sysdatabases set status = -32768 where dbid = db_id("my_hosed_db")
  61.  5. commit transaction
  62.  6. shutdown
  63.  7. startserver -f RUN_*
  64.  8. fix the problem that caused the database to be marked suspect
  65.  9. begin transaction
  66. 10. update sysdatabases set status = saved_value where dbid = db_id
  67.     ("my_hosed_db")
  68. 11. commit transaction
  69. 12. sp_configure "allow updates", 0
  70. 13. reconfigure
  71. 14. shutdown
  72. 15. startserver -f RUN_*
  73.  
  74. System 10
  75.  
  76.  1. sp_configure "allow updates", 1
  77.  2. reconfigure with override
  78.  3. select status - 320 from sysdatabases where dbid = db_id("my_hosed_db") -
  79.     save this value.
  80.  4. begin transaction
  81.  5. update sysdatabases set status = -32768 where dbid = db_id("my_hosed_db")
  82.  6. commit transaction
  83.  7. shutdown
  84.  8. startserver -f RUN_*
  85.  9. fix the problem that caused the database to be marked suspect
  86. 10. begin transaction
  87. 11. update sysdatabases set status = saved_value where dbid = db_id
  88.     ("my_hosed_db")
  89. 12. commit transaction
  90. 13. sp_configure "allow updates", 0
  91. 14. reconfigure
  92. 15. shutdown
  93. 16. startserver -f RUN_*
  94.  
  95. Pre System 10
  96.  
  97.  1. sp_configure "allow updates", 1
  98.  2. reconfigure with override
  99.  3. select status - 320 from sysdatabases where dbid = db_id("my_hosed_db") -
  100.     save this value.
  101.  4. begin transaction
  102.  5. update sysdatabases set status = -32767 where dbid = db_id("my_hosed_db")
  103.  6. commit transaction
  104.  7. you should be able to access the database for it to be cleared out. If not:
  105.      1. shutdown
  106.      2. startserver -f RUN_*
  107.  8. fix the problem that caused the database to be marked suspect
  108.  9. begin transaction
  109. 10. update sysdatabases set status = saved_value where dbid = db_id
  110.     ("my_hosed_db")
  111. 11. commit transaction
  112. 12. sp_configure "allow updates", 0
  113. 13. reconfigure
  114.  
  115. Return to top
  116.  
  117. -------------------------------------------------------------------------------
  118.  
  119. 1.4.2 On startup, the transaction log of a database has filled and recovery has
  120. suspended, what can I do?
  121.  
  122. -------------------------------------------------------------------------------
  123.  
  124. You might find the following in the error log:
  125.  
  126. 00:00000:00001:2000/01/04 07:43:42.68 server Can't allocate space for object
  127. 'syslogs' in database 'DBbad' because 'logsegment' segment is full/has no free
  128. extents. If you ran out of space in syslogs, dump the transaction log.
  129. Otherwise, use ALTER DATABASE or sp_extendsegment to increase size of the
  130. segment.
  131. 00:00000:00001:2000/01/04 07:43:42.68 server Error: 3475, Severity: 21, State:
  132. 7
  133. 00:00000:00001:2000/01/04 07:43:42.68 server There is no space available in
  134. SYSLOGS for process 1 to log a record for which space has been reserved. This
  135. process will retry at intervals of one minute. The internal error number is -4.
  136.  
  137. which can prevent ASE from starting properly.  A neat solution from Sean Kiely
  138. (sean.kiely@sybase.com) of Sybase Technical Support, that works if the database
  139. has any "data only" segments.  Obviously this method does not apply to the
  140. master database.   The Sybase Trouble Shooting Guide has very good coverage of
  141. recovering the master database.
  142.  
  143.  1. You will have to bring the server up with trace flag 3608 to prevent the
  144.     recovery of the user databases.
  145.  2. sp_configure "allow updates",1
  146.     go
  147.  3. Write down the segmap entries from the sysusages table for the toasted
  148.     database.
  149.  4. update sysusages
  150.        set segmap = 7
  151.     where dbid   = db_id("my_toasted_db")
  152.        and segmap = 3
  153.  5. select status - 320
  154.       from sysdatabases
  155.     where dbid = db_id("my_toasted_db") -- save this value.
  156.     go
  157.     begin transaction
  158.     update sysdatabases set status = -32768 where dbid = db_id("my_toasted_db")
  159.     go -- if all is OK, then...
  160.     commit transaction
  161.     go
  162.     shutdown
  163.     go
  164.  6. Restart the server without the trace flag.  With luck it should now have
  165.     enough space to recover.  If it doesn't, you are in deeper trouble than
  166.     before, you do have a good, recent backup don't you?
  167.  7. dump database my_toasted_db with truncate_only
  168.     go
  169.  8. Reset the segmap entries in sysusages to be those as saved in 3. above.
  170.  9. Shutdown ASE and restart.  (The traceflag should have gone at step 6., but
  171.     ensure that it is not there!)
  172.  
  173. Return to top
  174.  
  175. -------------------------------------------------------------------------------
  176.  
  177. 1.4.3: Why do my page locks not get escalated to a table lock after 200 locks?
  178.  
  179. -------------------------------------------------------------------------------
  180.  
  181. Several reasons why this may be happening.
  182.  
  183.   * Are you doing the updates from within a cursor?
  184.  
  185.     The lock promotion only happens if you are attempting to take out 200 locks
  186.     in a single operation ie a single insert, update or delete.  If you
  187.     continually loop over a table using a cursor, locking one row at time, the
  188.     lock promotion never fires.   Either use an explicit mechanism to lock the
  189.     whole table, if that is required, or remove the cursor replacing it with an
  190.     appropriate join.
  191.    
  192.   * A single operation is failing to escalate?
  193.  
  194.     Even if you are performing a single insert, update or delete, Sybase only 
  195.     attempts to lock the whole table when the lock escalation point is
  196.     reached.  If this attempt fails because there is another lock which
  197.     prevents the escalation, the attempt is aborted and individual page locking
  198.     continues.
  199.    
  200. Return to top
  201.  
  202. -------------------------------------------------------------------------------
  203.  
  204. Performance and Tuning Advanced Administration ASE FAQ
  205.  
  206.