SQLEXPRESS Backup File Losing NETWORK SERVICE User When Copied

Mar 11, 2008

I'm using the methods of the Microsoft.SqlServer.Management.Smo namespace within a .NET application to create a backup file from a SQLEXPRESS database. I can then restore the database from that backup device using methods in the same namespace. Here is a snippet from the restore code:


srv = New Server("MYPCSQLEXPRESS")

db = srv.Databases("washmaster")

Dim bdi As New BackupDeviceItem(BackupFileName, DeviceType.File)

Dim recoverymod As RecoveryModel

recoverymod = db.DatabaseOptions.RecoveryModel

rs.NoRecovery = False

rs.Devices.Add(bdi)

rs.Database = "washmaster"

rs.ReplaceDatabase = True

srv.KillAllProcesses("washmaster")

rs.SqlRestore(srv)


This works great as long as I used one of the backup files that I created directly on the disk. However, my application has a utility that allows the user to copy the backup files onto another drive, such as a CD or a thumb drive and when I try to restore from the copy of the backup, I get the following exception:

....Cannot open backup device..[filename]...Operating system error 5(Access is denied.)

The reason I get this error is that the "NETWORK SERVICE" account was removed from the file permissions when the file was copied.

How can I copy a backup to another drive and preserve the "NETWORK SERVICE" account? If I can't do that, is it wise to try to add the account back to the file before using it to restore or is there a better way?

Thanks,
SJonesy

View 3 Replies


ADVERTISEMENT

Transact SQL :: Script That Creates User Mapping For Network Service

Aug 20, 2015

SQL script that creates a User Mapping for NT AUTHORITYNETWORK SERVICE to a database?

View 3 Replies View Related

Unable To Start SQL Express 2005 Service As A Network User

Oct 4, 2007

I am trying to start ms sql server 2005 express as a network user from originally starting as local system. I cannot start the service.

I have given this network user administrator access to sql express from the sql server surface area configuration "Add New Administrator". I have went into the local users/groups and added this network user to the 3 security groups

SQLServer2005MSSQLServerADHelperUser$SQL1
SQLServer2005MSSQLUser$SQL1$SQLEXPRESS
SQLServer2005MSSQLBrowserUser$SQL1


I receive one alert int he event logs/application

EventID: 26010

The server could not load the certificate it needs to initiate an SSL connection. It returned the following error: 0x8009030d. Check certificates to make sure they are valid.

I receive five errors in the event logs/application

EventID: 26014

Unable to load user specified certificate. The server will not accept a connection. You should verify that the certificate is correctly installed. See "Configuring Certificate for Use by SSL" in Books Online.

EventID: 17182

TDSSNIClient initialization failed with error 0x80092004, status code 0x80

EventID: 17182
TDSSNIClient initialization failed with error 0x80092004, status code 0x1

EventID: 17826

Could not start the network library because of an internal error in the network library. To determine the cause, review the errors immediately prceding this one in the error log.

EventID: 17120

SQL Server could not spawn the FRunCM thread. Check the SQL Server error log and the Windows event logs for information about possible related problems.

I don't recall assigning any sql specific certificates. The reason I'm trying to run this as a network user is because an application on a remote windows server requires it.

After starting the service back running as local system as it was before, I went into the
SQL Server Management Studio Express and edited the properties for this new network user I wish to run the service as. I gave him full access including checking all grants in securables.

I now see a bit of a difference in the event logs with these errors.

EventID: 17058

initerrlog: Could not open the log file 'c:Program FilesMicrosoft SQL ServerMSSQL1MSSQLLOGERRORLOG.' Operating system error =5(Access is denied).

I saw a notification when changing the sql server service's logon that the new network user has been granted the log on locally right.

The second and last new error is

EventID: 17053

UpdateUptimeRegKey: Operating system error 5(Access is denied.) encountered.

View 6 Replies View Related

How To Grant 'Network Service' Or 'ASPNET' User Accounts Permissions To Connect To Database

Feb 18, 2008

