win2003系統網路安裝——基於linux+pxe+dhcp+tftp+samba+ris

来源:http://www.cnblogs.com/netonline/archive/2017/06/22/7066867.html
-Advertisement-
Play Games

原文發表於:2010-09-16 轉載至cu於:2012-07-21 一.原理簡介 PXE(preboot execute environment)工作於Client/Server的網路模式,支持工作站通過網路從遠端伺服器下載鏡像,並由此支持來自網路的操作系統的啟動。啟動過程中,終端由DHCP伺服器 ...


原文發表於:2010-09-16

轉載至cu於:2012-07-21

一.原理簡介

PXE(preboot execute environment)工作於Client/Server的網路模式,支持工作站通過網路從遠端伺服器下載鏡像,並由此支持來自網路的操作系統的啟動。啟動過程中,終端由DHCP伺服器分配IP地址,再用TFTPtrivial file transfer protocol)等協議下載存在於伺服器(NFS,FTP,HTTP, SAMBA)的操作系統內核和文件系統等到本機記憶體中並執行,由此完成終端基本軟體設置,從而引導預先安裝在伺服器中的終端操作系統。

RIS(遠程安裝服務,Remote Installation Services) windows server的可選服務,利用RIS可以讓管理員很方便地為客戶端部署操作系統。

二.環境說明

server os

CentOS 5.4 i386

server soft

dhcp, tftp, samba, ris-linux

可以使用yum安裝:

yum –y install dhcp*
yum –y install tftp*
yum –y install samba*

server ip

eth1: 192.168.0.1

client

HP 360G5

windows 2003 sp2 cn enterprise

三.安裝配置過程簡介

1. 配置DHCP

more /etc/dhcpd.conf

ddns-update-style interim;
ignore client-updates;
allow booting;
allow bootp;

subnet 192.168.0.0 netmask 255.255.255.0 {
        option routers                  192.168.0.1;
        option subnet-mask              255.255.255.0;
        option domain-name-servers      192.168.0.1;
        option time-offset              -18000; # Eastern Standard Time
        range dynamic-bootp 192.168.0.10 192.168.1.254;
        default-lease-time 21600;
        max-lease-time 43200;

# Group the PXE bootable hosts
# PXE-server configuration direction
        next-server 192.168.0.1;    #指向nfs伺服器
        filename "/pxelinux.0";     #/tftp根目錄下的啟動引導文件
}

重啟dhcp服務:

/etc/init.d/dhcpd restart 

2. 配置TFTP

more /etc/xinetd.d/tftp

# default: off
# description: The tftp server serves files using the trivial file transfer \
#       protocol.  The tftp protocol is often used to boot diskless \
#       workstations, download configuration files to network-aware printers, \
#       and to start the installation process for some operating systems.

service tftp
{
        socket_type            = dgram
        protocol               = udp
        wait                   = yes
        user                   = root
        server                 = /usr/sbin/in.tftpd
        
        #-s指定tftp根目錄, -m指定一個規則文件, -vv輸出tftp的log到/var/log/message 
        server_args            = -u nobody -s /tftpboot -m /tftpboot/rules -vv

        #預設yes,關閉
        disable                = no        
        per_source             = 11
        cps                    = 100 2
        flags                  = IPv4
}

重啟tftp服務:

/etc/init.d/xinetd.restart

查看tftp服務是否啟動:

chkconfig –list | grep tftp 

3. 建立TFTPrules文件

Linux下區分大小寫,但windows不區分,為免混亂,將所有查找文件內容統一改成小寫。

more  /tftpboot/rules

ri ^[a-z]: # Remove "drive letters"
rg \\ / # Convert backslashes to slashes
rg \# @ # Convert hash marks to @ signs
rg /../ /..no../ # Convert /../ to /..no../
rg A a
rg B b
rg C c
rg D d
rg E e
rg F f
rg G g
rg H h
rg I i
rg J j
rg K k
rg L l
rg M m
rg N n
rg O o
rg P p
rg Q q
rg R r
rg S s
rg T t
rg U u
rg V v
rg W w
rg X x
rg Y y
rg Z z
r ^/(.*) \1 

