Move Mdf/ldf Files For A Replicated Database

Jul 23, 2005

Can someone lend some assistance in this? It sounds like it should be
able to be done.

We have a large replicated database in SQL 2000. We need to move the
mdf and ldf files to a location on another drive.

Will doing this affect or break replication in any way? Is there any
way to prevent this?

Thanks in advance.

Glenn Dekhayser
Voyant Strategies

View 1 Replies


ADVERTISEMENT

Move Replicated Database

Sep 2, 2005

Hi,
We have to move two of our servers in US hosting SQL Server 2000 database to different location. These servers are clustered using MSCS and uses SAN to store database data. The database on this cluster hosts publisher and distributor. The other two sites in Europe host updateable subscribers. We are using transactional replication. The downtime will be around 24 hours during which servers will be physically moved from one location to other. During this time we will keep the two subscribers running and let the changes queued on subscribers. I have listed following steps based on my limited knowledge of SQL Server. Could somebody please advise if this approach is valid and if I have missed any steps?

1. Make sure no users are accessing database
2. Backup database (In case of emergency need)
3. Stop snapshot, Log Reader, Queue Reader and Distributor Agents
4. Stop SQL Server Service and SQL Agent
5. Take OS backup
5. Shutdown the server
6. Ship the servers and OS backup to new location
7. Setup servers at new location and restore OS backup
8. Start SQL Server Service and SQL Agent
9. Start agents listed in step 3

Regards,
Nilesh

View 6 Replies View Related

How To Move Replicated Database?

May 8, 2006

I got Server A with 30 Databases and I was asked to move 30 databases to Server B…
But server A is having 2 databases as Publication and Distribution to two different servers….. and Server A is a subscription for 6 Databases from other servers….

Once I move the databases from Server A to Server B…… what is the best way to get the Replications too…. I mean Server B should have 2 Db’s as Pub & Distr and 6 Db’s as Subscription…

Is there any way I can script it out in Server A and run the same script in Server B with some modification…. so that the Replication work…..??

I have Jobs and Maintenance plans…. Which should also move from Server A to Server B…. I know using DTS...... is there any better way..??

Please some one give me ur suggestion on this…

Thanks
Bob

View 6 Replies View Related

Move Replicated DB To Different Server?

May 22, 2007

Is it possible to move/migrate a replicated database to a different server without breaking the subscriptions etc?

If so, is there a guide on how to do this?

Many thanks for your help in advance!

best regards, Stefan

View 3 Replies View Related

SQL Server 2008 :: Move Database Log Files Massively

Sep 14, 2015

I want to to move all database log files from drive E to F .

There are more than 10 databases so I don’t wanna move them 1 by 1 .

At the moment I use detach – attach method .

-Detach db
-Move log file
-Attach db

How do I do this massively in one go ?

View 5 Replies View Related

Recovery :: Move Database Files That Are In Availability Group?

Sep 17, 2015

I need to move files for a lot of databases that are all part of an AG. I've used the method at the bottom of this link with success on a small test DB.

View 2 Replies View Related

Move Log Files

Apr 23, 2001

Can someone tell me how to move the log file for a database from one drive
to anoyher. I want to keep the data on one drive and the logs on another
so I need to move the log files to another drive.
Thanx, Kelly

View 1 Replies View Related

Move Files

Jun 13, 2001

Without restoring the database, has anyone written a slick little piece of code that moves a file existing on on filegroup to another newly created filegroup without doing it from a restore.

The purpose of doing this is to get rid of one data file and placing the data into the data file we are retaining. We have some more physical file space and are moving data into one data file and one transaction log file.

We have already ran the DBCC SHRINKFILE with EMPTYFILE to move the data,
We have already ran the ALTER DATABASE statement but here, because the filegroup is identified as PRIMARY in the sysfilegroup table, we can not REMOVE the data file because of indexes relating to the PRIMARY filegroup.

So if I could ALTER DATABASE and create a bogus filegroup and move the data file which I want to get rid of into the bogus filegroup, I could ALTER DATABASE with REMOVE filegroup and solve the situation.

Does anyone know of an easier way to do it other than BACKUP database and RESTORE database.....please help!!!

Thanks,
Daimon

View 1 Replies View Related

How To Move Files Between Servers?

Sep 9, 2004

Can I move a database from one server to another server using QA?

EXEC sp_detach_db @dbname = 'IISLOG'
EXEC sp_attach_single_file_db @dbname = 'IISLOG',
@physname = 'c:Program FilesMicrosoft SQL ServerMSSQLDataIISLOG.mdf'

