473,657 Members | 2,576 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 8840
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********@lai ki.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****@sommarsk og.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
3873
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 I find it strange that the log file doesn't seem to increase its size. The timestamp of the logfile is updating as well. But the size of the file is constant. I haven't configured my database to do auto-shrink so Im really confused why it hasn't...
3
7569
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 jobs: -- Database Backup BACKUP DATABASE TO WITH NOINIT ,
1
1459
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
2219
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 the best practice with SQL server 2000 for location of transaction logs? I remember that Microsoft used to take the position that transaction logs should be placed on their own FAT partition.
1
4410
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 am having is after I restore the database using the following statement : RESTORE DATABASE CMAMSPROD FROM DISK = ’C:\Databasename.BAK’ WITH STANDBY = ’D:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\Databasename\databasename.STANDBY’ ,MOVE...
2
3232
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 and asume I will need to run an SQL script to do this. Problem: I do not have MS Enterprise Manager of any database utility on my website apart from MS Access. Where can I download a free SQL tool that I can use to delete the transaction logs...
3
1617
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, and I set up maintenance plans to back these up online on a daily basis. In the research I did it was recommended backing up the transaction logs as well on a frequent basis to ensure recovery to POF or point in time. I had assumed that they work...
1
2490
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. I can't access the transaction logs to back them up. I am told that my ISP's tech support should have it set up to shrink those logs automatically every so often. Is that true?
3
6275
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 database conection is not permitted on standby database. USEREXIT, I don't know whether it can run on standby database or
0
1293
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 the file. Is there any way that I can delete the used transaction logs in my LOG File to free some disk space that I need. I cannot delete or add any new files on my database, because the transaction log file is full. My database is set AUTO GROW...
0
8392
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8305
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8732
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6163
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4302
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1953
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1611
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.