set up asp .net user account on sql server 2005Question:

I've read the instructions in this article: http://www.netomatix.com/Development/aspnetuserpermissions.aspxBut do not know how to do this:You can grant 'Network Service' or 'ASPNET' user accounts permissions to connect to database.Please provide example on how to do this, thanks!

View 2 Replies View Related

Backup Files In Append Mode To Be Copied.

Oct 18, 2007



Hi,

I have a database on sqlserver 2005.I usually take a full db backup and sequential transaction log backups and append each of the backups it to a backup file.Now if i want to copy my second transaction log file to a specific folder on my server.Do we have any procedure to do it.

Regards
Arvind L

View 3 Replies View Related

Attach Db File Copied Previously

Jul 20, 2005

I got a mdf file from my co-workerwho just stopped SQL server and delete ldf fileand give me a mdf file.if it was detached, it would work finebut it was just copied.Is there any way to attach this mdf file?I tried sp_attach_db and sp_attach_single_file_dband both failed.thanks,

View 4 Replies View Related

Recovery :: Backup File Works Fine From Network But Not When Moved Into Sandbox Environment

Dec 3, 2014

We have a valid full backup of a database. We know it is valid, we have restored it twice from the network with no problems, but we do not have access to the network location from our sandbox environment.

The .bak file is sizable at about 9GB. The .bak file resides on our internal network, in a SAN drive. No problems there. When we copy the file from there into a sandbox environment to attempt the restore in the sandbox environment it gets corrupted. We've tried three different times and all three different times it gets corrupted. First time we copied the file over to the sandbox the restore went up to 50% and failed. The second time we copied the file again and attempted the restore again it failed at 70%.

The third time it failed at 60%. The error message we get during the restore is "...Read on ... failed: 13(The data is invalid) Msg 3013, Level 16, State 1, Line 1 Restore database is terminating abnormally."

Now some background here. To move the file our network team is doing this: they have this .vmdk file that they mount out in our production environment (which has access to the network location where the .bak file is), copy the file into the drive, then move the .vmdk file into the sandbox environment(which does not have access to the network location), mount the drive in the sandbox environment, and then I have access to the .bak file from within the sandbox environment.

Something in the process of using the .vmdk file to move the .bak file from production into the sandbox is causing the file to get corrupted.

View 13 Replies View Related

The SQL Server (SQLEXPRESS) Service Terminated With Service-specific Error 10013.

Jul 12, 2007

I have an almost virgin install of SQLExpres running on a WIN2K Pro system.

Have been able to create and connect db to Access 2000 without problem.



Now I wish to extend to remote connections. Using Surface Area Configuration tool, I changed Remote Connections to Local and Remote.

Whenever this setting contains TCP/IP and I try to restart the service I receive the following errors:



System Log:



The SQL Server (SQLEXPRESS) service terminated with service-specific error 10013.



Application Log:



Server TCP provider failed to listen on [ 'any' <ipv4> 0]. Tcp port is already in use.



TDSSNIClient initialization failed with error 0x271d, status code 0xa.



TDSSNIClient initialization failed with error 0x271d, status code 0x1.



Could not start the network library because of an internal error in the network library. To determine the cause, review the errors immediately preceding this one in the error log.



SQL Server could not spawn FRunCM thread. Check the SQL Server error log and the Windows event logs for information about possible related problems.





If I change back to Local Connections Only or Local and Remote using named pipes only, the service starts up again without a problem.



After five days of investigating, researching, reinstalling and waiting I have to ask for help.



Any suggestions or leads?



Thank You in advance.

View 14 Replies View Related

Using SQLExpress On A Network

Oct 26, 2006

Hi,

I have a VS2005 application that I run with a SQL server 2003 database.

In order to make the application distributable, I'm trying to get it to run with SQLExpress.

I've installed SQLExpress on a spare machine and changed the connection string in my application to use SQLExpress c:databasesmydatabase.mdf (and the database is obviously in that location!). This works fine on the spare machine.