Or would I need a tape backup to move this database to another server?

Thanks

Lystra

View 1 Replies View Related

How To Move Data Files

Jul 20, 2005

hello,my problem is how to move data files drom drive c: to drive d: ??--MarcinS

View 1 Replies View Related

Move Objects Between Mdf Files

Apr 1, 2006

what is the easiest way to move objects (tables with data and stored procedures) from one sqlexpress database mdf to another mdf?

View 1 Replies View Related

Move Bad Files To Error

Oct 1, 2007

Hi,

I am looping a set of .txt files in a folder using foreach.

Inside foreach, I have a Dataflow task that does the transformation. After that i have added a File System that moves file to archive.

However, If the user puts any other file instead of a .txt file, i want to move the file to Error folder and this should be before the DataFlow starts within foreach.

How can i do this? I want to use script to read the file extension and then move it to the error.

Lalit.

View 8 Replies View Related

Need To Move Data And Log Files To A Different Drive?

Jul 3, 2001

View 1 Replies View Related

How To Move Files From C:dirf2.mdf To E:dirf1.mdf

Oct 17, 2003

Hi ,


I created a few databases but I forgot to change the location from c:program filesd1.mdf.I don't have much space left on c: drive but have lot of space left on e:

How do I move the data and log files to e: drive ?

Thanks,
Sal

View 1 Replies View Related

Move Files In Data Flow

Sep 7, 2007



Hi all,

I'm trying to find some way to implement a move file task in my Data Flow. I parse through a flat file, retrieve a value, then I'm using a lookup table to check if that value exists in a table... if the value doesnt exist, I need to move this file to a new directory and insert the value into a different table. Does anyone have any ideas about how to move the file while using the Data Flow pane?

Or is there some way to pass information from the look up table to the Control flow pane and use the Move File Task there? I'm trying to stay away from a Script task or a Script component unless it's unavoidable. I appreciate any ideas!

View 6 Replies View Related

New Install, But I Need To Move Data Files

Apr 26, 2007

I could really use some help on this one. I know virtually nothing about SQL Server. We installed this because our database for the application we're running (Lexis Nexis Time Matters) had gotten too large for the Express 2005 version. We've also installed a new version of the software, and on a new server.

The new server has the drive partitioned into two partitions. When installing the application, I selected drive D (545 gb) as the data drive, but when I installed SQL server, it was installed on drive C (12 gb). I did not realize that the the application data was simply configuration information, and the data for the program is actually being installed on the C drive (Program FilesMicrosoft SQL ServerMSSQL.1MSSQLData).

Is there a simple procedure to move this data, including the SQL instance (TIMEMATTERS) to the D drive? Or should I uninstall and start over?

View 1 Replies View Related

How To Move Only The Transaction Log Files (.ldf) To A Different Drive?

Apr 17, 2007

Hello guys and girls. I have installed SQL Server 2005 Standard Edition and I have specified that the databases should be created on the K: drive. This is okay but now I need to move all the transaction log files (.ldf) to the L: drive. I have already changed the default location for the log files to point to the L: drive and the new databases that were created after the installation have their transaction log file correctly in the L: drive but now I need to move transaction log files for the master, model, temp ... databases. How can this be done? And are there any gotchas?

View 11 Replies View Related

How To Move BackUp Files By Schedule To Any Computers ?

Jul 25, 2007

I set up MA plan to full back up by schedule
and I would like to move them each completing process to another computer for preventing failing if harddisk of server was damaged.
 
How to move them by schedule to any computers ??
Please give me some suggest. 

View 1 Replies View Related

Move Log Files For SQL 2005 Databases To Another Drive

Jan 24, 2008



Hello,

I need to move all log files for my SQL 2005 databases to another drive. I don't wish to shrink the files, I need to move the logs to another drive spindle. I did find an article (Article ID: 224071) that describes moving both the database and logs using sp_detach and then sp_attach. What is the best way just to move the logs to another drive on the same server, and that keeps the databases in their original location?
Thanks.

View 3 Replies View Related

Move Mdf Files For System Databases To Another Location

Mar 18, 2008



Hello there,
I've been told that it is good practice to keep mdf and ldf files in another location... We have it in place for all our user databases, however mdf and ldf files for our system dbs are still at the same location. I was wondering what is the right way of splitting those should be?

View 5 Replies View Related

Move Distribution Data/log Files To Another Drive

Jun 20, 2007

