Tuesday, March 20, 2012

Planning of log backup suggestions

Hello Guys,
I would like to overwrite the log file every two weeks.
The log file is backed up every hours every hours (append to the
device) and the full backup runs every day at 11 pm.
I would like to run a job that overwrite the log backup every two
weeks. What do you advice me to do? at which time is better?
I would like to overwrite the file every two weeks at 10 pm before of
the full backup.
any suggestion?
Inaina

> I would like to overwrite the log file every two weeks.
> The log file is backed up every hours every hours (append to the
> device) and the full backup runs every day at 11 pm.
BACKUP LOG... WITH INIT just after FULL BACKUP of the database
If you do Database20061101.bak as regular full backup , try to compare
GETDATE() -14 with '20061101' portion of .BAK file
Tools
1)CONVERT function
2)SUBSTRING/RIGHT/LEFT functions
"ina" <roberta.inalbon@.gmail.com> wrote in message
news:1163408898.605077.87490@.m73g2000cwd.googlegroups.com...
> Hello Guys,
> I would like to overwrite the log file every two weeks.
> The log file is backed up every hours every hours (append to the
> device) and the full backup runs every day at 11 pm.
>
> I would like to run a job that overwrite the log backup every two
> weeks. What do you advice me to do? at which time is better?
> I would like to overwrite the file every two weeks at 10 pm before of
> the full backup.
> any suggestion?
> Ina
>|||Thanks Uri,
I did not understand the this:
If you do Database20061101.bak as regular full backup , try to compare

> GETDATE() -14 with '20061101' portion of .BAK file
> Tools
> 1)CONVERT function
> 2)SUBSTRING/RIGHT/LEFT functions
Ina
Uri Dimant wrote:
[vbcol=seagreen]
> ina
>
>
> BACKUP LOG... WITH INIT just after FULL BACKUP of the database
> If you do Database20061101.bak as regular full backup , try to compare
> GETDATE() -14 with '20061101' portion of .BAK file
> Tools
> 1)CONVERT function
> 2)SUBSTRING/RIGHT/LEFT functions
>
>
>
> "ina" <roberta.inalbon@.gmail.com> wrote in message
> news:1163408898.605077.87490@.m73g2000cwd.googlegroups.com...|||ina
It is how you identify your backup file
DECLARE @.FileName AS VARCHAR(255)
DECLARE @.Date AS VARCHAR(20)
SET @.Date =CONVERT(VARCHAR(10),GETDATE(),112)
SELECT @.FileName = 'C:\dbname' + @.Date+'.bak'
BACKUP DATABASE dbname TO DISK = @.FileName
Now you have to compare , whether the .BAK file is two weeks old and if it
is you just perform BACKUP LOG ...WITH INIT
"ina" <roberta.inalbon@.gmail.com> wrote in message
news:1163414330.502761.160300@.h48g2000cwc.googlegroups.com...
> Thanks Uri,
> I did not understand the this:
> If you do Database20061101.bak as regular full backup , try to compare
>
> Ina
>
> Uri Dimant wrote:
>
>|||Ah ok thanks did not know So I can do a job that everyday test this
validation and if it true a overwrite the device.
Ina
Uri Dimant wrote:
[vbcol=seagreen]
> ina
> It is how you identify your backup file
> DECLARE @.FileName AS VARCHAR(255)
> DECLARE @.Date AS VARCHAR(20)
> SET @.Date =CONVERT(VARCHAR(10),GETDATE(),112)
> SELECT @.FileName = 'C:\dbname' + @.Date+'.bak'
> BACKUP DATABASE dbname TO DISK = @.FileName
>
> Now you have to compare , whether the .BAK file is two weeks old and if i
t
> is you just perform BACKUP LOG ...WITH INIT
>
>
>
>
> "ina" <roberta.inalbon@.gmail.com> wrote in message
> news:1163414330.502761.160300@.h48g2000cwc.googlegroups.com...

No comments:

Post a Comment