Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall
These two days I found that a portal that I was running had problems with data that could not be written, new members can not register, the information can not be published, can not log on the membership system, it is not found the reason to restore the backup database, but in the process of recovering the MSSQL database, prompted the database log full, please empty the database log Restore。 I think that's probably why the data can't be written correctly, then Baidu search the relevant information, and finally found the reason, the program run out, repair success, the source code released today, hope to help everyone, we have similar problems in the future have to empty the database log method, can also solve similar problems, empty the database log does not damage the server data, can solve the database can not write the reason, the code is as follows:
' SQL database connection parameters: Database name (sqldatabasename), user password (sqlpassword), user name (sqlusername),
' Connection name (Sqllocalname) (Local locally, field IP)
Const sqldatabasename = "Database name"
Const sqlpassword = "Database user password"
Const sqlusername = "Database user name"
Const sqllocalname = "Database Server" if the server is native, it can be set to: (local), if it is remote to set the database IP address
' Please do not modify the following
Dim ConnStr
ConnStr = "Provider = SQLOLEDB; User ID = "& Sqlusername &"; Password = "& SQLPassword &"; Initial Catalog = "&
Sqldatabasename & "; Data Source = "& Sqllocalname &";
Set conn = Server.CreateObject ("ADODB. Connection ")
Conn.Open ConnStr
Conn.execute ("DUMP TRANSACTION" & Sqldatabasename & "with No_log")
Conn.execute ("DBCC shrinkdatabase (& Sqldatabasename &)")
Conn.close
Set conn=nothing
Response.Write Your MSSQL database log has been emptied. "
%>
above code for and MSSQL database, support ASP space and set, Save the above code as So-and-so name. asp, and then in the input saved Web page address, the program runs automatically empty the database log, the perfect solution to the database can not write the problem, I hope the above code for SEO webmaster Help, thank you.
Author: seoer Xi yuan site: http://www.noseo.org.cn/
All rights reserved. Reprint must be linked to the form of the author and the original site and this statement.