AS SALAMO ALAIKUM WA RAHMATULLAH
--
MA ASALAAM
PASSION 4 ORACLE
USE AdventureWorks2012
Go
Begin
Declare @Filename Varchar(200);
Declare @FullPath Varchar(300);
Declare @FinalPath Varchar(300);
Set @FullPath='D:\ DB_Backup_Daily\DifferentialBackup\';
Set @Filename=' AdventureWorks2012_'+Convert(varchar(10),Getdate(),120)+'.bak';
Set @FinalPath=@FullPath + @Filename
print @FinalPath
BACKUP DATABASE AdventureWorks2012 TO DISK = @FinalPath WITH
DIFFERENTIAL
End
USE AdventureWorks2012
GO
Begin
Declare @Filename Varchar(200);
Declare @FullPath Varchar(300);
Declare @FinalPath Varchar(300);
Set @FullPath='D:\DB_Backup_Daily\FullBackup\';
Set @Filename=' AdventureWorks2012_'+Convert(varchar(10),Getdate(),120)+'.bak';
Set @FinalPath=@FullPath + @Filename
print @FinalPath
BACKUP DATABASE AdventureWorks2012 TO DISK = @FinalPath WITH
INIT
End
USE FahaheelLiveStore
go
Begin
Declare @Filename Varchar(200);
Declare @FullPath Varchar(300);
Declare @FinalPath Varchar(300);
Set @FullPath='D:\DB_Backup_Daily\TransactionBackup\';
Set @Filename=' AdventureWorks2012_'+Convert(varchar(10),Getdate(),120)+'.log';
Set @FinalPath=@FullPath + @Filename
print @FinalPath
BACKUP LOG AdventureWorks2012 TO DISK = @FinalPath WITH STATS =1
END
--
MA ASALAAM
PASSION 4 ORACLE
No comments:
Post a Comment