Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backup-SQLDatabaseToFile Error Cannot find drive... #51

Open
GreatScott000 opened this issue May 16, 2018 · 4 comments
Open

Backup-SQLDatabaseToFile Error Cannot find drive... #51

GreatScott000 opened this issue May 16, 2018 · 4 comments

Comments

@GreatScott000
Copy link
Contributor

This command
Backup-SQLDatabaseToFile -DatabaseServer NAVDEV1 -DatabaseName "Demo Database NAV (11-0-21836 GB)"
Gives me the following error. Is there an assumption that I am issuing the command from a session on the SQL server machine? "G" (referenced below) is the drive where the SQL backups are put by default.

Join-Path : Cannot find drive. A drive with the name 'G' does not exist.
At C:\Program Files\WindowsPowerShell\Modules\Cloud.Ready.Software.SQL\1.0.1.7\Backup-SQLDatabaseToFile.ps1:51 char:27

  • $BackupFileFullPath = Join-Path $Backuplocation $BackupFile
    
  •                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : ObjectNotFound: (G:String) [Join-Path], DriveNotFoundException
    • FullyQualifiedErrorId : DriveNotFound,Microsoft.PowerShell.Commands.JoinPathCommand

Backing up database ...
BACKUP DATABASE [Demo Database NAV (11-0-21836 GB)] TO DISK = N'' WITH COPY_ONLY, NOFORMAT, INIT, NAME = N'NAVAPP_QA_MT-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
Invoke-Sqlcmd : Invalid zero-length device name. Reissue the BACKUP statement with a valid device name.
BACKUP DATABASE is terminating abnormally.
At C:\Program Files\WindowsPowerShell\Modules\Cloud.Ready.Software.SQL\1.0.1.7\Backup-SQLDatabaseToFile.ps1:57 char:5

  • Invoke-Sqlcmd -Query $SQLString -ServerInstance "$DatabaseServer\ ...
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [Invoke-Sqlcmd], SqlPowerShellSqlExecutionException
    • FullyQualifiedErrorId : SqlError,Microsoft.SqlServer.Management.PowerShell.GetScriptCommand

Get-Item : Cannot bind argument to parameter 'Path' because it is null.
At C:\Program Files\WindowsPowerShell\Modules\Cloud.Ready.Software.SQL\1.0.1.7\Backup-SQLDatabaseToFile.ps1:59 char:14

  • Get-Item $BackupFileFullPath
    
  •          ~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidData: (:) [Get-Item], ParameterBindingValidationException
    • FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.GetItemCommand
@waldo1001
Copy link
Owner

is the G-drive known on the SQL machine - since that machine will be executing the backup-procedure?

@GreatScott000
Copy link
Contributor Author

Yes the G-drive is a physical drive on the SQL server

@waldo1001
Copy link
Owner

Hm - no clue - I must admit, I haven't been using this for quite a while (since docker). And I don't have a system where I can test this. May be it's better to use a drive that's available on both machines?

@GreatScott000
Copy link
Contributor Author

If I just give a filename with no path it seems to be happy. That will do for what I need. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants