SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SQL Server transaction log backup procedure using batch file.


SQL Server transaction log backup procedure using batch file.

Author
Message
Saggy
Saggy
SSC-Enthusiastic
SSC-Enthusiastic (179 reputation)SSC-Enthusiastic (179 reputation)SSC-Enthusiastic (179 reputation)SSC-Enthusiastic (179 reputation)SSC-Enthusiastic (179 reputation)SSC-Enthusiastic (179 reputation)SSC-Enthusiastic (179 reputation)SSC-Enthusiastic (179 reputation)

Group: General Forum Members
Points: 179 Visits: 234
I think when i perform transaction log backup it will be in format:

backup log databasename to disk='Path.trn'

When we perform regular log backup like in 15 mins OR 5 mins basis then what i observed is always transaction log file is smaller in size.

Append will work in full backup.

thnx.......reply
Dird
Dird
SSC-Addicted
SSC-Addicted (489 reputation)SSC-Addicted (489 reputation)SSC-Addicted (489 reputation)SSC-Addicted (489 reputation)SSC-Addicted (489 reputation)SSC-Addicted (489 reputation)SSC-Addicted (489 reputation)SSC-Addicted (489 reputation)

Group: General Forum Members
Points: 489 Visits: 810
Append will work in transaction log too using the WITH NOINIT. The default is also append. You must be looking at something different. Easy way to see it:
 create table dird (colA char(100))

BACKUP LOG ReplicationDB to disk='D:\tlog.bak'

with t1 as (select 'aaa' colA union all select 'aaa' union all select 'aaa' union all select 'aaa' union all
select 'aaa' union all select 'aaa' union all select 'aaa' union all select 'aaa' union all
select 'aaa' colA union all select 'aaa'),
t2 as (select t.colA from t1 t, t1 b),
t3 as (select t.colA from t2 t, t2 a, t2 b)
insert into dird select * from t3

BACKUP LOG ReplicationDB to disk='D:\tlog.bak'

delete from dird

BACKUP LOG ReplicationDB to disk='D:\tlog.bak'

with t1 as (select 'aaa' colA union all select 'aaa' union all select 'aaa' union all select 'aaa' union all
select 'aaa' union all select 'aaa' union all select 'aaa' union all select 'aaa' union all
select 'aaa' colA union all select 'aaa'),
t2 as (select t.colA from t1 t, t1 b)
insert into dird select * from t2

BACKUP LOG ReplicationDB to disk='D:\tlog.bak'



The size of the tlog backup continues to increase. Even though the last one only inserts 100 rows.


Dird
Saggy
Saggy
SSC-Enthusiastic
SSC-Enthusiastic (179 reputation)SSC-Enthusiastic (179 reputation)SSC-Enthusiastic (179 reputation)SSC-Enthusiastic (179 reputation)SSC-Enthusiastic (179 reputation)SSC-Enthusiastic (179 reputation)SSC-Enthusiastic (179 reputation)SSC-Enthusiastic (179 reputation)

Group: General Forum Members
Points: 179 Visits: 234
when i perform transaction log backup which is in format:

backup log databasename to disk='path.trn'


When we perform transaction log backup regularly it size get smaller and in full backup we do "with init" i.e. overwrite OR 'with noinit" i.e. append.

My main motto is in express edition how to schedule transaction log backup using Windows task scheduler which will be scheduled and using batch file in which all command will be present.


thnx...........reply
Dird
Dird
SSC-Addicted
SSC-Addicted (489 reputation)SSC-Addicted (489 reputation)SSC-Addicted (489 reputation)SSC-Addicted (489 reputation)SSC-Addicted (489 reputation)SSC-Addicted (489 reputation)SSC-Addicted (489 reputation)SSC-Addicted (489 reputation)

Group: General Forum Members
Points: 489 Visits: 810
I have already given you everything to handle a 15 minute transaction log backup. Just specify WITH NOINIT and see how it goes.


Dird
Saggy
Saggy
SSC-Enthusiastic
SSC-Enthusiastic (179 reputation)SSC-Enthusiastic (179 reputation)SSC-Enthusiastic (179 reputation)SSC-Enthusiastic (179 reputation)SSC-Enthusiastic (179 reputation)SSC-Enthusiastic (179 reputation)SSC-Enthusiastic (179 reputation)SSC-Enthusiastic (179 reputation)

Group: General Forum Members
Points: 179 Visits: 234
If any problem occurs i will post u msg in this post only.

thnx......Dird:-)
Dird
Dird
SSC-Addicted
SSC-Addicted (489 reputation)SSC-Addicted (489 reputation)SSC-Addicted (489 reputation)SSC-Addicted (489 reputation)SSC-Addicted (489 reputation)SSC-Addicted (489 reputation)SSC-Addicted (489 reputation)SSC-Addicted (489 reputation)

Group: General Forum Members
Points: 489 Visits: 810
OK. good luck


Dird
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search