Data Backup and Recovery

how to schedule powershell commands for clone a db in smsql 5

visnetapp
2,046 Views

Hi

i want to schedule a clone job in smsql 5

in the wizard you have no option to do this

with powershell commands executed in the netapp cli works

when i make a sqljob wiht powershell option d'osnt work

how i can schedule my job in sql or task scheduler

thx for help

andy

1 REPLY 1

visnetapp
2,046 Views

here is the solution:

powershell.exe -ImportSystemModules clone-database -Server Servername -Username admin -Password P@ssw0rd -ServerInstance Instance -Database DBName -TargetDatabase DBName_Clone -TargetServerInstance Targetserver -MountPointDir c:\Mountpoint -UseMountPoint

you can schedule this batch by Windows Task Scheduler or in a SQL Job.

I have created a SQL Job with a detach Step first.

Public