However the problem is getting the application to run on another machine but using the same database. I note that SQLExpress won't let me put the database on a networked drive.

On another machine I've also installed SQLExpress, I've enabled the tcpip stuff and the browser but to be honest don't really know what I'm doing!

How do I set up additional machines to use the database on the original PC? What do I put in my connection string? If I leave it as it is won't it look for the database on it's own local disk?

Any pointers much appreciated!

View 13 Replies View Related

Network Access SQLExpress

Jan 16, 2006

I am  trying to access a SQLExpress database on another computer on my LAN.  Using Windows Authentication. I don't really want to go to Mixed Mode authentication as I understand it involves a registry tweak and creating a new user. I am a novice at this.

Getting the following error on running the connection code below:

SQLException was unhandled "Login failed for user 'D37YKC1SGuest'."

No doubt it is a security problem but I am not sure how to get around it.  Any help appreciated.

Connection code:

Dim conn As New SqlClient.SqlConnection

conn.ConnectionString = "Server=D37YKC1SSQLEXPRESS;Integrated Security=True;Database=VBNMDATA"

conn.Open()

Tried the following which is my Windows logon on the other computer (blank password) but same error:

conn.ConnectionString = "Server=D37YKC1SSQLEXPRESS;Integrated Security=True;Database=VBNMDATA; User Id=Geoff; Password="

I have TCP/IP enabled in SQL Express  and the firewall is off.  I can see the server on the other computer with this code:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

' Retrieve the enumerator instance and then the data.

Dim instance As SqlDataSourceEnumerator = _

SqlDataSourceEnumerator.Instance

Dim table As System.Data.DataTable = instance.GetDataSources()

' Display the contents of the table.

DisplayData(table)

End Sub

Private Sub DisplayData(ByVal table As DataTable)

For Each row As DataRow In table.Rows

For Each col As DataColumn In table.Columns

MessageBox.Show(col.ColumnName.ToString & " " & row(col).ToString)

Next

Next

End Sub

View 7 Replies View Related

Losing Oracle User Name And Password

Mar 17, 2006

I have written a simple SQL Server 2005 package to pull some data from Oracle (using ODBC) and pumping it into SQL Server. When I run it from the server in debug mode in VS it works fine. When I schedule the job it errors out with "ora-01005: null password given; logon denied." The password is there. Has anyone experienced this? Is there a security setting somewhere preventing me from saving passwords? Is there a work around? Thanks.

View 2 Replies View Related

Share May Sqlexpress 2005 On Network

Apr 1, 2008

how can Share may sqlexpress 2005 on network   that other can access my databasess on their pc and edit update and insert recored into my table
please tell me how can do this ?

View 2 Replies View Related

Connect To Sqlexpress From Network Computer

Mar 3, 2007



Hi

Please if any one can answer.I am developing .net vb app sqlexpress database.

In single user work ok.In multiuser from other computer on network I cannot get data.Any form without data workok fine . The error I am getting is as follows.



Application attempted to perform operation not allowed by the security policy.

request for permission of type

'System.data.sqlclientpermission,system.data,

version=2.0.0.0.,culture=Normal, publickeytoken=b77a5c561934e089'

Zaabdullah











View 1 Replies View Related

SQL Server 2000 TempDB User Losing Permissions

Jan 15, 2007

I am supporting a system that needs to allow users to have access to TempDB.

I set these users up using the GUI, but whenever the server is restarted, these users permissions are wiped out and the db_owner permission is lost and I have to manually go in and apply the permissons for the database to work again, it happens on most reboots but not all.

Is there anyway to keep these users permissions when the server is rebooted?

Your help is most appriciated.

P.S Could I create a stored procedure that when ever the Server is rebooted the procedure would recreate these permissions?

If I need to do this how would I go about doing this?

View 8 Replies View Related

Help:SQLExpress User Instance Fails For Normal User; Works For Administrator

Jan 22, 2008

I'm using the RTM version of Visual Studion 2008 and SQLServer Express.

Logged in as an administrator, I can create a connection to an mdf file and all is well.

