Sqlserver2008+IIS7.5 自动安装恢复及发部WEB
发布时间:2020-12-12 14:07:14 所属栏目:MsSql教程 来源:网络整理
导读:本文意在方便的部署一个WEB程序,故学写一个SHELL(俗称一下) 注:本次实验为 WINDOWS SERVER2008R2+Sqlserver2008(developer)+IIS7.5+ASP.NET 有啥米问题QQ:285979593留言哒 @echo offset current_path=%~dp0set hostname=WIN-S43U30SI4GQset INSTALLSQLD
本文意在方便的部署一个WEB程序,故学写一个SHELL(俗称一下) 注:本次实验为 WINDOWS SERVER2008R2+Sqlserver2008(developer)+IIS7.5+ASP.NET 有啥米问题QQ:285979593留言哒
@echo off set current_path=%~dp0 set hostname=WIN-S43U30SI4GQ set INSTALLSQLDATADIR=c:MSSQL2008 set INSTANCENAME=fkfj set PASSWORD=IBM-Password2012 set restoredbname=dayunoatarget set disk=%~dp0oatarget.bak REM --------------------------------IIS变量 set sitename=dayun set siteport=80 set sitephysicalpath=c:oa :init mkdir %INSTALLSQLDATADIR% mkdir %sitephysicalpath% if exist c:setup.txt (goto setup) else goto check :setup for /f ?%%i ?in (c:setup.txt) do (ECHO %%i if "%%i" == "STEP1" (goto STEP1) if "%%i" == "STEP2" (goto STEP2) if "%%i" == "STEP3" (goto STEP3) if "%%i" == "STEP4" (goto STEP4) if "%%i" == "STEP5" (goto STEP5) ) goto exit REM ------------------------------------------------------NET组件安装 :STEP1 echo STEP2> c:setup.txt reg add "HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionRun" /v autoinstall /d "%current_path%auto_install.bat" /f ServerManagerCmd -install NET-Framework -allSubFeatures Setup.exe /QS shutdown -r -t 0 goto exit REM ------------------------------------------------------数据库安装 :STEP2 echo STEP3>c:setup.txt Setup.exe /QS /ACTION=Install /SkipRules=VSShellInstalledRule /IAcceptSQLServerLicenseTerms="True" /FEATURES=SQLEngine,IS,SSMS /INSTANCENAME=%INSTANCENAME% /INSTALLSQLDATADIR="%INSTALLSQLDATADIR%" /SQLSVCACCOUNT="NT AUTHORITYSYSTEM" /SAPWD="IBM-Yunsoft2012" /SQLSYSADMINACCOUNTS="%hostname%ADMINISTRATOR" /AGTSVCACCOUNT="NT AUTHORITYSYSTEM"? ping 127.1 -n 10 >nul 2>nul shutdown -r -t 0 goto exit REM ------------------------------------------------------数据库恢复 :STEP3 echo STEP4>c:setup.txt? ping 127.1 -n 20 >nul 2>nul osql -E -S .%INSTANCENAME% -Q "restore database %restoredbname% from disk = '%disk%' with move 'UCMLOASESTarget' to '%INSTALLSQLDATADIR%MSSQL10_50.%INSTANCENAME%MSSQLDATAUCMLOAEnv_090527.mdf',move 'UCMLOASESTarget_log' to '%INSTALLSQLDATADIR%MSSQL10_50.%INSTANCENAME%MSSQLDATAUCMLOAEnv_090527_log.ldf'" pkgmgr /iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;IIS-HttpRedirect;IIS-ApplicationDevelopment;IIS-ASPNET;IIS-NetFxExtensibility;IIS-ASP;IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-ServerSideIncludes;IIS-HealthAndDiagnostics;IIS-HttpLogging;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-HttpTracing;IIS-CustomLogging;IIS-ODBCLogging;IIS-Security;IIS-BasicAuthentication;IIS-WindowsAuthentication;IIS-DigestAuthentication;IIS-ClientCertificateMappingAuthentication;IIS-IISCertificateMappingAuthentication;IIS-URLAuthorization;IIS-RequestFiltering;IIS-IPSecurity;IIS-Performance;IIS-WebServerManagementTools;IIS-ManagementConsole;IIS-ManagementScriptingTools;IIS-ManagementService;IIS-IIS6ManagementCompatibility;IIS-Metabase;IIS-WMICompatibility;IIS-LegacyScripts;IIS-LegacySnapIn;WAS-WindowsActivationService;WAS-ProcessModel;WAS-NetFxEnvironment;WAS-ConfigurationAPI ping 127.1 -n 20 >nul 2>nul shutdown -r -t 0 goto exit REM ------------------------------------------------------开启数据库SA权限及IIS安装 :STEP4 echo STEP5>c:setup.txt reg add HKEY_LOCAL_MACHINESOFTWAREMicrosoftMicrosoft SQL ServerMSSQL10_50.FKFJMSSQLServer /v LoginMode /t REG_DWORD /d 2 /f ping 127.1 -n 20 >nul 2>nul osql -E -S .fkfj -Q "ALTER LOGIN sa WITH PASSWORD ='%PASSWORD%'" osql -E -S .fkfj -Q "ALTER LOGIN sa ENABLE" net stop mssql$fkfj net start mssql$fkfj pkgmgr /iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;IIS-HttpRedirect;IIS-ApplicationDevelopment;IIS-ASPNET;IIS-NetFxExtensibility;IIS-ASP;IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-ServerSideIncludes;IIS-HealthAndDiagnostics;IIS-HttpLogging;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-HttpTracing;IIS-CustomLogging;IIS-ODBCLogging;IIS-Security;IIS-BasicAuthentication;IIS-WindowsAuthentication;IIS-DigestAuthentication;IIS-ClientCertificateMappingAuthentication;IIS-IISCertificateMappingAuthentication;IIS-URLAuthorization;IIS-RequestFiltering;IIS-IPSecurity;IIS-Performance;IIS-WebServerManagementTools;IIS-ManagementConsole;IIS-ManagementScriptingTools;IIS-ManagementService;IIS-IIS6ManagementCompatibility;IIS-Metabase;IIS-WMICompatibility;IIS-LegacyScripts;IIS-LegacySnapIn;WAS-WindowsActivationService;WAS-ProcessModel;WAS-NetFxEnvironment;WAS-ConfigurationAPI shutdown -r -t 0 goto exit REM ------------------------------------------------------拷贝文件及IIS发布 :STEP5 echo FINISH>c:setup.txt robocopy %current_path%BPObject %sitephysicalpath% /E C:WindowsSystem32inetsrvappcmd.exe add site /name:"%sitename%" /bindings:http://localhost:%siteport% /physicalpath:%sitephysicalpath% C:WindowsSystem32inetsrvappcmd.exe set apppool /apppool.name:DefaultAppPool /enable32BitAppOnWin64:true net start aspnet_state goto exit REM ------------------------------------------------------ :check echo 配制文件不存在 echo STEP1>c:setup.txt goto init REM ------------------------------------------------------ :exit (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- data.table join with roll =“nearest”返回“搜索值”而不
- SqlServer中关于时间函数的应用
- SQLServer中批量插入数据方式的性能对比
- sqlserver、mysql、oracle关于jdbc连接
- SQLServer 2008R2主从部署实战
- sql-server-2008-r2 – 重新计算BIDS中的时间维度
- Sqlserver2005在安装过程中,提示“ [Microsoft][SQL Nativ
- 将数据从SQL Server导出到Excel(SSIS)时如何避免“存储为文
- SQLServer2008密钥
- Sql Server 2012 分页方法分析(offset and fetch)