I haven't found the definitive answer on how or if this can be done without removing replication. I'm thinking ALTER DATABASE modify_file is the way to go. Anybody know if this will work or a better way to go about it?

Thanks

View 2 Replies View Related

Transact SQL :: Move Files From One Location To Another Using Powershell

Jul 12, 2015

I have a job which copies .txt files 24 hours 7 days a week to c:TempSource

What I am planning to do is copy the files from one location to another say c:TempTarget

So I have written the Powell shell script and when i put that in the sql agent job i get below error ;

A job step received an error at line 5 in a PowerShell script. The corresponding line is '$filesToMove = $files | Where -Property "Name" -NotLike -Value $newestFile.Name'. Correct the script and reschedule the job. The error information returned by PowerShell is: 'A parameter cannot be found that matches parameter name 'Property'. '. Process Exit Code -1. The step failed.

$sourceFiles = "c:TempSource*.txt"
$targetFolder = "c:TempTarget"
$files = Get-ChildItem $sourceFiles
$newestFile = ($files | sort LastWriteTime -Descending)[0]
$filesToMove = $files | Where -Property "Name" -NotLike -Value $newestFile.Name
$filesToMove | ForEach { Move-Item $_ $targetFolder } 

View 12 Replies View Related

Move The Source Excel Files To Archieve Folder

Apr 15, 2008

Using the below script task I am checking for the excel file existence and upon file existence using the data flow task will load the excel data into sql table. After the data is loaded from one file or however number of excel files present, I want to move those into a archieve folder with datetimestamp to the filenames,please let me know how I can move those files with datetimestamp to the filenames, any help is greatly appreciated. Thanks!!

Imports System
Imports System.Data
Imports System.Math
Imports Microsoft.SqlServer.Dts.Runtime
Imports System.IO
Public Class ScriptMain
Public Sub Main()
If File.Exists(ReadVariable("FileNameVariable").ToString()) Then
Dts.TaskResult = Dts.Results.Success
Else
Dts.TaskResult = Dts.Results.Failure
End If
End Sub

'From Daniel Read's Blog - http://www.developerdotstar.com/community/node/512/
Private Function ReadVariable(ByVal varName As String) As Object
Dim result As Object
Try
Dim vars As Variables
Dts.VariableDispenser.LockForRead(varName)
Dts.VariableDispenser.GetVariables(vars)
Try
result = vars(varName).Value
Catch ex As Exception
Throw ex
Finally
vars.Unlock()
End Try
Catch ex As Exception
Throw ex
End Try
Return result
End Function
End Class

View 8 Replies View Related

Move The Source Excel Files To Archieve Folder

Apr 15, 2008

Using the below script task I am checking for the excel file existence and upon file existence
using the data flow task will load the excel data into sql table. After the data is loaded from one file or
however number of excel files present, I want to move those excel files into a archieve folder with date&timestamp to the filenames, please let me know how I can move those files with datetimestamp to the filename,
any help is greatly appreciated. Thanks!!
Imports System
Imports System.Data
Imports System.Math
Imports Microsoft.SqlServer.Dts.Runtime
Imports System.IO
Public Class ScriptMain
Public Sub Main()
If File.Exists(ReadVariable("FileNameVariable").ToString()) Then
Dts.TaskResult = Dts.Results.Success
Else
Dts.TaskResult = Dts.Results.Failure
End If
End Sub
'From Daniel Read's Blog - http://www.developerdotstar.com/community/node/512/
Private Function ReadVariable(ByVal varName As String) As Object
Dim result As Object
Try
Dim vars As Variables
Dts.VariableDispenser.LockForRead(varName)
Dts.VariableDispenser.GetVariables(vars)
Try
result = vars(varName).Value
Catch ex As Exception
Throw ex
Finally
vars.Unlock()
End Try
Catch ex As Exception
Throw ex
End Try
Return result
End Function
End Class

View 6 Replies View Related

FTP Functionality (see If File Exists, Move Remote Files)

Jul 18, 2007

I want to poll an ftp site to see when files arrive, then I would like to download them, and move them into a different directory on the ftp site. It seems like I would have to do a lot to work around the limitations of the FTP Task. Is it capable of this sort of work? If not is there a 3rd party task that is better suited for ftp operations within SSIS?

View 4 Replies View Related

How To Move The Bad Data Into Another Directory While Looping Through A Set Of FLAT FILES ?

Sep 1, 2007

Currently looping through the set of flat files like CHK0604, CHK0611, CHK0618, and CHK0625 from the source folder C:SOURCE



