DB Engine :: Moving Database Backup Files From One Server To Another?

Sep 15, 2015

How to move the database backup files (.bak) from one server to another server using ‘XP_CMDSHELL’

View 2 Replies


ADVERTISEMENT

DB Engine :: Server Agent Job Failing After Moving A Database

Aug 10, 2015

On Saturday we moved a few databases from SQL Server 2005 to a SQL Server 2012 cluster; and as expected some jobs have been failing because of this. The Job in Question executes two stored procedures and then an SSIS package; however when I ran the Job it failed with the error

Msg 7411, Level 16, State 1, Line 1
Server 'servername' is not configured for RPC

I therefore configured the Server for RPC with the following script: -

exec sp_serveroption @server='servername', @optname='rpc', @optvalue='true'
GO
But the job failed again.  So I therefore reran the script with the reconfigure option: -
exec sp_serveroption @server='OCELOT7CLUST', @optname='rpc', @optvalue='true'
GO
reconfigure with override
go

But again the job failed.  I then closed SSMS and reopened it and attempt to run the job again and once again it failed.This is not an issue with the Linked Server as the linked Server is connecting as sa.

View 6 Replies View Related

DB Engine :: Moving FILESTREAM To A New Database

Oct 26, 2015

Our development organization has created an application employing FILESTREAM, which through the pilot has been incorporated into a schema within our Data Warehouse Staging database. Going to production, the development and BI teams have determined that they want it separated out into a separate database, and they'd like to separate it in the current pilot environment (DEV). How can I best move (or at least copy) the existing FILESTREAM data from the current database into a new one?

View 6 Replies View Related

Moving Database Files

Aug 28, 2007

Sorry for the ultra-beginner question, but I've just recently started playing with SQL 2005 Express Edition for a task I've been assigned to at work.

I'm building an ASP.NET 2.0 web site that needs to connect to a SQL database to pull information. I installed SQL Express 2005 and installed the SQL Server Management Studio and I've managed to build a small database with one table.

I noticed that by default, the mdf and ldf files are located in C:Program FilesMS SQL ServerMSSQLDATA (or something along those lines). The website I'm working on is temporarily stored in C:WebSite. I need to move the database files over to C:WebSiteApp_Data so I can access them easily with ASP.NET and VS 2005 Express.

I can copy and paste the mdf and ldf files, but then I can't figure out how to point the SQL Server Management Studio to the new location.

I am obviously just a complete newbie at all of this. It's pretty sad that I can't figure out how to simply move the database from one directory to another on the same server... it makes me worry about when I'll need to move it to the new webserver!

Could anyone point me in the right direction at least?

Thanks in advance!

View 2 Replies View Related

Moving System Database Files

Sep 19, 2002

Is this possible? If so, how is it done?

View 1 Replies View Related

DB Engine :: Database Files Shrinking

Jul 6, 2015

I have dataware house database and it's size is 2 TB with simple recovery model.I want to reduce it's size because everyday before loading table gets truncate.Is it best practice to shrink the datafiles?database having 5 data files and one log file.what is the best way to reduce?

View 7 Replies View Related

Transact SQL :: Moving MDF And NDF Files After Database Is Detached

Aug 19, 2015

I am using SQL 2012 SE. I am trying to move .mdf and .ndf files after a database is detached. Here is my code that is just to copy the mdf file. I am testing it against this file now and if it worked then I would do the move ldf file the same way.

EXEC master.dbo.sp_configure 'show advanced options', 1
RECONFIGURE WITH OVERRIDE
GO
EXEC master.dbo.sp_configure 'xp_cmdshell', 1
RECONFIGURE WITH OVERRIDE
DECLARE @cmd nvarchar(4000)

[Code] ...

The only message is I see while the query is executing is :Configuration option 'show advanced options' changed from 0 to 1. Run the RECONFIGURE statement to install.

If I manually copy over the file it takes 30 seconds since the file is only 2GB and the script takes 45 minutes and still executing.

View 7 Replies View Related

How Can We Modify The Files Path For The Database In Database Engine?

