Showing posts with label sys. Show all posts
Showing posts with label sys. Show all posts

Wednesday, March 7, 2012

audit log

Are there any sys tables that store audit logs for
commands such as sp_changeobjectowner? Is this a feature
that can be turned on? If so where?
Thanks in advance :-)
TylerTyler,
Check the Profiler tool. It comes with SQL Server and is described in Books
OnLine. You can check some 3rd party tools as well, for example check
www.lumigent.com.
--
Dejan Sarka, SQL Server MVP
FAQ from Neil & others at: http://www.sqlserverfaq.com
Please reply only to the newsgroups.
PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org
"tyler" <e_tyler@.netzero.net> wrote in message
news:0cc801c35c2b$5e5edc10$a501280a@.phx.gbl...
> Are there any sys tables that store audit logs for
> commands such as sp_changeobjectowner? Is this a feature
> that can be turned on? If so where?
> Thanks in advance :-)
> Tyler

Thursday, February 16, 2012

attaching mdf & ldf files

Hi,
Our dev. guys have stopped sequel & took the backup of mdf and ldf file of a
database, formatted that server with the help of a sys admin.
I am aware that attach wont work 90% times without a detach. Now the dev.
guys say that they have some sp codes in that db and expecting me to make DB
available.
I am sure that chances are less but I am giving a try and this is the
present situation.
step1:
EXEC sp_attach_db @.dbname = N'MyDB',
@.filename1 = N'd:\backup\MyDB_Data.mdf',
@.filename2 = N'd:\backup\MyDB_log.ldf'
output:
Server: Msg 5173, Level 16, State 2, Line 1
Cannot associate files with different databases.
step2:
EXEC sp_attach_single_file_db @.dbname = 'MyDB',
@.physname = 'd:\bkup\MyDB_Data.mdf'
output:
Server: Msg 823, Level 24, State 2, Line 1
I/O error (bad page ID) detected during read at offset 0x00000028840000 in
file 'd:\backup\MyDB_Data.mdf'.
Device activation error. The physical file name 'C:\Program Files\Microsoft
SQL Server\MSSQL\data\MyDB_Log.LDF' may be incorrect.
New log file 'd:\backup\MyDB_log.LDF' was created.
Connection Broken
Whats happening & what else i can try.
Thanks
reddi
Reddi,
Have you recreated the exact same paths that were on the original build?
Have you got a backup you can restore from?
My hopes are not high that you will be able to recover this database. If
you are really desperate you should give MS PSS a call.
http://www.mssqlserver.com/faq/general-pss.asp
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602m.html
Reddi wrote:
> Hi,
> Our dev. guys have stopped sequel & took the backup of mdf and ldf file of a
> database, formatted that server with the help of a sys admin.
> I am aware that attach wont work 90% times without a detach. Now the dev.
> guys say that they have some sp codes in that db and expecting me to make DB
> available.
> I am sure that chances are less but I am giving a try and this is the
> present situation.
> step1:
> EXEC sp_attach_db @.dbname = N'MyDB',
> @.filename1 = N'd:\backup\MyDB_Data.mdf',
> @.filename2 = N'd:\backup\MyDB_log.ldf'
>
> output:
> Server: Msg 5173, Level 16, State 2, Line 1
> Cannot associate files with different databases.
>
> step2:
> EXEC sp_attach_single_file_db @.dbname = 'MyDB',
> @.physname = 'd:\bkup\MyDB_Data.mdf'
> output:
> Server: Msg 823, Level 24, State 2, Line 1
> I/O error (bad page ID) detected during read at offset 0x00000028840000 in
> file 'd:\backup\MyDB_Data.mdf'.
> Device activation error. The physical file name 'C:\Program Files\Microsoft
> SQL Server\MSSQL\data\MyDB_Log.LDF' may be incorrect.
> New log file 'd:\backup\MyDB_log.LDF' was created.
> Connection Broken
> Whats happening & what else i can try.
> Thanks
> reddi
>
|||Hi Mark,
Have you recreated the exact same paths that were on the original build?
--These are just mdf and ldf files which were moved onto other server by
stopping the SQL Server. Do you mean to say that I need to create a similar
directory path as in source server and try to attach?
Have you got a backup you can restore from?
--yes but a old one..
Thanks
Reedi
"Mark Allison" wrote:

> Reddi,
> Have you recreated the exact same paths that were on the original build?
> Have you got a backup you can restore from?
> My hopes are not high that you will be able to recover this database. If
> you are really desperate you should give MS PSS a call.
> http://www.mssqlserver.com/faq/general-pss.asp
> --
> Mark Allison, SQL Server MVP
> http://www.markallison.co.uk
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602m.html
>
> Reddi wrote:
>
|||On the second step, did you check if your database was restored?
Peter Yeoh
http://www.yohz.com
Need smaller SQL2K backup files? Use MiniSQLBackup Lite, free!
"Reddi" <Reddi@.discussions.microsoft.com> wrote in message
news:A0C79772-6A2F-471D-B842-ECD98AC9F244@.microsoft.com...
> Hi,
> Our dev. guys have stopped sequel & took the backup of mdf and ldf file of
a
> database, formatted that server with the help of a sys admin.
> I am aware that attach wont work 90% times without a detach. Now the dev.
> guys say that they have some sp codes in that db and expecting me to make
DB
> available.
> I am sure that chances are less but I am giving a try and this is the
> present situation.
> step1:
> EXEC sp_attach_db @.dbname = N'MyDB',
> @.filename1 = N'd:\backup\MyDB_Data.mdf',
> @.filename2 = N'd:\backup\MyDB_log.ldf'
>
> output:
> Server: Msg 5173, Level 16, State 2, Line 1
> Cannot associate files with different databases.
>
> step2:
> EXEC sp_attach_single_file_db @.dbname = 'MyDB',
> @.physname = 'd:\bkup\MyDB_Data.mdf'
> output:
> Server: Msg 823, Level 24, State 2, Line 1
> I/O error (bad page ID) detected during read at offset 0x00000028840000 in
> file 'd:\backup\MyDB_Data.mdf'.
> Device activation error. The physical file name 'C:\Program
Files\Microsoft
> SQL Server\MSSQL\data\MyDB_Log.LDF' may be incorrect.
> New log file 'd:\backup\MyDB_log.LDF' was created.
> Connection Broken
> Whats happening & what else i can try.
> Thanks
> reddi
>
|||Hi Peter,
Thanks for the input.. i havent check that.. request u to keep this thread
on watch
will be back soon
reedi
"Peter Yeoh" wrote:

> On the second step, did you check if your database was restored?
> --
> Peter Yeoh
> http://www.yohz.com
> Need smaller SQL2K backup files? Use MiniSQLBackup Lite, free!
>
> "Reddi" <Reddi@.discussions.microsoft.com> wrote in message
> news:A0C79772-6A2F-471D-B842-ECD98AC9F244@.microsoft.com...
> a
> DB
> Files\Microsoft
>
>
|||Hi Peter,
Extremely sorry for the delay.. after executing step 2, I dont see that
database created in EM.
Thanks
Reedi.
"Reddi" wrote:
[vbcol=seagreen]
> Hi Peter,
> Thanks for the input.. i havent check that.. request u to keep this thread
> on watch
> will be back soon
> reedi
>
> "Peter Yeoh" wrote:
|||Hi Reddi,
This might of help to you
http://www.spaceprogram.com/knowledg...leted_log.html
http://www.spaceprogram.com/knowledg..._received.html
http://forums1.itrc.hp.com/service/f...hreadId=653793
Regards
Ravi
"Reddi" <Reddi@.discussions.microsoft.com> wrote in message news:<A0C79772-6A2F-471D-B842-ECD98AC9F244@.microsoft.com>...
> Hi,
> Our dev. guys have stopped sequel & took the backup of mdf and ldf file of a
> database, formatted that server with the help of a sys admin.
> I am aware that attach wont work 90% times without a detach. Now the dev.
> guys say that they have some sp codes in that db and expecting me to make DB
> available.
> I am sure that chances are less but I am giving a try and this is the
> present situation.
> step1:
> EXEC sp_attach_db @.dbname = N'MyDB',
> @.filename1 = N'd:\backup\MyDB_Data.mdf',
> @.filename2 = N'd:\backup\MyDB_log.ldf'
>
> output:
> Server: Msg 5173, Level 16, State 2, Line 1
> Cannot associate files with different databases.
>
> step2:
> EXEC sp_attach_single_file_db @.dbname = 'MyDB',
> @.physname = 'd:\bkup\MyDB_Data.mdf'
> output:
> Server: Msg 823, Level 24, State 2, Line 1
> I/O error (bad page ID) detected during read at offset 0x00000028840000 in
> file 'd:\backup\MyDB_Data.mdf'.
> Device activation error. The physical file name 'C:\Program Files\Microsoft
> SQL Server\MSSQL\data\MyDB_Log.LDF' may be incorrect.
> New log file 'd:\backup\MyDB_log.LDF' was created.
> Connection Broken
> Whats happening & what else i can try.
> Thanks
> reddi

