[ Pobierz całość w formacie PDF ]
.Backup/Recover: What You Need to Know Before You StartIt is possible that the SQL Server service (either SQL Server 2005 Express Edition SP1 or SQL Server 2005) is installed on the Virtual Machine Manager server but is not used to store the Virtual Machine Manager database.If you do not know whether the Virtual Machine Manager database is stored locally or on a remote server running SQL Server 2005, use the following procedure.To determine whether the VMM database is stored locally or remotely1.Open the Registry Editor.2.Navigate to the following subkey:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft System Center Virtual Machine Manager 2007 Server\Settings\Sql3.View the value for OnRemoteServer: If OnRemoteServer is set to 0, the database is on the local Virtual Machine Manager server. If OnRemoteServer is set to 1, the database is on a remote server running the SQL Server service.BackupLocalVMM.ps1You can use the BackupLocalVMM.ps1 script to back up the Virtual Machine Manager database if the database is stored locally on the Virtual Machine Manager server.How BackupLocalVMM.ps1 WorksThe first command in the script connects to VMMServer1 in the Contoso.com domain, retrieves the server object from the Virtual Machine Manager database, and stores the server object in variable $VMMServer:$VMMServer = Get-VMMServer -ComputerName "VMMServer1.Contoso.com"The second command in the script uses the Backup-VMMServer cmdlet to back up the Virtual Machine Manager database stored on VMMServer1 to C:\VMMBackups on VMMServer1:Backup-VMMServer -Path "C:\VMMBackups" -VMMServer $VMMServerThe destination path (C:\VMMBackups in the following example) must be on a server that stores the Virtual Machine Manager database.The server must be running SQL Server 2005 or SQL Server 2005 Express Edition SP1.The following example assumes that SQL Server is installed on VMMServer1 rather than on a remote server.BackupLocalVMM.ps1 - Complete ScriptCopy the following complete version of BackupLocalVMM.ps1 into a Notepad file, and save it as BackupLocalVMM.ps1.# Filename: BackupLocalVMM.ps1# Description: Backs up the VMM database when the database# is stored locally on the VMM server.# DISCLAIMER:# Copyright (c) Microsoft Corporation.All rights reserved.This# script is made available to you without any express, implied or# statutory warranty, not even the implied warranty of# merchantability or fitness for a particular purpose, or the# warranty of title or non-infringement.The entire risk of the# use or the results from the use of this script remains with you.# Substitute the name of your VMM server and domain in this command:$VMMServer = Get-VMMServer -ComputerName "VMMServer1.Contoso.com"# Substitute your backup folder path and name for C:\VMMBackups:Backup-VMMServer -Path "C:\VMMBackups" -VMMServer $VMMServerBackupRemoteVMM.ps1You can use the BackupRemoteVMM.ps1 script to back up the Virtual Machine Manager database if the database is stored on a remote server that is running SQL Server 2005.How BackupRemoteVMM.ps1 WorksThe first command in the script connects to VMMServer1 in the Contoso.com domain, retrieves the server object from the Virtual Machine Manager database, and stores the server object in variable $VMMServer:$VMMServer = Get-VMMServer -ComputerName "VMMServer1.Contoso.com"The second command in the script uses a network share (instead of a local folder as in BackupLocalVMM.ps1 example script) as the destination path.The command backs up the Virtual Machine Manager database that is stored on SQLServer01 to the VMMBackups share on SQLServer01:Backup-VMMServer -Path "\\SQLServer01\VMMBackups" -VMMServer $VMMServerThe destination path (\\SQLServer01\VMMBackups in the following example) must be on a server that stores the Virtual Machine Manager database and is running SQL Server 2005.The following example assumes that SQL Server 2005 is installed on a remote server, called SQLServer01, that stores the Virtual Machine Manager database managed by VMMServer1.BackupRemoteVMM.ps1 - Complete ScriptCopy the following complete version of BackupRemoteVMM.ps1 into a Notepad file, and save it as BackupRemoteVMM.ps1.# Filename: BackupRemoteVMM.ps1# Description: Backs up the VMM database when the database# is stored on a remote SQL Server
[ Pobierz całość w formacie PDF ]