buck.woody
LinkedIn | FaceBook | Twitter
Resume
I gave a presentation at TechEd 2008 where I covered our new features in "A Day in the Life of a DBA". Here's more of what I showed for 10:00am - "Panic Button":
Now that I've found there are a few databases that haven't been backed up, I want to run a "Panic Backup" on all of them. Here's a PowerShell script, driven by an XML document containing the server names and database names that will take care of that for me - note that you could add a "WITH COPY" option so as not to break the Backup Chain:
Script:
# Buck Woody
# Last changed: 05/16/2008
# Requires an XML file called "ServerList.XML"
# in the c:\temp\ directory
# SQL Server Access
Function
{
}
# Main script Block
cls
# Create an XML document object, read in the file
$programSource
write-Host
$doc
# Fist loop - used for the servers
foreach
XML:
# XML Driver File:
<?xml version="1.0" encoding="utf-8"?>
<servers>
<server servername = "serverOne">
<database databasename = "databaseOne"></database>
<database databasename = "databaseTwo"></database>
<database databasename = "databaseThree"></database>
</server>
<server servername = "serverTwo">
</servers>
PingBack from http://wordnew.acne-reveiw.info/?p=4759