Showing posts with label network. Show all posts
Showing posts with label network. Show all posts

Wednesday, March 28, 2012

Restoring to a network paths?

I'm getting the error "The file \\xxx... is on a network path that is not supported for database files. File xx cannot be restored to \\xx..... Use WITH MOVE to identify a valid location for the file. Below is my code for the restore. I've even shared the folder on the network but still no success.

Try
Dim restoreToServer As New Server("xxxx")
Dim rest As New Restore
rest.Devices.AddDevice("\\xx\x$\Program Files\Microsoft SQL Server\MSSQL\BACKUP\myData\myData.BAK", DeviceType.File)

rest.Action = RestoreActionType.Database
rest.Database = "myDatabase"
rest.NoRecovery = False
rest.ReplaceDatabase = True

rest.RelocateFiles.Add(New RelocateFile("myData", "\\xx\data\myData.mdf"))
rest.RelocateFiles.Add(New RelocateFile("myData_log", "\\xx\logs\myData.ldf"))

rest.SqlRestore(restoreToServer)
Catch ex As Exception
MessageBox.Show(ex.InnerException.ToString)

End Try

Can you run a database from a network path?

Why would you want to do it?
|||

We are running the vb app on a desktop. To connect to the production db we issue smo commands. Those commands will backup the production database and then we need to do a restore on another database. To connect to any of the two mentioned we connect using \\host-machine\drive$ but this does not work.

|||That what is wrote for placing data files on a network shares some days ago:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=477137&SiteID=1

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

Wednesday, March 21, 2012

Restoring replication

I have a problem that needs tip: Our main replica server need to be restored.
It has been the main server within a network using merge replications between
around 10 servers with publications and push/pull subscriptions. Now listen
the server was stolen and I need to restore (I got the all the *.mdf files on
a separate ghost-disk) the server. I need some good advice on how to restore
properly. I have also backup-files from all replica-databases plus master
database and distribution database. But I have not any backup on the
MSDB-database. Suggestions?
Best wishes
Basically you are hosed. All of your merge agent job information is gone.
You will have to drop your publications and subscriptions and rebuild from
scratch.
Hilary Cotter
Looking for a SQL Server replication book?
Now available for purchase at:
http://www.nwsu.com/0974973602.html
"Mats" <Mats@.discussions.microsoft.com> wrote in message
news:787985FB-1CA8-47E3-8B00-0575443082D4@.microsoft.com...
>I have a problem that needs tip: Our main replica server need to be
>restored.
> It has been the main server within a network using merge replications
> between
> around 10 servers with publications and push/pull subscriptions. Now
> listen
> the server was stolen and I need to restore (I got the all the *.mdf files
> on
> a separate ghost-disk) the server. I need some good advice on how to
> restore
> properly. I have also backup-files from all replica-databases plus master
> database and distribution database. But I have not any backup on the
> MSDB-database. Suggestions?
> --
> Best wishes

Friday, March 9, 2012

restoring from network drive

Ok -I'm drawing a huge blank.
After a new install of SQL2K and SP3a, I'm unable to restore a backup from a
network drive.
SQL services are logging on with a domain account
The SQL service account has also been granted Local admin access on the PC
When trying to restore a database from Device, the only drive listed is the
local C: drive - none of the mapped drives are available.
JTTry entering a UNC name for the name of the backup, something like:
\\backupserver\sharename\backup\database
.bak
Also note the MSSQLSERVER service account will need access to the network
share.
----
----
--
Need SQL Server Examples check out my website at
http://www.geocities.com/sqlserverexamples
"JT" <JT_*n*o*s*p*a*m*Goalie33@.cox.net> wrote in message
news:WAZzc.4489$cj3.1501@.lakeread01...
> Ok -I'm drawing a huge blank.
> After a new install of SQL2K and SP3a, I'm unable to restore a backup from
a
> network drive.
> SQL services are logging on with a domain account
> The SQL service account has also been granted Local admin access on the PC
> When trying to restore a database from Device, the only drive listed is
the
> local C: drive - none of the mapped drives are available.
> JT
>

restoring from network drive

Ok -I'm drawing a huge blank.
After a new install of SQL2K and SP3a, I'm unable to restore a backup from a
network drive.
SQL services are logging on with a domain account
The SQL service account has also been granted Local admin access on the PC
When trying to restore a database from Device, the only drive listed is the
local C: drive - none of the mapped drives are available.
JT
Try entering a UNC name for the name of the backup, something like:
\\backupserver\sharename\backup\database.bak
Also note the MSSQLSERVER service account will need access to the network
share.
----
Need SQL Server Examples check out my website at
http://www.geocities.com/sqlserverexamples
"JT" <JT_*n*o*s*p*a*m*Goalie33@.cox.net> wrote in message
news:WAZzc.4489$cj3.1501@.lakeread01...
> Ok -I'm drawing a huge blank.
> After a new install of SQL2K and SP3a, I'm unable to restore a backup from
a
> network drive.
> SQL services are logging on with a domain account
> The SQL service account has also been granted Local admin access on the PC
> When trying to restore a database from Device, the only drive listed is
the
> local C: drive - none of the mapped drives are available.
> JT
>

restoring from network drive

Ok -I'm drawing a huge blank.
After a new install of SQL2K and SP3a, I'm unable to restore a backup from a
network drive.
SQL services are logging on with a domain account
The SQL service account has also been granted Local admin access on the PC
When trying to restore a database from Device, the only drive listed is the
local C: drive - none of the mapped drives are available.
JTTry entering a UNC name for the name of the backup, something like:
\\backupserver\sharename\backup\database.bak
Also note the MSSQLSERVER service account will need access to the network
share.
--
----
----
--
Need SQL Server Examples check out my website at
http://www.geocities.com/sqlserverexamples
"JT" <JT_*n*o*s*p*a*m*Goalie33@.cox.net> wrote in message
news:WAZzc.4489$cj3.1501@.lakeread01...
> Ok -I'm drawing a huge blank.
> After a new install of SQL2K and SP3a, I'm unable to restore a backup from
a
> network drive.
> SQL services are logging on with a domain account
> The SQL service account has also been granted Local admin access on the PC
> When trying to restore a database from Device, the only drive listed is
the
> local C: drive - none of the mapped drives are available.
> JT
>|||SQL Server will only show local drives/partitions on the
computer you are trying to restore to...Use UNC names/IP
adresses when restoring from a network drive.
EX:
RESTORE DATABASE MYDATABASE
FROM DISK = '\\SERVER1\D$\Program Files\Microsoft SQL
Server\MSSQL\Backup\MYDATABASE\MYDATABASE.BAK'
WITH
DBO_ONLY,
REPLACE,
STANDBY = '\\SERVER1\D$\Program Files\Microsoft SQL
Server\MSSQL\Backup\MYDATABASE\'UNDO_MYDATABASE.ldf',
MOVE 'MYDATABASE_Data' TO 'D:\Program Files\Microsoft SQL
Server\MSSQL\Data\MYDATABASE_Data.mdf',
MOVE 'MYDATABASE_Log' TO 'D:\Program Files\Microsoft SQL
Server\MSSQL\Data\MYDATABASE_Log.ldf'
e.t.c
>--Original Message--
>Ok -I'm drawing a huge blank.
>After a new install of SQL2K and SP3a, I'm unable to
restore a backup from a
>network drive.
>SQL services are logging on with a domain account
>The SQL service account has also been granted Local admin
access on the PC
>When trying to restore a database from Device, the only
drive listed is the
>local C: drive - none of the mapped drives are available.
>JT
>
>.
>