OBJECTIVE within the flat file if any records/rows cause error i have to move the bad data into separate folder C:ERROR



STEPS TAKEN

1) In FOREACH LOOP component i specified the variable User:: sourceFilePath for my source file CHK0604 etc. location C:SOURCE. The loop walkthrough each file in C:SOURCE and if no error then moves the flat file into another folder C:ARCHIVED. This task is perfectly working.



2) Within the dataflow I am diverting the the bad rows from "conditional component" into "Flat File Destination" Component.



3) "Flat File Destination" Connection manager i set the expressions as @[User:: sourceFilePath] +"_Error.TXT".



ISSUE

Because of point (3) the error file is created in the SOURCE flat file location C:SOURCE.



QUESTION



1) My error file name should be CHK0604_Error, CHK0611_Error, CHK0618_Error, CHK0625_Error created in another folder C:ERROR.



2) How to move the bad data into another directory while looping through a set of FLAT FILES ?

3) If i have to create another variable like @[User:: ErrorFilePath] where to create ? How to use the source file title as the title of error file.?

Thanks for the help

View 4 Replies View Related

Integration Services :: Move Files Based On Filename?

May 12, 2015

I have a requirement to move files from HOLD folder to input folder. In HOLD folder I receive multiple files starting with af, ai, ar i.e. af*.txt , ai*.txt, ar*.txt . I need to move one file at a time to input folder as each file is to be loaded into database before next file is processed. In all the files the SSIS has to look at ai*.txt files first followed by af*.txt and lastly ar*.txt. If there are multiple files of same group the file with oldest date has to be moved first. How do I achieve this?

View 5 Replies View Related

SQL Server 2008 :: Powershell Script To Move Backup Files

Feb 11, 2015

I am trying to create a job using power-shell script to move the backup files from one folder to another. I am using Ola Hallengren script for backups. Ola hallengren created a common backup folder with sub-folders for databases and even more sub folders for Full and Log backups. My goal is to move full backups, which are older than a month and save them in a different drive along with the same folder structure. I was able to move the first set of backups without any problem, but I can't move anymore files and keep getting this error even when I try to overwrite the previous file with the force statement:

Move-Item : Cannot create a file when that file already exists.

At line:5 char:9
+ Move-Item $i.FullName C:Test -force
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (C:BackupVALIDATIONgcommon:DirectoryInfo) [Move-Item], I
+ FullyQualifiedErrorId : MoveDirectoryItemIOError,Microsoft.PowerShell.Commands.MoveItemCommand

Here's the script that I used to move the first set of files:

foreach ($i in Get-ChildItem C:BackupVALIDATION)
{
if ($i.CreationTime -lt ($(Get-Date).AddMonths(-1)))
{
Move-Item $i.FullName C:Test
}
}

View 0 Replies View Related

Move Files From Directory Based On Names On A Static List.

May 2, 2008

I have a scenario where I need to move a series of files from within a directory of many files. The files follow no nameing convention and are more of less random. However the file names never change from week to week. I tried various different options in a 'file system task', no go.
Any ideas on how to move only a list of files?

or

can I load only specific files into a 'Foreach Loop container' from a certain directory. I tried delimiting file names in the file source, that did not work.

Either way can work,
Thanks

View 1 Replies View Related

Resotring A Replicated Database

Mar 3, 2004

I have a database A on server_1 that is being merge replicated to database B on server_2 which is production a box

NOW

I want to restore database A on server_3 that is being merge replicated to database B on Server_4 which is test box.

How about do I do that with replication being involved?

Thanx

View 2 Replies View Related

Alter Table In Replicated Database

Apr 26, 2003

How can I do an alter table in some table that replicated database ?
I got the error message when I try !

View 3 Replies View Related

Backup/Restore For Replicated Database

Jul 5, 2006

Hi, I have setup a merged replication on two server. Server A contains the Publisher and the Distributor database and Server B contains Subscriber.

If the database at the Subscriber got corrupted. I am thinking maybe i can 'restore' the subscriber database by resynchronising the data from the publisher to subscriber.

But what happen if the Publisher database failed? How should one restore the publisher database and then restore the replication setup?

What will be a good backup/restore strategy for such a setup?

View 1 Replies View Related

Remove Primary Key On Replicated Database

Jul 31, 2006

I have a table that was set up with a primary key - that i need to change. The problem is that the database is being replicated to a remote location, and will not allow me to remove or change the primary key on a published database.
Due to the size of the database and bandwith limitations it is not an option to re-initialise the published database.
Is there any to do this without breaking replication

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved