Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase «««56789

Database Space Capacity Planning Expand / Collapse
Author
Message
Posted Thursday, October 18, 2012 9:23 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Thursday, May 16, 2013 5:46 AM
Points: 257, Visits: 671
narayanaswamy (10/18/2012)
Hi All,

In SQL Server 2008 instance i have created spacedm database and created all objects tables,views,sp's

I've executed this command prompt .\write-dbspacetodb.ps1 'instancename' spacedm

I am getting below error from powershell. An exception calling "fill" with "1" can't open database spacedm. Login failed to open Spacedm database

Please help me how to resolve this issue. I have created one login assigned db_owner to spacedm even then same issue.




It seems like you're having trouble making a connection. Try just running a test connection:

$serverName = 'instancename'
$databasename = "spacedm"
$connString = "Server=$serverName;Database=$databaseName;Integrated Security=SSPI;"
$con = new-object System.Data.SqlClient.SqlConnection
$con.ConnectionString = $connString
$con.Open()



Post #1374433
Posted Thursday, January 24, 2013 1:40 PM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: 2 days ago @ 4:55 PM
Points: 1,597, Visits: 2,770
Thanks, Chad, this is one of the best scripts on internet I can find about space monitoring.
I tried serveral before and compare them with this one, this is the cleanest and more powerfull code
and implementation.

Thanks much!
Post #1411330
Posted Thursday, January 24, 2013 6:12 PM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: 2 days ago @ 4:55 PM
Points: 1,597, Visits: 2,770
A question about permissions.
When I schedule the job, because it will run using SQL agent service account, it won't work because it cannot login to other computers using that service account to check disk and db size.
So I created a proxy account using my own credentials, for I am a dba, so I have access to those servers that I need to check.

Is that the right approach to go? I mean for the account that run the SQL job - it has to be sysadmin on all those servers that need to be checked, correct?

Thanks
Post #1411421
Posted Friday, January 25, 2013 5:44 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Thursday, May 16, 2013 5:46 AM
Points: 257, Visits: 671
sqlfriends (1/24/2013)
A question about permissions.
When I schedule the job, because it will run using SQL agent service account, it won't work because it cannot login to other computers using that service account to check disk and db size.
So I created a proxy account using my own credentials, for I am a dba, so I have access to those servers that I need to check.

Is that the right approach to go? I mean for the account that run the SQL job - it has to be sysadmin on all those servers that need to be checked, correct?

Thanks


The way I run it--I use an account that has sysadmin rights on servers being collected. I'm not sure if less rights will work easily.



Post #1411642
Posted Friday, January 25, 2013 1:12 PM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: 2 days ago @ 4:55 PM
Points: 1,597, Visits: 2,770
Thanks much.

Does this job have to be scheduled to run daily? How about if I just want to collect the data once a week, or once a month?

If so, do I need to change the view for the column of daily_growth_mb,
because in the view it is like AND d2.dt = DATEADD(dd, - 1, d1.dt)

If I don't change it, and I collect only once a week, then I think it will has no records. correct?

Thanks
Post #1411912
Posted Friday, January 25, 2013 4:54 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Thursday, May 16, 2013 5:46 AM
Points: 257, Visits: 671
I haven't looked at the code in a while, but I think you're right on the view.


Post #1411959
Posted Thursday, May 02, 2013 4:22 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, May 02, 2013 8:42 AM
Points: 5, Visits: 33
Can anyone tell me why the calculation for usable size is (v1.percent_free, v1.size_gb * .8 AS usable_size_gb).

I know it's got to do with the initial disk formating and so forth but why the .8? Something to do with 8 bytes?
Post #1448750
Posted Thursday, May 02, 2013 5:31 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Thursday, May 16, 2013 5:46 AM
Points: 257, Visits: 671
An assumption around always keeping at least 20% free space on NTFS volumes.


Post #1448770
« Prev Topic | Next Topic »

Add to briefcase «««56789

Permissions Expand / Collapse