niedziela, 6 marca 2011

SAC droga do szybkiej konfiguracji

Duża ilość serwerów to duży problem, szczególnie nużąca jest faza konfiguracji, jeżeli tą sama czynność musimy powtórzyć na dwudziestu lub więcej serwerach. Ustawianie po kolei silnika bazy, report service, browse service, agenta sql, protokołów sieciowych etc. jest ciekawym zajęciem ale tylko za pierwszym razem.
Z pomocą przychodzi nam niepozorny program SAC.EXE, który jest konsolą SQL SERVER AREA CONFIGURATION, w standardowej instalacji można go znaleźć w folderze C:\Program Files\Microsoft SQL Server\90\Shared\
Pozwala on na eksportowanie i importowanie konfiguracji do pliku dzięki odpowiednim przełącznikom (brak przełącznika kopiuje wszystkie ustawienia)


DE
import/eksport ustawień silnika bazy
AS
import/eksport ustawień analysis services
RS
import/eksport ustawień reporting services
IS
import/eksport ustawień integration services
NS
import/eksport ustawień notification services
AG
import/eksport ustawień SQL server agent
BS
import/eksport ustawień SQL browse service
FT
import/eksport ustawień full-text search
F
import/eksport ustawień area configuration
N
import/eksport ustawień protokołów sieciowych
T
import/eksport ustawień serwisów systemowych





Wybieramy co chcemy skopiować, robimy eksport do pliku, ewentualnie edytujemy powstałego xmla i importujemy do następnego serwera

xp_cmdshell '"C:\Program Files\Microsoft SQL Server\90\Shared\SAC.exe" OUT c:\rk_pliczek.xml -i nowy -F'

output
-----------------------------------------------------------------------------------------
Exporting surface area settings for Analysis Services instance SERWER\NOWY...Started
Exporting surface area settings for Analysis Services instance SERWER\NOWY...Complete
Exporting surface area settings for Database Engine instance SERWER\NOWY...Started
Exporting surface area settings for Database Engine instance SERWER\NOWY...Complete
Exporting surface area settings for Reporting Services instance SERWER\NOWY...Started
Exporting surface area settings for Reporting Services instance SERWER\NOWY...Complete
NULL
Plik możemy wgrać na inny serwer

xp_cmdshell '"C:\Program Files\Microsoft SQL Server\90\Shared\SAC.exe" IN c:\rk_pliczek.xml –S INNY -F'

output
-----------------------------------------------------------------------------------------
Importing surface area settings for Analysis Services instance INNY\MSSQLSERVER...Started
Importing surface area settings for Analysis Services instance INNY\MSSQLSERVER...Complete
Importing surface area settings for Database Engine instance INNY\MSSQLSERVER...Started
Importing surface area settings for Database Engine instance INNY\MSSQLSERVER...Complete
Importing surface area settings for Reporting Services instance INNY\MSSQLSERVER...Started
Importing surface area settings for Reporting Services instance INNY\MSSQLSERVER...Complete



Pełna składnia polecenia

C:\Program Files\Microsoft SQL Server\90\Shared>sac /?
Imports and exports SQL Server 2005 surface area settings.
  sac {in | out} filename [-S computer_name]
      [-U SQL_login [-P SQL_password]]
      [-i instance_name ]
      [-DE] [-AS] [-RS] [-IS] [-NS] [-AG] [-BS] [-FT]
      [-F] [-N]  [-T]  [-O]
      [-H | -?]
  in               Import the surface area settings from a file.
  out              Export the surface area configuration settings
                   from an instance to a file.
  filename         Full path of the import or export file.
  -S computer_name Name of a remote computer. Default is local
                   computer.
  -U SQL_login     SQL Server Authentication login for the Database
                   Engine connection. Default is Windows
                   Authentication.
  -P SQL_password  Password for SQL_login.
  -i instance_name SQL Server instance to run sac against. Default
                   is all instances on the specified computer.
  -DE              Import or export Database Engine settings.
  -AS              Import or export Analysis Services settings.
  -RS              Import or export Reporting Services settings.
  -IS              Import or export Integration Services settings.
  -NS              Import or export Notification Services settings.
  -AG              Import or export SQL Server Agent settings.
  -BS              Import or export the SQL Browse service settings.
  -FT              Import or export the Full-Text Search service
                   settings.
  -F               Import or export the state of features.
  -N               Import or export the state of network protocols.
  -T               Import or export the state of Windows services.
  -O               Name of the file that receives command-line output.
  -H | -?          Display command syntax. Other arguments are
                   ignored.

Niestety w SQL Server 2008 stwierdzono, że SAC jest niepotrzebny.

Brak komentarzy:

Prześlij komentarz