Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Logical file is not part of Database

Status
Not open for further replies.

ccampbell

Programmer
Aug 16, 2001
201
US
I am having a problem. Here is the query that I am doing.
IF EXISTS (SELECT *
FROM master..sysdatabases
WHERE name = N'CVIEW')
DROP DATABASE CVIEW
GO

CREATE DATABASE CVIEW
GO

-- =====================
-- Restore Database
-- =====================
USE master
GO
-- First determine the number and names of the files in the backup.
RESTORE FILELISTONLY
FROM DISK = N'c:\xCVIEW\Data Dump\XCVW20010519.dbk'
-- Restore the files for new Db.
RESTORE DATABASE CVIEW
FROM DISK = N'c:\xCVIEW\Data Dump\XCVW20010519.dbk'
WITH RECOVERY,
MOVE 'CVIEW_Data' TO 'C:\Program Files\Microsoft SQL Server\MSSQL\data\CVIEW_Data.mdf',
MOVE 'CVIEW_Log' TO 'C:\Program Files\Microsoft SQL Server\MSSQL\data\CVIEW_Log.ldf'
GO

This should create a new database and then restore a dbk file to create all the indexes and tables. The error that I am getting is

The CREATE DATABASE process is allocating 0.63 MB on disk 'CVIEW'.
The CREATE DATABASE process is allocating 0.49 MB on disk 'CVIEW_log'.

(2 row(s) affected)

Server: Msg 3234, Level 16, State 2, Line 5
Logical file 'CVIEW_Data' is not part of database 'CVIEW'. Use RESTORE FILELISTONLY to list the logical file names.
Server: Msg 3013, Level 16, State 1, Line 5
RESTORE DATABASE is terminating abnormally.

How do I fix this? I also want to know when I create the database, how can I specify the log size and the data file size? I want them both to be 2000 meg rather than .49 meg and .63 meg. Thanks
 
I fixed the previous error, now I am just getting the error

Server: Msg 3154, Level 16, State 2, Line 5
The backup set holds a backup of a database other than the existing 'CVIEW' database.
Server: Msg 3013, Level 16, State 1, Line 5
RESTORE DATABASE is terminating abnormally.

How can I fix this? Also, how can I increase the size of my Data file and my log file from teh the Query ANalyzer tool?

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top