Database Space Capacity Planning

  • Adding Some more details.. there are the databases with the same name for different servers.

  • Hi

    Its really a good stuff , but could you tell about the powershell script how it works? because while executing the Write-DbSpaceToDb.ps1 am getting error like

    Exception calling "Fill" with "1" argument(s): "Invalid object name 'server_space_lku'."

    At D:\spaceanalysis\SpaceAnalysis\SpaceAnalysis\Write-DbSpaceToDb.ps1:27 char:19

    + [void]$da.fill <<<< ($dt)

    + CategoryInfo : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : DotNetMethodException

    Please please help me with this

    Thanks

    Nivetha

  • I am getting this error:

    A job step received an error at line 83 in a PowerShell script. The corresponding line is 'foreach {'. Correct the script and reschedule the job. The error information returned by PowerShell is: 'Exception calling "WriteToServer" with "1" argument(s): "Violation of PRIMARY KEY constraint 'PK_db_space'. Cannot insert duplicate key in object 'dbo.db_space'. The duplicate key value is (****\***, _DB, R:\DB.mdf, Feb 10 2011 12:00AM). The statement has been terminated." Violation of PRIMARY KEY constraint 'PK_db_space'. Cannot insert duplicate key in object 'dbo.db_space'. The duplicate key value is (****\***, DB, R:\DB.mdf, Feb 10 2011 12:00AM). The statement has been terminated. '. Process Exit Code -1. The step failed.

    I assume this is because we cannot run this more than once on a day. But what if we added a new instance to monitor. Is there a way to rather replace any existing data so that the job continues.

  • I have enhance Powershell script and introduced a identity column on both table.

    This will fix error encountered on column mapping, Primary key violation.

    Attachments:
    You must be logged in to view attached files.
  • Thank you Saumyabrata Bhattacharya !

    Great effort on posting something that actually works.

    Initial post - thanks, great stuff, chapeau and all that - woud have been better if tested and working scripts posted.

    SSRS reports - no detail on how to get these working either. :-/

    Something with a PK built on a date = means we can only run it once per day. Not too great if we're honest. PK violations. Eugh.

    Needed an ID column.

Viewing 5 posts - 91 through 94 (of 94 total)

You must be logged in to reply to this topic. Login to reply