May 14, 2007

Hi, all experts here,

Thank you very much for your kind attention.

I am trying to modify the files path (primary file, log file) of databases, but it looks like I am not able to mofidy their files path directly from the database property dialogue? Would please any experts here give me some ideas on what else can I try to figure it out? Thanks a lot in advance and I am looking forward to hearing from you shortly.

With best regards,

Yours sincerely,

View 5 Replies View Related

DB Engine :: System Database Files Location

May 16, 2015

I have C,D,E drives on server. Data files will be on D and Log on E. My question is what is best practice for data and log files for system databases during sql server installation selection? Should they be on C drive along with SQL Server installation or D & E? If they should not be on C then what is the reason and what is benefit to move them on other drives.

View 9 Replies View Related

DB Engine :: Prevent User To Backup From Database

Apr 28, 2015

We have a user with read,write and execute permissions.

But this user with is used by a windows application,Is able to backup on the Database server(On C: drive).

How can I prevent it to backup on the server.

View 4 Replies View Related

DB Engine :: How To Take Backup Of Database Audit Specification

Nov 10, 2015

How can I take backup of Database Audit Specification ?

View 3 Replies View Related

SQL 2012 :: Opening Files Result In Connect To Database Engine Prompt?

Feb 24, 2014

When opening .sql files, I get a connect to database engine prompt every single time. how to stop this from prompting vs. just using my current active connection?

View 4 Replies View Related

DB Engine :: How To Prevent User Of DB Owner To Backup Database

Nov 6, 2015

vendor did a full backup for his database and put some folder not being backed up by TSM, he is the owner of the database, and delete his backup later. The backup is not copy only, all the differential and log backups taken are based on his FULL backup. so they cannot be restored.

QUESTION: To prevent this happen in the future, what is the normal practices? or any way to prevent db_owner to do the ad-hoc full backup? I am thinking of using DENY backup database, or write a policy  claiming no responsibility if vendor make it happen again.

View 3 Replies View Related

DB Engine :: High Availability Database Backup Error

May 19, 2015

Backing up all databases on a sql server that hosts secondary high availability databases as well as other databases.  The other databases back up fine, but the high availability secondaries all get the same error:

BackupDiskFile::OpenMedia: Backup device 'F:MSSQLBackupdbnamedbname_backup_2015_MM_DD_tttttt_ttttttt.bak' failed to open. Operating system error 2(The system cannot find the file specified.)

View 11 Replies View Related

SQL 2012 :: FOR FILES Command To Delete Old Backup Files On Remote Server?

Feb 24, 2015

I have the need to delete old backup files via TSQL job. Found this solution online:

PushD "
emoteservershareDIFF" &&(
forfiles -m *DIFF*.sqb -d -1 -c "cmd /c del /q @path"
) & PopD

It works remotely if I run it via command prompt. But when I add this to a TSQL job on my remote SQL instance, it runs without deleting anything. What I'm missing?

View 6 Replies View Related

SQL Server 2008 :: Count Number Of Backup Files Deleted From A Default Backup Location

Mar 13, 2015

I've written a custom script to delete backup files from location. But unable to modify now to count the number of files are deleted. How to modify the script...

/* Script to delete older than N days backup from a specific directory */

USE [db_admin]
GO
IF OBJECT_ID('usp_DeleteBackup', 'P') IS NOT NULL
DROP PROC usp_DeleteBackup
GO

[Code] .....

View 2 Replies View Related

Moving DB Files To Another Drive On The Server.

Sep 27, 2005

Howdy y'all! :)

I have been instructed to move a large database we have on one of our servers off the current drive (local RAID-5 driveset in the server) to a EMC "drive" (logical drive, off-server).

I know one option is to back up the database, delete the database, re-create the db using the new drive for data/log files, then restore the database.

However, I was wondering if it would be better to just detach the DB, move the data/log files, then reattach to them?

Is it half-doz of one, and 6 of the other?

How should I go about this dastardly deed?

