473,398 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

How to move transaction logs on-line?

nai
Hi all,

I have a database with 20GB transaction log file.
The recovery model of the database is Full.
I need to move the T. log file to a new location with the minimal
downtime.
I know I can do this by dettaching the DB, copying the T. Log and
attaching it at the new location. This will take some time though as
copying the T. log file will take up some time.

I thoght that I could maybe create a secondary T. log file and delete
the primary T. log file.
What does it take so I'm able to delete the primary T. log file? Can
you please explain how to accomplish this?

Also, if you can figure out of a better way, then please let me know.

Jul 3 '06 #1
3 8832
nai wrote:
Hi all,

I have a database with 20GB transaction log file.
The recovery model of the database is Full.
I need to move the T. log file to a new location with the minimal
downtime.
I know I can do this by dettaching the DB, copying the T. Log and
attaching it at the new location. This will take some time though as
copying the T. log file will take up some time.

I thoght that I could maybe create a secondary T. log file and delete
the primary T. log file.
What does it take so I'm able to delete the primary T. log file? Can
you please explain how to accomplish this?

Also, if you can figure out of a better way, then please let me know.
Do you regularly do backups and shrink the TX log? If not, that's the
first thing I'd do.

Kind regards

robert

Jul 4 '06 #2
1)backup you log to a specific local location...
2) copy it on another machine (using xp_cmdshell)
3) call for a restore log by remotely calling a repote procedure on the
destination instance (you need to declare the remote instance as a
linked server first though)

Hope this helps...
nai wrote:
Hi all,

I have a database with 20GB transaction log file.
The recovery model of the database is Full.
I need to move the T. log file to a new location with the minimal
downtime.
I know I can do this by dettaching the DB, copying the T. Log and
attaching it at the new location. This will take some time though as
copying the T. log file will take up some time.

I thoght that I could maybe create a secondary T. log file and delete
the primary T. log file.
What does it take so I'm able to delete the primary T. log file? Can
you please explain how to accomplish this?

Also, if you can figure out of a better way, then please let me know.
Jul 4 '06 #3
nai (ni********@laiki.com) writes:
I have a database with 20GB transaction log file.
The recovery model of the database is Full.
I need to move the T. log file to a new location with the minimal
downtime.
I know I can do this by dettaching the DB, copying the T. Log and
attaching it at the new location. This will take some time though as
copying the T. log file will take up some time.

I thoght that I could maybe create a secondary T. log file and delete
the primary T. log file.
What does it take so I'm able to delete the primary T. log file? Can
you please explain how to accomplish this?
It appears you cannot remove the primary log file.

I would:

1) Backup the transaction log.
2) Shrink the log file.
3) Throw out users.
4) Detach database.
5) Copy log file (which is now small).
6) Attach database.
7) Let users in.
8) Increase log file to 20 GB again.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Jul 4 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: enigma | last post by:
Just wondering if you could help me on this one. I'm not sure if my transaction logs are behaving oddly or what. I've successfuly managed to shrink my transaction logs from 7GB down to 1MB and now...
3
by: Thiko | last post by:
Hi I take one nightly full database backup at 02:00 and backup the transaction log to one backup set every 15mins. The commands to do this are as follows and are set up to run as database...
1
by: eudamon | last post by:
DB is 150GB and I cannot take it offline long enough to apply logs to a back up. I am moving from one sub storage system to another. Any mirroring ideas? Thanks
3
by: Andrew S. | last post by:
I recently performed an SQL server 2000 installation. Other than placing the program files on C: and data on D:, I saw no option to install transaction logs in an alternate location. What is...
1
by: CPNZ | last post by:
I have a database i am m oving to another server, during the process I am moving the data and log files to another drive.(Which I have done countless times before with no problems) The problem I...
2
by: francois1 | last post by:
I am running a website with a SQL Server database attached. My transaction logs are full and my hosting co. won't allocate more disk space for me. I need to delete my database transaction logs...
3
by: TG | last post by:
Coming from a (mostly) Oracle shop, I am unclear how SS transaction logs work as far as up to point of failure recovery goes. I have the few MSSQL databases I look after in full recovery mode,...
1
by: JA | last post by:
Hi, I know just about nothing about SQL Server. I am getting this error: The log file for database 'my_database' is full. Back up the transaction log for the database to free up some log space. ...
3
by: Laurence | last post by:
Hi folks, How to remove the transaction logs which are out of date in HADR environment? DB2 command PRUNE, it can only run on primary database but cannot run on standby database. Because the...
0
by: kazper | last post by:
Good day, I have some problems regarding my Hard disk space for my logs in SQL Server 2005. When I try shrinking the database it returns an error not letting me to do anything about the size of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.