master 数据库
master 数据库记录 SQL Server 系统的所有系统级别信息。它记录所有的登录帐户和系统配置设置,所有其它的数据库,其中包括数据库文件的位置。master 数据库记录 SQL Server 的初始化信息,它始终有一个可用的最新 master 数据库备份。
tempdb 数据库
tempdb 数据库保存所有的临时表和临时存储过程。它还满足任何其它的临时存储要求,例如存储 SQL Server 生成的工作表。tempdb 数据库是全局资源,所有连接到系统的用户的临时表和存储过程都存储在该数据库中。tempdb 数据库在 SQL Server 每次启动时都重新创建,因此该数据库在系统启动时总是干净的。临时表和存储过程在连接断开时自动除去,而且当系统关闭后将没有任何连接处于活动状态,因此 tempdb 数据库中没有任何内容会从 SQL Server 的一个会话保存到另一个会话。
默认情况下,在 SQL Server 在运行时 tempdb 数据库会根据需要自动增长。不过,与其它数据库不同,每次启动数据库引擎时,它会重置为其初始大小。如果为 tempdb 数据库定义的大小较小,则每次重新启动 SQL Server时,将tempdb 数据库的大小自动增加到支持工作负荷所需的大小这一工作可能会成为系统处理负荷的一部分。为避免这种开销,可以使用 ALTER DATABASE 增加 tempdb 数据库的大小。
model 数据库
model 数据库用作在系统上创建的所有数据库的模板。当发出 CREATE DATABASE 语句时,新数据库的第一部分通过复制 model 数据库中的内容创建,剩余部分由空页填充。由于 SQL Server 每次启动时都要创建 tempdb 数据库,model 数据库必须一直存在于 SQL Server 系统中。
msdb 数据库
msdb 数据库供 SQL Server 代理程序调度警报和作业以及记录操作员时使用。
Northwind 示例数据库
Northwind Traders 示例数据库包含一个名为 Northwind Traders 的虚构公司的销售数据,该公司从事世界各地的特产食品进出口贸易
pubs 示例数据库
pubs 示例数据库以一个图书出版公司为模型,用于演示 SQL Server 数据库中可用的许多选项。该数据库及其中的表经常在文档内容所介绍的示例中使用。
2009年1月22日星期四
2009年1月16日星期五
vbs修改注册表 添加IE浏览器信任站点
Windows xp系统可以通过以下脚本来添加域名地址到IE浏览器信任站点
On Error Resume Next
Const HKEY_CURRENT_USER = &H80000001
strUrl_base = "google.com"
strUrl = strUrl_base & "\www"
strComputer = "."
Set objReg = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}\\" & strComputer & _
"\root\default:StdRegProv")
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Internet Settings\" _
& "ZoneMap\Domains\" & strUrl_base
objReg.CreateKey HKEY_CURRENT_USER,strKeyPath
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Internet Settings\" _
& "ZoneMap\Domains\" & strUrl
objReg.CreateKey HKEY_CURRENT_USER,strKeyPath
strValueName = "http"
dwValue = 2
objReg.SetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue
Wscript.Echo "Added http://www.google.com to Trusted sites Zone successfully."
如果是Windows 2003操作系统则需要把注册表路径Domains修改为EscDomains即可。
'**************************************************
Windows xp系统可以通过以下脚本来添加IP地址到IE浏览器信任站点
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set WSHShell = CreateObject("WScript.Shell")
on Error resume next
WshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Ranges\Range111\",""
WshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Ranges\Range111\http","2","REG_DWORD"
WshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Ranges\Range111\:Range","192.168.2.11"
Wscript.Echo "Added http://192.168.2.11 to Trusted sites Zone successfully."
如果是Windows 2003操作系统则需要把注册表路径Ranges修改为EscRanges即可。
On Error Resume Next
Const HKEY_CURRENT_USER = &H80000001
strUrl_base = "google.com"
strUrl = strUrl_base & "\www"
strComputer = "."
Set objReg = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}\\" & strComputer & _
"\root\default:StdRegProv")
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Internet Settings\" _
& "ZoneMap\Domains\" & strUrl_base
objReg.CreateKey HKEY_CURRENT_USER,strKeyPath
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Internet Settings\" _
& "ZoneMap\Domains\" & strUrl
objReg.CreateKey HKEY_CURRENT_USER,strKeyPath
strValueName = "http"
dwValue = 2
objReg.SetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue
Wscript.Echo "Added http://www.google.com to Trusted sites Zone successfully."
如果是Windows 2003操作系统则需要把注册表路径Domains修改为EscDomains即可。
'**************************************************
Windows xp系统可以通过以下脚本来添加IP地址到IE浏览器信任站点
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set WSHShell = CreateObject("WScript.Shell")
on Error resume next
WshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Ranges\Range111\",""
WshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Ranges\Range111\http","2","REG_DWORD"
WshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Ranges\Range111\:Range","192.168.2.11"
Wscript.Echo "Added http://192.168.2.11 to Trusted sites Zone successfully."
如果是Windows 2003操作系统则需要把注册表路径Ranges修改为EscRanges即可。
2009年1月5日星期一
使用vbs脚本通过SMTP服务批量发送邮件
'从数据库用户表中取出邮件信息循环发送
set cndb=CreateObject("ADODB.Connection")
cndb.open "Provider=SQLOLEDB.1;Password=[密码];Persist Security Info=True;User ID=[数据库用户名];Initial Catalog=test;Data Source=[数据库]"
on error resume next
sql="select * from [数据表]"
set rs=createobject("adodb.recordset")
rs.open sql,cndb,1,1
servername=""
do until rs.eof
Wscript.Echo trim(rs.Fields("mailbox"))
sendmail "发送人邮箱",trim(rs.Fields("mailbox")),"关于停止使用旧邮件系统的通知","",txt
rs.movenext
loop
msgbox "ok"
function sendmail(mailfrom,mailto,mailsubject,mailcc,mailtext)
ON ERROR RESUME NEXT
sendmail=0
Dim msg
Dim iConf
Dim Flds
set msg =CreateObject ("cdo.message")
set iconf =CreateObject ("cdo.configuration")
set Flds = iConf.Fields
ExpiredTime = 172800
' Set the configuration for Network Send
with flds
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
'可用的SMTP服务器[测试开通] telnet inner.chinaXXX.com 25
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "inner.chinaXXX.com"
.Item("cdoSMTPServerPort") = 25
.Item("cdoSMTPConnectionTimeout") = 30
.Item("cdoSMTPAccountName") = mailfrom
.Item("cdoSendUserReplyEmailAddress") = mailfrom
.Item("cdoSendEmailAddress") = mailfrom
.Update
end with
Set msg.Configuration = iConf
With msg
.From = mailfrom
.To = mailto
.CC = mailcc
.Subject = mailsubject
'.TextBody = mailtext
.CreateMHTMLBody "http://localhost/SendMail.htm", cdoSuppressNone
'添加附件
.AddAttachment "d:\zn\手册.doc"
'.BodyFormat = 0
.Send
End With
if err.number<>0 then
Wscript.Echo "False--" & trim(rs.Fields("mailbox"))
err.number=0
end if
set iConf = nothing
Set msg = Nothing
set flds = nothing
end function
set cndb=CreateObject("ADODB.Connection")
cndb.open "Provider=SQLOLEDB.1;Password=[密码];Persist Security Info=True;User ID=[数据库用户名];Initial Catalog=test;Data Source=[数据库]"
on error resume next
sql="select * from [数据表]"
set rs=createobject("adodb.recordset")
rs.open sql,cndb,1,1
servername=""
do until rs.eof
Wscript.Echo trim(rs.Fields("mailbox"))
sendmail "发送人邮箱",trim(rs.Fields("mailbox")),"关于停止使用旧邮件系统的通知","",txt
rs.movenext
loop
msgbox "ok"
function sendmail(mailfrom,mailto,mailsubject,mailcc,mailtext)
ON ERROR RESUME NEXT
sendmail=0
Dim msg
Dim iConf
Dim Flds
set msg =CreateObject ("cdo.message")
set iconf =CreateObject ("cdo.configuration")
set Flds = iConf.Fields
ExpiredTime = 172800
' Set the configuration for Network Send
with flds
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
'可用的SMTP服务器[测试开通] telnet inner.chinaXXX.com 25
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "inner.chinaXXX.com"
.Item("cdoSMTPServerPort") = 25
.Item("cdoSMTPConnectionTimeout") = 30
.Item("cdoSMTPAccountName") = mailfrom
.Item("cdoSendUserReplyEmailAddress") = mailfrom
.Item("cdoSendEmailAddress") = mailfrom
.Update
end with
Set msg.Configuration = iConf
With msg
.From = mailfrom
.To = mailto
.CC = mailcc
.Subject = mailsubject
'.TextBody = mailtext
.CreateMHTMLBody "http://localhost/SendMail.htm", cdoSuppressNone
'添加附件
.AddAttachment "d:\zn\手册.doc"
'.BodyFormat = 0
.Send
End With
if err.number<>0 then
Wscript.Echo "False--" & trim(rs.Fields("mailbox"))
err.number=0
end if
set iConf = nothing
Set msg = Nothing
set flds = nothing
end function
2008年12月22日星期一
server 2008 安装 Microsoft Loopback Adapter(环回适配器)
为了更好地使用虚机来访问本的资源,所以安装了回路网卡,本来以为server 2008不带Microsoft Loopback Adapter的驱动程序,后来终于找到创建的方法(如下图)
Start -> Computer -> Right-click, Properties -> Device Manager -> Computer Name, Right-click, Add Legacy Hardware -> Next -> Install the hardware I manually select from a list -> Next -> Network Adapters -> Microsoft on the right, Loopback adapter on the left -> Next
Start -> Computer -> Right-click, Properties -> Device Manager -> Computer Name, Right-click, Add Legacy Hardware -> Next -> Install the hardware I manually select from a list -> Next -> Network Adapters -> Microsoft on the right, Loopback adapter on the left -> Next
2008年12月19日星期五
Dell E6400 成功安装windows server 2008(64bit) & hyper-v
这两天回公司新领了笔记本E6400,CPU P8600[2.4G]支持vt技术,终于可以装上一直心仪的hyper-v玩玩了,以后工作上开发的东西可以在vt虚机上跑了,呵呵。
主要是以太网的驱动不太适合,为了解决这个问题差不多花了一天的时间……
安装过程中其中主要遇到了三个问题:
1、首先是虚拟网卡驱动的安装,装上之后发现不能正常工作,后来发现Server 2008对于无线网卡要新增feature[功能]安装,在服务管理器添加功能选项安装对无线网卡的支持;
2、安装hyper-v角色后发现服务不能正常运行,想起忘了配置BIOS中对VT应用支持的选项,采用Intel的cpu的机器vt支持大部分需要在BIOS中开启;
3、最后遇到最辣手的问题就是以太网卡825XX的驱动安装了,最后去网上找了一个Inter公版的intel_pro1000_130_vista64,试了半天终于强制安装上了82567LM-2型号的驱动,装上后插上网线测试一切正常,强制安装网卡驱动的步骤如下:
右键computer(我的电脑)--properties(属性)--左边栏第一个devicemanager(硬件管理)--找到显卡右键选 updatedriver(升级驱动)--选第2项browse my computer.....----选第2项Let me pick....(选择计算机驱动列表)--have disk(查询)指向你的驱动文件包里的INF文件--找到你的硬件型号安装,出现红字提示选继续……
哈哈,现在继续开始装其他软件和hyper-v虚机了……
因为暂时没时间回公司申请license,临时安装的是msdn下载的server datacenter版本,所以要用命令演出一下激活前使用的有效期……
slmgr.vbs -dli [查看时间]
slmgr.vbs -rearm [增加有效使用时间最高可以180天]
主要是以太网的驱动不太适合,为了解决这个问题差不多花了一天的时间……
安装过程中其中主要遇到了三个问题:
1、首先是虚拟网卡驱动的安装,装上之后发现不能正常工作,后来发现Server 2008对于无线网卡要新增feature[功能]安装,在服务管理器添加功能选项安装对无线网卡的支持;
2、安装hyper-v角色后发现服务不能正常运行,想起忘了配置BIOS中对VT应用支持的选项,采用Intel的cpu的机器vt支持大部分需要在BIOS中开启;
3、最后遇到最辣手的问题就是以太网卡825XX的驱动安装了,最后去网上找了一个Inter公版的intel_pro1000_130_vista64,试了半天终于强制安装上了82567LM-2型号的驱动,装上后插上网线测试一切正常,强制安装网卡驱动的步骤如下:
右键computer(我的电脑)--properties(属性)--左边栏第一个devicemanager(硬件管理)--找到显卡右键选 updatedriver(升级驱动)--选第2项browse my computer.....----选第2项Let me pick....(选择计算机驱动列表)--have disk(查询)指向你的驱动文件包里的INF文件--找到你的硬件型号安装,出现红字提示选继续……
哈哈,现在继续开始装其他软件和hyper-v虚机了……
因为暂时没时间回公司申请license,临时安装的是msdn下载的server datacenter版本,所以要用命令演出一下激活前使用的有效期……
slmgr.vbs -dli [查看时间]
slmgr.vbs -rearm [增加有效使用时间最高可以180天]
订阅:
博文 (Atom)