User Tools

Site Tools


wiki:backuppc_mssql

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
wiki:backuppc_mssql [2015/06/04 17:31] – [The folder and scripts] jrdalrymplewiki:backuppc_mssql [2018/09/27 02:29] (current) – external edit 127.0.0.1
Line 28: Line 28:
   - We need 2 files in that folder\\ <file DOS backup_dbs.cmd>   - We need 2 files in that folder\\ <file DOS backup_dbs.cmd>
 erase "c:\dbbackups\*.bak" erase "c:\dbbackups\*.bak"
-sqlcmd -E -i "c:\dbbackups\backupdbs.sql"</file>\\ If you aren't using the default instances of SQL Server on your Windows host you may need to add something like "-S .\\MYINSTANCEto the sqlcmd line. Note the double backslash to work properly in the bash shell.\\ <file DOS backupdbs.sql>+sqlcmd -E -i "c:\dbbackups\backupdbs.sql"</file>If you aren't using the default instance of SQL Server on your Windows host you may need to add something like<code>-S .\MYINSTANCE</code>to the sqlcmd line. Incidentally you may have more than one of the following .sql files and more than one sqlcmd to run if you're needing to backup multiple running SQL instances on one host.<file DOS backupdbs.sql>
 BACKUP DATABASE [DATABASE_1] TO  DISK = N'c:\dbbackups\DATABASE_1.bak' WITH NOFORMAT, NOINIT,  NAME = N'DATABASE_1-Full Database Backup', SKIP, NOREWIND, NOUNLOAD,  STATS = 10 BACKUP DATABASE [DATABASE_1] TO  DISK = N'c:\dbbackups\DATABASE_1.bak' WITH NOFORMAT, NOINIT,  NAME = N'DATABASE_1-Full Database Backup', SKIP, NOREWIND, NOUNLOAD,  STATS = 10
 BACKUP DATABASE [DATABASE_2] TO  DISK = N'c:\dbbackups\DATABASE_2.bak' WITH NOFORMAT, NOINIT,  NAME = N'DATABASE_2-Full Database Backup', SKIP, NOREWIND, NOUNLOAD,  STATS = 10 BACKUP DATABASE [DATABASE_2] TO  DISK = N'c:\dbbackups\DATABASE_2.bak' WITH NOFORMAT, NOINIT,  NAME = N'DATABASE_2-Full Database Backup', SKIP, NOREWIND, NOUNLOAD,  STATS = 10
wiki/backuppc_mssql.1433439106.txt.gz · Last modified: 2018/09/27 02:30 (external edit)