Thursday, February 16, 2012

Backup Otomatis Dengan TSQL + Job

:: BACKUP OTOMATIS DENGAN TSQL + JOB ::

Langkah pertama, buat store procedure berikut:

--

CREATE PROC SP_BACKUP
AS

BEGIN
DECLARE @name VARCHAR(50) -- database name 
DECLARE @path VARCHAR(256) -- path for backup files 
DECLARE @fileName VARCHAR(256) -- filename for backup 
DECLARE @fileDate VARCHAR(20) -- used for file name

SET @path = 'E:\Backup\' 

SET @name = 'NAMA_DATABASE_GUE' 

SET @fileName = 'NAMA_BACKUP_GUE' 

SET @fileName = @path + @name + '.BAK' 
BACKUP DATABASE @name TO DISK = @fileName  with INIT

END

--

Kemudian, buat Job di sql server. Cara membuatnya, masuk ke SQL SERVER AGENT > Jobs > klik kanan, NEW JOB

setelah muncul, di page General, buat nama jobs:

Masuk ke page Steps. Klik tombol Edit. Masukan store procedure BACKUP.


Lalu masuk ke page Schedule, buat tipe schedule menjadi Recurring. Periodenya terserah, bisa 6 jam sekali, atau 1 hari sekali :

Kategori

info (205) foto (133) komentar ga penting (128) fotografi (123) Technology (104) Kantor (95) website (88) blog (84) Jakarta (78) comic strip (75) bisnis (71) karir (51) suara hati (51) senda-gurau (50) wisata (38) Bekasi (37) Internet (34) manajemen (31) kuliner (22) selebritis (21) soccer (21) Navision (20) iklan (14) kasus (14) sql server 2005 (13) buku (11) Greeting (10) movie (10) komik strip (9) novel (9) programming (9) televisi (9) Banjir (8) VCD/DVD (8) kopi (8) Vanessa (7) billiard (7) hypermarket (7) bogor (6) kesehatan (6) rumah (6) old document (5) Terios (4) basket (4) guru (4) Axapta (3) bioinformatika (3) azure (1)

My Instagram