4. 配置SAMBA

windowsris安裝是通過windows共用文件的方式進行文件傳輸,在linux下可以通過samba實現與windows進行文件共用,進而實現ris安裝windows

編輯samba配置文件:/etc/samba/smb.conf

#全局配置
[global]
       null passwords = true
       workgroup = WORKGROUP
       server string = Samba Server Version %v
       security = share
       dns proxy = no
       load printers = no
       disable spoolss = yes
       debug level = 2
       log file = /var/log/samba/%m.log
       max log size = 0

#共用配置
[wininstall]
comment = Windows 2003 Install
        path = /tftpboot
        browsable = true
        read only = no
        writeable = yes
        guest ok = yes

重啟samba服務:

/etc/init.d/smb restart 

5. 配置啟動需要的文件

上傳windows2003的鏡像或者文件到伺服器。這裡使用上傳鏡像然後掛載。

mount /root/win2003cn.iso /mnt –o loop
mkdir /tftpboot/win2k3
cd /mnt
cp –a * /tftpboot/win2k3

 

下麵需要解壓一些iso中的文件,可以使用cabextract

下載頁:http://www.cabextract.org.uk/

可以根據版本下載。

wget http://www.cabextract.org.uk/cabextract-1.3-1.i386.rpm
rpm –ivh cabextract-1.3-1.i386.rpm

 

配置windows ris 啟動文件:

cd /tftpboot
cabextract win2k3/i386/startrom.n1_
#解壓
sed -i -e 's/NTLDR/W2K3L/gi' startrom.n12
#直接替換startrom.n12文件中” NTLDR”為” W2K3L”
#W2K3L: windows 2003 Setup Loader
mv startrom.n12 /tftpboot/w2k3.0
#w2k3.0: windows 2003 pxe loader
cabextract win2k3/i386/setupldr.ex_
sed -i -e 's/winnt\.sif/wi2k3\.sif/gi' setupldr.exe
sed -i -e 's/ntdetect\.com/ntdetect\.2k3/gi' setupldr.exe
mv setupldr.exe /tftpboot/w2k3l
cp win2k3/i386/ntdetect.com /tftpboot/ntdetect.2k3
#ntdetect.2k3: windows 2003 ntdetect.com

 

配置pxe啟動鏡像:

cp /usr/lib/syslinux/pxelinux.0 /tftpboot
# pxelinux.0依賴於syslinux,沒有安裝使用yum:yum –y install syslinux*
# pxelinux.0是PXE啟動引導文件

 

配置pxe啟動載入文件:

pxelinux.0啟動中,讀取同目錄先pxelinux.cfg文件夾下的配置文件以確定它應該怎麼載入啟動文件。

mkdir /tftpboot/pxelinux.cfg

vim /tftpboot/pxelinux.cfg/default
     default win2k3
     label win2k3
     kernel w2k3.0       #與ris啟動文件匹配

 

建立安裝應答文件:

這個文件很強大,提供的參數不是對系統很瞭解的人並不一定全知道,我們只需要知道對我們有用的參數。當然,沒事的時候也可以慢慢研究。J

vim /tftpboot/wi2k3.sif

[data]
AutoPartition = "0"
#關閉自動分區,2003還不能完全自動分區,這點需要手工操作。如果一定要跳過這一步,需要和後面的參數配合,並且2003提供的只有將全盤劃成根盤(c:\)
floppyless = "1"
msdosinitiated = "1"
UnattendedInstall = "Yes"
OriSrc = \\192.168.0.1\wininstall\win2k3\i386
#註意samba和win安裝文件路徑
OriTyp = "4"
LocalSourceOnCD = "1"
DisableAdminAccountOnDomainJoin = "1"
 
