Tuesday, March 27, 2012
Error 9004 attaching a database
of .ndf files, and a .log file. When I try to attach the .mdf file in
Server Management Studio, I get error 9004, An error occurred while
processing the log.
Any suggestions?
Phil Hibbs.Phil,
Kevin Farlee's answer has helped a couple of people with your problem.
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=598396&SiteID=1
RLF
"PhilHibbs" <snarks@.gmail.com> wrote in message
news:1193140510.353843.250240@.y27g2000pre.googlegroups.com...
> I've been given a database backup in the form of an .mdf file, a bunch
> of .ndf files, and a .log file. When I try to attach the .mdf file in
> Server Management Studio, I get error 9004, An error occurred while
> processing the log.
> Any suggestions?
> Phil Hibbs.
>|||On 23 Oct, 13:31, "Russell Fields" <russellfie...@.nomail.com> wrote:
> Kevin Farlee's answer has helped a couple of people with your problem.
> http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=598396&SiteID=1
Hm, looked promising, but when I try to "bring online" the database
with the files replaced, I get a load of errors in this form:
E:\data\data_file_09.ndf is not a primary database file
I have a .mdf file and 26 .ndf files, it looks like the creation of
the empty database is creating these files in a different way to the
original database.
Phil Hibbs.|||Phil,
Did you first create the 26 ndf files in your database to be replaced before
trying to copy the files into place?
RLF
"PhilHibbs" <snarks@.gmail.com> wrote in message
news:1193148065.531336.193770@.e34g2000pro.googlegroups.com...
> On 23 Oct, 13:31, "Russell Fields" <russellfie...@.nomail.com> wrote:
>> Kevin Farlee's answer has helped a couple of people with your problem.
>> http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=598396&SiteID=1
> Hm, looked promising, but when I try to "bring online" the database
> with the files replaced, I get a load of errors in this form:
> E:\data\data_file_09.ndf is not a primary database file
> I have a .mdf file and 26 .ndf files, it looks like the creation of
> the empty database is creating these files in a different way to the
> original database.
> Phil Hibbs.
>|||On 23 Oct, 20:15, "Russell Fields" <russellfie...@.nomail.com> wrote:
> Did you first create the 26 ndf files in your database to be replaced before
> trying to copy the files into place?
Yep. I made a big CREATE DATABASE statement with the .mdf and all
the .ndf files specified in it.
Phil Hibbs.|||On 23 Oct, 20:15, "Russell Fields" <russellfie...@.nomail.com> wrote:
> Did you first create the 26 ndf files in your database to be replaced before
> trying to copy the files into place?
Yep. I made a big CREATE DATABASE statement with the .mdf and all
the .ndf files specified in it.
Phil Hibbs.|||Phil,
I understand that you are using SQL Server 2005, since you mention
Management Studio. I have tested and not been able to duplicate your
problem. When you use SSMS to do the attach, have you pressed the Script
command at the top of the panel. This will provide an exact script of the
commands to be run. If you do that, perhaps you will see something helpful.
Or, you can post it here for review.
Obviously something is different between our setups. I am running SQL
Server 2005 SP2. Are you also running SP2? I ask because SP2 fixed some
Management Studio problems and you should update to it (plus some hotfixes)
if you have not done so.
This describe my patch level:
http://blogs.msdn.com/psssql/archive/2007/04/06/post-sql-server-2005-service-pack-2-sp2-fixes-explained.aspx
For more recent fixes, see also: http://support.microsoft.com/kb/937137/LN/
RLF
"PhilHibbs" <snarks@.gmail.com> wrote in message
news:1193222031.764752.35650@.v29g2000prd.googlegroups.com...
> On 23 Oct, 20:15, "Russell Fields" <russellfie...@.nomail.com> wrote:
>> Did you first create the 26 ndf files in your database to be replaced
>> before
>> trying to copy the files into place?
> Yep. I made a big CREATE DATABASE statement with the .mdf and all
> the .ndf files specified in it.
> Phil Hibbs.
>|||On 25 Oct, 17:34, "Russell Fields" <russellfie...@.nomail.com> wrote:
> I have tested and not been able to duplicate your
> problem.
I suspect that is because you don't have the same .mdf and .ndf
and .log files that I have.
Phil Hibbs.|||Phil, No doubt about that. Sorry this did not help. - RLF
"PhilHibbs" <snarks@.gmail.com> wrote in message
news:1193761341.010344.78000@.k79g2000hse.googlegroups.com...
> On 25 Oct, 17:34, "Russell Fields" <russellfie...@.nomail.com> wrote:
>> I have tested and not been able to duplicate your
>> problem.
> I suspect that is because you don't have the same .mdf and .ndf
> and .log files that I have.
> Phil Hibbs.
>
Error 8985 cannot locate file xxx in sysfiles
receive this error message 'Error 8985 cannot locate file xxx in sysfiles'.
I have repeatedly verified the data file name and even did a 'cut n paste'
into a query in qa dbcc shrinkfile with the same results. I have no
problem shrinking the second file and the log file through either method.
I even ran dbcc shrinkfile (3, emptyfile) moving all data to the problem
file. After removing the second datafile I created a new second datafile
in the primary filegroup and am in the process of moving the data to the
new file. Hopefully I will be able to remove the problem file afterward.
Although I suspect this will still not work because I will have to use the
logical file name and not the number.
Any help will be greatly appreciated!
Thanks
Message posted via http://www.sqlmonster.com
You did a cut and paste from where? What column of what
query? Generally the error is due to referencing the
physical file name and not the logical file name. It's hard
to tell as you example is using the file id which is fine as
well. Also, make sure you are in the correct database when
getting the logical file name or id and when executing the
shrinkfile. If you are selecting from sysfiles or executing
sp_helpdb to get the name, it applies to the current
database only. If it still fails and you aren't using
fileid, try using that instead. It could be an issue with
the logical file name not following the rules for
identifiers.
-Sue
On Wed, 02 Mar 2005 19:49:01 GMT, "andy williams via
SQLMonster.com" <forum@.SQLMonster.com> wrote:
>I am attempting to shrink a datafile (I have 2 primary data files) when I
>receive this error message 'Error 8985 cannot locate file xxx in sysfiles'.
>I have repeatedly verified the data file name and even did a 'cut n paste'
>into a query in qa dbcc shrinkfile with the same results. I have no
>problem shrinking the second file and the log file through either method.
>I even ran dbcc shrinkfile (3, emptyfile) moving all data to the problem
>file. After removing the second datafile I created a new second datafile
>in the primary filegroup and am in the process of moving the data to the
>new file. Hopefully I will be able to remove the problem file afterward.
>Although I suspect this will still not work because I will have to use the
>logical file name and not the number.
>Any help will be greatly appreciated!
>Thanks
Error 8985 cannot locate file xxx in sysfiles
receive this error message 'Error 8985 cannot locate file xxx in sysfiles'.
I have repeatedly verified the data file name and even did a 'cut n paste'
into a query in qa dbcc shrinkfile with the same results. I have no
problem shrinking the second file and the log file through either method.
I even ran dbcc shrinkfile (3, emptyfile) moving all data to the problem
file. After removing the second datafile I created a new second datafile
in the primary filegroup and am in the process of moving the data to the
new file. Hopefully I will be able to remove the problem file afterward.
Although I suspect this will still not work because I will have to use the
logical file name and not the number.
Any help will be greatly appreciated!
Thanks
Message posted via http://www.droptable.comYou did a cut and paste from where? What column of what
query? Generally the error is due to referencing the
physical file name and not the logical file name. It's hard
to tell as you example is using the file id which is fine as
well. Also, make sure you are in the correct database when
getting the logical file name or id and when executing the
shrinkfile. If you are selecting from sysfiles or executing
sp_helpdb to get the name, it applies to the current
database only. If it still fails and you aren't using
fileid, try using that instead. It could be an issue with
the logical file name not following the rules for
identifiers.
-Sue
On Wed, 02 Mar 2005 19:49:01 GMT, "andy williams via
droptable.com" <forum@.droptable.com> wrote:
>I am attempting to shrink a datafile (I have 2 primary data files) when I
>receive this error message 'Error 8985 cannot locate file xxx in sysfiles'.
>I have repeatedly verified the data file name and even did a 'cut n paste'
>into a query in qa dbcc shrinkfile with the same results. I have no
>problem shrinking the second file and the log file through either method.
>I even ran dbcc shrinkfile (3, emptyfile) moving all data to the problem
>file. After removing the second datafile I created a new second datafile
>in the primary filegroup and am in the process of moving the data to the
>new file. Hopefully I will be able to remove the problem file afterward.
>Although I suspect this will still not work because I will have to use the
>logical file name and not the number.
>Any help will be greatly appreciated!
>Thanks
Sunday, March 11, 2012
Error 5180: Could not open FCB for invalid file id : 120
'"Error 5180: Could not open FCB for invalid file id : 120"
When we attach the mdf and ldf files we get this error, what can we do to restore the database?
SEe this KBA http://support.microsoft.com/default.aspx?scid=kb;en-us;815183 to fix.Error 5180: Could not open FCB for invalid file id : 120
'"Error 5180: Could not open FCB for invalid file id : 120"
When we attach the mdf and ldf files we get this error, what can we do to restore the database?
SEe this KBA http://support.microsoft.com/default.aspx?scid=kb;en-us;815183 to fix.|||I de-tached and then attempted reattached a database from my server. I was not able to reattached, so I changed the name of the old database file by adding an X to the end. I then created a new database with the same name as the old one, deleted the new database file, and then renamed the old file by removing the X. Now when I try to open tables or veiws, I get error 5180: Could not open FCB... I followed the link to the suggestion about parallelism, ran the code, and still have the problem. I am running SQL Server 2000, but I don't know about the service packs.
Friday, March 9, 2012
Error 5020 after try to delete one of log files
OS: W2k sp2
I tried to move log files at one database from location A
to another location B. I first created new log fileB.ldf
for this database at locationB. Then shrank the original
log fileA.ldf as much as possible. Next I tried to
delete fileA from SQL Server EM -> properties ->
transaction log-> highligt fileA.ldf -> delete. But I got
error 5020: The primary data or log file cannot be removed
from a database.
How can I drop or move log files from database?
Thanks.Maggie,
First, detach the database using sp_detach_db after making sure that users
are not accessing it.Once done, the database is thus offline.Now copy the
.ldf file to location B.Attach the database using sp_attach_db, mentioning
the new location for .ldf.
--
Dinesh.
SQL Server FAQ at
http://www.tkdinesh.com
"Maggie" <seamorning@.yahoo.com> wrote in message
news:5d4901c35781$4df49c60$a001280a@.phx.gbl...
> Platform: SQL Server 2k with sp2
> OS: W2k sp2
> I tried to move log files at one database from location A
> to another location B. I first created new log fileB.ldf
> for this database at locationB. Then shrank the original
> log fileA.ldf as much as possible. Next I tried to
> delete fileA from SQL Server EM -> properties ->
> transaction log-> highligt fileA.ldf -> delete. But I got
> error 5020: The primary data or log file cannot be removed
> from a database.
> How can I drop or move log files from database?
> Thanks.|||Go to EM, right click the database, then Transaction Log tab, select the 2nd
log file, press Delete button.
You can't delete first log file, but other log files you can delete.
"Maggie" <seamorning@.yahoo.com> wrote in message
news:5e5d01c3578e$5cd34cb0$a001280a@.phx.gbl...
> How can just delete the extra log files from one
> location? I only want to keep one?
> >--Original Message--
> >Maggie,
> >
> >First, detach the database using sp_detach_db after
> making sure that users
> >are not accessing it.Once done, the database is thus
> offline.Now copy the
> >..ldf file to location B.Attach the database using
> sp_attach_db, mentioning
> >the new location for .ldf.
> >
> >--
> >Dinesh.
> >SQL Server FAQ at
> >http://www.tkdinesh.com
> >
> >"Maggie" <seamorning@.yahoo.com> wrote in message
> >news:5d4901c35781$4df49c60$a001280a@.phx.gbl...
> >> Platform: SQL Server 2k with sp2
> >> OS: W2k sp2
> >> I tried to move log files at one database from location
> A
> >> to another location B. I first created new log
> fileB.ldf
> >> for this database at locationB. Then shrank the
> original
> >> log fileA.ldf as much as possible. Next I tried to
> >> delete fileA from SQL Server EM -> properties ->
> >> transaction log-> highligt fileA.ldf -> delete. But I
> got
> >> error 5020: The primary data or log file cannot be
> removed
> >> from a database.
> >>
> >> How can I drop or move log files from database?
> >>
> >> Thanks.
> >
> >
> >.
> >
Sunday, February 19, 2012
Error 25 invalid connection string
Data Source=.\MSSQLSERVER;AttachDbFilename="C:\Program Files\Microsoft
SQL Server\MSSQL.1\MSSQL\Data\AdventureWorks_Data.mdf" ;Integrated
Security=True;Connect Timeout=30;User Instance=True
i am trying to connect visuyal c# express with sql server 2005 develop
edition
Can someone point what is wrong with my connection string
Try adding the "Initial Catalog=AdventureWorks" key-value pair. What's the
exception message?
See Chapter 9.
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
------
"pierre" <pf@.arobas.net> wrote in message
news:uEARym9THHA.4928@.TK2MSFTNGP03.phx.gbl...
> here is the string:
> Data Source=.\MSSQLSERVER;AttachDbFilename="C:\Program Files\Microsoft SQL
> Server\MSSQL.1\MSSQL\Data\AdventureWorks_Data.mdf" ;Integrated
> Security=True;Connect Timeout=30;User Instance=True
> i am trying to connect visuyal c# express with sql server 2005 develop
> edition
> Can someone point what is wrong with my connection string
Error 25 invalid connection string
Data Source=.\MSSQLSERVER;AttachDbFilename="C:\Program Files\Microsoft
SQL Server\MSSQL.1\MSSQL\Data\AdventureWorks_Data.mdf";Integrated
Security=True;Connect Timeout=30;User Instance=True
i am trying to connect visuyal c# express with sql server 2005 develop
edition
Can someone point what is wrong with my connection stringTry adding the "Initial Catalog=AdventureWorks" key-value pair. What's the
exception message?
See Chapter 9.
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
----
---
"pierre" <pf@.arobas.net> wrote in message
news:uEARym9THHA.4928@.TK2MSFTNGP03.phx.gbl...
> here is the string:
> Data Source=.\MSSQLSERVER;AttachDbFilename="C:\Program Files\Microsoft SQL
> Server\MSSQL.1\MSSQL\Data\AdventureWorks_Data.mdf";Integrated
> Security=True;Connect Timeout=30;User Instance=True
> i am trying to connect visuyal c# express with sql server 2005 develop
> edition
> Can someone point what is wrong with my connection string