ÔÚ´ò°ü³ÌÐòÖÐ×Ô¶¯°²×°SQL ServerÊý¾Ý¿â
1¡¢´´½¨°²×°ÏîÄ¿“Setup1”°²×°ÏîÄ¿
ÔÚ“Îļþ”²Ëµ¥ÉÏÖ¸Ïò“Ìí¼ÓÏîÄ¿”£¬È»ºóÑ¡Ôñ“н¨ÏîÄ¿”¡£
ÔÚ“Ìí¼ÓÐÂÏîÄ¿”¶Ô»°¿òÖУ¬Ñ¡Ôñ“ÏîÄ¿ÀàÐÍ”´°¸ñÖеē°²×°ºÍ²¿ÊðÏîÄ¿”£¬È»ºóÑ¡Ôñ“Ä£°å”´°¸ñÖеē°²×°ÏîÄ¿”¡£ÔÚ“Ãû³Æ”¿òÖмüÈë “setup1”¡£
µ¥»÷“È·¶¨”¹Ø±Õ¶Ô»°¿ò¡£
ÏîÄ¿±»Ìí¼Óµ½½â¾ö·½°¸×ÊÔ´¹ÜÀíÆ÷ÖУ¬²¢ÇÒÎļþϵͳ±à¼Æ÷´ò¿ª¡£
ÔÚ“ÊôÐÔ”´°¿ÚÖУ¬Ñ¡Ôñ ProductName ÊôÐÔ£¬²¢¼üÈë”ÒÚÍòµçÆ÷³ÉÌ×±¨¼Ûϵͳ”¡£
2¡¢ÔÚ°²×°ÏîÄ¿Öд´½¨°²×°³ÌÐòÀࣨinstall.cs£©¡£
Ìí¼Ó´´½¨Êý¾Ý¿â£¨InstallDatabase.txt£©¡¢É¾³ýÊý¾Ý¿â£¨DropDatabase.txt£©¡¢³õʼ»¯Êý¾Ý»ù±¾Êý¾Ý(InitializeData.txt)½Å±¾Îļþ£¬½«ÊôÐÔ“Éú³É²Ù×÷”ÉèΪ“ǶÈëµÄ×ÊÔ´”¡£´úÂëÈçÏ£º
using System;
using System.Collections;
using System.ComponentModel;
using System.Configuration.Install;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Reflection;
using System.Text.RegularExpressions;
using System.Windows.Forms;
using System.Text;
using Microsoft.Win32;
namespace install
{
/// <summary>
/// Installer µÄժҪ˵Ã÷¡£
/// </summary>
[RunInstaller(true)]
public class Installer : System.Configuration.Install.Installer
{
/// <summary>
/// ±ØÐèµÄÉè¼ÆÆ÷±äÁ¿¡£
/// </summary>
string conStr="packet size=4096;integrated security=SSPI;"+
"data source=\"(local)\";persist security info=False;"+
"initial catalog=master;connect timeo
Ïà¹ØÎĵµ£º
ÏÂÃæÌá³öÁË10ÌõºÍDB2 SQLÐÔÄÜÏà¹ØµÄ10ÌõÒòËØ£º
1¡¢ÌṩÊʵ±µÄͳ¼ÆÐÅÏ¢
¶ÔDB2ÓÅ»¯¹ÜÀíÆ÷£¨otimizer£©¶øÑÔ£¬ÈçºÎ¸ü¼ÓÓÐЧµÄÖ´ÐÐSQLÓï¾äÊÇÓÉ´æÔÚÓÚDB2 catalogÖеÄͳ¼ÆÐÅÏ¢¾ö¶¨µÄ£¬ÓÅ»¯Æ÷ÀûÓÃÕâЩÐÅÏ¢¾ö¶¨×îÓÅ»¯µÄ·¾¶¡£
Òò´Ë£¬ÎªÁ˱£³ÖϵͳÄܹ»×ö³ö×î¼ÑÑ¡Ôñ£¬ÐèÒª¾³£µÄÔËÐÐRunstatsÃüÁÀ´±£³Öϵͳͳ¼ÆÐÅÏ¢µÄ¼°Ê±ÓÐЧ¡£Ô ......
´óÐÍϵͳµÄÉú²ú»·¾³£¬Ò»°ãÇé¿öÏ£¬ÎÒÃÇÆÀ¼ÛÒ»Ìõ²éѯÊÇ·ñÓÐЧÂÊ£¬¸ü¶àµÄÊǹØ×¢Âß¼ IO( ÖÁÓÚΪʲô£¬»ØÍ·²¹Ò»Æª ) ¡£ÎÒÃdz£Ëµ£¬“Òª½¨±ëº·µÄË÷Òý”¡¢“Ҫд¸ßЧµÄ SQL ”£¬Æäʵ×îÖÕÄ¿µÄ¾ÍÊÇÔÚÏàͬ½á¹û¼¯Çé¿öÏ£¬¾¡¿ÉÄܼõÉÙÂß¼ IO ¡£
1.1 where Ìõ¼þµÄÁÐÉ϶¼µÃÓÐͳ¼ÆÐÅ ......
Ò»¡¢»ù´¡
1¡¢ËµÃ÷£º´´½¨Êý¾Ý¿â
CREATE DATABASE database-name
2¡¢ËµÃ÷£ºÉ¾³ýÊý¾Ý¿â
drop database dbname
3¡¢ËµÃ÷£º±¸·Ýsql server
--- ´´½¨ ±¸·ÝÊý¾ÝµÄ device
USE master
EXEC sp_addumpdevice 'disk', 'testBack', 'c:\mssql7backup\MyNwind_1.dat'
--- ¿ªÊ¼ ±¸·Ý
BACKUP DATABASE pubs TO testBack
......
Ò». ÒýÑÔ
¡¡¡¡Èç¹ûÄãÔø¾Ê¹ÓÃSQL Server¿ª·¢¹ýÈκÎÈí¼þ£¬ÄÇôÄã¿Ï¶¨»áÏ°¹ßÓÚʹÓÃËIJ¿·Ö±êʶ·ûÀ´²Î¿¼Ò»¸ö¶ÔÏó£º
[[[server.][database].][schema_name].]object_name
¡¡¡¡ÕýÈçÉÏÃæµÄ·½À¨ºÅËùÏÔʾµÄ£¬¸ÃÓï·¨µÄ²»Í¬²¿·Ö¿ÉÒÔ±»ºöÂÔ£¬Ö»ÒªÄãÌṩ×ã¹»µÄ±í´ïÀ´ÎÞ¶þÒåµØ±êʶÄãµÄ¶ÔÏó¼´¿É¡£ÀýÈ磬ÏÂÃæËùÓÐÕâЩ±í´ï¶¼¿ÉÄܲο¼Ïàͬµ ......