[SetupData]
OsLoadOptions = "/fastdetect"
SetupSourceDevice = "\Device\LanmanRedirector\192.168.0.1\wininstall\win2k3"
 
[Unattended]
UnattendMode = "FullUnattended"
#使用unattended文件
FileSystem = "LeaveAlone"
NtUpgrade = "No"
OverwriteOemFilesOnUpgrade = "No"
DriverSigningPolicy = "Ignore"
UpdateInstalledDrivers = "Yes"
ConfirmHardware = "No"
ExtendOEMPartition = "0"
TargetPath = "\WINDOWS"
UnattendSwitch = "Yes"
WaitForReboot = "No"
CrashDumpSetting = "0"
OemSkipEula = "Yes"
OEMSkipWelcome = "1"
InstallFilesPath = "\\192.168.0.1\wininstall\win2k3\i386"
LegacyNIC = "1"
OemPreInstall = "Yes"    #載入OEM中的驅動
 
[UserData]
ProductKey = "M4VQK-HVTD9-42RQX-2DJP2-23KVM"
FullName = "admin"
OrgName = "SDO"
ComputerName = C1ZJ
 
[GuiUnattended]
AdminPassword = WD#sd7258
EncryptedAdminPassword = "No"
OEMSkipRegional = "1"
TimeZone = "220"
OemSkipWelcome = "1"

[LicenseFilePrintData]
AutoMode=PerServer
AutoUsers=5
 
[Identification]
JoinWorkgroup = WORKGROUP
 
#這裡和分區有關
[RemoteInstall]
Repartition = "NO"
UseWholeDisk = "No"
 
[Networking]
InstallDefaultComponents = "Yes"

 

#以下的預設文件中沒有,和伺服器raid卡驅動有關:

[MassStorageDrivers]
"Windows Driver for Smart Array SAS/SATA Controllers" = OEM
 
[OEMBootFiles]
cp011324.xml
cpqsetup.exe
generic.dll
hpcisss2.cat
hpcisss2.sys
hpcissx2.inf
install.xml
txtsetup.oem

#以下是系統安裝完畢後第一次啟動執行的批處理文件
[GuiRunOnce]
%systemdrive%\preinstall\runonce.cmd

6. 驅動載入相關

因為是伺服器的安裝,所以需要提前載入一些驅動,自動安裝的麻煩就在此。

 

pxe安裝需要載入網卡驅動(引導和文件傳輸是兩個階段,傳輸文件階段開始時要先把網卡驅動載入起來的)

查到伺服器使用的Broadcom NetXtreme II網卡,而Broadcom提供在ris下的驅動:

wget http://www.broadcom.com/docs/driver_download/NXII/win_2k3_RIS-5.0.0.zip
mkdir /tftpboot/nicdrive
unzip win_2k3_RIS-5.0.0.zip -d /tftpboot/nicdrive

 

驅動網卡,需要有一個binl serverbinl讀取所有新的與網路介面卡相關的.inf文件,併在映像中創建.pnf文件。

 binl server下載:http://oss.netfarm.it/guides/

wget http://oss.netfarm.it/guides/ris-linux-0.4.tar.gz
tar –zxvf ris-linux-0.4.tar.gz
cd ris-linux-0.4
./infparser.py /tftpboot/nicdrive/Server/W2K3_W2K8/RIS/
./binlsrv.py -d     #-d 後臺運行,不能停止此程式
cp /tftpboot/nicdrive/Server/W2K3_W2K8/RIS/b06nd51x.sys /tftpboot/win2k3/i386

 

這裡是Broadcom提供有專門的ris網卡驅動,如果沒有,可以將windows需要的網卡驅動(不限於網卡).inf文件放在/tftpboot/inf文件夾下,執行:

./infparser.py /tftpboot/inf
./binlsrv.py

 

然後是載入raid卡驅動(其他驅動也適用,關鍵是能否找到相關文件)。

