Data Backup and Recovery
I'm trying to automate cloning our databases into our different development environments with powershell. I can create the database clone with the clone-database command, but when I try to delete it with this command:
delete-clone -Server PER-0-SQL08-INF\SQL2008INF -Database InfusionImport -ServerInstance STG-0-DB0-B\LOCAL
I get this output:
Connecting to server: [PER-0-SQL08-INF\SQL2008INF] [processing]
Connecting to server: [PER-0-SQL08-INF\SQL2008INF] [completed]
Retrieving SnapManager Configuration Information: [processing]
Retrieving SnapManager Configuration Information: [completed]
Database Name specified InfusionImport is not valid. Please specify a valid name for the Database clone that you wish to de
An Error occured while deleting the Database clone.Please check the SnapManager Reports/Windows EventLogs for more informat
Details:The pipeline has been stopped.
delete-clone : Database Name specified InfusionImport is not valid. Please specify a valid name for the Database clone that
you wish to delete.
At line:1 char:13
+ delete-clone <<<< -Server PER-0-SQL08-INF\SQL2008INF -Database InfusionImport -ServerInstance STG-0-DB0-B\LOCAL
+ CategoryInfo : InvalidArgument: (SMSQLPSSnapIn.SMSQLPSDeleteClone:SMSQLPSDeleteClone) [delete-clone], Excep
+ FullyQualifiedErrorId : [Invalid Database Name],SMSQLPSSnapIn.SMSQLPSDeleteClone
The InfusionImport is defiantly valid on the PER-0-SQL08-INF\SQL2008INF SQL instance.
I can't find anything in the Windows Event logs. Any ideas why this may be happening?
Also, why is it necessary to give the source server in the -ServerInstance option?
The database name need to be either single quote or double quote.
Here is the example: delete-clone -Server SQL2012HADR3 -database 'AdventureWorks'
Sorry, that didn't help either.
PS D:\Scripts> delete-clone -Server PER-0-SQL08-INF\SQL2008INF -Database 'InfusionImport' -ServerInstance STG-0-DB0-B\LOCAL
+ delete-clone <<<< -Server PER-0-SQL08-INF\SQL2008INF -Database 'InfusionImport' -ServerInstance STG-0-DB0-B\LOCAL
PS D:\Scripts> delete-clone -Server PER-0-SQL08-INF\SQL2008INF -Database "InfusionImport" -ServerInstance STG-0-DB0-B\LOCAL
+ delete-clone <<<< -Server PER-0-SQL08-INF\SQL2008INF -Database "InfusionImport" -ServerInstance STG-0-DB0-B\LOCAL
Ok from the picture you sent. Isn't the syntax should be as follows:
delete-clone -Server PER-0-SQL08-INF -ServerInstance PER-0-SQL08-INF\SQL2008INF -Database 'InfusionImport'
Thank you so much, that worked. I thought I had tried that combination before.
According to the documentation -ServerInstance is for the Source of the backup. I cloned the database from STG-0-DB0-B\LOCAL to PERF-0-SQL08-INF\SQL2008INF. The documentation isn't very clear.
From the SnapManager® 5.1 for Microsoft® SQL Server® Installation and Administration Guide
"-ServerInstance (String Parameter): This parameter specifies the SQL
server instance where the database is backed up originally. SnapManager takes
the local computer name as the default server instance.
If multiple databases reside on the same LUN but are owned by different SQL
server instances when you backed them up originally, use the following format:
The first database specified in the -Database parameter refers the first server
instance in the -ServerInstance parameter, the second database in the -Database
parameter refers to the second server instance in the -ServerInstance parameter
and so on."
Let's walk you through the new & improved Knowledge Base and further enrich your experience with NetApp Products.
The Insights to Actions Community is back with a new look! Click here to learn how to get started.
Join our Discord Community