Showing posts with label properly. Show all posts
Showing posts with label properly. Show all posts

Thursday, February 16, 2012

attaching DB using single MDF file

Hi there,
I'm trying to attach a DB using a single MDF file. The file was not properly detached as our server had crashed suddenly neither was the a proper backup done..When I try to attach it says
"the file you've specified is not a valid sql server database file" . But another database was restored using a MDF file without any problems ?
Please do get back if anyone may get what the problem likely is ? It'd be of great help. Let me know if my problem was clear or if I've to put it in a different fashion.

Cheers
GaneshOriginally posted by gans_sr
Hi there,
I'm trying to attach a DB using a single MDF file. The file was not properly detached as our server had crashed suddenly neither was the a proper backup done..When I try to attach it says
"the file you've specified is not a valid sql server database file" . But another database was restored using a MDF file without any problems ?
Please do get back if anyone may get what the problem likely is ? It'd be of great help. Let me know if my problem was clear or if I've to put it in a different fashion.

Cheers
Ganesh

what do u mean by
other database was restored using a MDF file without any problems ?
was it the same file which u r trying to restore again??
to me it seems that the database file is corrupted and u will have to look for the most recent backup for the database.|||Harshal,
Its not the same file and its a differnt one . I also reckon it could be corrupt, but do you think it can be repaired by any chance ?
About backup, somehting had happened to hte server it seems , may be some virus and it stopped job schedule on sql server also.
Thanks for any ideas
Ganesh|||Originally posted by gans_sr
Harshal,
Its not the same file and its a differnt one . I also reckon it could be corrupt, but do you think it can be repaired by any chance ?
About backup, somehting had happened to hte server it seems , may be some virus and it stopped job schedule on sql server also.
Thanks for any ideas
Ganesh

In that case u r in a real problem! I haven't heard of repairing a corrupt database file yet.The only solution that I see is to get the latest workable backup from the backup sets and restore them. I hope you have some backups before the job stopped running.
and also once every thing is running, do configure an alert for all the jobs so that their status is mailed to u every time they run.
regards,
Harshal.|||Thanks Harshal .Looks like thats the only option available now.

Sunday, February 12, 2012

Attached DB not working properly in Vista Ultimate enviroment

hi,

i have installed SQLEXPRESS (SQL Server 9.0.3042) on my windows ultimate laptop. of late am facing this issue of database. this database is from SQl 7.0 Desktop edition(the one that i use in my office machine with Xp SP2). As such it works fine in SQL 2000 server after attachment (for test).

i have run SQLEXPRESS as administrator to make/attach new database. i can attach the database easily and can even view tables and other stuffs inside database in administrator mode. the issue pops up when i run SQLEXPRESS in normal mode. when i try to open and view the same DB's content, error pops up stating

"The database XXX is not accessible. (Micorosoft.sqlserver.express.objectExplorer)"

i cannot access this DB via VB 6 form as it dosnt show up at all in database list when tried to connect via ADODC.

i want to make this DB accessibility as normal operation, not previliged only to administrator as application run on normal mode only.

the issue dosnt arise when i locally make a new database as it can be accessed when run in normal mode also. why does this happen to database that is attached and not to ones locally made.

pls guide me as i usually do my works at home and making whole database again will surely take lots of pain. why not it just attach then start working, not asking for preveliged mode.

thanks in adv
Nyaken

Hi,

Try checking the owner of the attached database. I found that when i restored a db I had to then set the ownership afferwards otherwise I couldn't access it.

Chris

|||

hi,

thanks for the prompt re. well, as per ur suggestion i have explored all possibiliites to find a way to change the ownership of database but alas!!! i just couldnt make it. can you pls guide me to take this corrective measure, please. i hope everything must be done in administrative mode only, isnt it?

awaiting for your re

regs

ken

|||

Hi,

If you right click on the attached database and select properties then go the the files page, you should see that the second text box down (the owner field) is blank. If so, set an owner by clicking the elipsis next to the box. After you have clicked all the ok's you can check the owner was set by going back to the files page, and if the box now is not empty then the owner was set. You should be able to use the database now.

Hope this helps,

Chris

P.s. I did try to post this yesterday several times but the forum kept giving me an "unkown error"