光碟安裝windows在開始時藍色屏幕上有一個按F6的提示,提示是通過軟盤載入磁碟驅動,這類驅動是windows系統中的驅動,可以下載好windows驅動,解壓好驅動放在一個指定的目錄,再通過應答文件,一般可以載入上這類驅動。這類驅動載入完畢後不必在系統中再安裝。載入這類驅動有註意點:文件要有正確的oem數字簽名(一般提供驅動的廠商都帶數字簽名),亂改動這類文件,同時不在配置文件中寫明去掉數字簽名認證,是不能載入的。

 

下載HPraid卡驅動(已經查明型號:Smart Array E200i, 一般一個驅動支持多種類型的raid):

wget http://h30445.www3.hp.com/pub/softlib2/software1/sc-windows/p1285069816/v55115/cp011324.exe
mkdir /tftpboot/win2k3/i386/$oem$/textmode
unzip cp011324.exe -d /tftpboot/win2k3/i386/$oem$/textmode

 

在自動應答文件wi2k3.sif末尾添加:

[MassStorageDrivers]
"Windows Driver for Smart Array SAS/SATA Controllers" = OEM
#”Windows Driver for Smart Array SAS/SATA Controllers”可以查看textmode文件夾下的txtsetup.oem文件,名字保持一致

[OEMBootFiles]
cp011324.xml
cpqsetup.exe
generic.dll
hpcisss2.cat
hpcisss2.sys
hpcissx2.inf
install.xml
txtsetup.oem
#textmode下的所有文件名字,一般自動安裝的驅動文件.inf, .cat, .sys

#新增參數,修改[Unattended]欄位
OemPreInstall = "Yes"

7. 補丁,前期包,其他驅動的載入

完成以上操作就已經可以安裝系統了,但是系統安裝完成後需要做一些前期操作,像打補丁,打安全包,或者一些驅動(晶元組,網卡,顯卡等在上面沒有載入到系統中的一些驅動)

這些優化的問題可以利用批處理文件解決。這些批處理文件最好是在windows下編輯好再上傳到伺服器,否則會出現格式問題導致文件不能執行。

 

首先需要在$oem$目錄下建立cmdlines.txt文件,這個文件會在系統安裝過程的註冊組件時間段(即還剩13分鐘左右時)調用:

vim /tftpboot/win2k3/$oem$/cmdlines.txt

#文件的內容以" [COMMANDS]"為起頭;使用引號“”來標記下麵需要執行的每條命令。 註意路徑問題,install.cmd的路徑為cmdlines.txt的同級目錄;
#這裡還可以添加註冊表。
[COMMANDS]
"install.cmd"

以下是此時使用的install.cmd

@ echo off
title Windows Install Prepackage, Hotfix and Drives
@ color 0a

@echo 安裝WINDOWS_2003_SP2補丁, 大約需要20分鐘... 2>>%HOMEDRIVE%/errlog.txt
@ cd hotfix 2>>%HOMEDRIVE%/errlog.txt
WindowsServer2003-KB914961-SP2-x86-CHS.exe /quiet /norestart
WindowsUpdateAgent30-x86.exe /quiet /norestart
WindowsServer2003-KB925902-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB930178-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB931784-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB932168-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB935839-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB935840-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB933729-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB943460-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB921503-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB938829-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB941644-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB943485-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB942830-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB942831-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB943055-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB946026-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB941693-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB944338-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB945553-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB948590-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB951748-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB950974-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB952954-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB938464-x86-CHS.exe /quiet /norestart
windowsserver2003-kb953155-x86-chs.exe /quiet /norestart
windowsserver2003-kb954211-x86-chs.exe /quiet /norestart
windowsserver2003-kb956803-x86-chs.exe /quiet /norestart
windowsserver2003-kb956841-x86-chs.exe /quiet /norestart
windowsserver2003-kb957095-x86-chs.exe /quiet /norestart
WindowsServer2003-KB958644-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB957097-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB956802-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB958687-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB958690-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB960225-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB952004-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB956572-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB960803-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB961501-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB968537-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB970238-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB958469-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB971032-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB971657-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB967723-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB953298-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB958869-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB971486-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB975467-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB969947-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB974392-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB972270-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB971468-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB975713-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB977165-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB978251-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB979683-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB980232-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB979559-x86-CHS.exe /quiet /norestart
WindowsServer2003-KB980218-x86-CHS.exe /quiet /norestart