attaching mdf & ldf files

Hi,
Our dev. guys have stopped sequel & took the backup of mdf and ldf file of a
database, formatted that server with the help of a sys admin.
I am aware that attach wont work 90% times without a detach. Now the dev.
guys say that they have some sp codes in that db and expecting me to make D
B
available.
I am sure that chances are less but I am giving a try and this is the
present situation.
step1:
EXEC sp_attach_db @.dbname = N'MyDB',
@.filename1 = N'd:\backup\MyDB_Data.mdf',
@.filename2 = N'd:\backup\MyDB_log.ldf'
output:
Server: Msg 5173, Level 16, State 2, Line 1
Cannot associate files with different databases.
step2:
EXEC sp_attach_single_file_db @.dbname = 'MyDB',
@.physname = 'd:\bkup\MyDB_Data.mdf'
output:
Server: Msg 823, Level 24, State 2, Line 1
I/O error (bad page ID) detected during read at offset 0x00000028840000 in
file 'd:\backup\MyDB_Data.mdf'.
Device activation error. The physical file name 'C:\Program Files\Microsoft
SQL Server\MSSQL\data\MyDB_Log.LDF' may be incorrect.
New log file 'd:\backup\MyDB_log.LDF' was created.
Connection Broken
Whats happening & what else i can try.
Thanks
reddiReddi,
Have you recreated the exact same paths that were on the original build?
Have you got a backup you can restore from?
My hopes are not high that you will be able to recover this database. If
you are really desperate you should give MS PSS a call.
http://www.mssqlserver.com/faq/general-pss.asp
--
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602m.html
Reddi wrote:
> Hi,
> Our dev. guys have stopped sequel & took the backup of mdf and ldf file of
a
> database, formatted that server with the help of a sys admin.
> I am aware that attach wont work 90% times without a detach. Now the dev.
> guys say that they have some sp codes in that db and expecting me to make
DB
> available.
> I am sure that chances are less but I am giving a try and this is the
> present situation.
> step1:
> EXEC sp_attach_db @.dbname = N'MyDB',
> @.filename1 = N'd:\backup\MyDB_Data.mdf',
> @.filename2 = N'd:\backup\MyDB_log.ldf'
>
> output:
> Server: Msg 5173, Level 16, State 2, Line 1
> Cannot associate files with different databases.
>
> step2:
> EXEC sp_attach_single_file_db @.dbname = 'MyDB',
> @.physname = 'd:\bkup\MyDB_Data.mdf'
> output:
> Server: Msg 823, Level 24, State 2, Line 1
> I/O error (bad page ID) detected during read at offset 0x00000028840000 in
> file 'd:\backup\MyDB_Data.mdf'.
> Device activation error. The physical file name 'C:\Program Files\Microsof
t
> SQL Server\MSSQL\data\MyDB_Log.LDF' may be incorrect.
> New log file 'd:\backup\MyDB_log.LDF' was created.
> Connection Broken
> Whats happening & what else i can try.
> Thanks
> reddi
>|||Hi Mark,
Have you recreated the exact same paths that were on the original build?
--These are just mdf and ldf files which were moved onto other server by
stopping the SQL Server. Do you mean to say that I need to create a similar
directory path as in source server and try to attach?
Have you got a backup you can restore from?
--yes but a old one..
Thanks
Reedi
"Mark Allison" wrote:

> Reddi,
> Have you recreated the exact same paths that were on the original build?
> Have you got a backup you can restore from?
> My hopes are not high that you will be able to recover this database. If
> you are really desperate you should give MS PSS a call.
> http://www.mssqlserver.com/faq/general-pss.asp
> --
> Mark Allison, SQL Server MVP
> http://www.markallison.co.uk
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602m.html
>
> Reddi wrote:
>|||On the second step, did you check if your database was restored?
Peter Yeoh
http://www.yohz.com
Need smaller SQL2K backup files? Use MiniSQLBackup Lite, free!
"Reddi" <Reddi@.discussions.microsoft.com> wrote in message
news:A0C79772-6A2F-471D-B842-ECD98AC9F244@.microsoft.com...
> Hi,
> Our dev. guys have stopped sequel & took the backup of mdf and ldf file of
a
> database, formatted that server with the help of a sys admin.
> I am aware that attach wont work 90% times without a detach. Now the dev.
> guys say that they have some sp codes in that db and expecting me to make
DB
> available.
> I am sure that chances are less but I am giving a try and this is the
> present situation.
> step1:
> EXEC sp_attach_db @.dbname = N'MyDB',
> @.filename1 = N'd:\backup\MyDB_Data.mdf',
> @.filename2 = N'd:\backup\MyDB_log.ldf'
>
> output:
> Server: Msg 5173, Level 16, State 2, Line 1
> Cannot associate files with different databases.
>
> step2:
> EXEC sp_attach_single_file_db @.dbname = 'MyDB',
> @.physname = 'd:\bkup\MyDB_Data.mdf'
> output:
> Server: Msg 823, Level 24, State 2, Line 1
> I/O error (bad page ID) detected during read at offset 0x00000028840000 in
> file 'd:\backup\MyDB_Data.mdf'.
> Device activation error. The physical file name 'C:\Program
Files\Microsoft
> SQL Server\MSSQL\data\MyDB_Log.LDF' may be incorrect.
> New log file 'd:\backup\MyDB_log.LDF' was created.
> Connection Broken
> Whats happening & what else i can try.
> Thanks
> reddi
>|||Hi Peter,
Thanks for the input.. i havent check that.. request u to keep this thread
on watch
will be back soon
reedi
"Peter Yeoh" wrote:

> On the second step, did you check if your database was restored?
> --
> Peter Yeoh
> http://www.yohz.com
> Need smaller SQL2K backup files? Use MiniSQLBackup Lite, free!
>
> "Reddi" <Reddi@.discussions.microsoft.com> wrote in message
> news:A0C79772-6A2F-471D-B842-ECD98AC9F244@.microsoft.com...
> a
> DB
> Files\Microsoft
>
>|||Hi Peter,
Extremely sorry for the delay.. after executing step 2, I dont see that
database created in EM.
Thanks
Reedi.
"Reddi" wrote:
[vbcol=seagreen]
> Hi Peter,
> Thanks for the input.. i havent check that.. request u to keep this thread
> on watch
> will be back soon
> reedi
>
> "Peter Yeoh" wrote:
>|||Hi Reddi,
This might of help to you
http://www.spaceprogram.com/knowled...s_received.html
http://forums1.itrc.hp.com/service/...threadId=653793
Regards
Ravi
"Reddi" <Reddi@.discussions.microsoft.com> wrote in message news:<A0C79772-6A2F-471D-B842-ECD
98AC9F244@.microsoft.com>...
> Hi,
> Our dev. guys have stopped sequel & took the backup of mdf and ldf file of
a
> database, formatted that server with the help of a sys admin.
> I am aware that attach wont work 90% times without a detach. Now the dev.
> guys say that they have some sp codes in that db and expecting me to make
DB
> available.
> I am sure that chances are less but I am giving a try and this is the
> present situation.
> step1:
> EXEC sp_attach_db @.dbname = N'MyDB',
> @.filename1 = N'd:\backup\MyDB_Data.mdf',
> @.filename2 = N'd:\backup\MyDB_log.ldf'
>
> output:
> Server: Msg 5173, Level 16, State 2, Line 1
> Cannot associate files with different databases.
>
> step2:
> EXEC sp_attach_single_file_db @.dbname = 'MyDB',
> @.physname = 'd:\bkup\MyDB_Data.mdf'
> output:
> Server: Msg 823, Level 24, State 2, Line 1
> I/O error (bad page ID) detected during read at offset 0x00000028840000 in
> file 'd:\backup\MyDB_Data.mdf'.
> Device activation error. The physical file name 'C:\Program Files\Microsof
t
> SQL Server\MSSQL\data\MyDB_Log.LDF' may be incorrect.
> New log file 'd:\backup\MyDB_log.LDF' was created.
> Connection Broken
> Whats happening & what else i can try.
> Thanks
> reddi

attaching mdf & ldf files

