Showing posts with label via. Show all posts
Showing posts with label via. Show all posts

Thursday, March 29, 2012

database still exists after deletion

hi

Basically, I create a database with sql, then I delete it manually(not via sql statment. This is a problem which I realise. In fact, you can't delete the database because the VS 2005 still is using it) I run the same code again,
then it says the database still exists, even it is physically destroied.

--Here is the errors:
System.Data.SqlClient.SqlException: Database 'riskDatabase' already exists.
at System.Data.SqlClient.SqlConnection.OnError(SqlExc eption exception, Boolea
n breakConnection)

--The evidence that the database doesn't exist physically:
Unhandled Exception: System.Data.SqlClient.SqlException: Cannot open database "riskDatabase" requested by the login. The login failed.

--The code:
/*
* C# code to programmically create
* database and table. It also inserts
* data into the table.
*/

using System;
using System.Collections.Generic;
using System.Text;

using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.IO;

namespace riskWizard
{
public class RiskWizard
{
// Sql
private string connectionString;
private SqlConnection connection;
private SqlCommand command;

// Database
private string databaseName;
private string currDatabasePath;
private string database_mdf;
private string database_ldf;

public RiskWizard(string databaseName, string currDatabasePath, string database_mdf, string database_ldf)
{
this.databaseName = databaseName;
this.currDatabasePath = currDatabasePath;
this.database_mdf = database_mdf;
this.database_ldf = database_ldf;
}

private void executeSql(string sql)
{
// Create a connection
connection = new SqlConnection(connectionString);

// Open the connection.
if (connection.State == ConnectionState.Open)
connection.Close();

connection.ConnectionString = connectionString;
connection.Open();

command = new SqlCommand(sql, connection);
try
{
command.ExecuteNonQuery();
}
catch (SqlException e)
{
Console.WriteLine(e.ToString());
}
}

public void createDatabase()
{
string database_data = databaseName + "_data";
string database_log = databaseName + "_log";

connectionString
= "Data Source=.\\SQLExpress;Initial Catalog=;Integrated Security=SSPI;";

string sql = "CREATE DATABASE " + databaseName + " ON PRIMARY"
+ "(name=" + database_data + ",filename=" + database_mdf + ",size=3,"
+ "maxsize=5,filegrowth=10%)log on"
+ "(name=" + database_log + ",filename=" + database_ldf + ",size=3,"
+ "maxsize=20,filegrowth=1)";

executeSql(sql);
}

public void dropDatabase()
{
connectionString
= "Data Source=.\\SQLExpress;Initial Catalog=" + databaseName + ";Integrated Security=SSPI;";

string sql = "DROP DATABASE " + databaseName;

executeSql(sql);
}

// Create table.
public void createTable(string tableName)
{
connectionString
= "Data Source=.\\SQLExpress;Initial Catalog=" + databaseName + ";Integrated Security=SSPI;";

string sql = "CREATE TABLE " + tableName +
"(userId INTEGER IDENTITY(1, 1) CONSTRAINT PK_userID PRIMARY KEY," +
"name CHAR(50) NOT NULL, address CHAR(255) NOT NULL, employmentTitle TEXT NOT NULL)";

executeSql(sql);
}

// Insert data
public void insertData(string tableName)
{
string sql;

connectionString
= "Data Source=.\\SQLExpress;Initial Catalog=" + databaseName + ";Integrated Security=SSPI;";

sql = "INSERT INTO " + tableName + "(userId, name, address, employmentTitle) " +
"VALUES (1001, 'Puneet Nehra', 'A 449 Sect 19, DELHI', 'project manager') ";
executeSql(sql);

sql = "INSERT INTO " + tableName + "(userId, name, address, employmentTitle) " +
"VALUES (1002, 'Anoop Singh', 'Lodi Road, DELHI', 'software admin') ";
executeSql(sql);

sql = "INSERT INTO " + tableName + "(userId, name, address, employmentTitle) " +
"VALUES (1003, 'Rakesh M', 'Nag Chowk, Jabalpur M.P.', 'tester') ";
executeSql(sql);

sql = "INSERT INTO " + tableName + "(userId, name, address, employmentTitle) " +
"VALUES (1004, 'Madan Kesh', '4th Street, Lane 3, DELHI', 'quality insurance mamager') ";
executeSql(sql);
}

public static void Main(String[] argv)
{
string databaseName = "riskDatabase";
string currDatabasePath = "E:\\liveProgrammes\\cSharpWorkplace\\riskWizard\\A pp_Data";
// Need to be more flexible.
string database_mdf = "'E:\\liveProgrammes\\cSharpWorkplace\\riskWizard\\ App_Data\\riskDatabase.mdf'";
string database_ldf = "'E:\\liveProgrammes\\cSharpWorkplace\\riskWizard\\ App_Data\\riskDatabase.ldf'";

RiskWizard riskWizard = new RiskWizard(databaseName, currDatabasePath, database_mdf, database_ldf);
riskWizard.createDatabase();
riskWizard.createTable("userTable");
riskWizard.insertData("userTable");
//riskWizard.dropDatabase();
}
}
}Have someone tried to create a database then drop it in runtime?

Monday, March 19, 2012

Database security

Hi,
I'm trying to implement some security on our more sensitive tables in a database.
The database is used by all for read/write via Web pages (IIS).
Is there any way to restrict users from accessing a table other than from a specific application (i.e. IIS or Crystal Reports)?
Am I looking in the wrong direction?

Thanks
MottyYes, you can do that by implementing application security(application role).
For more details see "application roles" in BOL.

Originally posted by mseal1
Hi,
I'm trying to implement some security on our more sensitive tables in a database.
The database is used by all for read/write via Web pages (IIS).
Is there any way to restrict users from accessing a table other than from a specific application (i.e. IIS or Crystal Reports)?
Am I looking in the wrong direction?

Thanks
Motty|||How is the access to the tables controlled?Thru Stored procedure ,roles?|||I have no control at this time as to how users access the Db.
Security is using NT logons, and domain users can read/write to all tables.
(Hope I don't sound too naive about administrating my database (SQL 7.0)

Thanks
Motty|||What if I have no control over the application that accesses SQL, then I can't run the sp_setapprole to gain access?|||Once the app role in place, you won`t need to keep NT logons , so this it would be the only way to connect to the database for the users. (supposing of course that guest acc. don`t exists in the current DB)

Originally posted by mseal1
What if I have no control over the application that accesses SQL, then I can't run the sp_setapprole to gain access?|||I know I'm sounding a little thick today
I have several applications (off the shelf) such as Crystal reporting, Access, Excel
I want to be able to limit access to a table based on the application name the users are coming from.
If I use Profiler, I have a column called 'Application Name' that identifies the type of application.
Can I use that information? At times I don't have a way to 'send' the sp_setapprole command.

Thanks for all your help!|||No you don't because SQL implements the security based on accounts and roles. The only way to restrict the access is to declare a custom role in your DB for each app., then set the privileges according to your policy, and map your users to these roles.

Originally posted by mseal1
I know I'm sounding a little thick today
I have several applications (off the shelf) such as Crystal reporting, Access, Excel
I want to be able to limit access to a table based on the application name the users are coming from.
If I use Profiler, I have a column called 'Application Name' that identifies the type of application.
Can I use that information? At times I don't have a way to 'send' the sp_setapprole command.

Thanks for all your help!|||Thanks,
I think I have enough to start

Thursday, March 8, 2012

Database restore help

I need to restore a database over an existing DB (I have made a backup and
it's SQL 2000).
When I do try and restore it via SQL Enterprose Manager 2000 (the only way I
know) it it says "logical file 'database' is not part of a database
'database2'. Use RESTORE FILELISTONLY to list the logocal file names.
RESTORE DATAVASE is terminating adbnormally.Use Query Analyzer and run RESTORE FILELISTONLY for the backup file. Post
those results here. We'll follow up when we get those.
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
SQL Server MVP
Toronto, ON Canada
https://mvp.support.microsoft.com/profile/Tom.Moreau
"Gonzo" <no@.no123.com> wrote in message
news:523266A9-C34C-47F9-9C22-FC91A9E798E7@.microsoft.com...
I need to restore a database over an existing DB (I have made a backup and
it's SQL 2000).
When I do try and restore it via SQL Enterprose Manager 2000 (the only way I
know) it it says "logical file 'database' is not part of a database
'database2'. Use RESTORE FILELISTONLY to list the logocal file names.
RESTORE DATAVASE is terminating adbnormally.|||I think you might have to tell it to overwrite your existing database. I
can't remember the actual steps to do it in EM, but somewhere in the
Restore wizard you have the option to "overwrite existing database" or
something like that.
Regards
Steen Schlter Persson
Database Administrator / System Administrator
Gonzo wrote:
> I need to restore a database over an existing DB (I have made a backup
> and it's SQL 2000).
> When I do try and restore it via SQL Enterprose Manager 2000 (the only
> way I know) it it says "logical file 'database' is not part of a
> database 'database2'. Use RESTORE FILELISTONLY to list the logocal file
> names. RESTORE DATAVASE is terminating adbnormally.|||Many thanks:
RESTORE FILElISTONLY from Disk = 'f:\MSSQL80\BACKUP\RM_test1.bak'
I get:
Btest_Data C:\Program Files\Microsoft SQL Server\MSSQL\Data\BRITLIVE.mdf
D PRIMARY
Btest_Log C:\Program Files\Microsoft SQL
Server\MSSQL\Data\BRITLIVE_log.ldf L NULL
On the server we have these DB's:
Btest
RM_test1
We sent a company the Btest DB to make some changes that they have done and
sent the bak file back. I need to restore this over the RM_test1 DB, but it
seems that it still references the original Btest DB everywhere.
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
news:OUAXLKMtHHA.4572@.TK2MSFTNGP02.phx.gbl...
> Use Query Analyzer and run RESTORE FILELISTONLY for the backup file. Post
> those results here. We'll follow up when we get those.
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
> SQL Server MVP
> Toronto, ON Canada
> https://mvp.support.microsoft.com/profile/Tom.Moreau
>
> "Gonzo" <no@.no123.com> wrote in message
> news:523266A9-C34C-47F9-9C22-FC91A9E798E7@.microsoft.com...
> I need to restore a database over an existing DB (I have made a backup and
> it's SQL 2000).
> When I do try and restore it via SQL Enterprose Manager 2000 (the only way
> I
> know) it it says "logical file 'database' is not part of a database
> 'database2'. Use RESTORE FILELISTONLY to list the logocal file names.
> RESTORE DATAVASE is terminating adbnormally.
>|||Hi there, I tried that, but get the same error. I have just replied to the
other post too with a bit more info
""Steen Schlter Persson (DK)"" <steen@.REMOVE_THIS_asavaenget.dk> wrote in
message news:eOsdMVMtHHA.4888@.TK2MSFTNGP02.phx.gbl...[vbcol=seagreen]
>I think you might have to tell it to overwrite your existing database. I
>can't remember the actual steps to do it in EM, but somewhere in the
>Restore wizard you have the option to "overwrite existing database" or
>something like that.
> --
> Regards
> Steen Schlter Persson
> Database Administrator / System Administrator
> Gonzo wrote:|||From QA, run:
RESTORE DATABASE RM_test1
FROM DISK = 'f:\MSSQL80\BACKUP\RM_test1.bak'
WITH REPLACE
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
SQL Server MVP
Toronto, ON Canada
https://mvp.support.microsoft.com/profile/Tom.Moreau
"Gonzo" <no@.no123.com> wrote in message
news:9F74A63C-2524-4AE0-AEAC-9E9853D66B30@.microsoft.com...
Many thanks:
RESTORE FILElISTONLY from Disk = 'f:\MSSQL80\BACKUP\RM_test1.bak'
I get:
Btest_Data C:\Program Files\Microsoft SQL Server\MSSQL\Data\BRITLIVE.mdf
D PRIMARY
Btest_Log C:\Program Files\Microsoft SQL
Server\MSSQL\Data\BRITLIVE_log.ldf L NULL
On the server we have these DB's:
Btest
RM_test1
We sent a company the Btest DB to make some changes that they have done and
sent the bak file back. I need to restore this over the RM_test1 DB, but it
seems that it still references the original Btest DB everywhere.
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
news:OUAXLKMtHHA.4572@.TK2MSFTNGP02.phx.gbl...
> Use Query Analyzer and run RESTORE FILELISTONLY for the backup file. Post
> those results here. We'll follow up when we get those.
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
> SQL Server MVP
> Toronto, ON Canada
> https://mvp.support.microsoft.com/profile/Tom.Moreau
>
> "Gonzo" <no@.no123.com> wrote in message
> news:523266A9-C34C-47F9-9C22-FC91A9E798E7@.microsoft.com...
> I need to restore a database over an existing DB (I have made a backup and
> it's SQL 2000).
> When I do try and restore it via SQL Enterprose Manager 2000 (the only way
> I
> know) it it says "logical file 'database' is not part of a database
> 'database2'. Use RESTORE FILELISTONLY to list the logocal file names.
> RESTORE DATAVASE is terminating adbnormally.
>|||Use
Restore Database <db_name>
from Disk = 'f:\MSSQL80\BACKUP\RM_test1.bak'
WITH Move 'Btest_Data' To 'C:\Program Files\Microsoft SQL
Server\MSSQL\Data\BRITLIVE_2.mdf',
Move 'Btest_Log' To 'C:\Program Files\Microsoft SQL
Server\MSSQL\Data\BRITLIVE_2_log.ldf',
just change the name of the .mdf & .ldf to something that doesn't already
exist.
--
MG
"Gonzo" wrote:

> It seems I can restore it using EM (tried on a test server) but only if i
> keep the logical names. in E:\Program Files\Microsoft SQL Server\MSSQL\Da
ta
> the databse is RM_test1 but I right click on the database and go to
> properties and then the tabs Data files and transaction log then the file
> name is Btest_data and Btest_logs. Now a database on the live server is
> already called 'Btest' will this cause a problem?
>
> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
> news:e4XJkINtHHA.3504@.TK2MSFTNGP05.phx.gbl...
>|||I have restored it now, how can I now change the logical names to something
else?
many thanks
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
news:O4i5xSNtHHA.3556@.TK2MSFTNGP05.phx.gbl...
> You have to keep the logical names for the restore. You can change those
> later.
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
> SQL Server MVP
> Toronto, ON Canada
> https://mvp.support.microsoft.com/profile/Tom.Moreau
>
> "Gonzo" <no@.no123.com> wrote in message
> news:A4969E2E-1F25-484A-BDE3-91247145CD79@.microsoft.com...
> It seems I can restore it using EM (tried on a test server) but only if i
> keep the logical names. in E:\Program Files\Microsoft SQL
> Server\MSSQL\Data
> the databse is RM_test1 but I right click on the database and go to
> properties and then the tabs Data files and transaction log then the file
> name is Btest_data and Btest_logs. Now a database on the live server is
> already called 'Btest' will this cause a problem?
>
> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
> news:e4XJkINtHHA.3504@.TK2MSFTNGP05.phx.gbl...
>|||Check out ALTER DATABASE in the BOL.
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
SQL Server MVP
Toronto, ON Canada
https://mvp.support.microsoft.com/profile/Tom.Moreau
"Gonzo" <no@.no123.com> wrote in message
news:%23JzdGUNtHHA.768@.TK2MSFTNGP04.phx.gbl...
I have restored it now, how can I now change the logical names to something
else?
many thanks
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
news:O4i5xSNtHHA.3556@.TK2MSFTNGP05.phx.gbl...
> You have to keep the logical names for the restore. You can change those
> later.
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
> SQL Server MVP
> Toronto, ON Canada
> https://mvp.support.microsoft.com/profile/Tom.Moreau
>
> "Gonzo" <no@.no123.com> wrote in message
> news:A4969E2E-1F25-484A-BDE3-91247145CD79@.microsoft.com...
> It seems I can restore it using EM (tried on a test server) but only if i
> keep the logical names. in E:\Program Files\Microsoft SQL
> Server\MSSQL\Data
> the databse is RM_test1 but I right click on the database and go to
> properties and then the tabs Data files and transaction log then the file
> name is Btest_data and Btest_logs. Now a database on the live server is
> already called 'Btest' will this cause a problem?
>
> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
> news:e4XJkINtHHA.3504@.TK2MSFTNGP05.phx.gbl...
>|||No. Logical names are local to the DB.
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
SQL Server MVP
Toronto, ON Canada
https://mvp.support.microsoft.com/profile/Tom.Moreau
"Gonzo" <no@.no123.com> wrote in message
news:28BF2F6F-4256-4299-BE76-1F1DAAB4D61F@.microsoft.com...
I now get:
Processed 9336 pages for database 'RM_test1', file 'Btest_Data' on file 1.
Processed 1 pages for database 'RM_test1', file 'Btest_Log' on file 1.
RESTORE DATABASE successfully processed 9337 pages in 13.278 seconds (5.760
MB/sec).
There is a database caleld Btest already uses Btest for it's database name
and logical name, will this create a problem with both having the same name?
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
news:e4XJkINtHHA.3504@.TK2MSFTNGP05.phx.gbl...
> Type:
> use master
> go
> ... before running the RESTORE. Also, be sure that no one is connected
> to
> the DB when you restore it.
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
> SQL Server MVP
> Toronto, ON Canada
> https://mvp.support.microsoft.com/profile/Tom.Moreau
>
> "Gonzo" <no@.no123.com> wrote in message
> news:863AE2DE-3B3B-4647-8AC6-6BFAE4FFDDEC@.microsoft.com...
> Hi I get:
> Server: Msg 3101, Level 16, State 1, Line 1
> Exclusive access could not be obtained because the database is in use.
> Server: Msg 3013, Level 16, State 1, Line 1
> RESTORE DATABASE is terminating abnormally.
>
>
>
>
> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
> news:%23SUif2MtHHA.4796@.TK2MSFTNGP04.phx.gbl...
>

Database restore help

I need to restore a database over an existing DB (I have made a backup and
it's SQL 2000).
When I do try and restore it via SQL Enterprose Manager 2000 (the only way I
know) it it says "logical file 'database' is not part of a database
'database2'. Use RESTORE FILELISTONLY to list the logocal file names.
RESTORE DATAVASE is terminating adbnormally.Use Query Analyzer and run RESTORE FILELISTONLY for the backup file. Post
those results here. We'll follow up when we get those.
--
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
SQL Server MVP
Toronto, ON Canada
https://mvp.support.microsoft.com/profile/Tom.Moreau
"Gonzo" <no@.no123.com> wrote in message
news:523266A9-C34C-47F9-9C22-FC91A9E798E7@.microsoft.com...
I need to restore a database over an existing DB (I have made a backup and
it's SQL 2000).
When I do try and restore it via SQL Enterprose Manager 2000 (the only way I
know) it it says "logical file 'database' is not part of a database
'database2'. Use RESTORE FILELISTONLY to list the logocal file names.
RESTORE DATAVASE is terminating adbnormally.|||I think you might have to tell it to overwrite your existing database. I
can't remember the actual steps to do it in EM, but somewhere in the
Restore wizard you have the option to "overwrite existing database" or
something like that.
--
Regards
Steen Schlüter Persson
Database Administrator / System Administrator
Gonzo wrote:
> I need to restore a database over an existing DB (I have made a backup
> and it's SQL 2000).
> When I do try and restore it via SQL Enterprose Manager 2000 (the only
> way I know) it it says "logical file 'database' is not part of a
> database 'database2'. Use RESTORE FILELISTONLY to list the logocal file
> names. RESTORE DATAVASE is terminating adbnormally.|||Many thanks:
RESTORE FILElISTONLY from Disk = 'f:\MSSQL80\BACKUP\RM_test1.bak'
I get:
Btest_Data C:\Program Files\Microsoft SQL Server\MSSQL\Data\BRITLIVE.mdf
D PRIMARY
Btest_Log C:\Program Files\Microsoft SQL
Server\MSSQL\Data\BRITLIVE_log.ldf L NULL
On the server we have these DB's:
Btest
RM_test1
We sent a company the Btest DB to make some changes that they have done and
sent the bak file back. I need to restore this over the RM_test1 DB, but it
seems that it still references the original Btest DB everywhere.
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
news:OUAXLKMtHHA.4572@.TK2MSFTNGP02.phx.gbl...
> Use Query Analyzer and run RESTORE FILELISTONLY for the backup file. Post
> those results here. We'll follow up when we get those.
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
> SQL Server MVP
> Toronto, ON Canada
> https://mvp.support.microsoft.com/profile/Tom.Moreau
>
> "Gonzo" <no@.no123.com> wrote in message
> news:523266A9-C34C-47F9-9C22-FC91A9E798E7@.microsoft.com...
> I need to restore a database over an existing DB (I have made a backup and
> it's SQL 2000).
> When I do try and restore it via SQL Enterprose Manager 2000 (the only way
> I
> know) it it says "logical file 'database' is not part of a database
> 'database2'. Use RESTORE FILELISTONLY to list the logocal file names.
> RESTORE DATAVASE is terminating adbnormally.
>|||Hi there, I tried that, but get the same error. I have just replied to the
other post too with a bit more info :)
""Steen Schlüter Persson (DK)"" <steen@.REMOVE_THIS_asavaenget.dk> wrote in
message news:eOsdMVMtHHA.4888@.TK2MSFTNGP02.phx.gbl...
>I think you might have to tell it to overwrite your existing database. I
>can't remember the actual steps to do it in EM, but somewhere in the
>Restore wizard you have the option to "overwrite existing database" or
>something like that.
> --
> Regards
> Steen Schlüter Persson
> Database Administrator / System Administrator
> Gonzo wrote:
>> I need to restore a database over an existing DB (I have made a backup
>> and it's SQL 2000).
>> When I do try and restore it via SQL Enterprose Manager 2000 (the only
>> way I know) it it says "logical file 'database' is not part of a database
>> 'database2'. Use RESTORE FILELISTONLY to list the logocal file names.
>> RESTORE DATAVASE is terminating adbnormally.|||From QA, run:
RESTORE DATABASE RM_test1
FROM DISK = 'f:\MSSQL80\BACKUP\RM_test1.bak'
WITH REPLACE
--
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
SQL Server MVP
Toronto, ON Canada
https://mvp.support.microsoft.com/profile/Tom.Moreau
"Gonzo" <no@.no123.com> wrote in message
news:9F74A63C-2524-4AE0-AEAC-9E9853D66B30@.microsoft.com...
Many thanks:
RESTORE FILElISTONLY from Disk = 'f:\MSSQL80\BACKUP\RM_test1.bak'
I get:
Btest_Data C:\Program Files\Microsoft SQL Server\MSSQL\Data\BRITLIVE.mdf
D PRIMARY
Btest_Log C:\Program Files\Microsoft SQL
Server\MSSQL\Data\BRITLIVE_log.ldf L NULL
On the server we have these DB's:
Btest
RM_test1
We sent a company the Btest DB to make some changes that they have done and
sent the bak file back. I need to restore this over the RM_test1 DB, but it
seems that it still references the original Btest DB everywhere.
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
news:OUAXLKMtHHA.4572@.TK2MSFTNGP02.phx.gbl...
> Use Query Analyzer and run RESTORE FILELISTONLY for the backup file. Post
> those results here. We'll follow up when we get those.
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
> SQL Server MVP
> Toronto, ON Canada
> https://mvp.support.microsoft.com/profile/Tom.Moreau
>
> "Gonzo" <no@.no123.com> wrote in message
> news:523266A9-C34C-47F9-9C22-FC91A9E798E7@.microsoft.com...
> I need to restore a database over an existing DB (I have made a backup and
> it's SQL 2000).
> When I do try and restore it via SQL Enterprose Manager 2000 (the only way
> I
> know) it it says "logical file 'database' is not part of a database
> 'database2'. Use RESTORE FILELISTONLY to list the logocal file names.
> RESTORE DATAVASE is terminating adbnormally.
>|||Hi I get:
Server: Msg 3101, Level 16, State 1, Line 1
Exclusive access could not be obtained because the database is in use.
Server: Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
news:%23SUif2MtHHA.4796@.TK2MSFTNGP04.phx.gbl...
> From QA, run:
> RESTORE DATABASE RM_test1
> FROM DISK = 'f:\MSSQL80\BACKUP\RM_test1.bak'
> WITH REPLACE
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
> SQL Server MVP
> Toronto, ON Canada
> https://mvp.support.microsoft.com/profile/Tom.Moreau
>
> "Gonzo" <no@.no123.com> wrote in message
> news:9F74A63C-2524-4AE0-AEAC-9E9853D66B30@.microsoft.com...
> Many thanks:
> RESTORE FILElISTONLY from Disk = 'f:\MSSQL80\BACKUP\RM_test1.bak'
> I get:
> Btest_Data C:\Program Files\Microsoft SQL Server\MSSQL\Data\BRITLIVE.mdf
> D PRIMARY
> Btest_Log C:\Program Files\Microsoft SQL
> Server\MSSQL\Data\BRITLIVE_log.ldf L NULL
>
> On the server we have these DB's:
> Btest
> RM_test1
>
> We sent a company the Btest DB to make some changes that they have done
> and
> sent the bak file back. I need to restore this over the RM_test1 DB, but
> it
> seems that it still references the original Btest DB everywhere.
>
> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
> news:OUAXLKMtHHA.4572@.TK2MSFTNGP02.phx.gbl...
>> Use Query Analyzer and run RESTORE FILELISTONLY for the backup file.
>> Post
>> those results here. We'll follow up when we get those.
>> --
>> Tom
>> ----
>> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
>> SQL Server MVP
>> Toronto, ON Canada
>> https://mvp.support.microsoft.com/profile/Tom.Moreau
>>
>> "Gonzo" <no@.no123.com> wrote in message
>> news:523266A9-C34C-47F9-9C22-FC91A9E798E7@.microsoft.com...
>> I need to restore a database over an existing DB (I have made a backup
>> and
>> it's SQL 2000).
>> When I do try and restore it via SQL Enterprose Manager 2000 (the only
>> way
>> I
>> know) it it says "logical file 'database' is not part of a database
>> 'database2'. Use RESTORE FILELISTONLY to list the logocal file names.
>> RESTORE DATAVASE is terminating adbnormally.
>|||Type:
use master
go
... before running the RESTORE. Also, be sure that no one is connected to
the DB when you restore it.
--
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
SQL Server MVP
Toronto, ON Canada
https://mvp.support.microsoft.com/profile/Tom.Moreau
"Gonzo" <no@.no123.com> wrote in message
news:863AE2DE-3B3B-4647-8AC6-6BFAE4FFDDEC@.microsoft.com...
Hi I get:
Server: Msg 3101, Level 16, State 1, Line 1
Exclusive access could not be obtained because the database is in use.
Server: Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
news:%23SUif2MtHHA.4796@.TK2MSFTNGP04.phx.gbl...
> From QA, run:
> RESTORE DATABASE RM_test1
> FROM DISK = 'f:\MSSQL80\BACKUP\RM_test1.bak'
> WITH REPLACE
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
> SQL Server MVP
> Toronto, ON Canada
> https://mvp.support.microsoft.com/profile/Tom.Moreau
>
> "Gonzo" <no@.no123.com> wrote in message
> news:9F74A63C-2524-4AE0-AEAC-9E9853D66B30@.microsoft.com...
> Many thanks:
> RESTORE FILElISTONLY from Disk = 'f:\MSSQL80\BACKUP\RM_test1.bak'
> I get:
> Btest_Data C:\Program Files\Microsoft SQL Server\MSSQL\Data\BRITLIVE.mdf
> D PRIMARY
> Btest_Log C:\Program Files\Microsoft SQL
> Server\MSSQL\Data\BRITLIVE_log.ldf L NULL
>
> On the server we have these DB's:
> Btest
> RM_test1
>
> We sent a company the Btest DB to make some changes that they have done
> and
> sent the bak file back. I need to restore this over the RM_test1 DB, but
> it
> seems that it still references the original Btest DB everywhere.
>
> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
> news:OUAXLKMtHHA.4572@.TK2MSFTNGP02.phx.gbl...
>> Use Query Analyzer and run RESTORE FILELISTONLY for the backup file.
>> Post
>> those results here. We'll follow up when we get those.
>> --
>> Tom
>> ----
>> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
>> SQL Server MVP
>> Toronto, ON Canada
>> https://mvp.support.microsoft.com/profile/Tom.Moreau
>>
>> "Gonzo" <no@.no123.com> wrote in message
>> news:523266A9-C34C-47F9-9C22-FC91A9E798E7@.microsoft.com...
>> I need to restore a database over an existing DB (I have made a backup
>> and
>> it's SQL 2000).
>> When I do try and restore it via SQL Enterprose Manager 2000 (the only
>> way
>> I
>> know) it it says "logical file 'database' is not part of a database
>> 'database2'. Use RESTORE FILELISTONLY to list the logocal file names.
>> RESTORE DATAVASE is terminating adbnormally.
>|||Hi
That means that somebody is using the database while you are trying to
restore it. Make sure that nobody is accessing the database - including
the session you are restoring from...:-).
--
Regards
Steen Schlüter Persson
Database Administrator / System Administrator
Gonzo wrote:
> Hi I get:
> Server: Msg 3101, Level 16, State 1, Line 1
> Exclusive access could not be obtained because the database is in use.
> Server: Msg 3013, Level 16, State 1, Line 1
> RESTORE DATABASE is terminating abnormally.
>
>
>
>
> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
> news:%23SUif2MtHHA.4796@.TK2MSFTNGP04.phx.gbl...
>> From QA, run:
>> RESTORE DATABASE RM_test1
>> FROM DISK = 'f:\MSSQL80\BACKUP\RM_test1.bak'
>> WITH REPLACE
>> --
>> Tom
>> ----
>> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
>> SQL Server MVP
>> Toronto, ON Canada
>> https://mvp.support.microsoft.com/profile/Tom.Moreau
>>
>> "Gonzo" <no@.no123.com> wrote in message
>> news:9F74A63C-2524-4AE0-AEAC-9E9853D66B30@.microsoft.com...
>> Many thanks:
>> RESTORE FILElISTONLY from Disk = 'f:\MSSQL80\BACKUP\RM_test1.bak'
>> I get:
>> Btest_Data C:\Program Files\Microsoft SQL
>> Server\MSSQL\Data\BRITLIVE.mdf
>> D PRIMARY
>> Btest_Log C:\Program Files\Microsoft SQL
>> Server\MSSQL\Data\BRITLIVE_log.ldf L NULL
>>
>> On the server we have these DB's:
>> Btest
>> RM_test1
>>
>> We sent a company the Btest DB to make some changes that they have
>> done and
>> sent the bak file back. I need to restore this over the RM_test1 DB,
>> but it
>> seems that it still references the original Btest DB everywhere.
>>
>> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
>> news:OUAXLKMtHHA.4572@.TK2MSFTNGP02.phx.gbl...
>> Use Query Analyzer and run RESTORE FILELISTONLY for the backup file.
>> Post
>> those results here. We'll follow up when we get those.
>> --
>> Tom
>> ----
>> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
>> SQL Server MVP
>> Toronto, ON Canada
>> https://mvp.support.microsoft.com/profile/Tom.Moreau
>>
>> "Gonzo" <no@.no123.com> wrote in message
>> news:523266A9-C34C-47F9-9C22-FC91A9E798E7@.microsoft.com...
>> I need to restore a database over an existing DB (I have made a
>> backup and
>> it's SQL 2000).
>> When I do try and restore it via SQL Enterprose Manager 2000 (the
>> only way
>> I
>> know) it it says "logical file 'database' is not part of a database
>> 'database2'. Use RESTORE FILELISTONLY to list the logocal file names.
>> RESTORE DATAVASE is terminating adbnormally.
>>
>|||There is still a connection to the db somewhere. SOmetimes EM doesn't show
it. Do a sp_helpdb, get the dbid of the database that you're dealing with, do
a select * from master..sysprocess where dbid = <whatever the dbid is>, get
the coresponding spid and kill <spid>, then try to restore.
--
MG
"Gonzo" wrote:
> Hi I get:
> Server: Msg 3101, Level 16, State 1, Line 1
> Exclusive access could not be obtained because the database is in use.
> Server: Msg 3013, Level 16, State 1, Line 1
> RESTORE DATABASE is terminating abnormally.
>
>
>
>
> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
> news:%23SUif2MtHHA.4796@.TK2MSFTNGP04.phx.gbl...
> > From QA, run:
> >
> > RESTORE DATABASE RM_test1
> > FROM DISK = 'f:\MSSQL80\BACKUP\RM_test1.bak'
> > WITH REPLACE
> >
> > --
> > Tom
> >
> > ----
> > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
> > SQL Server MVP
> > Toronto, ON Canada
> > https://mvp.support.microsoft.com/profile/Tom.Moreau
> >
> >
> > "Gonzo" <no@.no123.com> wrote in message
> > news:9F74A63C-2524-4AE0-AEAC-9E9853D66B30@.microsoft.com...
> > Many thanks:
> >
> > RESTORE FILElISTONLY from Disk = 'f:\MSSQL80\BACKUP\RM_test1.bak'
> >
> > I get:
> >
> > Btest_Data C:\Program Files\Microsoft SQL Server\MSSQL\Data\BRITLIVE.mdf
> > D PRIMARY
> > Btest_Log C:\Program Files\Microsoft SQL
> > Server\MSSQL\Data\BRITLIVE_log.ldf L NULL
> >
> >
> > On the server we have these DB's:
> >
> > Btest
> > RM_test1
> >
> >
> > We sent a company the Btest DB to make some changes that they have done
> > and
> > sent the bak file back. I need to restore this over the RM_test1 DB, but
> > it
> > seems that it still references the original Btest DB everywhere.
> >
> >
> > "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
> > news:OUAXLKMtHHA.4572@.TK2MSFTNGP02.phx.gbl...
> >> Use Query Analyzer and run RESTORE FILELISTONLY for the backup file.
> >> Post
> >> those results here. We'll follow up when we get those.
> >>
> >> --
> >> Tom
> >>
> >> ----
> >> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
> >> SQL Server MVP
> >> Toronto, ON Canada
> >> https://mvp.support.microsoft.com/profile/Tom.Moreau
> >>
> >>
> >> "Gonzo" <no@.no123.com> wrote in message
> >> news:523266A9-C34C-47F9-9C22-FC91A9E798E7@.microsoft.com...
> >> I need to restore a database over an existing DB (I have made a backup
> >> and
> >> it's SQL 2000).
> >>
> >> When I do try and restore it via SQL Enterprose Manager 2000 (the only
> >> way
> >> I
> >> know) it it says "logical file 'database' is not part of a database
> >> 'database2'. Use RESTORE FILELISTONLY to list the logocal file names.
> >> RESTORE DATAVASE is terminating adbnormally.
> >>
> >
>|||It seems I can restore it using EM (tried on a test server) but only if i
keep the logical names. in E:\Program Files\Microsoft SQL Server\MSSQL\Data
the databse is RM_test1 but I right click on the database and go to
properties and then the tabs Data files and transaction log then the file
name is Btest_data and Btest_logs. Now a database on the live server is
already called 'Btest' will this cause a problem?
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
news:e4XJkINtHHA.3504@.TK2MSFTNGP05.phx.gbl...
> Type:
> use master
> go
> ... before running the RESTORE. Also, be sure that no one is connected
> to
> the DB when you restore it.
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
> SQL Server MVP
> Toronto, ON Canada
> https://mvp.support.microsoft.com/profile/Tom.Moreau
>
> "Gonzo" <no@.no123.com> wrote in message
> news:863AE2DE-3B3B-4647-8AC6-6BFAE4FFDDEC@.microsoft.com...
> Hi I get:
> Server: Msg 3101, Level 16, State 1, Line 1
> Exclusive access could not be obtained because the database is in use.
> Server: Msg 3013, Level 16, State 1, Line 1
> RESTORE DATABASE is terminating abnormally.
>
>
>
>
> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
> news:%23SUif2MtHHA.4796@.TK2MSFTNGP04.phx.gbl...
>> From QA, run:
>> RESTORE DATABASE RM_test1
>> FROM DISK = 'f:\MSSQL80\BACKUP\RM_test1.bak'
>> WITH REPLACE
>> --
>> Tom
>> ----
>> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
>> SQL Server MVP
>> Toronto, ON Canada
>> https://mvp.support.microsoft.com/profile/Tom.Moreau
>>
>> "Gonzo" <no@.no123.com> wrote in message
>> news:9F74A63C-2524-4AE0-AEAC-9E9853D66B30@.microsoft.com...
>> Many thanks:
>> RESTORE FILElISTONLY from Disk = 'f:\MSSQL80\BACKUP\RM_test1.bak'
>> I get:
>> Btest_Data C:\Program Files\Microsoft SQL
>> Server\MSSQL\Data\BRITLIVE.mdf
>> D PRIMARY
>> Btest_Log C:\Program Files\Microsoft SQL
>> Server\MSSQL\Data\BRITLIVE_log.ldf L NULL
>>
>> On the server we have these DB's:
>> Btest
>> RM_test1
>>
>> We sent a company the Btest DB to make some changes that they have done
>> and
>> sent the bak file back. I need to restore this over the RM_test1 DB, but
>> it
>> seems that it still references the original Btest DB everywhere.
>>
>> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
>> news:OUAXLKMtHHA.4572@.TK2MSFTNGP02.phx.gbl...
>> Use Query Analyzer and run RESTORE FILELISTONLY for the backup file.
>> Post
>> those results here. We'll follow up when we get those.
>> --
>> Tom
>> ----
>> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
>> SQL Server MVP
>> Toronto, ON Canada
>> https://mvp.support.microsoft.com/profile/Tom.Moreau
>>
>> "Gonzo" <no@.no123.com> wrote in message
>> news:523266A9-C34C-47F9-9C22-FC91A9E798E7@.microsoft.com...
>> I need to restore a database over an existing DB (I have made a backup
>> and
>> it's SQL 2000).
>> When I do try and restore it via SQL Enterprose Manager 2000 (the only
>> way
>> I
>> know) it it says "logical file 'database' is not part of a database
>> 'database2'. Use RESTORE FILELISTONLY to list the logocal file names.
>> RESTORE DATAVASE is terminating adbnormally.
>>
>|||I now get:
Processed 9336 pages for database 'RM_test1', file 'Btest_Data' on file 1.
Processed 1 pages for database 'RM_test1', file 'Btest_Log' on file 1.
RESTORE DATABASE successfully processed 9337 pages in 13.278 seconds (5.760
MB/sec).
There is a database caleld Btest already uses Btest for it's database name
and logical name, will this create a problem with both having the same name?
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
news:e4XJkINtHHA.3504@.TK2MSFTNGP05.phx.gbl...
> Type:
> use master
> go
> ... before running the RESTORE. Also, be sure that no one is connected
> to
> the DB when you restore it.
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
> SQL Server MVP
> Toronto, ON Canada
> https://mvp.support.microsoft.com/profile/Tom.Moreau
>
> "Gonzo" <no@.no123.com> wrote in message
> news:863AE2DE-3B3B-4647-8AC6-6BFAE4FFDDEC@.microsoft.com...
> Hi I get:
> Server: Msg 3101, Level 16, State 1, Line 1
> Exclusive access could not be obtained because the database is in use.
> Server: Msg 3013, Level 16, State 1, Line 1
> RESTORE DATABASE is terminating abnormally.
>
>
>
>
> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
> news:%23SUif2MtHHA.4796@.TK2MSFTNGP04.phx.gbl...
>> From QA, run:
>> RESTORE DATABASE RM_test1
>> FROM DISK = 'f:\MSSQL80\BACKUP\RM_test1.bak'
>> WITH REPLACE
>> --
>> Tom
>> ----
>> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
>> SQL Server MVP
>> Toronto, ON Canada
>> https://mvp.support.microsoft.com/profile/Tom.Moreau
>>
>> "Gonzo" <no@.no123.com> wrote in message
>> news:9F74A63C-2524-4AE0-AEAC-9E9853D66B30@.microsoft.com...
>> Many thanks:
>> RESTORE FILElISTONLY from Disk = 'f:\MSSQL80\BACKUP\RM_test1.bak'
>> I get:
>> Btest_Data C:\Program Files\Microsoft SQL
>> Server\MSSQL\Data\BRITLIVE.mdf
>> D PRIMARY
>> Btest_Log C:\Program Files\Microsoft SQL
>> Server\MSSQL\Data\BRITLIVE_log.ldf L NULL
>>
>> On the server we have these DB's:
>> Btest
>> RM_test1
>>
>> We sent a company the Btest DB to make some changes that they have done
>> and
>> sent the bak file back. I need to restore this over the RM_test1 DB, but
>> it
>> seems that it still references the original Btest DB everywhere.
>>
>> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
>> news:OUAXLKMtHHA.4572@.TK2MSFTNGP02.phx.gbl...
>> Use Query Analyzer and run RESTORE FILELISTONLY for the backup file.
>> Post
>> those results here. We'll follow up when we get those.
>> --
>> Tom
>> ----
>> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
>> SQL Server MVP
>> Toronto, ON Canada
>> https://mvp.support.microsoft.com/profile/Tom.Moreau
>>
>> "Gonzo" <no@.no123.com> wrote in message
>> news:523266A9-C34C-47F9-9C22-FC91A9E798E7@.microsoft.com...
>> I need to restore a database over an existing DB (I have made a backup
>> and
>> it's SQL 2000).
>> When I do try and restore it via SQL Enterprose Manager 2000 (the only
>> way
>> I
>> know) it it says "logical file 'database' is not part of a database
>> 'database2'. Use RESTORE FILELISTONLY to list the logocal file names.
>> RESTORE DATAVASE is terminating adbnormally.
>>
>|||You have to keep the logical names for the restore. You can change those
later.
--
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
SQL Server MVP
Toronto, ON Canada
https://mvp.support.microsoft.com/profile/Tom.Moreau
"Gonzo" <no@.no123.com> wrote in message
news:A4969E2E-1F25-484A-BDE3-91247145CD79@.microsoft.com...
It seems I can restore it using EM (tried on a test server) but only if i
keep the logical names. in E:\Program Files\Microsoft SQL Server\MSSQL\Data
the databse is RM_test1 but I right click on the database and go to
properties and then the tabs Data files and transaction log then the file
name is Btest_data and Btest_logs. Now a database on the live server is
already called 'Btest' will this cause a problem?
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
news:e4XJkINtHHA.3504@.TK2MSFTNGP05.phx.gbl...
> Type:
> use master
> go
> ... before running the RESTORE. Also, be sure that no one is connected
> to
> the DB when you restore it.
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
> SQL Server MVP
> Toronto, ON Canada
> https://mvp.support.microsoft.com/profile/Tom.Moreau
>
> "Gonzo" <no@.no123.com> wrote in message
> news:863AE2DE-3B3B-4647-8AC6-6BFAE4FFDDEC@.microsoft.com...
> Hi I get:
> Server: Msg 3101, Level 16, State 1, Line 1
> Exclusive access could not be obtained because the database is in use.
> Server: Msg 3013, Level 16, State 1, Line 1
> RESTORE DATABASE is terminating abnormally.
>
>
>
>
> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
> news:%23SUif2MtHHA.4796@.TK2MSFTNGP04.phx.gbl...
>> From QA, run:
>> RESTORE DATABASE RM_test1
>> FROM DISK = 'f:\MSSQL80\BACKUP\RM_test1.bak'
>> WITH REPLACE
>> --
>> Tom
>> ----
>> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
>> SQL Server MVP
>> Toronto, ON Canada
>> https://mvp.support.microsoft.com/profile/Tom.Moreau
>>
>> "Gonzo" <no@.no123.com> wrote in message
>> news:9F74A63C-2524-4AE0-AEAC-9E9853D66B30@.microsoft.com...
>> Many thanks:
>> RESTORE FILElISTONLY from Disk = 'f:\MSSQL80\BACKUP\RM_test1.bak'
>> I get:
>> Btest_Data C:\Program Files\Microsoft SQL
>> Server\MSSQL\Data\BRITLIVE.mdf
>> D PRIMARY
>> Btest_Log C:\Program Files\Microsoft SQL
>> Server\MSSQL\Data\BRITLIVE_log.ldf L NULL
>>
>> On the server we have these DB's:
>> Btest
>> RM_test1
>>
>> We sent a company the Btest DB to make some changes that they have done
>> and
>> sent the bak file back. I need to restore this over the RM_test1 DB, but
>> it
>> seems that it still references the original Btest DB everywhere.
>>
>> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
>> news:OUAXLKMtHHA.4572@.TK2MSFTNGP02.phx.gbl...
>> Use Query Analyzer and run RESTORE FILELISTONLY for the backup file.
>> Post
>> those results here. We'll follow up when we get those.
>> --
>> Tom
>> ----
>> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
>> SQL Server MVP
>> Toronto, ON Canada
>> https://mvp.support.microsoft.com/profile/Tom.Moreau
>>
>> "Gonzo" <no@.no123.com> wrote in message
>> news:523266A9-C34C-47F9-9C22-FC91A9E798E7@.microsoft.com...
>> I need to restore a database over an existing DB (I have made a backup
>> and
>> it's SQL 2000).
>> When I do try and restore it via SQL Enterprose Manager 2000 (the only
>> way
>> I
>> know) it it says "logical file 'database' is not part of a database
>> 'database2'. Use RESTORE FILELISTONLY to list the logocal file names.
>> RESTORE DATAVASE is terminating adbnormally.
>>
>|||Use
Restore Database <db_name>
from Disk = 'f:\MSSQL80\BACKUP\RM_test1.bak'
WITH Move 'Btest_Data' To 'C:\Program Files\Microsoft SQL
Server\MSSQL\Data\BRITLIVE_2.mdf',
Move 'Btest_Log' To 'C:\Program Files\Microsoft SQL
Server\MSSQL\Data\BRITLIVE_2_log.ldf',
just change the name of the .mdf & .ldf to something that doesn't already
exist.
--
MG
"Gonzo" wrote:
> It seems I can restore it using EM (tried on a test server) but only if i
> keep the logical names. in E:\Program Files\Microsoft SQL Server\MSSQL\Data
> the databse is RM_test1 but I right click on the database and go to
> properties and then the tabs Data files and transaction log then the file
> name is Btest_data and Btest_logs. Now a database on the live server is
> already called 'Btest' will this cause a problem?
>
> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
> news:e4XJkINtHHA.3504@.TK2MSFTNGP05.phx.gbl...
> > Type:
> >
> > use master
> > go
> >
> > ... before running the RESTORE. Also, be sure that no one is connected
> > to
> > the DB when you restore it.
> >
> > --
> > Tom
> >
> > ----
> > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
> > SQL Server MVP
> > Toronto, ON Canada
> > https://mvp.support.microsoft.com/profile/Tom.Moreau
> >
> >
> > "Gonzo" <no@.no123.com> wrote in message
> > news:863AE2DE-3B3B-4647-8AC6-6BFAE4FFDDEC@.microsoft.com...
> > Hi I get:
> >
> > Server: Msg 3101, Level 16, State 1, Line 1
> > Exclusive access could not be obtained because the database is in use.
> > Server: Msg 3013, Level 16, State 1, Line 1
> > RESTORE DATABASE is terminating abnormally.
> >
> >
> >
> >
> >
> >
> >
> >
> > "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
> > news:%23SUif2MtHHA.4796@.TK2MSFTNGP04.phx.gbl...
> >> From QA, run:
> >>
> >> RESTORE DATABASE RM_test1
> >> FROM DISK = 'f:\MSSQL80\BACKUP\RM_test1.bak'
> >> WITH REPLACE
> >>
> >> --
> >> Tom
> >>
> >> ----
> >> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
> >> SQL Server MVP
> >> Toronto, ON Canada
> >> https://mvp.support.microsoft.com/profile/Tom.Moreau
> >>
> >>
> >> "Gonzo" <no@.no123.com> wrote in message
> >> news:9F74A63C-2524-4AE0-AEAC-9E9853D66B30@.microsoft.com...
> >> Many thanks:
> >>
> >> RESTORE FILElISTONLY from Disk = 'f:\MSSQL80\BACKUP\RM_test1.bak'
> >>
> >> I get:
> >>
> >> Btest_Data C:\Program Files\Microsoft SQL
> >> Server\MSSQL\Data\BRITLIVE.mdf
> >> D PRIMARY
> >> Btest_Log C:\Program Files\Microsoft SQL
> >> Server\MSSQL\Data\BRITLIVE_log.ldf L NULL
> >>
> >>
> >> On the server we have these DB's:
> >>
> >> Btest
> >> RM_test1
> >>
> >>
> >> We sent a company the Btest DB to make some changes that they have done
> >> and
> >> sent the bak file back. I need to restore this over the RM_test1 DB, but
> >> it
> >> seems that it still references the original Btest DB everywhere.
> >>
> >>
> >> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
> >> news:OUAXLKMtHHA.4572@.TK2MSFTNGP02.phx.gbl...
> >> Use Query Analyzer and run RESTORE FILELISTONLY for the backup file.
> >> Post
> >> those results here. We'll follow up when we get those.
> >>
> >> --
> >> Tom
> >>
> >> ----
> >> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
> >> SQL Server MVP
> >> Toronto, ON Canada
> >> https://mvp.support.microsoft.com/profile/Tom.Moreau
> >>
> >>
> >> "Gonzo" <no@.no123.com> wrote in message
> >> news:523266A9-C34C-47F9-9C22-FC91A9E798E7@.microsoft.com...
> >> I need to restore a database over an existing DB (I have made a backup
> >> and
> >> it's SQL 2000).
> >>
> >> When I do try and restore it via SQL Enterprose Manager 2000 (the only
> >> way
> >> I
> >> know) it it says "logical file 'database' is not part of a database
> >> 'database2'. Use RESTORE FILELISTONLY to list the logocal file names.
> >> RESTORE DATAVASE is terminating adbnormally.
> >>
> >>
> >
>|||I have restored it now, how can I now change the logical names to something
else?
many thanks
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
news:O4i5xSNtHHA.3556@.TK2MSFTNGP05.phx.gbl...
> You have to keep the logical names for the restore. You can change those
> later.
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
> SQL Server MVP
> Toronto, ON Canada
> https://mvp.support.microsoft.com/profile/Tom.Moreau
>
> "Gonzo" <no@.no123.com> wrote in message
> news:A4969E2E-1F25-484A-BDE3-91247145CD79@.microsoft.com...
> It seems I can restore it using EM (tried on a test server) but only if i
> keep the logical names. in E:\Program Files\Microsoft SQL
> Server\MSSQL\Data
> the databse is RM_test1 but I right click on the database and go to
> properties and then the tabs Data files and transaction log then the file
> name is Btest_data and Btest_logs. Now a database on the live server is
> already called 'Btest' will this cause a problem?
>
> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
> news:e4XJkINtHHA.3504@.TK2MSFTNGP05.phx.gbl...
>> Type:
>> use master
>> go
>> ... before running the RESTORE. Also, be sure that no one is connected
>> to
>> the DB when you restore it.
>> --
>> Tom
>> ----
>> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
>> SQL Server MVP
>> Toronto, ON Canada
>> https://mvp.support.microsoft.com/profile/Tom.Moreau
>>
>> "Gonzo" <no@.no123.com> wrote in message
>> news:863AE2DE-3B3B-4647-8AC6-6BFAE4FFDDEC@.microsoft.com...
>> Hi I get:
>> Server: Msg 3101, Level 16, State 1, Line 1
>> Exclusive access could not be obtained because the database is in use.
>> Server: Msg 3013, Level 16, State 1, Line 1
>> RESTORE DATABASE is terminating abnormally.
>>
>>
>>
>>
>> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
>> news:%23SUif2MtHHA.4796@.TK2MSFTNGP04.phx.gbl...
>> From QA, run:
>> RESTORE DATABASE RM_test1
>> FROM DISK = 'f:\MSSQL80\BACKUP\RM_test1.bak'
>> WITH REPLACE
>> --
>> Tom
>> ----
>> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
>> SQL Server MVP
>> Toronto, ON Canada
>> https://mvp.support.microsoft.com/profile/Tom.Moreau
>>
>> "Gonzo" <no@.no123.com> wrote in message
>> news:9F74A63C-2524-4AE0-AEAC-9E9853D66B30@.microsoft.com...
>> Many thanks:
>> RESTORE FILElISTONLY from Disk = 'f:\MSSQL80\BACKUP\RM_test1.bak'
>> I get:
>> Btest_Data C:\Program Files\Microsoft SQL
>> Server\MSSQL\Data\BRITLIVE.mdf
>> D PRIMARY
>> Btest_Log C:\Program Files\Microsoft SQL
>> Server\MSSQL\Data\BRITLIVE_log.ldf L NULL
>>
>> On the server we have these DB's:
>> Btest
>> RM_test1
>>
>> We sent a company the Btest DB to make some changes that they have done
>> and
>> sent the bak file back. I need to restore this over the RM_test1 DB,
>> but
>> it
>> seems that it still references the original Btest DB everywhere.
>>
>> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
>> news:OUAXLKMtHHA.4572@.TK2MSFTNGP02.phx.gbl...
>> Use Query Analyzer and run RESTORE FILELISTONLY for the backup file.
>> Post
>> those results here. We'll follow up when we get those.
>> --
>> Tom
>> ----
>> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
>> SQL Server MVP
>> Toronto, ON Canada
>> https://mvp.support.microsoft.com/profile/Tom.Moreau
>>
>> "Gonzo" <no@.no123.com> wrote in message
>> news:523266A9-C34C-47F9-9C22-FC91A9E798E7@.microsoft.com...
>> I need to restore a database over an existing DB (I have made a backup
>> and
>> it's SQL 2000).
>> When I do try and restore it via SQL Enterprose Manager 2000 (the only
>> way
>> I
>> know) it it says "logical file 'database' is not part of a database
>> 'database2'. Use RESTORE FILELISTONLY to list the logocal file names.
>> RESTORE DATAVASE is terminating adbnormally.
>>
>|||No. Logical names are local to the DB.
--
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
SQL Server MVP
Toronto, ON Canada
https://mvp.support.microsoft.com/profile/Tom.Moreau
"Gonzo" <no@.no123.com> wrote in message
news:28BF2F6F-4256-4299-BE76-1F1DAAB4D61F@.microsoft.com...
I now get:
Processed 9336 pages for database 'RM_test1', file 'Btest_Data' on file 1.
Processed 1 pages for database 'RM_test1', file 'Btest_Log' on file 1.
RESTORE DATABASE successfully processed 9337 pages in 13.278 seconds (5.760
MB/sec).
There is a database caleld Btest already uses Btest for it's database name
and logical name, will this create a problem with both having the same name?
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
news:e4XJkINtHHA.3504@.TK2MSFTNGP05.phx.gbl...
> Type:
> use master
> go
> ... before running the RESTORE. Also, be sure that no one is connected
> to
> the DB when you restore it.
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
> SQL Server MVP
> Toronto, ON Canada
> https://mvp.support.microsoft.com/profile/Tom.Moreau
>
> "Gonzo" <no@.no123.com> wrote in message
> news:863AE2DE-3B3B-4647-8AC6-6BFAE4FFDDEC@.microsoft.com...
> Hi I get:
> Server: Msg 3101, Level 16, State 1, Line 1
> Exclusive access could not be obtained because the database is in use.
> Server: Msg 3013, Level 16, State 1, Line 1
> RESTORE DATABASE is terminating abnormally.
>
>
>
>
> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
> news:%23SUif2MtHHA.4796@.TK2MSFTNGP04.phx.gbl...
>> From QA, run:
>> RESTORE DATABASE RM_test1
>> FROM DISK = 'f:\MSSQL80\BACKUP\RM_test1.bak'
>> WITH REPLACE
>> --
>> Tom
>> ----
>> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
>> SQL Server MVP
>> Toronto, ON Canada
>> https://mvp.support.microsoft.com/profile/Tom.Moreau
>>
>> "Gonzo" <no@.no123.com> wrote in message
>> news:9F74A63C-2524-4AE0-AEAC-9E9853D66B30@.microsoft.com...
>> Many thanks:
>> RESTORE FILElISTONLY from Disk = 'f:\MSSQL80\BACKUP\RM_test1.bak'
>> I get:
>> Btest_Data C:\Program Files\Microsoft SQL
>> Server\MSSQL\Data\BRITLIVE.mdf
>> D PRIMARY
>> Btest_Log C:\Program Files\Microsoft SQL
>> Server\MSSQL\Data\BRITLIVE_log.ldf L NULL
>>
>> On the server we have these DB's:
>> Btest
>> RM_test1
>>
>> We sent a company the Btest DB to make some changes that they have done
>> and
>> sent the bak file back. I need to restore this over the RM_test1 DB, but
>> it
>> seems that it still references the original Btest DB everywhere.
>>
>> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
>> news:OUAXLKMtHHA.4572@.TK2MSFTNGP02.phx.gbl...
>> Use Query Analyzer and run RESTORE FILELISTONLY for the backup file.
>> Post
>> those results here. We'll follow up when we get those.
>> --
>> Tom
>> ----
>> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
>> SQL Server MVP
>> Toronto, ON Canada
>> https://mvp.support.microsoft.com/profile/Tom.Moreau
>>
>> "Gonzo" <no@.no123.com> wrote in message
>> news:523266A9-C34C-47F9-9C22-FC91A9E798E7@.microsoft.com...
>> I need to restore a database over an existing DB (I have made a backup
>> and
>> it's SQL 2000).
>> When I do try and restore it via SQL Enterprose Manager 2000 (the only
>> way
>> I
>> know) it it says "logical file 'database' is not part of a database
>> 'database2'. Use RESTORE FILELISTONLY to list the logocal file names.
>> RESTORE DATAVASE is terminating adbnormally.
>>
>|||Check out ALTER DATABASE in the BOL.
--
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
SQL Server MVP
Toronto, ON Canada
https://mvp.support.microsoft.com/profile/Tom.Moreau
"Gonzo" <no@.no123.com> wrote in message
news:%23JzdGUNtHHA.768@.TK2MSFTNGP04.phx.gbl...
I have restored it now, how can I now change the logical names to something
else?
many thanks
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
news:O4i5xSNtHHA.3556@.TK2MSFTNGP05.phx.gbl...
> You have to keep the logical names for the restore. You can change those
> later.
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
> SQL Server MVP
> Toronto, ON Canada
> https://mvp.support.microsoft.com/profile/Tom.Moreau
>
> "Gonzo" <no@.no123.com> wrote in message
> news:A4969E2E-1F25-484A-BDE3-91247145CD79@.microsoft.com...
> It seems I can restore it using EM (tried on a test server) but only if i
> keep the logical names. in E:\Program Files\Microsoft SQL
> Server\MSSQL\Data
> the databse is RM_test1 but I right click on the database and go to
> properties and then the tabs Data files and transaction log then the file
> name is Btest_data and Btest_logs. Now a database on the live server is
> already called 'Btest' will this cause a problem?
>
> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
> news:e4XJkINtHHA.3504@.TK2MSFTNGP05.phx.gbl...
>> Type:
>> use master
>> go
>> ... before running the RESTORE. Also, be sure that no one is connected
>> to
>> the DB when you restore it.
>> --
>> Tom
>> ----
>> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
>> SQL Server MVP
>> Toronto, ON Canada
>> https://mvp.support.microsoft.com/profile/Tom.Moreau
>>
>> "Gonzo" <no@.no123.com> wrote in message
>> news:863AE2DE-3B3B-4647-8AC6-6BFAE4FFDDEC@.microsoft.com...
>> Hi I get:
>> Server: Msg 3101, Level 16, State 1, Line 1
>> Exclusive access could not be obtained because the database is in use.
>> Server: Msg 3013, Level 16, State 1, Line 1
>> RESTORE DATABASE is terminating abnormally.
>>
>>
>>
>>
>> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
>> news:%23SUif2MtHHA.4796@.TK2MSFTNGP04.phx.gbl...
>> From QA, run:
>> RESTORE DATABASE RM_test1
>> FROM DISK = 'f:\MSSQL80\BACKUP\RM_test1.bak'
>> WITH REPLACE
>> --
>> Tom
>> ----
>> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
>> SQL Server MVP
>> Toronto, ON Canada
>> https://mvp.support.microsoft.com/profile/Tom.Moreau
>>
>> "Gonzo" <no@.no123.com> wrote in message
>> news:9F74A63C-2524-4AE0-AEAC-9E9853D66B30@.microsoft.com...
>> Many thanks:
>> RESTORE FILElISTONLY from Disk = 'f:\MSSQL80\BACKUP\RM_test1.bak'
>> I get:
>> Btest_Data C:\Program Files\Microsoft SQL
>> Server\MSSQL\Data\BRITLIVE.mdf
>> D PRIMARY
>> Btest_Log C:\Program Files\Microsoft SQL
>> Server\MSSQL\Data\BRITLIVE_log.ldf L NULL
>>
>> On the server we have these DB's:
>> Btest
>> RM_test1
>>
>> We sent a company the Btest DB to make some changes that they have done
>> and
>> sent the bak file back. I need to restore this over the RM_test1 DB,
>> but
>> it
>> seems that it still references the original Btest DB everywhere.
>>
>> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
>> news:OUAXLKMtHHA.4572@.TK2MSFTNGP02.phx.gbl...
>> Use Query Analyzer and run RESTORE FILELISTONLY for the backup file.
>> Post
>> those results here. We'll follow up when we get those.
>> --
>> Tom
>> ----
>> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
>> SQL Server MVP
>> Toronto, ON Canada
>> https://mvp.support.microsoft.com/profile/Tom.Moreau
>>
>> "Gonzo" <no@.no123.com> wrote in message
>> news:523266A9-C34C-47F9-9C22-FC91A9E798E7@.microsoft.com...
>> I need to restore a database over an existing DB (I have made a backup
>> and
>> it's SQL 2000).
>> When I do try and restore it via SQL Enterprose Manager 2000 (the only
>> way
>> I
>> know) it it says "logical file 'database' is not part of a database
>> 'database2'. Use RESTORE FILELISTONLY to list the logocal file names.
>> RESTORE DATAVASE is terminating adbnormally.
>>
>|||Woudl this be it? I would have to do this for both files I guess (this is
all new to me)
ALTER DATABASE
MODIFY FILE (NAME = logical_file_name, NEWNAME = new_logical_name...).
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
news:%23PPC$WNtHHA.4688@.TK2MSFTNGP05.phx.gbl...
> Check out ALTER DATABASE in the BOL.
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
> SQL Server MVP
> Toronto, ON Canada
> https://mvp.support.microsoft.com/profile/Tom.Moreau
>
> "Gonzo" <no@.no123.com> wrote in message
> news:%23JzdGUNtHHA.768@.TK2MSFTNGP04.phx.gbl...
> I have restored it now, how can I now change the logical names to
> something
> else?
> many thanks
>
> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
> news:O4i5xSNtHHA.3556@.TK2MSFTNGP05.phx.gbl...
>> You have to keep the logical names for the restore. You can change those
>> later.
>> --
>> Tom
>> ----
>> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
>> SQL Server MVP
>> Toronto, ON Canada
>> https://mvp.support.microsoft.com/profile/Tom.Moreau
>>
>> "Gonzo" <no@.no123.com> wrote in message
>> news:A4969E2E-1F25-484A-BDE3-91247145CD79@.microsoft.com...
>> It seems I can restore it using EM (tried on a test server) but only if i
>> keep the logical names. in E:\Program Files\Microsoft SQL
>> Server\MSSQL\Data
>> the databse is RM_test1 but I right click on the database and go to
>> properties and then the tabs Data files and transaction log then the file
>> name is Btest_data and Btest_logs. Now a database on the live server is
>> already called 'Btest' will this cause a problem?
>>
>> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
>> news:e4XJkINtHHA.3504@.TK2MSFTNGP05.phx.gbl...
>> Type:
>> use master
>> go
>> ... before running the RESTORE. Also, be sure that no one is connected
>> to
>> the DB when you restore it.
>> --
>> Tom
>> ----
>> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
>> SQL Server MVP
>> Toronto, ON Canada
>> https://mvp.support.microsoft.com/profile/Tom.Moreau
>>
>> "Gonzo" <no@.no123.com> wrote in message
>> news:863AE2DE-3B3B-4647-8AC6-6BFAE4FFDDEC@.microsoft.com...
>> Hi I get:
>> Server: Msg 3101, Level 16, State 1, Line 1
>> Exclusive access could not be obtained because the database is in use.
>> Server: Msg 3013, Level 16, State 1, Line 1
>> RESTORE DATABASE is terminating abnormally.
>>
>>
>>
>>
>> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
>> news:%23SUif2MtHHA.4796@.TK2MSFTNGP04.phx.gbl...
>> From QA, run:
>> RESTORE DATABASE RM_test1
>> FROM DISK = 'f:\MSSQL80\BACKUP\RM_test1.bak'
>> WITH REPLACE
>> --
>> Tom
>> ----
>> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
>> SQL Server MVP
>> Toronto, ON Canada
>> https://mvp.support.microsoft.com/profile/Tom.Moreau
>>
>> "Gonzo" <no@.no123.com> wrote in message
>> news:9F74A63C-2524-4AE0-AEAC-9E9853D66B30@.microsoft.com...
>> Many thanks:
>> RESTORE FILElISTONLY from Disk = 'f:\MSSQL80\BACKUP\RM_test1.bak'
>> I get:
>> Btest_Data C:\Program Files\Microsoft SQL
>> Server\MSSQL\Data\BRITLIVE.mdf
>> D PRIMARY
>> Btest_Log C:\Program Files\Microsoft SQL
>> Server\MSSQL\Data\BRITLIVE_log.ldf L NULL
>>
>> On the server we have these DB's:
>> Btest
>> RM_test1
>>
>> We sent a company the Btest DB to make some changes that they have done
>> and
>> sent the bak file back. I need to restore this over the RM_test1 DB,
>> but
>> it
>> seems that it still references the original Btest DB everywhere.
>>
>> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
>> news:OUAXLKMtHHA.4572@.TK2MSFTNGP02.phx.gbl...
>> Use Query Analyzer and run RESTORE FILELISTONLY for the backup file.
>> Post
>> those results here. We'll follow up when we get those.
>> --
>> Tom
>> ----
>> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
>> SQL Server MVP
>> Toronto, ON Canada
>> https://mvp.support.microsoft.com/profile/Tom.Moreau
>>
>> "Gonzo" <no@.no123.com> wrote in message
>> news:523266A9-C34C-47F9-9C22-FC91A9E798E7@.microsoft.com...
>> I need to restore a database over an existing DB (I have made a backup
>> and
>> it's SQL 2000).
>> When I do try and restore it via SQL Enterprose Manager 2000 (the only
>> way
>> I
>> know) it it says "logical file 'database' is not part of a database
>> 'database2'. Use RESTORE FILELISTONLY to list the logocal file names.
>> RESTORE DATAVASE is terminating adbnormally.
>>
>>
>|||Yep.
--
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
SQL Server MVP
Toronto, ON Canada
https://mvp.support.microsoft.com/profile/Tom.Moreau
"Gonzo" <no@.no123.com> wrote in message
news:46D17BBE-E208-4A83-942E-B7446A202C5A@.microsoft.com...
Woudl this be it? I would have to do this for both files I guess (this is
all new to me)
ALTER DATABASE
MODIFY FILE (NAME = logical_file_name, NEWNAME = new_logical_name...).
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
news:%23PPC$WNtHHA.4688@.TK2MSFTNGP05.phx.gbl...
> Check out ALTER DATABASE in the BOL.
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
> SQL Server MVP
> Toronto, ON Canada
> https://mvp.support.microsoft.com/profile/Tom.Moreau
>
> "Gonzo" <no@.no123.com> wrote in message
> news:%23JzdGUNtHHA.768@.TK2MSFTNGP04.phx.gbl...
> I have restored it now, how can I now change the logical names to
> something
> else?
> many thanks
>
> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
> news:O4i5xSNtHHA.3556@.TK2MSFTNGP05.phx.gbl...
>> You have to keep the logical names for the restore. You can change those
>> later.
>> --
>> Tom
>> ----
>> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
>> SQL Server MVP
>> Toronto, ON Canada
>> https://mvp.support.microsoft.com/profile/Tom.Moreau
>>
>> "Gonzo" <no@.no123.com> wrote in message
>> news:A4969E2E-1F25-484A-BDE3-91247145CD79@.microsoft.com...
>> It seems I can restore it using EM (tried on a test server) but only if i
>> keep the logical names. in E:\Program Files\Microsoft SQL
>> Server\MSSQL\Data
>> the databse is RM_test1 but I right click on the database and go to
>> properties and then the tabs Data files and transaction log then the file
>> name is Btest_data and Btest_logs. Now a database on the live server is
>> already called 'Btest' will this cause a problem?
>>
>> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
>> news:e4XJkINtHHA.3504@.TK2MSFTNGP05.phx.gbl...
>> Type:
>> use master
>> go
>> ... before running the RESTORE. Also, be sure that no one is connected
>> to
>> the DB when you restore it.
>> --
>> Tom
>> ----
>> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
>> SQL Server MVP
>> Toronto, ON Canada
>> https://mvp.support.microsoft.com/profile/Tom.Moreau
>>
>> "Gonzo" <no@.no123.com> wrote in message
>> news:863AE2DE-3B3B-4647-8AC6-6BFAE4FFDDEC@.microsoft.com...
>> Hi I get:
>> Server: Msg 3101, Level 16, State 1, Line 1
>> Exclusive access could not be obtained because the database is in use.
>> Server: Msg 3013, Level 16, State 1, Line 1
>> RESTORE DATABASE is terminating abnormally.
>>
>>
>>
>>
>> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
>> news:%23SUif2MtHHA.4796@.TK2MSFTNGP04.phx.gbl...
>> From QA, run:
>> RESTORE DATABASE RM_test1
>> FROM DISK = 'f:\MSSQL80\BACKUP\RM_test1.bak'
>> WITH REPLACE
>> --
>> Tom
>> ----
>> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
>> SQL Server MVP
>> Toronto, ON Canada
>> https://mvp.support.microsoft.com/profile/Tom.Moreau
>>
>> "Gonzo" <no@.no123.com> wrote in message
>> news:9F74A63C-2524-4AE0-AEAC-9E9853D66B30@.microsoft.com...
>> Many thanks:
>> RESTORE FILElISTONLY from Disk = 'f:\MSSQL80\BACKUP\RM_test1.bak'
>> I get:
>> Btest_Data C:\Program Files\Microsoft SQL
>> Server\MSSQL\Data\BRITLIVE.mdf
>> D PRIMARY
>> Btest_Log C:\Program Files\Microsoft SQL
>> Server\MSSQL\Data\BRITLIVE_log.ldf L NULL
>>
>> On the server we have these DB's:
>> Btest
>> RM_test1
>>
>> We sent a company the Btest DB to make some changes that they have done
>> and
>> sent the bak file back. I need to restore this over the RM_test1 DB,
>> but
>> it
>> seems that it still references the original Btest DB everywhere.
>>
>> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
>> news:OUAXLKMtHHA.4572@.TK2MSFTNGP02.phx.gbl...
>> Use Query Analyzer and run RESTORE FILELISTONLY for the backup file.
>> Post
>> those results here. We'll follow up when we get those.
>> --
>> Tom
>> ----
>> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
>> SQL Server MVP
>> Toronto, ON Canada
>> https://mvp.support.microsoft.com/profile/Tom.Moreau
>>
>> "Gonzo" <no@.no123.com> wrote in message
>> news:523266A9-C34C-47F9-9C22-FC91A9E798E7@.microsoft.com...
>> I need to restore a database over an existing DB (I have made a backup
>> and
>> it's SQL 2000).
>> When I do try and restore it via SQL Enterprose Manager 2000 (the only
>> way
>> I
>> know) it it says "logical file 'database' is not part of a database
>> 'database2'. Use RESTORE FILELISTONLY to list the logocal file names.
>> RESTORE DATAVASE is terminating adbnormally.
>>
>>
>|||Sorry about this, I'm now getting:
ALTER DATABASE RM_TEST1
MODIFY FILE (Btest_Data = logical_file_name, RM_test1_DATA =new_logical_name...).
Server: Msg 155, Level 15, State 1, Line 2
'Btest_Data' is not a recognized CREATE/ALTER DATABASE option.
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
news:O$$Y4jNtHHA.4824@.TK2MSFTNGP06.phx.gbl...
> Yep.
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
> SQL Server MVP
> Toronto, ON Canada
> https://mvp.support.microsoft.com/profile/Tom.Moreau
>
> "Gonzo" <no@.no123.com> wrote in message
> news:46D17BBE-E208-4A83-942E-B7446A202C5A@.microsoft.com...
> Woudl this be it? I would have to do this for both files I guess (this is
> all new to me)
> ALTER DATABASE
> MODIFY FILE (NAME = logical_file_name, NEWNAME = new_logical_name...).
>
> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
> news:%23PPC$WNtHHA.4688@.TK2MSFTNGP05.phx.gbl...
>> Check out ALTER DATABASE in the BOL.
>> --
>> Tom
>> ----
>> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
>> SQL Server MVP
>> Toronto, ON Canada
>> https://mvp.support.microsoft.com/profile/Tom.Moreau
>>
>> "Gonzo" <no@.no123.com> wrote in message
>> news:%23JzdGUNtHHA.768@.TK2MSFTNGP04.phx.gbl...
>> I have restored it now, how can I now change the logical names to
>> something
>> else?
>> many thanks
>>
>> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
>> news:O4i5xSNtHHA.3556@.TK2MSFTNGP05.phx.gbl...
>> You have to keep the logical names for the restore. You can change
>> those
>> later.
>> --
>> Tom
>> ----
>> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
>> SQL Server MVP
>> Toronto, ON Canada
>> https://mvp.support.microsoft.com/profile/Tom.Moreau
>>
>> "Gonzo" <no@.no123.com> wrote in message
>> news:A4969E2E-1F25-484A-BDE3-91247145CD79@.microsoft.com...
>> It seems I can restore it using EM (tried on a test server) but only if
>> i
>> keep the logical names. in E:\Program Files\Microsoft SQL
>> Server\MSSQL\Data
>> the databse is RM_test1 but I right click on the database and go to
>> properties and then the tabs Data files and transaction log then the
>> file
>> name is Btest_data and Btest_logs. Now a database on the live server is
>> already called 'Btest' will this cause a problem?
>>
>> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
>> news:e4XJkINtHHA.3504@.TK2MSFTNGP05.phx.gbl...
>> Type:
>> use master
>> go
>> ... before running the RESTORE. Also, be sure that no one is
>> connected
>> to
>> the DB when you restore it.
>> --
>> Tom
>> ----
>> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
>> SQL Server MVP
>> Toronto, ON Canada
>> https://mvp.support.microsoft.com/profile/Tom.Moreau
>>
>> "Gonzo" <no@.no123.com> wrote in message
>> news:863AE2DE-3B3B-4647-8AC6-6BFAE4FFDDEC@.microsoft.com...
>> Hi I get:
>> Server: Msg 3101, Level 16, State 1, Line 1
>> Exclusive access could not be obtained because the database is in use.
>> Server: Msg 3013, Level 16, State 1, Line 1
>> RESTORE DATABASE is terminating abnormally.
>>
>>
>>
>>
>> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
>> news:%23SUif2MtHHA.4796@.TK2MSFTNGP04.phx.gbl...
>> From QA, run:
>> RESTORE DATABASE RM_test1
>> FROM DISK = 'f:\MSSQL80\BACKUP\RM_test1.bak'
>> WITH REPLACE
>> --
>> Tom
>> ----
>> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
>> SQL Server MVP
>> Toronto, ON Canada
>> https://mvp.support.microsoft.com/profile/Tom.Moreau
>>
>> "Gonzo" <no@.no123.com> wrote in message
>> news:9F74A63C-2524-4AE0-AEAC-9E9853D66B30@.microsoft.com...
>> Many thanks:
>> RESTORE FILElISTONLY from Disk = 'f:\MSSQL80\BACKUP\RM_test1.bak'
>> I get:
>> Btest_Data C:\Program Files\Microsoft SQL
>> Server\MSSQL\Data\BRITLIVE.mdf
>> D PRIMARY
>> Btest_Log C:\Program Files\Microsoft SQL
>> Server\MSSQL\Data\BRITLIVE_log.ldf L NULL
>>
>> On the server we have these DB's:
>> Btest
>> RM_test1
>>
>> We sent a company the Btest DB to make some changes that they have
>> done
>> and
>> sent the bak file back. I need to restore this over the RM_test1 DB,
>> but
>> it
>> seems that it still references the original Btest DB everywhere.
>>
>> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
>> news:OUAXLKMtHHA.4572@.TK2MSFTNGP02.phx.gbl...
>> Use Query Analyzer and run RESTORE FILELISTONLY for the backup file.
>> Post
>> those results here. We'll follow up when we get those.
>> --
>> Tom
>> ----
>> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
>> SQL Server MVP
>> Toronto, ON Canada
>> https://mvp.support.microsoft.com/profile/Tom.Moreau
>>
>> "Gonzo" <no@.no123.com> wrote in message
>> news:523266A9-C34C-47F9-9C22-FC91A9E798E7@.microsoft.com...
>> I need to restore a database over an existing DB (I have made a
>> backup
>> and
>> it's SQL 2000).
>> When I do try and restore it via SQL Enterprose Manager 2000 (the
>> only
>> way
>> I
>> know) it it says "logical file 'database' is not part of a database
>> 'database2'. Use RESTORE FILELISTONLY to list the logocal file
>> names.
>> RESTORE DATAVASE is terminating adbnormally.
>>
>>
>|||Run:
sp_helpfile
...and post the results.
--
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
SQL Server MVP
Toronto, ON Canada
https://mvp.support.microsoft.com/profile/Tom.Moreau
"Gonzo" <no@.no123.com> wrote in message
news:OKu6WmNtHHA.768@.TK2MSFTNGP04.phx.gbl...
Sorry about this, I'm now getting:
ALTER DATABASE RM_TEST1
MODIFY FILE (Btest_Data = logical_file_name, RM_test1_DATA =new_logical_name...).
Server: Msg 155, Level 15, State 1, Line 2
'Btest_Data' is not a recognized CREATE/ALTER DATABASE option.
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
news:O$$Y4jNtHHA.4824@.TK2MSFTNGP06.phx.gbl...
> Yep.
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
> SQL Server MVP
> Toronto, ON Canada
> https://mvp.support.microsoft.com/profile/Tom.Moreau
>
> "Gonzo" <no@.no123.com> wrote in message
> news:46D17BBE-E208-4A83-942E-B7446A202C5A@.microsoft.com...
> Woudl this be it? I would have to do this for both files I guess (this is
> all new to me)
> ALTER DATABASE
> MODIFY FILE (NAME = logical_file_name, NEWNAME = new_logical_name...).
>
> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
> news:%23PPC$WNtHHA.4688@.TK2MSFTNGP05.phx.gbl...
>> Check out ALTER DATABASE in the BOL.
>> --
>> Tom
>> ----
>> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
>> SQL Server MVP
>> Toronto, ON Canada
>> https://mvp.support.microsoft.com/profile/Tom.Moreau
>>
>> "Gonzo" <no@.no123.com> wrote in message
>> news:%23JzdGUNtHHA.768@.TK2MSFTNGP04.phx.gbl...
>> I have restored it now, how can I now change the logical names to
>> something
>> else?
>> many thanks
>>
>> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
>> news:O4i5xSNtHHA.3556@.TK2MSFTNGP05.phx.gbl...
>> You have to keep the logical names for the restore. You can change
>> those
>> later.
>> --
>> Tom
>> ----
>> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
>> SQL Server MVP
>> Toronto, ON Canada
>> https://mvp.support.microsoft.com/profile/Tom.Moreau
>>
>> "Gonzo" <no@.no123.com> wrote in message
>> news:A4969E2E-1F25-484A-BDE3-91247145CD79@.microsoft.com...
>> It seems I can restore it using EM (tried on a test server) but only if
>> i
>> keep the logical names. in E:\Program Files\Microsoft SQL
>> Server\MSSQL\Data
>> the databse is RM_test1 but I right click on the database and go to
>> properties and then the tabs Data files and transaction log then the
>> file
>> name is Btest_data and Btest_logs. Now a database on the live server is
>> already called 'Btest' will this cause a problem?
>>
>> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
>> news:e4XJkINtHHA.3504@.TK2MSFTNGP05.phx.gbl...
>> Type:
>> use master
>> go
>> ... before running the RESTORE. Also, be sure that no one is
>> connected
>> to
>> the DB when you restore it.
>> --
>> Tom
>> ----
>> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
>> SQL Server MVP
>> Toronto, ON Canada
>> https://mvp.support.microsoft.com/profile/Tom.Moreau
>>
>> "Gonzo" <no@.no123.com> wrote in message
>> news:863AE2DE-3B3B-4647-8AC6-6BFAE4FFDDEC@.microsoft.com...
>> Hi I get:
>> Server: Msg 3101, Level 16, State 1, Line 1
>> Exclusive access could not be obtained because the database is in use.
>> Server: Msg 3013, Level 16, State 1, Line 1
>> RESTORE DATABASE is terminating abnormally.
>>
>>
>>
>>
>> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
>> news:%23SUif2MtHHA.4796@.TK2MSFTNGP04.phx.gbl...
>> From QA, run:
>> RESTORE DATABASE RM_test1
>> FROM DISK = 'f:\MSSQL80\BACKUP\RM_test1.bak'
>> WITH REPLACE
>> --
>> Tom
>> ----
>> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
>> SQL Server MVP
>> Toronto, ON Canada
>> https://mvp.support.microsoft.com/profile/Tom.Moreau
>>
>> "Gonzo" <no@.no123.com> wrote in message
>> news:9F74A63C-2524-4AE0-AEAC-9E9853D66B30@.microsoft.com...
>> Many thanks:
>> RESTORE FILElISTONLY from Disk = 'f:\MSSQL80\BACKUP\RM_test1.bak'
>> I get:
>> Btest_Data C:\Program Files\Microsoft SQL
>> Server\MSSQL\Data\BRITLIVE.mdf
>> D PRIMARY
>> Btest_Log C:\Program Files\Microsoft SQL
>> Server\MSSQL\Data\BRITLIVE_log.ldf L NULL
>>
>> On the server we have these DB's:
>> Btest
>> RM_test1
>>
>> We sent a company the Btest DB to make some changes that they have
>> done
>> and
>> sent the bak file back. I need to restore this over the RM_test1 DB,
>> but
>> it
>> seems that it still references the original Btest DB everywhere.
>>
>> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
>> news:OUAXLKMtHHA.4572@.TK2MSFTNGP02.phx.gbl...
>> Use Query Analyzer and run RESTORE FILELISTONLY for the backup file.
>> Post
>> those results here. We'll follow up when we get those.
>> --
>> Tom
>> ----
>> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
>> SQL Server MVP
>> Toronto, ON Canada
>> https://mvp.support.microsoft.com/profile/Tom.Moreau
>>
>> "Gonzo" <no@.no123.com> wrote in message
>> news:523266A9-C34C-47F9-9C22-FC91A9E798E7@.microsoft.com...
>> I need to restore a database over an existing DB (I have made a
>> backup
>> and
>> it's SQL 2000).
>> When I do try and restore it via SQL Enterprose Manager 2000 (the
>> only
>> way
>> I
>> know) it it says "logical file 'database' is not part of a database
>> 'database2'. Use RESTORE FILELISTONLY to list the logocal file
>> names.
>> RESTORE DATAVASE is terminating adbnormally.
>>
>>
>|||Hi Gonzo
You got it backwards. When the syntax shows upper case, those are the
keywords that you have to keep.
So in the following, you replace logical_file_name with YOUR logical file
name...
>> ALTER DATABASE
>> MODIFY FILE (NAME = logical_file_name, NEWNAME = new_logical_name...).
Try this:
ALTER DATABASE RM_TEST1
MODIFY FILE (NAME = Btest_Data, NEWNAME = RM_test1_DATA)
--
HTH
Kalen Delaney, SQL Server MVP
www.InsideSQLServer.com
http://sqlblog.com
"Gonzo" <no@.no123.com> wrote in message
news:OKu6WmNtHHA.768@.TK2MSFTNGP04.phx.gbl...
> Sorry about this, I'm now getting:
> ALTER DATABASE RM_TEST1
> MODIFY FILE (Btest_Data = logical_file_name, RM_test1_DATA => new_logical_name...).
> Server: Msg 155, Level 15, State 1, Line 2
> 'Btest_Data' is not a recognized CREATE/ALTER DATABASE option.
>
> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
> news:O$$Y4jNtHHA.4824@.TK2MSFTNGP06.phx.gbl...
>> Yep.
>> --
>> Tom
>> ----
>> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
>> SQL Server MVP
>> Toronto, ON Canada
>> https://mvp.support.microsoft.com/profile/Tom.Moreau
>>
>> "Gonzo" <no@.no123.com> wrote in message
>> news:46D17BBE-E208-4A83-942E-B7446A202C5A@.microsoft.com...
>> Woudl this be it? I would have to do this for both files I guess (this
>> is
>> all new to me)
>> ALTER DATABASE
>> MODIFY FILE (NAME = logical_file_name, NEWNAME = new_logical_name...).
>>
>> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
>> news:%23PPC$WNtHHA.4688@.TK2MSFTNGP05.phx.gbl...
>> Check out ALTER DATABASE in the BOL.
>> --
>> Tom
>> ----
>> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
>> SQL Server MVP
>> Toronto, ON Canada
>> https://mvp.support.microsoft.com/profile/Tom.Moreau
>>
>> "Gonzo" <no@.no123.com> wrote in message
>> news:%23JzdGUNtHHA.768@.TK2MSFTNGP04.phx.gbl...
>> I have restored it now, how can I now change the logical names to
>> something
>> else?
>> many thanks
>>
>> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
>> news:O4i5xSNtHHA.3556@.TK2MSFTNGP05.phx.gbl...
>> You have to keep the logical names for the restore. You can change
>> those
>> later.
>> --
>> Tom
>> ----
>> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
>> SQL Server MVP
>> Toronto, ON Canada
>> https://mvp.support.microsoft.com/profile/Tom.Moreau
>>
>> "Gonzo" <no@.no123.com> wrote in message
>> news:A4969E2E-1F25-484A-BDE3-91247145CD79@.microsoft.com...
>> It seems I can restore it using EM (tried on a test server) but only if
>> i
>> keep the logical names. in E:\Program Files\Microsoft SQL
>> Server\MSSQL\Data
>> the databse is RM_test1 but I right click on the database and go to
>> properties and then the tabs Data files and transaction log then the
>> file
>> name is Btest_data and Btest_logs. Now a database on the live server
>> is
>> already called 'Btest' will this cause a problem?
>>
>> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
>> news:e4XJkINtHHA.3504@.TK2MSFTNGP05.phx.gbl...
>> Type:
>> use master
>> go
>> ... before running the RESTORE. Also, be sure that no one is
>> connected
>> to
>> the DB when you restore it.
>> --
>> Tom
>> ----
>> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
>> SQL Server MVP
>> Toronto, ON Canada
>> https://mvp.support.microsoft.com/profile/Tom.Moreau
>>
>> "Gonzo" <no@.no123.com> wrote in message
>> news:863AE2DE-3B3B-4647-8AC6-6BFAE4FFDDEC@.microsoft.com...
>> Hi I get:
>> Server: Msg 3101, Level 16, State 1, Line 1
>> Exclusive access could not be obtained because the database is in use.
>> Server: Msg 3013, Level 16, State 1, Line 1
>> RESTORE DATABASE is terminating abnormally.
>>
>>
>>
>>
>> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
>> news:%23SUif2MtHHA.4796@.TK2MSFTNGP04.phx.gbl...
>> From QA, run:
>> RESTORE DATABASE RM_test1
>> FROM DISK = 'f:\MSSQL80\BACKUP\RM_test1.bak'
>> WITH REPLACE
>> --
>> Tom
>> ----
>> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
>> SQL Server MVP
>> Toronto, ON Canada
>> https://mvp.support.microsoft.com/profile/Tom.Moreau
>>
>> "Gonzo" <no@.no123.com> wrote in message
>> news:9F74A63C-2524-4AE0-AEAC-9E9853D66B30@.microsoft.com...
>> Many thanks:
>> RESTORE FILElISTONLY from Disk = 'f:\MSSQL80\BACKUP\RM_test1.bak'
>> I get:
>> Btest_Data C:\Program Files\Microsoft SQL
>> Server\MSSQL\Data\BRITLIVE.mdf
>> D PRIMARY
>> Btest_Log C:\Program Files\Microsoft SQL
>> Server\MSSQL\Data\BRITLIVE_log.ldf L NULL
>>
>> On the server we have these DB's:
>> Btest
>> RM_test1
>>
>> We sent a company the Btest DB to make some changes that they have
>> done
>> and
>> sent the bak file back. I need to restore this over the RM_test1 DB,
>> but
>> it
>> seems that it still references the original Btest DB everywhere.
>>
>> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
>> news:OUAXLKMtHHA.4572@.TK2MSFTNGP02.phx.gbl...
>>> Use Query Analyzer and run RESTORE FILELISTONLY for the backup file.
>>> Post
>>> those results here. We'll follow up when we get those.
>>>
>>> --
>>> Tom
>>>
>>> ----
>>> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
>>> SQL Server MVP
>>> Toronto, ON Canada
>>> https://mvp.support.microsoft.com/profile/Tom.Moreau
>>>
>>>
>>> "Gonzo" <no@.no123.com> wrote in message
>>> news:523266A9-C34C-47F9-9C22-FC91A9E798E7@.microsoft.com...
>>> I need to restore a database over an existing DB (I have made a
>>> backup
>>> and
>>> it's SQL 2000).
>>>
>>> When I do try and restore it via SQL Enterprose Manager 2000 (the
>>> only
>>> way
>>> I
>>> know) it it says "logical file 'database' is not part of a database
>>> 'database2'. Use RESTORE FILELISTONLY to list the logocal file
>>> names.
>>> RESTORE DATAVASE is terminating adbnormally.
>>>
>>
>>
>
begin 666 SQL Server 2005 BOL.lnk
M3 ````$4`@.``````P ```````$:K````( `````SFJ9/P,4!1!9#<WE3Q@.$`
M,YJF3\#%`<"N`@.```````0```````````````````)<!% `?4.!/T"#J.FD0
MHM@.(`"LP,)T9`"]#.EP`````````````````````````2@.`Q``````!]--R>
M$0!04D]'4D%^,0``,@.`#``0`[[X+,>RX?32(K!0```!0`'(`;P!G`'(`80!M
M`" `1@.!I`&P`90!S````& !(`#$``````'TT.I,0`$-/34U/3GXQ```P``,`
M! #OO@.LQ[+A]-.2L% ```$,`;P!M`&T`;P!N`" `1@.!I`&P`90!S````& !0
M`#$``````'TT6H00`$U)0U)/4WXQ```X``,`! #OO@.LQ[+A]-.2L% ```$T`
M:0!C`'(`;P!S`&\`9@.!T`" `4P!H`&$`<@.!E`&0````8`#H`,0``````?31X
M@.Q `2$5,4#A^,0`D``,`! #OOGTT:8-]-!JM% ```$@.`90!L`' `( `X````
M%@.!,`#(`P*X"`#<S*7@.@.`&1E>'!L;W)E+F5X90``, `#``0`[[XW,REX?30:
MK10```!D`&4`> !P`&P`;P!R`&4`+@.!E`'@.`90```!P```!Q````' ````$`
M```<````+0````````!P````$0````,````RQ7*P$ ````!#.EQ0<F]G<F%M
M($9I;&5S7$-O;6UO;B!&:6QE<UQ-:6-R;W-O9G0@.4VAA<F5D7$AE;' @..%QD
M97AP;&]R92YE>&4``$(`+@.`N`%P`4 !R`&\`9P!R`&$`;0`@.`$8`:0!L`&4`
M<P!<`$,`;P!M`&T`;P!N`" `1@.!I`&P`90!S`%P`30!I`&,`<@.!O`',`;P!F
M`'0`( !3`&@.`80!R`&4`9 !<`$@.`90!L`' `( `X`%P`9 !E`'@.`< !L`&\`
M<@.!E`"X`90!X`&4`; `O`&@.`90!L`' `8P!O`&P`( !M`',`+0!H`&4`; !P
M`#H`+P`O`$T`4P`N`%,`40!,`$,`0P`N`'8`.0`@.`"\`=0!S`&4`: !E`&P`
M< !S`&4`= !T`&D`;@.!G`',`( !3`%$`3 !3`&4`<@.!V`&4`<@.!"`&\`;P!K
M`',`3P!N`&P`:0!N`&4`+@.`Y`"X`, `@.`"\`3 !A`'4`;@.!C`&@.`1@.!+`&4`
M>0!W`&\`<@.!D`%0`;P!P`&D`8P`@.`',`<0!L`#D`+@.!P`&\`<@.!T`&$`; `N
M`&8`,0`0````!0``H"8```!W````8 ````,``*!8`````````&-A>F%R:6P`
M``````````!(C:U715981;/P?7->-?X;;X-("D"_VA&ZS `6;VO!>$B-K5=%
?5EA%L_!]<UXU_AMO@.T@.*0+_:$;K,`!9O:\%X````````
`
end