if %errorlevel% EQU 0 (
@ echo 補丁安裝成功, 繼續安裝prepackge... 2>>%HOMEDRIVE%/errlog.txt
@ cd ..
@ goto prepackge 2>>%HOMEDRIVE%/errlog.txt
) else (
@ echo 補丁安裝失敗, 繼續安裝prepackge... 2>>%HOMEDRIVE%/errlog.txt
@ cd ..
@ goto prepackge 2>>%HOMEDRIVE%/errlog.txt
)

:prepackge

@ echo 安裝Prepackage中... 2>>%HOMEDRIVE%/errlog.txt
@ cd windows_2010628 2>>%HOMEDRIVE%/errlog.txt
install.bat /qn 2>>%HOMEDRIVE%/errlog.txt
if %errorlevel% EQU 0 (
@ echo Prepackage安裝成功 2>>%HOMEDRIVE%/errlog.txt
@ cd ..
@ goto end 2>>%HOMEDRIVE%/errlog.txt
) else (
@ echo Prepackage安裝失敗 2>>%HOMEDRIVE%/errlog.txt
@ cd ..
@ goto end 2>>%HOMEDRIVE%/errlog.txt
)

:end

批處理文件中的hotfix(出重要的補丁時可以下載放到這,但別忘記了修改批處理文件)windows_20100628(安全部門製作的安全包解壓所得)文件夾和install.cmd位於同級目錄,這裡就是在/tftpboot/win2k3/$oem$/下。

其中在組件註冊時不能執行的的命令或者程式(包括有交互而不適合執行的程式),可以通過在自動應答文件wi2k3.sif中添加[GuiRunOnce]欄位,在第一次登錄系統時執行腳本來完成一些短時間能夠完成的操作。

/tftpboot/win2k3/$oem$/下建立文件夾$1,這個文件夾下的所有文件()會在安裝過程中複製到兄根目錄,即C盤。

mkdir /tftpboot/win2k3/$oem$/$1
cd mkdir /tftpboot/win2k3/$oem$/$1
mkdir preinstall

windows平臺編輯一個批處理文件runonce.cmd,上傳到preinstall文件夾下:

@ echo off
title Windows GuiRunOnce Install Drives
@ color 0a

echo starting drive
echo.
@ cd\
@ cd preinstall
@ cd hp
call bp000588.cmd

echo.
echo starting pcanywhere
@ cd\
@ cd preinstall
@ cd pcanywhere_10.5.1cn
start /wait SymantecpcAnywhere.msi 

echo.
shutdown -r -t 0
exit

這裡我將HP的所有驅動放到hp文件夾下(因為我也分不清楚哪些需要,哪些不需要,就只有全部上傳了,L)pcanywhere安裝文件放到pcanywhere_10.5.1cn文件夾下。所有這些文件夾統一放到preinstall文件夾下(有需要還可以增加,修改runonce.cmd即可)

最後在自動應答文件wi2k3.sif中添加:

#註意路徑
[GuiRunOnce]
%systemdrive%\preinstall\runonce.cmd 

8. 進階

上面只是提到32為系統,對於64位系統,我們可以在/tftpboot下建立win2k3_64文件夾,將iso下的文件拷到此文件夾下。