Off to poke around in BOL, but thought I would post first in case it's an incredibly easy answer for y'all

Thanks!

View 3 Replies View Related

Moving Data Files To A New Disk, Same Server

Jul 23, 2005

Hello, I have been having a bit of trouble finding help on the safestway to move data files to a different disk on the same server. Mosthelp is about moving data files to a different sqlserver. I just wantto move the files to a different drive on the same server. Any helpwould be appreciated.Thanks,David

View 6 Replies View Related

Backup Database To CSV Files

Nov 1, 2006

HiWhat is the easiest option for Exporting ALL of my SQL Server tables into a CSV file (either separate CSV files for each table or one big file with all the table columns and data) ???I just want to Backup my SQL Server database like we backup MySQL database using phpMyAdmin. Unfortunately, my SQL hosting company does not allow backups for free.Thanks for help

View 1 Replies View Related

Database Backup Using .LDF && .MDF Files

Apr 12, 2006

Hi,
I am developing a tool that takes snapshot of a particular database.
By snapshot I mean, attaching the .LDF & .MDF files.
Would  you please let me know how to access these files & take a backup of the same.
And also how to restore them back. (using c# programming)
Thanks,
Archana A.A.
 

View 1 Replies View Related

Backup Database Using Files

Aug 10, 2004

I am but a lowly DBA unworthy of this task...

I have a large (200+ GB) database with many (100+) files. Please don't ask me why I did it this way; I inherited this database -- really, it wasn't my idea.

My predecessor also seemd to think that backups were unnecessary; there have been no backups of this database -- ever.

While we cast about for a good long term solution, I am trying various short-term options. One I want to explore is to back the database up in chunks -- ie, by backing up individual files. I created a test database with five files (there is only one filegroup on the production server). Here is the DDL:


-- =============================================
-- Create database on mulitple file groups
-- =============================================
IF EXISTS (SELECT *
FROM master..sysdatabases
WHERE name = N'MultiFile')
DROP DATABASE MultiFile
GO

CREATE DATABASE MultiFile
ON PRIMARY
( NAME = MultiFile,
FILENAME = N'e:MSSQLDataMultiFile.mdf',
SIZE = 1MB,
MAXSIZE = 10MB,
FILEGROWTH = 10%),

( NAME = MultiFile2,
FILENAME = N'e:MSSQLDataMultiFile2.ndf',
SIZE = 1MB,
MAXSIZE = 10MB,
FILEGROWTH = 10%),

( NAME = MultiFile3,
FILENAME = N'e:MSSQLDataMultiFile3.ndf',
SIZE = 1MB,
MAXSIZE = 10MB,
FILEGROWTH = 10%),

( NAME = MultiFile4,
FILENAME = N'e:MSSQLDataMultiFile4.ndf',
SIZE = 1MB,
MAXSIZE = 10MB,
FILEGROWTH = 10%),

( NAME = MultiFile5,
FILENAME = N'e:MSSQLDataMultiFile5.ndf',
SIZE = 1MB,
MAXSIZE = 10MB,
FILEGROWTH = 10%)

LOG ON
( NAME = MultiFile_Log,
FILENAME = N'e:MSSQLDataMultiFile_Log.ldf',
SIZE = 1MB,
MAXSIZE = 10MB,
FILEGROWTH = 10%)
GO



I have tried the following backup script:


BACKUP DATABASE MultiFile
FILE = 'MultiFile',
FILE = 'MultiFile2'
TO Backup01
WITH
INIT

BACKUP DATABASE MultiFile
FILE = 'MultiFile3',
FILE = 'MultiFile4'
TO Backup02
WITH
INIT

BACKUP DATABASE MultiFile
FILE = 'MultiFile5'
TO Backup03
WITH
INIT


And here is the restore script:


RESTORE DATABASE MultiFile2
FILE = 'MultiFile',
FILE = 'MultiFile2',
FILE = 'MultiFile3',
FILE = 'MultiFile4',
FILE = 'MultiFile5'
FROM Backup01, Backup02, Backup03
WITH MOVE 'MultiFile' TO 'E:MSSQLDataaMultfile.mdf',
MOVE 'MultiFile2' TO 'E:MSSQLDataaMultifile2.mdf',
MOVE 'MultiFile2' TO 'E:MSSQLDataaMultifile3.mdf',
MOVE 'MultiFile2' TO 'E:MSSQLDataaMultifile4.mdf',
MOVE 'MultiFile2' TO 'E:MSSQLDataaMultifile5.mdf',
MOVE 'MultiFile_log' TO 'E:MSSQLaMultFile_Log.ldf'


However, running the Restore script generates the following error:


Server: Msg 3259, Level 16, State 1, Line 1
The volume on device 'Backup02' is not part of a multiple family media set. BACKUP WITH FORMAT can be used to form a new media set.
Server: Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.


I'm not sure what to make of this. What do I need to alter in either the backup script or the restore script to make this work?

I am trying this because my objectives are to:
1. Limit the amount of work that the server is performing during any one given backup session. The idea that I have is to backup the database in chunks using a rolling 3-5 day window.
2. The database must be up and operational 7x24x365 (except for one 4 hour window each month)
3. This is not the long-term solution; but I need something to tide us over until we can purchase additional storage capacity.


I appreciate any thoughts and or guidance you can provide.

Regards,

hmscott

View 2 Replies View Related

Backup Individual Files Vs Whole Database

May 10, 2007

We have a pretty large SQL Server database, just shy of 400 GB. It is divided up into 24 different data files. The previous DBA here said it is faster to backup the backup individual data files to seperate files. So what he did was issue 6 backup statements like the one below as a step in an agent job.

BACKUP DATABASE MYDATABASE
FILE = 'Data',
FILE = 'data2',
FILE = 'data3',
FILE = 'data4'
TO Data1_4
WITH FORMAT

Next step:

BACKUP DATABASE MYDATABASE
FILE = 'data5',
FILE = 'data6',
FILE = 'data7',
FILE = 'data8'
TO Data5_8
WITH FORMAT

etc.. in sequence.

What I question is how this is faster than just issuing a backup for the whole database? Has anyone ever ran into this before?

- Eric

View 9 Replies View Related

Backup SQL Database Files With Vb.net 2005

Mar 17, 2008

I am trying to backup the sql database files from a local computer to a server location through vb.net 2005. Is there a simple way to do this? Every time I try to detach the database, I cannot because the database is in use. Is there something I am missing with this?

Thanks

View 5 Replies View Related

I Dont Have Any Backup Of My Database, But I Have The Mdf's And Ldf's Files

Jul 23, 2005

Im trying to recover my database using the mdf and ldf files.I dont have any backup and i have recovered two of the mdf files usinga tool which "discovers" deleted files after hard drive formatting...It sounds cool, isnt it...:? :(Obviously, i get a "suspect" message when the server starts and the logfile says this kind of things:·"Full PathName.MDF is not a primary database file." (This is one ofthe files repaired using the magic tool.·Error: 823, Severity: 24, State: 6·"I/O error (torn page) detected during read at offset0000000000000000 in file 'Full PathiName2.mdf'... Name2.mdf is thesecond file·Device activation error. The physical file name 'Full PathName2.mdf'may be incorrect.When i try to execute the command "DBCC CHECKDB ('Database_Name') WITHPHYSICAL_ONLY" i get the following message :·Could not open FCB for invalid file ID 0 in database 'Logs'.Do you have any ideas? Thank you very much...:D

View 2 Replies View Related

DB Engine :: Restoring A Backup Of Server

Nov 21, 2015

I am restoring a backup of sql server 2005 which I inherited on to sql server 2012 and is in a recovery pending state and the reason why is, this is a backup from a different domain and does not have the logins from the legacy domain, looks like its some access issue as its not being able to find the necessary login on sql server 2012.

View 4 Replies View Related

DB Engine :: Copy Files From Source Server On Destination Server

Sep 25, 2015

I want to schedule a job which pulls files from a non SQL server (Sybase) which later needs to have a step 2 kicking the ssis package. Problem is that, on the source a batch file will run every 4 hours and outputs total of 10 text files. (takes 5 minutes complete). Now, on destination i want to pull these files via SQL job but while scheduling;

1. I don't see any option saying like 4 hours 10 minutes or so
2. If its out there, then i believe this might be a problem as this time would be an increment one e.g next run would be 4 hours 20 minutes in that case.

How should i achieve pulling these files up because we have an SSIS package on destination that needs those text files to be used as soon as they arrive on SQL server(destination)

View 2 Replies View Related

How To Backup A Database Into A Number Of Smaller Files ?

Jul 23, 2005

To all,How to backup a database into a number of smaller files ?For example, can I can fully backup a DB of 10 MB into 10 files (each 1MB)???The problem I've met is that the DB backup file is too large, over 4GB, and even Winzip can't compress it (after compressing, around 80 %of compression rate is possible)Thanks![color=blue]>From Jason (Kusanagihk)[/color]

View 11 Replies View Related

DB Engine :: Receive Backup Failed For Server

Oct 6, 2015

I have a VM with Windows Server 2012 and SQL 2014 installed.  Some things about the VM:  Using VMware Workstation 11.  Created with 160 GB hard disk and 4G memory (that's all we could do when needing to run multiple VMs from the box we're using).  I am able to get to the internet and to our network but the internet connection tells me that there is no internet access and we can't seem to fix it.When I attempt to create a backup of one of my DBs, I receive the attached error.  No other backup has been created for this particular DB so it would not need to overwrite anything.  This is an issue for all of the DBs that are in the SQL Server and not just an isolated DB.

We ran DBCC CHECKDB against the DB and no errors were returned.A bit about the DBs:  Our software creates a number of empty DBs upon install.  For testing purposes we have DBs that are populated with data that we restore once the install is complete.  So our procedure is, once all services are shut down for our software and the SQL connection has been cut, we delete the DBs created during install and restore the DBs that will replace them. All of the DBs restored successfully so I don't understand why there would be an issue with backing them up. 

View 8 Replies View Related

Seagate Backup Exec Will Not Copy DAT Database Files

Feb 10, 1999

We are having a problem with trying to backup the database device and log DAT files located in the MSSQLData directory.
The Seagate Backup Exec. states that the files are busy and skips them during its backup cycle. It skips all the devices in the
directory.

Any suggestions?

View 3 Replies View Related

Need Suggestion For BACKUP And Database Files On RAID 5 Configuration....!

Sep 10, 2007

I have RAID 5 with 1 logical drive with 2 partitions with SQL Server 2000 running on SERVER.

what best model for data storage and backup would some experienced one suggest:

basically I want to put Master, Database files and T-Log files away from each other.

-- Data files
-- Log files
-- Master database.

Thanks,

Fahim.

View 1 Replies View Related

DB Engine :: Restore Backup File To Remote Server

Jul 8, 2015

I am working on a project for an SQL job. I am:

1.) Taking a database out of an availability group,
2.) Setting the recovery to simple,
3.) Shrinking the log file,
4.) Setting the recovery mode back to full,
5.) Then backing it up.

I need to restore the file to my secondary server with replace and non recovery mode. I am having trouble performing that call?  I have the code to reestablish the database to the availability group if I can get the restore feature working. 

View 11 Replies View Related

DB Engine :: Backup On Remote Server - Access Error

Nov 12, 2015

I am trying to make my maintenance plan to backup on a remote server but it fails with:

"failed with the following error: "xp_delete_file() returned error 2".

I am pretty sure its because it doesnt have full access to the share folder... My question is, how can I grant access to it, if I am using a local account as sql agent service: NT ServiceSQLSERVERAGENT.I need to change the service account?

View 13 Replies View Related

DB Engine :: Take Only Last 1 Year Data Backup Using Script From Server

May 20, 2015

I have last 5 years data in my database(SQL server).

I want to take backup only last 1 year(last 365 days) data using SQL script.

View 6 Replies View Related







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