As a normal user, attempting to create a connection gives the message "sqlservr.exe has stopped working A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available."

I have tried this with UAC turned on and turned off. The result is the same. In Services I can see that SQLEXPRESS is running, but each time I try to connect, I get the "stopped working" message.

For existing database programs that have the .mdf file stored in the project folder, I can run the program in the VS IDE on my XP machine and on my Vista machine as administrator, but not as a normal user.

I'm not looking for a workaround to make this work once, but the cause and solution to the problem. This is for an introductory VB textbook and we must be able to move a database program from one machine to another and make it work. Everything I have read says that SQLExpress should be able to do that.

Can anyone help me with this?

Judy Fraser

View 26 Replies View Related

Running SQL Service Under Network Service Account

May 15, 2007

Microsoft recommends that you do not use the Network Service account to run the SQL Server service (see http://msdn2.microsoft.com/en-us/library/ms143504.aspx).



Can anyone tell me what the drawbacks are of doing this?

View 1 Replies View Related

Convert A SQLExpress File Based DB Project To SQLExpress Server DB Project

Jul 1, 2006

Hi All,I've been struggling with this for hours...Could someone please advise me on how to convert my current File based SQL Server Express website to a Server based SQL Express one.Particularly interested in what I need to do in the SQL Express management tool, changes I need to make the projecvt itself and changes needed to get IIS to understand things have been changed.Thanks,Martin.

View 1 Replies View Related

Losing Config File Between Child Packages And *$##@!- Passwords!

Feb 5, 2007

I have a parent package that uses Execute Package Task against three child packages. They are all setup to use the same configuration file, and the packages are all located in the same folder. Purpose of the configuation is to use the same connection strings for each child package.

I removed the path from the config. file specification to facilitate deployment. During debugging, the child packages cannot find the config file when they are run via the parent unless the full path is specified. If run standalone, a child package can find the config. file without the path. As I said, all dtsx filaes and the config file is in the same folder.

Also, the password-removal issue is killing me in development. Everytime I touch the config. file, it removes the password from the connection string. I have "protection level" set to "don't save sensitive" - I'd appreciate help with this too.

thanks

View 8 Replies View Related

Losing Rows From File To Destination Table - Need Troubleshooting Help

May 30, 2006

I am losing data from time to time and can not figure out where the rows are vanishing to. In essence, I have 5 files that I process. The processing occurs on a daily basis by one SQLAgent job that calls 5 individual packages, each doing a different piece of work.

I stage each file to a temp table, then perform some minor transformations, then union the rowsets from each file before landing to another temporary table. A subsequent package performs additional transformations that apply to the entire dataset, before inserting them to their final destination. Along the way, I reject some records based on the business rules applied. Each package in the entire Job is logging(OnError, TaskFailed, Pre and Post execute). Their are no errors being generated. No rows are being rejected to my reject tables either.

Without getting into the specific transforms, etc. being used in this complex process, has anyone seen similar unexplained behaviour? I've not been able to identify any pattern, except that it is usually only 1 or 2 of the record types (specific to a source file), that will ever not be loaded. No patterns around volumes for specific source files. There are some lookups and dedupes, however I've seen the records 'drop off' before reaching these transforms. I have noticed I had my final desination load not using fast load. However sometimes the records disappear before even getting to my final staging table which is inserting using fast load. I am going to turn on logging the pipelinerowssent event. Any other suggestions for troubleshooting/tracking down these disappearing records?

Thanks

View 3 Replies View Related

Cannot Start SQLExpress Service

Apr 21, 2008

I had a working VS Express 2005 system 2 years ago and have not done any development on it since. Recently I wanted to enhance the application I had developed and so updated my system to VS EXpress 2008 and now can't start my database service. What do I need to do to get access to my database again?

I am running on an up to date Windows XP Pro system




Dennis J.

View 9 Replies View Related

SQLEXPRESS Service Started And Then Stopped! Plz Help, Its Urgent!

Mar 9, 2008

Hi,
My SQLEXPRESS service suddenly gives me this error.
ERROR: The SQL Server(SQLEXPRESS) service on Local Computer started and then stopped. Some services stop automatically if they have no work to do, for example, the Performance Logs and Alerts service.
My OS is Microsoft Windows Server 2003, Enterprise Edition, SP2.
It all started when I restarted the system prompted by the Windows updates.
Please help. Its urgent as this is one of the important servers to be managed.
Thanks and Regards
Madhu

View 3 Replies View Related

BackUp SQLEXPRESS Mdf Files

Sep 28, 2006

Hi All,I searched the archives but I could not find any useful stuff for me.I can backup a database on SQLExpress like USE masterEXEC sp_addumpdevice 'disk', 'Store_1', 'c:Store_1.dat'BACKUP DATABASE Store TO Store_1Here is my problem: If I use logins,roles etc. in an application automatically a mdf file is created. Or I can create a new sql database.  SQLExpress dynamically use the mdf file when connection string defined. This mdf file is not defined as a database on SQLExpress. Because SQLExpress has not a gui, I cannot see the registered database.  How can I backup any sqlexpress mdf file without deattaching or attaching?Thanks

View 2 Replies View Related

Cross-database Stored Procedure Stops SQLEXPRESS Service

Feb 22, 2008

I've written a stored procedure that copies records from tables in one database to the same tables in another database. Here is a snippet for a single table:


delete from washmaster_mirror.dbo.batches

DBCC CHECKIDENT (washmaster_mirror.dbo.batches', RESEED, 0)

alter table washmaster_mirror.dbo.batches disable trigger tr_BATCHES_INSERT

alter table washmaster_mirror.dbo.batches disable trigger tr_BATCHES_UPDATE

insert into washmaster_mirror.dbo.batches(processorid,batchnum,processdate,transcount,batchamount,dtmCreate,dtmUpdate,keypreserve)

(select processorid,batchnum,processdate,transcount,batchamount,dtmCreate,dtmUpdate,[ID]

from washmaster.dbo.batches)

alter table washmaster_mirror.dbo.batches enable trigger tr_BATCHES_INSERT

alter table washmaster_mirror.dbo.batches enable trigger tr_BATCHES_UPDATE


This kind of block is repeated in the same stored procedure for each table. There are 20 tables populated this way. The idea is to copy records from the working (washmaster) database to a mirror (washmaster_mirror) database then back up the mirror database so I can avoid having down time during the back up process (due to database locking).

The problem I have is that the above stored procedure sometimes causes the SQLEXPRESS service to stop, thus the Sql Express connection to break. I've checked the error logs and the event log (I'm running on Windows Vista) and nothing sheds light on the issue. When I originally coded the stored procedure I surrounded it by a TRY - CATCH block, which forced it to lose the connection every time. When I eliminated the TRY - CATCH block the broken connection issue became rare, but still occurs occasionally. Any ideas why this might be occuring or what I can do to solve it?

Thanks,
SJonesy

View 5 Replies View Related

How Do I Add ASPNET User To SQLExpress DB?

Sep 1, 2006

I am going though the ASP.NET QuickStart tutorials.  One of the lessons is to add a datagrid.  I am able to do that with VWD and am able to connect to the database in VWD.  However when I try to execute the application I get a "Login failure" message because the user pcName/ASPNET cannot login. How do I add the ASPNET user to the SQLExpress database?  There don't seem to be any administration tools that were installed with SQL Server Express 2005. Thanks in advance for the help!

View 3 Replies View Related

How To Add Aspnet User To Sqlexpress

Apr 15, 2007

Hi guys
 
I am trying to add aspnet user to sqlexpress. I am able to select the asp.net however when I click on OK button,
it is asking me to enter a name for it. COuld you tell me what name I should enter? I tried computernameaspnet didn't help?
 is there better way to do this?
 thanks for your help
Cemal

View 1 Replies View Related

Backup Sqlexpress 2005 To A 2000 Database -

Jan 14, 2008

I have sqlexpress 2005 on my local machine - but my hoster has sql 2000 - so i used the DB publishing wizard to create the script and sent it over to them - they are now saying that they need a .bak file in 2000 to host my database - is this a bunch of horse hockey or not?
if this is legit - any ideas on how I can create a .bak 2000 sql from sqlexpress 2005?
 
many thanks

View 5 Replies View Related

SQLExpress, User Instance And Detach

Feb 17, 2006

Basically I need to know how to detach a db from a user instance of SQL Express from inside a VS2005 windows forms application.

The application is project oriented and the design calls for each project to be stored in its own separate .mdf file. When the user wants to switch projects the application will detach the current database and attach a different one, containing the data for the desired project.

I have this working fine with the default (.SQLEXPRESS) db instance, but I am having a problem getting the code to work with a SQL Express user instance (also part of the specification).

I am using the SMO library to do the Detach, and this works fine with the default instance, but for the user instance I am unable to connect to the necessary (user) instance of the db server.

I have tried selecting the instance name from dm_os_child_instances on the default instance and using the dynamically generated instance name to create the Server object. I get a good instance name, but when I create the Server object, the connection fails. I have also tried issuing "sp_detach_db" on the user instance, but this fails because the db is in use.

Any ideas would be greatly appreciated...

View 3 Replies View Related

User Account Per SQL Server Service && SQL Agent Service, Why?

Jul 30, 2007

Hi all,
 I do understand that it is highly recomended to have aserprate user (perfered a domain user account) for each of the SQL Server service and SQL Agent service.
What is the reason behind that? (Someone told me to not run the service with an account that has a powerul privilegs! - I don't undrstanmd this point can you explain it please?)
What is the diffrent between: 1- Local System account 2 -Network Service account
 
Thanks in advanced!
CS4Ever

View 4 Replies View Related

Enabling ASPNET User To Access SQLEXPRESS

May 28, 2005

Im getting ASP.Net 2.0 Beta 2 setup on my home machine to kick around
with.  Im assuming this error means i have SqlServer Express
mis-configured for integrated security.  if so, how do i go about
making sure that the ASPNET user has at least read access to the
Database?
 Error Message wrote:
Server Error in '/Kinetic' Application.

Cannot open database "aspnetdb" requested by the login. The login failed.Login failed for user 'GAMESASPNET'.



Description: An
unhandled exception occurred during the execution of the current web
request. Please review the stack trace for more information about the
error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Cannot open database "aspnetdb" requested by the login. The login failed.Login failed for user 'GAMESASPNET'.

Source Error:




Line 13: protected void Page_Load(object sender, EventArgs e)Line 14: {Line 15: Membership.CreateUser("jeff", [password], [email]);Line 16: }Line 17: }







Source File: c:InetpubKineticDefault.aspx.cs    Line: 15

View 3 Replies View Related

SQL Network Backup

Jun 25, 2002

How do I backup SQL Server databases to disk over my network?

View 4 Replies View Related

Network Backup

Nov 23, 1998

i try to create a dump device on a drive remote from the sql server(6.5),using machinenamefolderdump.dat. it creates the dump but when i tried to initial the backup it gives and error system that the device is offline. thanks in advance

View 1 Replies View Related

Network Backup

May 15, 2008

Is it possible to have individual backup file for each DB, possibly in the form of DB_Name_YYYYMMDD.BAK while backing up on – NETWORK?

------------------------
I think, therefore I am - Rene Descartes

View 9 Replies View Related

Backup On Network!

Jul 23, 2005

hello group,a few days ago i used the following backup statement and everthingworked fine:sp_addumpdevice 'disk','pipedump','\192.x.x.xLData est.bak'Backup database Test to pipedumpThe same statement is not working today!!!!!What's the reason?Please dont tell me that check if the network path exists or not! I'vechecked the path and permissions. Everything is ok!Thanks in advanceDebian*** Sent via Developersdex http://www.developersdex.com ***

View 11 Replies View Related







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