cabextract win2k3_64/i386/startrom.n1_
#解壓
sed -i -e 's/NTLDR/W2K3L_64/gi' startrom.n12
#直接替換startrom.n12文件中" NTLDR"為" W2K3L_64"
#W2K3L_64: windows 2003 64bit Setup Loader
mv startrom.n12 /tftpboot/w2k3_64.0
# w2k3_64.0: windows 2003 bit pxe loader
cabextract win2k3_64/i386/setupldr.ex_
sed -i -e 's/winnt\.sif/wi2k3_64\.sif/gi' setupldr.exe
sed -i -e 's/ntdetect\.com/ntdetect\.2k3_64/gi' setupldr.exe
mv setupldr.exe /tftpboot/w2k3l_64
cp win2k3_64/i386/ntdetect.com /tftpboot/ntdetect.2k3_64
# ntdetect.2k3_64: windows 2003 bit ntdetect.com

samba伺服器需要建立針對64位系統的共用目錄,如[win64install];同時建立自動應答文件/tftpboot/wi2k3_64.sif 這兩者當中的路徑問題請一定要註意一一對應

pxe載入/tftpboot/pxelinux.cfg/default文件,需要有系統選擇時,可以修改文件:

vim /tftpboot/pxelinux.cfg/default

default win2k3
timeout 30
label win2k3
kernel w2k3.0
label win2k3_64
kernel w2k3_64.0

其實不管是32位還是64位系統,啟動文件都是一樣的,這些都可以不用修改,只是客戶端從伺服器下載文件的路徑一定要區分32位和64位。

啟動順序:pxelinux.0> default> pxe loader(w2k3.0, startrom.n12)>setup loader(w2k3l, setupldr.exe) > ntdetect.com(ntdetect.2k3) and winnt.sif(wi2k3.sif)

9. 小結

關於驅動載入的問題,如果我們參照一臺已經裝好windows2003系統的伺服器的硬體驅動(重要的是晶元組,網卡,顯卡等)可以看出這些驅動主要由.sys, .dll, .inf(驅動信息文件), .cat(驅動簽名文件)等文件組成。如果能收集到這些文件放到系統安裝文件里,就不用事後打驅動那麼麻煩。但這個過程目前我還沒有摸透,這點還是有很大的改進空間的。

使用這套系統安裝windows2003系統,加上打補丁(大概超過20分鐘)的時間,前後在40分鐘左右。我看過安全部門製作的安全包,系統正式上線後應該是可以自動打補丁的。如果有可能的話,可以把打補丁這個環節去掉。這樣利用這套系統安裝一臺windows2003系統大概是20分鐘,批量安裝更能體現效果。


您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • ...
  • Oracle執行計劃詳解 一.相關的概念 Rowid的概念 Recursive Sql概念 Predicate(謂詞) DRiving Table(驅動表) Probed Table(被探查表) 組合索引(concatenated index) 可選擇性(selectivity) 二.oracle訪 ...
  • Configuration File(配置文件) Core Options(核心設置) mongos-only Options(mongo單獨設置) Windows Service Options(windows系統設置) Configuration File File Format You can ...
  • 用sys用戶sqlplus連接到數據: SQL*Plus: Release 11.2.0.3.0 Production on Thu Jun 22 11:07:58 2017 Copyright (c) 1982, 2011, Oracle. All rights reserved. Connect ...
  • [20170622]傳輸表空間與dblink.txt--//測試看看使用dblink+傳輸表空間的情況.寫的情況相對複雜一點,具體看測試:1.環境:--//2個資料庫版本一致.實際上在1台主機上.SCOTT@book> @ &r/ver1PORT_STRING VERSION BANNER x86_ ...
  • 有時候,我們會用 Set Identity_Insert Table ON 來處理數據表的某些自增列。如果在本地倒是沒什麼問題。如果是遠程伺服器,則會報 找不到對象"XXX" ,因為它不存在或者您沒有所需的許可權 其實這個跟你的許可權無關,即使你鏈接伺服器用的是sa一樣會報這個。 其實解決方法很簡單,換 ...
  • pt-query-digest可以通過logs, processlist, 和tcpdump來分析MySQL的查詢相關信息,基本語法如下: pt-query-digest [OPTIONS] [FILES] [DSN] pt-query-digest是一種用於分析MySQL查詢的簡單易用的工具,沒有 ...
  • 首先獲取scsi設備的信息。 [root@server2 ~]# lsscsi [2:0:0:0] disk VMware, VMware Virtual S 1.0 /dev/sda [4:0:0:0] cd/dvd NECVMWar VMware SATA CD01 1.00 /dev/sr0 ...
