October 14, 2009 at 7:12 am
Look like very usefull stuff, thanks but cant try with out spacedm.procedures.sql
can you please copy paste the procedures in the article itself.
I tried downloading it from following link too but cant find spacedm.procedures.sql there also 🙁
October 14, 2009 at 7:17 am
Hi
I am stepping thorugh the various steps, but when I try to launch the powershell scripts, I get the following error
C:\BIN>WRITE-DBSPACETODB.PS1
Exception calling "Fill" with "1" argument(s): "Invalid object name 'server_spa
ce_lku'."
At C:\BIN\Write-DbSpaceToDb.ps1:13 char:15
+ [void]$da.fill( <<<< $dt)
I have the following entry in 'Server_space)lku'
servname\instance
October 14, 2009 at 7:51 am
vinodkn (10/14/2009)
Look like very usefull stuff, thanks but cant try with out spacedm.procedures.sqlcan you please copy paste the procedures in the article itself.
I tried downloading it from following link too but cant find spacedm.procedures.sql there also 🙁
My apologies, somehow I've managed not to include the stored procedure creation statements yet again. I'll fix the download in the article and provide a script just for the procedure creation statements later this evening.
October 14, 2009 at 8:12 am
graeme.black (10/14/2009)
HiI am stepping thorugh the various steps, but when I try to launch the powershell scripts, I get the following error
C:\BIN>WRITE-DBSPACETODB.PS1
Exception calling "Fill" with "1" argument(s): "Invalid object name 'server_spa
ce_lku'."
At C:\BIN\Write-DbSpaceToDb.ps1:13 char:15
+ [void]$da.fill( <<<< $dt)
I have the following entry in 'Server_space)lku'
servname\instance
You need specifiy both a server name and database name, where server name is the SQL Server instance where your spacedm database is located and database is your space dm database. The script should be called like this:
Write-dbspacetodb.ps1 Z002\SQL2K8 spacedm
October 14, 2009 at 3:08 pm
Link to the stored procedure creation statements. I will update the zip file included with the article, but this may take a few days to show up.
October 15, 2009 at 2:36 am
thank you very much !!!
October 15, 2009 at 3:47 am
Hello
I have strange results from the powershell scripts.
The scripts run successfully, however the Free_MB column only displays Null values in exception of the master database.
The powershell script is executed with an windows account with full DB access so I am not sure why this is happening? Any ideas?
😀
October 15, 2009 at 4:04 am
need help, Sorry not asking you to troubleshoot the issue but just tell me where i am going wrong, ( I am very much interested in this spacedm solution )
How will you connect If the DB is installed on default instance ?
for example
Server name is REP
used default instance and installed DB name called XXX
created spacedm DB
if i run the following
Write-DbSpaceToDb.ps1 rep\XXX spacedm
PS E:\SpaceAnalysis\SpaceAnalysis> .\Write-DbSpaceToDb.ps1 rep\XXX spacedm
Exception calling "Fill" with "1" argument(s): "An error has occurred while establishing a connection to the server. W
hen connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server do
es not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specifie
d)"
At E:\SpaceAnalysis\SpaceAnalysis\Write-DbSpaceToDb.ps1:27 char:19
+ [void]$da.fill( <<<< $dt)
I also tried following but nothing worked. 🙁
PS E:\SpaceAnalysis\SpaceAnalysis> .\Write-DbSpaceToDb.ps1 XXX spacedm
PS E:\SpaceAnalysis\SpaceAnalysis> .\Write-DbSpaceToDb.ps1 .\XXX spacedm
PS E:\SpaceAnalysis\SpaceAnalysis> .\Write-DbSpaceToDb.ps1 rep\. spacedm
remote connections already enabled
October 15, 2009 at 4:12 am
you just need to do the following
Write-DbSpaceToDb.ps1 'rep' spacedm
October 15, 2009 at 4:34 am
My server name is IEOAK-2005-B, and I have a default instance installed
when i run
C:\BIN>write-dbspacetodb.ps1 'IEOAK-2005-B' spacedm
I still get the following error
Exception calling "Fill" with "1" argument(s): "Invalid object name 'server_spa
ce_lku'."
At C:\BIN\Write-DbSpaceToDb.ps1:27 char:19
+ [void]$da.fill( <<<< $dt)
in the field
server_space_lku I have and IEOAK-SQL2005-B
October 15, 2009 at 4:59 am
Birdmaster777, It was quick, thank you.
But some have it didn't work 🙁
October 15, 2009 at 5:02 am
what is the contents of you table server_space_lku ?
October 15, 2009 at 5:29 am
looks like following command completed without error
PS E:\SpaceAnalysis\SpaceAnalysis> .\Write-DbSpaceToDb.ps1 "rep" "spacedm"
October 15, 2009 at 5:32 am
Birdmaster777 (10/15/2009)
HelloI have strange results from the powershell scripts.
The scripts run successfully, however the Free_MB column only displays Null values in exception of the master database.
The powershell script is executed with an windows account with full DB access so I am not sure why this is happening? Any ideas?
😀
What if you run the query executed by the PowerShell script in SSMS. What results do you see?
CREATE TABLE #output(
server_name varchar(128),
dbname varchar(128),
physical_name varchar(260),
dt datetime,
file_group_name varchar(128),
size_mb int,
free_mb int)
exec sp_MSforeachdb @command1=
'INSERT #output
SELECT CAST(SERVERPROPERTY(''ServerName'') AS varchar(128)) AS server_name,
''?'' AS dbname,
f.filename AS physical_name,
CAST(FLOOR(CAST(getdate() AS float)) AS datetime) AS dt,
g.groupname,
CAST (size*8.0/1024.0 AS int) AS ''size_mb'',
CAST((size - FILEPROPERTY(f.name,''SpaceUsed''))*8.0/1024.0 AS int) AS ''free_mb''
FROM ?..sysfiles f
JOIN ?..sysfilegroups g
ON f.groupid = g.groupid'
SELECT * FROM #output
October 15, 2009 at 5:41 am
ive just ran it on Query An using the master database.
The output displays all the databases and values execept the last column which it has set to null, the only exception is the master database which is poplulated correctly
Viewing 15 posts - 16 through 30 (of 94 total)
You must be logged in to reply to this topic. Login to reply