中文版
 
 
◆  Add collections
◆ Set Home
◆ Contact Us
 
CHINESE

ENGLISH

  Home About Product B-service A-service Employment Bbs

 

   About YiLiDa  
 Company’s ideology
 Enterprise’s Cultures
 certificate
 The Development Course
 contact
 
 
  When the SQL database log file has been full, or the diary sees a very big solution  
   

database log file has been full, or the diary sees a very big solution

   1. Clear the log file

   DUMP TRANSACTION databasename WITH

       2. Interrupt the business diary

BACKUP LOG databasename WITH NO_LOG

3. Contract the database file (If documents are not compressed, the number of database documents cannot drop)

The enterprise management device – right click the database you want to compress-- all duties -- contraction of database -- contraction of documents

---- choose the log file -- in the contraction way to choose the contraction to XXM, here can produce the smallest M number which a permission contracts, direct type and confirm this number.

---- choose the data file -- choose the contraction in the contraction way to XXM, here could produce the smallest M number which a permission contracted, direct input this number, the determination was allowed

Also the SQL sentence is used to complete the program

---- contraction of database

DBCC SHRINKDATABASE (customer material)

---- contraction of assigned database, 1 is the file number, use this sentence to inquire: select * from sysfiles
  DBCC SHRINKFILE(1)

4. For the maximized reduction of the log file (if it is sql 7.0, this step only can be carried on in the inquire analyzer)

a. Separate database:

Business management -- server -- database -- right key -- separation database

b. Delete LOG document in my computer

c. Add database: business management -- server -- database – right click -- add database

This law will produce new LOG, the size only has more than 500 K or uses the code:

The under demonstration separates pubs and then attaches a pubs in document to current server a. Separation

E X E C sp_detach_db @dbname = 'pubs'

b. Delete log file

c. Then, add

 E X E C sp_attach_single_file_db @dbname = 'pubs',
    @physname = 'c:\Program Files\Microsoft SQL Server\MSSQL\Data\pubs.mdf'

     5. To automatically contract database later, make the following settings:

Business management -- server -- right click database -- attribute -- option -- choice "automatic contraction"

--SQL sentence establishment way:

E X E C sp_dboption'databasename','autoshrink','TRUE'

6. If the log file cannot grow too much:

Business management -- server -- right key database -- attribute -- business

log -- the document growth limit is xM (x will be the biggest data file size which you permit) --SQL sentence establishment way:

Note:

Please follow the steps. If you have not carried on the previous step, please do not have to make the next step, otherwise it is possible to damage your database;

Generally it is not suggested to make the steps 4 and 62;

The 4th step is unsafe. It has the possibility to damage the database or lose the data;

If the log hits the upper limit for the 6th step, the later database process will fail. Only the log is cleared, can the process be restored.

Moreover, we provide one simpler method for everybody.

1. Right click the database attribute window the breakdown reductive model set as simple

2. Right click all duties of database the contraction of database

3. Right click the database attribute window -- the breakdown reductive model -- set as the large-capacity log records



 

 

 

 

 
  Home about Before-sales service Post-sale service  
  Copyright © 2007 hnyld.com.All rights reserved.  
Hainan YiLiDa High Technology Development Co. Ltd.
ICP 05000235