<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://powershell.com/cs/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Search results for 'sectionid:198' matching tag 'DBA'</title><link>http://powershell.com/cs/search/SearchResults.aspx?q=sectionid%3A198&amp;tag=DBA&amp;orTags=0&amp;o=DateDescending</link><description>Search results for 'sectionid:198' matching tag 'DBA'</description><dc:language>en-US</dc:language><generator>CommunityServer 2008.5 (Build: 30929.2835)</generator><item><title>Re: generate sql server all databases script</title><link>http://powershell.com/cs/forums/thread/20212.aspx</link><pubDate>Mon, 26 Nov 2012 06:00:00 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:20212</guid><dc:creator>Cvakumar</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; To genereate sql(2008) db script for all databases(Single Instance) using powershell script.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Sivakumar.T&lt;/p&gt;
&lt;p&gt;SQL_DBA&lt;/p&gt;</description></item><item><title>generate sql server all databases script</title><link>http://powershell.com/cs/forums/thread/20203.aspx</link><pubDate>Sat, 24 Nov 2012 06:00:00 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:20203</guid><dc:creator>Cvakumar</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;We need generate sql serve all databases script using powershell. Because every day we have changed database procedures,tables we will change.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Now we manually taken databases scripts.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;We want sheduled job for generate all databases scirpts using powershell.&lt;img src="http://powershell.com/cs/emoticons/emotion-12.gif" alt="Angry" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please reply.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>How to get the &amp;quot;Analysis Server Properties&amp;quot;</title><link>http://powershell.com/cs/forums/thread/18065.aspx</link><pubDate>Thu, 02 Aug 2012 05:00:00 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:18065</guid><dc:creator>Nik</dc:creator><description>&lt;p&gt;Hi All i have to collect the SSAS properties (&amp;quot;Analysis Server Properties&amp;quot;) into a SQL table , i can not find any DMV to get the &amp;quot;Analysis Server Properties&amp;quot; but i am assuming it can be done with PowerShell, can anyone help?&lt;/p&gt;
&lt;p&gt;I also need the &amp;quot;SSAS Database Properties&amp;quot;.&lt;/p&gt;
&lt;p&gt;bottom line i will be using SSIS to collect the data.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>SafeToSQL utility in a powershell script</title><link>http://powershell.com/cs/forums/thread/12084.aspx</link><pubDate>Wed, 31 Aug 2011 05:00:00 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:12084</guid><dc:creator>miklaw2</dc:creator><description>&lt;p&gt;We have Idera&amp;#39;s SQLSafe product and we want to run their SafeToSQL utilty to change the Safe file into a .bak file&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I can run the command from the command prompt fine.. but it doesnt work from powershell &amp;nbsp;I am unsure what cmdlet I would use to get it going. &amp;nbsp;I have tried:&lt;/p&gt;
&lt;p&gt;invoke-expression and invoke-item &amp;nbsp;and I am not sure that they will work or not but right now its a not....&lt;/p&gt;
&lt;p&gt;Here is my script&lt;/p&gt;
&lt;p&gt;
&lt;p&gt;$tool= &amp;#39;C:\Program Files\Idera\SafeToSQL\SafeToSQL.exe&amp;#39;&lt;/p&gt;
&lt;p&gt;$cmdLine = &amp;#39;V:\SQL\QA\TMW3\Backup\Current\AtlasENewsQARecent.safe&amp;#39;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;##invoke-expression -command &amp;quot;$tool $cmdLine&amp;quot;&lt;/p&gt;
&lt;p&gt;invoke-item &amp;quot;$tool $cmdLine&amp;quot;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;any help or direction you can provide would be awesome. &amp;nbsp;Thanks&lt;/p&gt;</description></item><item><title>Query Oracle database with PowerShell</title><link>http://powershell.com/cs/forums/thread/9257.aspx</link><pubDate>Sat, 05 Feb 2011 06:00:00 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:9257</guid><dc:creator>ByteBlock</dc:creator><description>&lt;p&gt;Dears,&lt;/p&gt;
&lt;p&gt;please could anyone help me with the following? As usually when asking on forums - I&amp;#39;m desperate unable finding a solution :-)&lt;/p&gt;
&lt;p&gt;I simply need to access and retrieve any data from an Oracle Database.&lt;/p&gt;
&lt;p&gt;I downloaded Oracle express edition and Oracle client - both the most recent versions. There is a default database with some default tables. I configured the users and am able to access the data via default web interface.&lt;/p&gt;
&lt;p&gt;I tried about at least 50 different ways to connect to Oracle from PowerShell. Tried to use different providers, either OLE DB, Oracle .NET provider and others with no avail.&lt;/p&gt;
&lt;p&gt;Basically I&amp;#39;m getting the error about resolving TNS names (I googled for this and followed the steps to troubleshoot - didn&amp;#39;t help). I reinstalled Oracle several times just to make sure it&amp;#39;s clean installation, tried to install it on some virtual machines - always the same result.&lt;/p&gt;
&lt;p&gt;I also tried milion connection string combinations for different providers. I guess I&amp;#39;m missing something very basic, but as I don&amp;#39;t have much experience in DB access, I&amp;#39;m not able to figure it out.&lt;/p&gt;
&lt;p&gt;I will appreciate any working solution which doesn&amp;#39;t need to install a lot of 3rd party software - some powerpacks are ok, but I can&amp;#39;t install some advanced Oracle troubleshooting/managing/diagnostic tools. Besides that I believe the DB itself is ok.&lt;/p&gt;
&lt;p&gt;One note - I&amp;#39;m using PowerGui if it could affect the functionality somehow (it did happen to me in the past, so I rather mention it here too).&lt;/p&gt;
&lt;p&gt;The only &amp;quot;progress&amp;quot; I made is that now I&amp;#39;m getting the error message &amp;quot;Connection not open&amp;quot; instead of the problem with TNS names. Here is the very basic part of the script:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="font-family:Courier New;color:#800080;font-size:x-small;"&gt;&lt;span style="font-family:Courier New;color:#800080;font-size:x-small;"&gt;&lt;span style="font-family:Courier New;color:#800080;font-size:x-small;"&gt;&lt;strong&gt;[System.Reflection.Assembly]::LoadWithPartialName(&amp;quot;System.Data.OracleClient&amp;quot;)&lt;/strong&gt;
&lt;p&gt;
&lt;p&gt;&lt;strong&gt;$connectionString = &amp;quot;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(Host=ono-sendai)(Port=1521)))(CONNECT_DATA=(SID=xexdb)));User ID=sys;Password=abc&amp;quot;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;$connection = New-Object System.Data.OracleClient.OracleConnection($connectionString)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;$queryString = &amp;quot;SELECT COUNT(LAST_NAME) FROM EMPLOYEES&amp;quot;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;$command = new-Object System.Data.OracleClient.OracleCommand($queryString, $connection)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;$connection.Open()&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;$employeesNames = $command.ExecuteScalar()&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;
&lt;p&gt;
&lt;p&gt;&lt;strong&gt;write-host &amp;quot;Number of employees: &amp;quot;$employeesNames&lt;/strong&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;$connection.Close()&lt;/strong&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;$Error[0] | fl &lt;i&gt;-Force&lt;/i&gt;&lt;span style="font-family:Courier New;color:#800080;font-size:x-small;"&gt;&lt;span style="font-family:Courier New;color:#800080;font-size:x-small;"&gt;&lt;span style="font-family:Courier New;color:#800080;font-size:x-small;"&gt;&lt;i&gt;&amp;nbsp;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:Courier New;color:#800080;font-size:x-small;"&gt;&lt;span style="font-family:Courier New;color:#800080;font-size:x-small;"&gt;&lt;span style="font-family:Courier New;color:#800080;font-size:x-small;"&gt;Infinite grace and many thanks to anyone able to help me :-)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:Courier New;color:#800080;font-size:x-small;"&gt;&lt;span style="font-family:Courier New;color:#800080;font-size:x-small;"&gt;&lt;span style="font-family:Courier New;color:#800080;font-size:x-small;"&gt;Martin&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;</description></item><item><title>TSQL Formatter</title><link>http://powershell.com/cs/forums/thread/8480.aspx</link><pubDate>Mon, 29 Nov 2010 06:00:00 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:8480</guid><dc:creator>elephant_shoes</dc:creator><description>&lt;p&gt;I am&amp;nbsp;in the process of converting all my usual monitoring to powershell when&amp;nbsp;I got thinking about how easy it may be to write something to reformat tsql queries based on my development standards.&amp;nbsp; I have used a few different products in the past, but none are flexible enough to exactly conform to the standards we have here.&amp;nbsp; Might make someone&amp;#39;s job easier if they could run a query through a powershell script and just do a blanket refractoring...&lt;/p&gt;
&lt;p&gt;Anyone start anything like this yet?&lt;/p&gt;</description></item><item><title>Re: Failed job steps in SQL Server</title><link>http://powershell.com/cs/forums/thread/8210.aspx</link><pubDate>Wed, 10 Nov 2010 06:00:00 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:8210</guid><dc:creator>realgnomidad</dc:creator><description>&lt;p&gt;I second this question, it would be helpful for me as well. I&amp;#39;m also interested in learning how leverage SQL Central Management Server and Powershell.&lt;/p&gt;</description></item><item><title>Write to SQL Database</title><link>http://powershell.com/cs/forums/thread/8206.aspx</link><pubDate>Wed, 10 Nov 2010 06:00:00 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:8206</guid><dc:creator>whitehs</dc:creator><description>&lt;p&gt;I am creating a powershell script to check a random set of SQL Server database backups, so that I can confirm that the backups are successful. Process is retrieve list of last nights backups from a central database, then copy the backup file to a dev machine, restore the database to the server and run a DBCC CHECKDB command on the restored database. I have the results of the DBCC CHECKDB command stored in a datatable, but I cannot get it to write these details back to my central database. &lt;/p&gt;
&lt;p&gt;What&amp;#39;s the best way to do this? I was trying to use Chad Miller&amp;#39;s Write-DataTable.ps1. Any help would be appreciated.&lt;/p&gt;</description></item><item><title>Re: Change service applicaiton account</title><link>http://powershell.com/cs/forums/thread/7962.aspx</link><pubDate>Thu, 21 Oct 2010 05:00:00 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:7962</guid><dc:creator>Donabel Santos</dc:creator><description>&lt;p&gt;In a nutshell, this may be what you are looking for:&lt;/p&gt;
&lt;pre&gt;&lt;p&gt;$servicename = &amp;quot;SQL Server&amp;quot;;&lt;br /&gt;$serviceaccount=&amp;quot;domain\username&amp;quot;;&lt;br /&gt;$password=&amp;quot;password&amp;quot;;&lt;br /&gt;$filter = &amp;quot;Name=&amp;#39;&amp;quot; + $servicename + &amp;quot;&amp;#39; &amp;quot;;&lt;br /&gt;&lt;br /&gt;$sqlservice=Get-WMIObject win32_service -filter $filter&lt;/p&gt;&lt;p&gt;#if service is running, stop it&lt;br /&gt;if($sqlservice.State -eq &amp;quot;Running&amp;quot; -or $sqlservice.State -eq &amp;quot;Started&amp;quot;)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp; $sqlservice.StopService();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#change service account, then restart service&lt;br /&gt;#note quite a few $null parameters, this is because you can change other service properties &lt;br /&gt;#(for ex, Start Mode, Display Name)&lt;br /&gt;#when you use the Change() method&lt;br /&gt;$sqlservice.change($null,$null,$null,$null,$null,$null, `&lt;br /&gt;                             $serviceaccount,$password,$null,$null,$null);&lt;br /&gt;$sqlservice.StartService();&lt;/p&gt;&lt;/pre&gt;
&lt;p&gt;Have a look at the &lt;a title="Change-ServiceAccount" href="http://powershell.com/cs/media/p/3846.aspx"&gt;Change-ServiceAccount script posted by Brian Hagerty&lt;/a&gt; in PowerShell.com&amp;#39;s script library:&lt;br /&gt;&lt;a title="Change-ServiceAccount" href="http://powershell.com/cs/media/p/3846.aspx"&gt;http://powershell.com/cs/media/p/3846.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>