SQL Clone
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
One Orange Chip
One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)

Group: General Forum Members
Points: 26582 Visits: 17557
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 Modens 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
SSCommitted
SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)

Group: General Forum Members
Points: 1604 Visits: 8586
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
SSCrazy
SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)

Group: General Forum Members
Points: 2424 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 Guru
SSC Guru (88K reputation)SSC Guru (88K reputation)SSC Guru (88K reputation)SSC Guru (88K reputation)SSC Guru (88K reputation)SSC Guru (88K reputation)SSC Guru (88K reputation)SSC Guru (88K reputation)

Group: General Forum Members
Points: 88704 Visits: 41132
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.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
Jeff Moden
Jeff Moden
SSC Guru
SSC Guru (88K reputation)SSC Guru (88K reputation)SSC Guru (88K reputation)SSC Guru (88K reputation)SSC Guru (88K reputation)SSC Guru (88K reputation)SSC Guru (88K reputation)SSC Guru (88K reputation)

Group: General Forum Members
Points: 88704 Visits: 41132
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.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
sqlbuddy123
sqlbuddy123
SSCrazy
SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)

Group: General Forum Members
Points: 2424 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