Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


DB will become read only. We cannot make any modifications here, How to avoid this scenario


DB will become read only. We cannot make any modifications here, How to avoid this scenario

Author
Message
sankepalli
sankepalli
Forum Newbie
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: General Forum Members
Points: 1 Visits: 27
Hello Folks,

Suppose, there are 1 million records, if we insert all these records in the log file, it will become full & DB will become read only. We cannot make any modifications here, How to avoid this scenario?

Immediate help would be highly appreciable

Thanks
Sean Lange
Sean Lange
SSCoach
SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)

Group: General Forum Members
Points: 16527 Visits: 16992
sankepalli (2/26/2014)
Hello Folks,

Suppose, there are 1 million records, if we insert all these records in the log file, it will become full & DB will become read only. We cannot make any modifications here, How to avoid this scenario?

Immediate help would be highly appreciable

Thanks


Don't insert the rows? I assume you mean you are inserting a million rows into a table since you can't insert rows into the log file. Not quite sure what you mean that you can't make any modifications. I would think that inserting a million rows is certainly making a modification.

The only way you can ensure the log file does not fill up with no other intervention is to do anything that causes any logging. :-P

_______________________________________________________________

Need help? Help us help you.

Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

Need to split a string? Try Jeff Moden's splitter.

Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Understanding and Using APPLY (Part 1)
Understanding and Using APPLY (Part 2)
David Webb-CDS
David Webb-CDS
SSC Eights!
SSC Eights! (914 reputation)SSC Eights! (914 reputation)SSC Eights! (914 reputation)SSC Eights! (914 reputation)SSC Eights! (914 reputation)SSC Eights! (914 reputation)SSC Eights! (914 reputation)SSC Eights! (914 reputation)

Group: General Forum Members
Points: 914 Visits: 8584
Several possible ways to prevent the log filling:

Insert the records in batches and take log backups between the batches.

Switch the DB to 'Simple' recovery mode, insert in batches, switch back to 'Full' recovery mode, take an immediate full backup (this may not be advisable if you need to maintain point in time recoverability for the DB)

Allow the log to grow, or add space to the log to cover the amount of data. Remove other files from the drive if possible to free up space.

Without more information about the situation, it's tough to give meaningful advice.



And then again, I might be wrong ...
David Webb
sqlbuddy123
sqlbuddy123
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1212 Visits: 2243
sankepalli (2/26/2014)
Hello Folks,

Suppose, there are 1 million records, if we insert all these records in the log file, it will become full & DB will become read only. We cannot make any modifications here, How to avoid this scenario?

Immediate help would be highly appreciable

Thanks


Do it as david mentioned. You need to break the insert into smaller chunks and do the inserts.

--
SQLBuddy
Jeff Moden
Jeff Moden
SSC-Forever
SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)

Group: General Forum Members
Points: 44922 Visits: 39857
sankepalli (2/26/2014)
Hello Folks,

Suppose, there are 1 million records, if we insert all these records in the log file, it will become full & DB will become read only. We cannot make any modifications here, How to avoid this scenario?

Immediate help would be highly appreciable

Thanks


If this doesn't sound like an interview or homework question, I don't know what does.

So what do YOU think?

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
     Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
Although they tell us that they want it real bad, our primary goal is to ensure that we dont actually give it to them that way.
Although change is inevitable, change for the better is usually not.
Just because you can do something in PowerShell, doesnt mean you should. Wink

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
Jeff Moden
Jeff Moden
SSC-Forever
SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)

Group: General Forum Members
Points: 44922 Visits: 39857
David Webb-CDS (2/26/2014)
Several possible ways to prevent the log filling:

Insert the records in batches and take log backups between the batches.

Switch the DB to 'Simple' recovery mode, insert in batches, switch back to 'Full' recovery mode, take an immediate full backup (this may not be advisable if you need to maintain point in time recoverability for the DB)

Allow the log to grow, or add space to the log to cover the amount of data. Remove other files from the drive if possible to free up space.

Without more information about the situation, it's tough to give meaningful advice.


You don't need to take a FULL backup to reestablish the log chain after switching back to the FULL recovery mode. DIFs work just fine for that.

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
     Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
Although they tell us that they want it real bad, our primary goal is to ensure that we dont actually give it to them that way.
Although change is inevitable, change for the better is usually not.
Just because you can do something in PowerShell, doesnt mean you should. Wink

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
sqlbuddy123
sqlbuddy123
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1212 Visits: 2243
Jeff Moden (2/26/2014)
sankepalli (2/26/2014)
Hello Folks,

Suppose, there are 1 million records, if we insert all these records in the log file, it will become full & DB will become read only. We cannot make any modifications here, How to avoid this scenario?

Immediate help would be highly appreciable

Thanks


If this doesn't sound like an interview or homework question, I don't know what does.

So what do YOU think?


Yep, You are right. It sounds like an interview\homework question ..

--
SQLBuddy
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