Hi,
Our dev. guys have stopped sequel & took the backup of mdf and ldf file of a
database, formatted that server with the help of a sys admin.
I am aware that attach wont work 90% times without a detach. Now the dev.
guys say that they have some sp codes in that db and expecting me to make DB
available.
I am sure that chances are less but I am giving a try and this is the
present situation.
step1:
EXEC sp_attach_db @.dbname = N'MyDB',
@.filename1 = N'd:\backup\MyDB_Data.mdf',
@.filename2 = N'd:\backup\MyDB_log.ldf'
output:
Server: Msg 5173, Level 16, State 2, Line 1
Cannot associate files with different databases.
step2:
EXEC sp_attach_single_file_db @.dbname = 'MyDB',
@.physname = 'd:\bkup\MyDB_Data.mdf'
output:
Server: Msg 823, Level 24, State 2, Line 1
I/O error (bad page ID) detected during read at offset 0x00000028840000 in
file 'd:\backup\MyDB_Data.mdf'.
Device activation error. The physical file name 'C:\Program Files\Microsoft
SQL Server\MSSQL\data\MyDB_Log.LDF' may be incorrect.
New log file 'd:\backup\MyDB_log.LDF' was created.
Connection Broken
Whats happening & what else i can try.
Thanks
reddiReddi,
Have you recreated the exact same paths that were on the original build?
Have you got a backup you can restore from?
My hopes are not high that you will be able to recover this database. If
you are really desperate you should give MS PSS a call.
http://www.mssqlserver.com/faq/general-pss.asp
--
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602m.html
Reddi wrote:
> Hi,
> Our dev. guys have stopped sequel & took the backup of mdf and ldf file of a
> database, formatted that server with the help of a sys admin.
> I am aware that attach wont work 90% times without a detach. Now the dev.
> guys say that they have some sp codes in that db and expecting me to make DB
> available.
> I am sure that chances are less but I am giving a try and this is the
> present situation.
> step1:
> EXEC sp_attach_db @.dbname = N'MyDB',
> @.filename1 = N'd:\backup\MyDB_Data.mdf',
> @.filename2 = N'd:\backup\MyDB_log.ldf'
>
> output:
> Server: Msg 5173, Level 16, State 2, Line 1
> Cannot associate files with different databases.
>
> step2:
> EXEC sp_attach_single_file_db @.dbname = 'MyDB',
> @.physname = 'd:\bkup\MyDB_Data.mdf'
> output:
> Server: Msg 823, Level 24, State 2, Line 1
> I/O error (bad page ID) detected during read at offset 0x00000028840000 in
> file 'd:\backup\MyDB_Data.mdf'.
> Device activation error. The physical file name 'C:\Program Files\Microsoft
> SQL Server\MSSQL\data\MyDB_Log.LDF' may be incorrect.
> New log file 'd:\backup\MyDB_log.LDF' was created.
> Connection Broken
> Whats happening & what else i can try.
> Thanks
> reddi
>|||Hi Mark,
Have you recreated the exact same paths that were on the original build?
--These are just mdf and ldf files which were moved onto other server by
stopping the SQL Server. Do you mean to say that I need to create a similar
directory path as in source server and try to attach?
Have you got a backup you can restore from?
--yes but a old one..
Thanks
Reedi
"Mark Allison" wrote:
> Reddi,
> Have you recreated the exact same paths that were on the original build?
> Have you got a backup you can restore from?
> My hopes are not high that you will be able to recover this database. If
> you are really desperate you should give MS PSS a call.
> http://www.mssqlserver.com/faq/general-pss.asp
> --
> Mark Allison, SQL Server MVP
> http://www.markallison.co.uk
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602m.html
>
> Reddi wrote:
> > Hi,
> >
> > Our dev. guys have stopped sequel & took the backup of mdf and ldf file of a
> > database, formatted that server with the help of a sys admin.
> >
> > I am aware that attach wont work 90% times without a detach. Now the dev.
> > guys say that they have some sp codes in that db and expecting me to make DB
> > available.
> >
> > I am sure that chances are less but I am giving a try and this is the
> > present situation.
> >
> > step1:
> >
> > EXEC sp_attach_db @.dbname = N'MyDB',
> > @.filename1 = N'd:\backup\MyDB_Data.mdf',
> > @.filename2 = N'd:\backup\MyDB_log.ldf'
> >
> >
> > output:
> >
> > Server: Msg 5173, Level 16, State 2, Line 1
> > Cannot associate files with different databases.
> >
> >
> > step2:
> >
> > EXEC sp_attach_single_file_db @.dbname = 'MyDB',
> > @.physname = 'd:\bkup\MyDB_Data.mdf'
> >
> > output:
> > Server: Msg 823, Level 24, State 2, Line 1
> > I/O error (bad page ID) detected during read at offset 0x00000028840000 in
> > file 'd:\backup\MyDB_Data.mdf'.
> > Device activation error. The physical file name 'C:\Program Files\Microsoft
> > SQL Server\MSSQL\data\MyDB_Log.LDF' may be incorrect.
> > New log file 'd:\backup\MyDB_log.LDF' was created.
> >
> > Connection Broken
> >
> > Whats happening & what else i can try.
> >
> > Thanks
> >
> > reddi
> >
>|||On the second step, did you check if your database was restored?
--
Peter Yeoh
http://www.yohz.com
Need smaller SQL2K backup files? Use MiniSQLBackup Lite, free!
"Reddi" <Reddi@.discussions.microsoft.com> wrote in message
news:A0C79772-6A2F-471D-B842-ECD98AC9F244@.microsoft.com...
> Hi,
> Our dev. guys have stopped sequel & took the backup of mdf and ldf file of
a
> database, formatted that server with the help of a sys admin.
> I am aware that attach wont work 90% times without a detach. Now the dev.
> guys say that they have some sp codes in that db and expecting me to make
DB
> available.
> I am sure that chances are less but I am giving a try and this is the
> present situation.
> step1:
> EXEC sp_attach_db @.dbname = N'MyDB',
> @.filename1 = N'd:\backup\MyDB_Data.mdf',
> @.filename2 = N'd:\backup\MyDB_log.ldf'
>
> output:
> Server: Msg 5173, Level 16, State 2, Line 1
> Cannot associate files with different databases.
>
> step2:
> EXEC sp_attach_single_file_db @.dbname = 'MyDB',
> @.physname = 'd:\bkup\MyDB_Data.mdf'
> output:
> Server: Msg 823, Level 24, State 2, Line 1
> I/O error (bad page ID) detected during read at offset 0x00000028840000 in
> file 'd:\backup\MyDB_Data.mdf'.
> Device activation error. The physical file name 'C:\Program
Files\Microsoft
> SQL Server\MSSQL\data\MyDB_Log.LDF' may be incorrect.
> New log file 'd:\backup\MyDB_log.LDF' was created.
> Connection Broken
> Whats happening & what else i can try.
> Thanks
> reddi
>|||Hi Peter,
Thanks for the input.. i havent check that.. request u to keep this thread
on watch
will be back soon
reedi
"Peter Yeoh" wrote:
> On the second step, did you check if your database was restored?
> --
> Peter Yeoh
> http://www.yohz.com
> Need smaller SQL2K backup files? Use MiniSQLBackup Lite, free!
>
> "Reddi" <Reddi@.discussions.microsoft.com> wrote in message
> news:A0C79772-6A2F-471D-B842-ECD98AC9F244@.microsoft.com...
> > Hi,
> >
> > Our dev. guys have stopped sequel & took the backup of mdf and ldf file of
> a
> > database, formatted that server with the help of a sys admin.
> >
> > I am aware that attach wont work 90% times without a detach. Now the dev.
> > guys say that they have some sp codes in that db and expecting me to make
> DB
> > available.
> >
> > I am sure that chances are less but I am giving a try and this is the
> > present situation.
> >
> > step1:
> >
> > EXEC sp_attach_db @.dbname = N'MyDB',
> > @.filename1 = N'd:\backup\MyDB_Data.mdf',
> > @.filename2 = N'd:\backup\MyDB_log.ldf'
> >
> >
> > output:
> >
> > Server: Msg 5173, Level 16, State 2, Line 1
> > Cannot associate files with different databases.
> >
> >
> > step2:
> >
> > EXEC sp_attach_single_file_db @.dbname = 'MyDB',
> > @.physname = 'd:\bkup\MyDB_Data.mdf'
> >
> > output:
> > Server: Msg 823, Level 24, State 2, Line 1
> > I/O error (bad page ID) detected during read at offset 0x00000028840000 in
> > file 'd:\backup\MyDB_Data.mdf'.
> > Device activation error. The physical file name 'C:\Program
> Files\Microsoft
> > SQL Server\MSSQL\data\MyDB_Log.LDF' may be incorrect.
> > New log file 'd:\backup\MyDB_log.LDF' was created.
> >
> > Connection Broken
> >
> > Whats happening & what else i can try.
> >
> > Thanks
> >
> > reddi
> >
>
>|||Hi Peter,
Extremely sorry for the delay.. after executing step 2, I dont see that
database created in EM.
Thanks
Reedi.
"Reddi" wrote:
> Hi Peter,
> Thanks for the input.. i havent check that.. request u to keep this thread
> on watch
> will be back soon
> reedi
>
> "Peter Yeoh" wrote:
> > On the second step, did you check if your database was restored?
> >
> > --
> > Peter Yeoh
> > http://www.yohz.com
> > Need smaller SQL2K backup files? Use MiniSQLBackup Lite, free!
> >
> >
> > "Reddi" <Reddi@.discussions.microsoft.com> wrote in message
> > news:A0C79772-6A2F-471D-B842-ECD98AC9F244@.microsoft.com...
> > > Hi,
> > >
> > > Our dev. guys have stopped sequel & took the backup of mdf and ldf file of
> > a
> > > database, formatted that server with the help of a sys admin.
> > >
> > > I am aware that attach wont work 90% times without a detach. Now the dev.
> > > guys say that they have some sp codes in that db and expecting me to make
> > DB
> > > available.
> > >
> > > I am sure that chances are less but I am giving a try and this is the
> > > present situation.
> > >
> > > step1:
> > >
> > > EXEC sp_attach_db @.dbname = N'MyDB',
> > > @.filename1 = N'd:\backup\MyDB_Data.mdf',
> > > @.filename2 = N'd:\backup\MyDB_log.ldf'
> > >
> > >
> > > output:
> > >
> > > Server: Msg 5173, Level 16, State 2, Line 1
> > > Cannot associate files with different databases.
> > >
> > >
> > > step2:
> > >
> > > EXEC sp_attach_single_file_db @.dbname = 'MyDB',
> > > @.physname = 'd:\bkup\MyDB_Data.mdf'
> > >
> > > output:
> > > Server: Msg 823, Level 24, State 2, Line 1
> > > I/O error (bad page ID) detected during read at offset 0x00000028840000 in
> > > file 'd:\backup\MyDB_Data.mdf'.
> > > Device activation error. The physical file name 'C:\Program
> > Files\Microsoft
> > > SQL Server\MSSQL\data\MyDB_Log.LDF' may be incorrect.
> > > New log file 'd:\backup\MyDB_log.LDF' was created.
> > >
> > > Connection Broken
> > >
> > > Whats happening & what else i can try.
> > >
> > > Thanks
> > >
> > > reddi
> > >
> >
> >
> >|||Hi Reddi,
This might of help to you
http://www.spaceprogram.com/knowledge/sqlserver_recover_from_deleted_log.html
http://www.spaceprogram.com/knowledge/sqlserver_recover_emails_received.html
http://forums1.itrc.hp.com/service/forums/questionanswer.do?admit=716493758+1098084882912+28353475&threadId=653793
Regards
Ravi
"Reddi" <Reddi@.discussions.microsoft.com> wrote in message news:<A0C79772-6A2F-471D-B842-ECD98AC9F244@.microsoft.com>...
> Hi,
> Our dev. guys have stopped sequel & took the backup of mdf and ldf file of a
> database, formatted that server with the help of a sys admin.
> I am aware that attach wont work 90% times without a detach. Now the dev.
> guys say that they have some sp codes in that db and expecting me to make DB
> available.
> I am sure that chances are less but I am giving a try and this is the
> present situation.
> step1:
> EXEC sp_attach_db @.dbname = N'MyDB',
> @.filename1 = N'd:\backup\MyDB_Data.mdf',
> @.filename2 = N'd:\backup\MyDB_log.ldf'
>
> output:
> Server: Msg 5173, Level 16, State 2, Line 1
> Cannot associate files with different databases.
>
> step2:
> EXEC sp_attach_single_file_db @.dbname = 'MyDB',
> @.physname = 'd:\bkup\MyDB_Data.mdf'
> output:
> Server: Msg 823, Level 24, State 2, Line 1
> I/O error (bad page ID) detected during read at offset 0x00000028840000 in
> file 'd:\backup\MyDB_Data.mdf'.
> Device activation error. The physical file name 'C:\Program Files\Microsoft
> SQL Server\MSSQL\data\MyDB_Log.LDF' may be incorrect.
> New log file 'd:\backup\MyDB_log.LDF' was created.
> Connection Broken
> Whats happening & what else i can try.
> Thanks
> reddi