notebook/IT/SQL/SCRIPTS SQL QSA ORSYS/EXO 6 tache plainfiées.sql
2020-11-26 18:38:25 +01:00

35 lines
814 B
SQL

-- sauvegardez en mode complet les bases : master, msdb, DB_GRAND_HOTEL
BACKUP DATABASE master
TO DISK = 'master.bak'
WITH COMPRESSION, RETAINDAYS = 3;
BACKUP DATABASE msdb
TO DISK = 'msdb.bak'
WITH COMPRESSION, RETAINDAYS = 3;
BACKUP DATABASE DB_GRAND_HOTEL
TO DISK = 'DB_GRAND_HOTEL.bak'
WITH COMPRESSION, RETAINDAYS = 3;
-- planifié à 22h tous les jours
-- sauvegarder le journal de transaction de la base DB_GRAND_HOTEL
BACKUP LOG DB_GRAND_HOTEL
TO DISK = 'DB_GRAND_HOTEL.trn'
WITH RETAINDAYS = 3;
-- planifié toutes les 20 minutes
RAISERROR('Mon erreur', 16, 1) WITH LOG;
EXECUTE AS USER = 'USR_ECRIVAIN'
RAISERROR('Mon erreur', 16, 1) WITH LOG;
-- IDERA, QUEST, APEX, REDGATE, SOLAR WINDS, SENTRY SQL
-- KUKANRU gratuit et léger