Web System Maintenance Experience (1)

Source: Internet
Author: User
Tags sql server query

The maintenance volume of a Web system is often larger than that of a single-host Edition program, mainly because it is often driven by a growing demand. To maintain a Web system, you must have the following skills and habits.
(1) A good habit of maintaining the Web system is to make full use of the Script for maintenance. For example, when maintaining the database, you should write some maintenance program scripts (ASP, PHP, JSP, etc.) in the Web system, instead of using the database terminal for maintenance. The main advantages of this operation are as follows: 1. Review can be performed to avoid misoperations; 2. incremental maintenance can be performed to provide technical accumulation for subsequent routine maintenance or maintenance of large data volumes. Therefore, when the Web system administrator is using SQL Server Query manager or enterprise manager, you should consider whether the maintenance operation can be written as a T-SQL script/ASP script. My habit is to put a FixError In the Administrator directory of the Web system. asp script, which contains all maintenance and operation commands for the database. When a Bug is corrected, comment out the original program. In addition, I also like to write this script in reverse chronological order (for example, below), so that this script can be easily read as my maintenance log.
'----------------------------------------------------------------------
'2017-08-16
'Fix label Error
'From: yankchina@gmail.com
'Set DBConn = GetConnection ("E: \ data \ db. mdb ")
'Sqlstr = "update TTemp set Title = 'temp 'where Title = 'temp1 '"
'Dbconn. Execute (SQLStr)
'Set DBConn = nothing
'----------------------------------------------------------------------
The reason for using ASP instead of ASP. NET is that ASP. NET requires compilation and is more complex, while ASP is much lighter. The maintenance work does not take efficiency into consideration. It is also very convenient to compile ASP code in many editing environments (such as Visual Studio/Dreamweaver/Editplus. Below are some of my common ASP program segments (CodeSnippets ).
Function GetConnection (DBFile)
DBCnnString = "Provider = Microsoft. Jet. OLEDB.4.0; Data Source =" & DBFile
Set GetConnection = Server. CreateObject ("ADODB. Connection ")
GetConnection. CursorLocation = 3 'cursorlocation
GetConnection. Open DBCnnString
GetConnection. CommandTimeout = 60
End Function
Function GetSingle (SQLStr)
Set RsTemp = NewConn. Execute (SQLStr)
If not (RsTemp. eof and RsTemp. bof) then
GetSingle = RsTemp (0)
End if
Set RsTemp = nothing
End Function

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.