一周排行
    -Advertisement-
    Play Games
  • 移動開發(一):使用.NET MAUI開發第一個安卓APP 對於工作多年的C#程式員來說,近來想嘗試開發一款安卓APP,考慮了很久最終選擇使用.NET MAUI這個微軟官方的框架來嘗試體驗開發安卓APP,畢竟是使用Visual Studio開發工具,使用起來也比較的順手,結合微軟官方的教程進行了安卓 ...
  • 前言 QuestPDF 是一個開源 .NET 庫,用於生成 PDF 文檔。使用了C# Fluent API方式可簡化開發、減少錯誤並提高工作效率。利用它可以輕鬆生成 PDF 報告、發票、導出文件等。 項目介紹 QuestPDF 是一個革命性的開源 .NET 庫,它徹底改變了我們生成 PDF 文檔的方 ...
  • 項目地址 項目後端地址: https://github.com/ZyPLJ/ZYTteeHole 項目前端頁面地址: ZyPLJ/TreeHoleVue (github.com) https://github.com/ZyPLJ/TreeHoleVue 目前項目測試訪問地址: http://tree ...
  • 話不多說,直接開乾 一.下載 1.官方鏈接下載: https://www.microsoft.com/zh-cn/sql-server/sql-server-downloads 2.在下載目錄中找到下麵這個小的安裝包 SQL2022-SSEI-Dev.exe,運行開始下載SQL server; 二. ...
  • 前言 隨著物聯網(IoT)技術的迅猛發展,MQTT(消息隊列遙測傳輸)協議憑藉其輕量級和高效性,已成為眾多物聯網應用的首選通信標準。 MQTTnet 作為一個高性能的 .NET 開源庫,為 .NET 平臺上的 MQTT 客戶端與伺服器開發提供了強大的支持。 本文將全面介紹 MQTTnet 的核心功能 ...
  • Serilog支持多種接收器用於日誌存儲,增強器用於添加屬性,LogContext管理動態屬性,支持多種輸出格式包括純文本、JSON及ExpressionTemplate。還提供了自定義格式化選項,適用於不同需求。 ...
  • 目錄簡介獲取 HTML 文檔解析 HTML 文檔測試參考文章 簡介 動態內容網站使用 JavaScript 腳本動態檢索和渲染數據,爬取信息時需要模擬瀏覽器行為,否則獲取到的源碼基本是空的。 本文使用的爬取步驟如下: 使用 Selenium 獲取渲染後的 HTML 文檔 使用 HtmlAgility ...
  • 1.前言 什麼是熱更新 游戲或者軟體更新時,無需重新下載客戶端進行安裝,而是在應用程式啟動的情況下,在內部進行資源或者代碼更新 Unity目前常用熱更新解決方案 HybridCLR,Xlua,ILRuntime等 Unity目前常用資源管理解決方案 AssetBundles,Addressable, ...
  • 本文章主要是在C# ASP.NET Core Web API框架實現向手機發送驗證碼簡訊功能。這裡我選擇是一個互億無線簡訊驗證碼平臺,其實像阿裡雲,騰訊雲上面也可以。 首先我們先去 互億無線 https://www.ihuyi.com/api/sms.html 去註冊一個賬號 註冊完成賬號後,它會送 ...
  • 通過以下方式可以高效,並保證數據同步的可靠性 1.API設計 使用RESTful設計,確保API端點明確,並使用適當的HTTP方法(如POST用於創建,PUT用於更新)。 設計清晰的請求和響應模型,以確保客戶端能夠理解預期格式。 2.數據驗證 在伺服器端進行嚴格的數據驗證,確保接收到的數據符合預期格 ...