When I Try To Restore A Database A Message Comes Up Saying That It Is Being Used By Another Program, How Do I Stop This?
Mar 17, 2008
I am reading a guide telling how to create a private server and it says I need to restore the database. So I go to File->Open->File->My Computer->Local Disk->Program Files->Microsoft SQL Server->MSSQL.1->MSSQL->Data->GunzDB. Then the following message comes up: "The file cannot be opened because it is being used by another process. Please close all applications that might access this file and try again."
The question is, how do I get past this? I need the answer as soon as possible, I am a newb with this program so I don't entirely know what I am doing. I have tried searching for the answer, but I cannot find anything.
Thank you.
View 3 Replies
ADVERTISEMENT
May 7, 2007
Hi All,
I have written ETL software that runs on SQL Server. We are running it for the first time on a 4cpu (2 x dual core) machine on sql server 2005.
One of the things this software does is perform a 'select * from tablename' to validate that the tables passed to it as parameters exist. This has worked fine on previous releases and on single cpu machines because what the optimiser decides to do is to return just the first page of data and then fetch more. I guess it even works in 2005 standard edition.
However, 2005 enterprise edition allows parallelism. And what the optimiser is deciding to do with such a query is to parallelise it and fetch all rows and then give the result back to the program. So, instead of seeing a fraction of a second to return the first page of data we are seeing up to 90 seconds and the database goes and fetches 15M rows in parallel.
Obviously, what we would like to do is to somehow tell the optimiser that this set of programs should not perform any parallel queries. Or, we would like to turn parallelism off on the specific tables we are dealing with for the period of running these ETL programs....they have no need of parallel processing at the database level for virtually all the calls that are performed.
Would someone please be so kind as to advise us if we can do something like pass a parameter to ODBC to stop parallelism or if we can issue commands against specific tables to stop parallelism for a period and then turn it back on?
Thanks in Advance.
Peter Nolan
www.peternolan.com
View 4 Replies
View Related
May 8, 2007
I am having difficulty restoring a database (DB_1) with 2 datafiles and one log file, DB Structure is as following:
Filegroup PRIMARY with file name 'fnm_data' with physical file name and location D:dbfile_1.mdf,
Filegroup 'FG1' with file name 'fgnm1_data1' with physical file name and location F:dbfile_FG1.mdf,
One log file with file name 'fnm_log' with physical file name and location (E:loglog_db.ldf)
{Note} Logfile resides on E drive whereas Datafiles reside on several other drives.
I need to restore the DB on another machine. And I need to move the log file to a drive other than E.In this case it is K drive. Hence I have used the following code,
restore log DB_1 from disk='M:kupccciclog.txt'
WITH RESTRICTED_USER , MOVE 'fnm_log'
TO 'K:DBlog_db.ldf', recovery, replace,RESTART
go
When I try to restore from backup files, I keep error message saying "Physical file name E:loglog_db.ldf may be incorrect." 'fnm_log' cannot be restored. Use Move command to identify a valid location for the file.
Even though I am using Move command to move the log file.
Then I found that if I create a drive with E: and a folder named 'log' then restore program runs alright. That is, when E:log exists then code does run smoothly. All the restore code is looking for the presence of path of the log file from where it is been backed up. In this case it is E:log folder. Once the database is restored I could kill that directory and nothing happens. Also log file has been restored on K:DB only.
Why the restore code is looking for the initial drive letter and path even though I have used Move command? Is there an issue in my code?
Any help will be highly appreciated.
View 3 Replies
View Related
Aug 3, 2006
We have automated the process of backing up and restoring the databases. But the problem is One database is restoring from several hrs ..though it is supposed to take only a few mins. So there is some issue with it and I want to find out how I can stop the restoring process.
Its not a command am running in query analyser or Enterprise manager, but its automated so i cant see the command to stop it.
Any ideas?
View 2 Replies
View Related
Aug 13, 2012
How do I stop the restore in the middle?
restore database blah
from disk='mybackups hismonthbackup1.BAK'
with replace, recovery, stats=5, maxtransfersize=1048576
View 3 Replies
View Related
Sep 18, 2001
I have a database in a restore mode. The SQL Enterprise Manager says the database is in a 'Loading' phase. How can this operation be cancelled?
Thanks,
Brian
View 1 Replies
View Related
May 23, 2007
why we use sql exceptions ...
what the program will do if we caught that exception .. i need some suggestions ... i got this exception(String or binary data would be truncated.
The statement has been terminated.).. will it affect the functionality of the program...
hiow can i avoid this exception..
View 1 Replies
View Related
Jan 20, 2005
When I try to do a restore filelistonly I get the following message
[Server: Msg 3624, Level 20, State 1, Line 1
Location: upgraddb.cpp:214
Expression: tableIndex < ARRAY_LEN (upgradeMap)
SPID: 8
Process ID: 216]
I get the same when I try a restore database
The instance is on a xp Pro local desktop which is only new. No database has been restored yet on this instance.
But everything seems to work fine on this instance e.g Northwind, xp_cmdshell etc.
Any help??
Thanks
View 2 Replies
View Related
Mar 19, 2008
I am currently writing a program that will use a SQL database. I am use to writing programs that are used to connect over some type of a network, but for this project I need to be able to load the Database and it's tables to the system locally. If anyone has a suggestion it will be greatly appreciated, or any sites for documentation on it. Thank you.
View 6 Replies
View Related
Dec 22, 2006
I need help to decide how to proceed.
I have written a program using vb 2005 express that will create menu items after the user presses a particular button. So if the user picks a mountain dew then inside the reciept window(list box) the user will see 1 MT DEW $1.00 also as the user selects more items the price is calculated and displayed also.
This part of the program works fine. After using the program for a while I realized that I will need to update prices and be able to add and subtract items from the menu that customers order from. The way I accompolish this now is to go back into my code and rewrite alot of code. From reading the forums I think that a database would be a good solution because what I have gathered so far is that by seperating the data into tables i.e price_table it would be easy to update anything in that table and not have to change the code anywhere else.
I have created a database that contains a table for menu items and each item has a menu_item ID,menu_Name and I also have a Price table and each price now has it's own price_ID
I would like to have code under the button click event like so:
createMenuItem(By Val Food_ID as Database object, By Val Price_ID As Database object)
display(Quantity,Food_Name,Food_Cost)
Food_Cost = Quantity * Price_ID
I know that this code does not work but If someone reading this has any ideas which part of database programming this falls under I could use a nudge in the right direction.
In a nutshell I would like to create menu items using the id's from the database
the data in the database would remain static and would only be used to supply arguements for my procedures and function that I use now.
Any help would be appreciated.
View 3 Replies
View Related
Mar 6, 2008
Hello,
I have been writing this piece of software for quite a while. And as it got bigger and bigger (more forms, more datasets) I started experiencing the following problem.
Well, I use an MDF file as a database container that gets copied to the destination directory after each build.
Well here is what happens:
I launch my application, work with it, search the database and so on and so on.
Then I exit the application.
I launch it again and I get en exception saying that file counld not be located on the disk.
I close the app, and run it again. I get the same thing.
Somtimes after a couple of tries I get an error saying that my user does not have rights to access the default database. (I have windows authentication on SQL server)
Now here is the trick: I open SQL Server Management Studio Express detatch (Delete) the database from the default server (the only one in the system ".SQLEXPRESS") and the application runs again.
What am I doing wrong? How can I programatically detatch the database from the server (Maybe some sql command)? Do I need it though?
This is the connection string that I use for connection:
Code Snippet
Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\MyAppDB.mdf;Integrated Security=True;Connect Timeout=10;User Instance=False
But the confusing part of it is that it happend on my work computer and not on my home computer. I have the same User/Password/Workgroup/VS version/MS SQL versoion/Windows version on both machines.
Thank you.
View 4 Replies
View Related
Oct 31, 2007
Hello,
i'm desperate! I have a application in my SQL Express and only one database for it. But right now it have 3,97gb, without log file.
i'm already buying a SQL Enterprise to upgrade this, take some days, but my question is: when this size came to 4,00gb my application will be stop working ? my business stop ???
Thanks
View 1 Replies
View Related
Oct 1, 2001
Hi,
While backing up our database, I am getting the following message:
Could not insert a backup or restore history/detail record in msdb.dbo.sysbackuphistory or sysrestorehistory. This may indicate a problem with the MSDB database. DUMP/LOAD was still successful. (Message 3009)
Does anybody have any resolution for the same ?
Thanks,
Rajan
View 2 Replies
View Related
Jan 16, 2008
hi.
When i click on the button, it will go to another page called fileB.aspx, it will query database based on textbox parameter from fileA.aspx and display gridview on fileB.aspx
It is based on sqldatasource. abit noob on programming visual basic.Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
'Code go here.End Sub
View 3 Replies
View Related
Apr 1, 2007
My program uses a database. Does the end-user have to have SQL server 2005?
It uses it to keep track of members so the database is in the installation folder and does not need to be accessed remotely
http://i130.photobucket.com/albums/p247/tarkster2/screen.gif
the above shows this error on another persons computer. they do not have sql server.
View 3 Replies
View Related
Jan 16, 2007
We have a web applicaiton backend database uses sql server. Now we stop using this web application. I would like to stop this sql server database. What do you usually do? I can backup this database and delete this database. Or if i want to keep this database. What should i do?
Thanks for you help.
View 7 Replies
View Related
Jun 17, 2015
the idea is to put together a folder that is in some place in the computer, like "c:excel_fles" and the database full backup in a single .bak file, the database can be recovered with sql server management studio(but no the folder), the restoration of the program can be done with a program, I think it can be done with msdb, but I'm a little lost in the road.
View 4 Replies
View Related
Mar 22, 2006
Hello guys,
I need help, because i'm executing a shrink database file (file with 189 GBytes of size), and i need to stop before it finish. If I stop the shrink process exist any possible that data corruption occurred.
Thanks.
Best regards,
Fernando Costa
View 4 Replies
View Related
May 8, 2008
We used windows authentication and we have our domain users set up to perform certian tasks like input time on their time sheet. Then I found out thru excel you can connect to the database and select any table that you have read access on. Then you can download all of the data to an excel workbook.
What is the best way to stop this?
View 3 Replies
View Related
Feb 1, 2006
hi ALL !!!
How can I insert Date in SQL Server 2000 database(table ) from ASP.NET 1.1. Program??
pls send me code if u can
pls help me ..
View 2 Replies
View Related
Nov 2, 2007
We want to deny access to sql server 2005 database by the sql management studio or any other sql editor while our developed application can access the database even malicious user gets the login name and password by disassembling our code
View 1 Replies
View Related
Jun 30, 2007
See my code below... it nicely insert in database data...
but I wish: if user of program in field "txtPozicija" try insert in
database same data detail like is in "Pozicija" field in database that
he be stopped and informed by message: you can not insert TWO SAME data
in the "Pozicija" table.
any advice here?
I AM TRY SOLVE THIS LIKE BELOW, NO ERROR BUT NOT WORK
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class adminpanel_Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
lblHR.Text = txtPozicija.Text;
lblEN.Text = txtLinkZaViseoMjestu.Text;
lblIT.Text = ddRegija.Text;
}
// On dropbox in the html added OnDataBound="MyDataBound" Occurs after the server control binds to a data source.
protected void myDataBound(Object sender, EventArgs e)
{
ddRegija.Items.Insert(0, "--- Selektiraj ---");
}
void SaveDataDB()
{
string ConnStr = ConfigurationManager.ConnectionStrings["croestate_dbConnectionString"].ConnectionString;
SqlConnection Conn = new SqlConnection(ConnStr);
try
{
Conn.Open();
String sqlQuery = "INSERT INTO PozicijaObjekta VALUES(@Pozicija, @LinkzaViseoMjestu, @Regija)";
SqlCommand cmd = new SqlCommand(sqlQuery, Conn);
cmd.Parameters.AddWithValue("@Pozicija", txtPozicija.Text);
cmd.Parameters.AddWithValue("@LinkzaViseoMjestu", txtLinkZaViseoMjestu.Text);
cmd.Parameters.AddWithValue("@Regija", ddRegija.SelectedValue);
cmd.ExecuteNonQuery();
}
catch (Exception ex)
{
Conn.Close();
Response.Write(ex.Message);
Wizard1.ActiveStepIndex = 0;
}
}
protected void Wizard1_NextButtonClick(object sender, WizardNavigationEventArgs e)
{
if (e.CurrentStepIndex == 0)
{
SaveDataDB();
}
if (e.CurrentStepIndex == 1)
{
//Register user into the database not hear because wizard have one step only
// SaveDataDB();
}
}
protected void CustomValidator1_ServerValidate(object source, ServerValidateEventArgs args)
{
if (ddRegija.SelectedIndex == 0)
args.IsValid = false;
}
protected void CustomValidatorPozicija_ServerValidate(object source, ServerValidateEventArgs args)
{
string ConnStr = ConfigurationManager.ConnectionStrings["croestate_dbConnectionString"].ConnectionString;
SqlConnection Conn = new SqlConnection(ConnStr);
try
{
Conn.Open();
String sqlQuery = "SELECT Pozicija FROM PozicijaObjekta WHERE Pozicija='" + txtPozicija.TemplateControl + "'";
SqlCommand cmd = new SqlCommand(sqlQuery, Conn);
SqlDataReader dr = cmd.ExecuteReader();
if (dr.Read() == true)
args.IsValid = false;
}
catch (Exception ex)
{
Conn.Close();
Response.Write(ex.Message);
Wizard1.ActiveStepIndex = 0;
}
}
}
View 10 Replies
View Related
Feb 16, 2008
I am working (or trying to work) in Management Studio. I have one database that I use on my one and only machine. ( I am not using any of the default databases.) I have several queries saved as files, which I open as needed. Every time I open a file I get that VERY ANOYING Connect to Database Engine dialog box. OK, it's no big thing. I don't use Server Authentication so all I have to do is hit enter and I get connected. But why should I even have to hit enter once after I'm already connected?
How can I MAKE IT STOP?
Thanks,
Gregory
View 3 Replies
View Related
Jun 2, 2015
We created one SA login [login name: test_db] and give the Db_owner permission for particular user db, but this test_db login able to access the all system database except model database.Here problem is I am giving the only one particular user database but that login why able to access the system database.Here how to stop the system database access…
View 8 Replies
View Related
Apr 27, 2007
I have seen this before. A 2000 restore fails, leaving the database thinking it is being restored but the restore job failed and errors when it is restarted. EM is clueless. I believe there is a proc to reset some flag. Can you share it with me???
Thanks!
View 4 Replies
View Related
May 21, 2007
Can I return a value in a variable from a SSIS program back to C# after the SSIS program is run from C#?
View 1 Replies
View Related
Apr 26, 2015
We have 3 maintenance jobs configured in this particular DB instance:
Daily backup of system database - SubPlan1 (Check Database Integrity Task --> Rebuild Index Task-->Backup Database Task)Daily backup of user databases - Five subplans for each task : (Check DB integrity --> Rebuild Index -->Backup User Database, Backup Log -->Cleanup History)Weekly maintenance - SubPlan1 (Check Database integrity job (system+user DB) + rebuild index job (system+user DB) )
PROBLEM: I just noticed that the User DB Rebuild Index task has been running since the 03/04 and the Weekly maintenance plan - subplan1 since the 12/04.
Which job is "safe" to stop without impacting the database?
View 14 Replies
View Related
Jun 17, 2008
Hi, I'm specify the size of the interger dataypes in my code behind files; e.g.
commad.Parameters.Add("@SomeID", SqlDbType.Int, 4)
I know it may seem silly, but I have to ask:
Will specifying ths size (i.e. 4) eventually stop the auto-icnrement of the underlying primary key SomeID in the SQL Server 2005 database?
What restriction, if any, does this place if the next SomeID value is 10000, which is 5 digits? or 999999, which is 6 digits?
Thank you
View 2 Replies
View Related
Nov 19, 1999
11/19
Trying to keep out sysadmins & sa during/between database RESTORE
Configuration:
WINNT Server Enterprise 4.0 w/SP5
SQL Server 7 Enterprise & SP1
2 SQL Servers:
Production Server
Standby server
I Backup (full backup) databases to disk on primary server (logical backup devices are physicaly located on a Standby server (dedicated gigabit NIC in each server for this process). Transaction logs are applied to the Standby server throughout the day.
Problem:
How to keep out "sa" and sysadmins from a database while I'm restoring (or between restores) to a standby server?
The database being restored cannot be in use during a restore.
If a DBA forgets that this process is happening, the statement fails (RESTORE)for the database they happen to be in at the time of the restore.
Example restore statement:
Standby Server -
RESTORE DATABASE databasename FROM database_dd WITH DBO_ONLY, REPLACE, STANDBY = 'g:Mssql7FromPrimaryDatabaseName_undo.ldf'
I could restrict Domain sysadmin access and change sa password. I could also put the database in "Single user" mode, however this could become problem if my process disconnects and then someone else connects - then my process is locked out. What I'm really looking for is to lock out all activity for a database that is in "standby mode" except for RESTORE processes.
Any ideas??
Wade
wadej@vailresorts.com
View 1 Replies
View Related
May 9, 2012
I'm taking a database(read-only) backup from one server and restoring it on other server. As soon as restore is done it is bringing database into single-user read-only mode.
why it is bringing the database into single user mode ?
View 1 Replies
View Related
Nov 15, 2006
Hello,i am in great trouble. I want to revert back to original state ofdatabase before i performed restore database on my sql server 2KDatabase. Accidently i didn't take backup of my Database and i didrestore, so is there any way to get the original state back of myDatabase?Any suggestion will be highly appriciated.Regards,S. Domadia.
View 2 Replies
View Related
May 7, 1999
Anybody figure a way around this:
In a development server you take a backup and you want to move the entire database to a production server. The production server does not contain the database, users, or logins in master.
When you restore the backup to production in 7.0, the users get moved to DBO because the logins do not exist and then you cannot delete them.
We are having to drop the users from the database on development, back up the database and restore it to production, then recreate the users on production.
This is bogus and did not happen in 6.5 because of the aliases.
Anybody come up with a better way?
View 1 Replies
View Related
Jul 3, 2007
I am fairly new to VS 2005 and SQL Server CE. I have developed a Desktop Windows application using VB 2005 and the SQL Compact Edition Database. This application will sell to users via web download.
When they download a service patch, or updated version, I wish for them to retain the data in their present database. In other words, fill the new database with the old data. The new table structures will remain intact except for added columns at the end.
Question is how to save the old data and update the new database with it. Is there an easy way to do this, or do I need to write a module to save a database copy, and update the new database with content at install time?
View 6 Replies
View Related