Monday, March 19, 2012
Crash with "Failed Assertion"
I have a table with 2 indexes.
My C++ program deletes some data from this table and then
does bcp data in. It does it twice in one run.
After I run my program for the first time I get the
correct result. When I run it again, the first bcp is
successful, however there is no data from the second bcp.
If I repeat it again, the result is correct; one more
time - the data from the first bcp only.
If I try to debug it, everything works fine.
If I run it without break points in the program, I
duplicate a problem.
SQL Server log records an error:
Failed Assertion = '(logMode != nonlogged) || (dbt-
>dbt_dbid == TEMPDBID)'
and creates a SQLdump file, which I don't know how to
interprit.
If I remove indexes from the table, everything works fine.
Does anyone understand what's going on?
I would appriciate any help.
Thanks.Are your indexes unique indexes? Chances are thats why it's failing the
second time, if you're using the same data in you're BCP load.
-Morgan
"Tanya Bardakh" <tbardakh@.dysanalytics.com> wrote in message
news:0cf001c39d5d$a3068a20$a401280a@.phx.gbl...
> Hello,
>
> I have a table with 2 indexes.
> My C++ program deletes some data from this table and then
> does bcp data in. It does it twice in one run.
> After I run my program for the first time I get the
> correct result. When I run it again, the first bcp is
> successful, however there is no data from the second bcp.
> If I repeat it again, the result is correct; one more
> time - the data from the first bcp only.
> If I try to debug it, everything works fine.
> If I run it without break points in the program, I
> duplicate a problem.
> SQL Server log records an error:
> Failed Assertion = '(logMode != nonlogged) || (dbt-
> >dbt_dbid == TEMPDBID)'
> and creates a SQLdump file, which I don't know how to
> interprit.
> If I remove indexes from the table, everything works fine.
> Does anyone understand what's going on?
> I would appriciate any help.
> Thanks.
>
>|||Thank you for the reply.
My indexes are not unique, nor cluster.
Tanya.
>--Original Message--
>Are your indexes unique indexes? Chances are thats why
it's failing the
>second time, if you're using the same data in you're BCP
load.
>-Morgan
>"Tanya Bardakh" <tbardakh@.dysanalytics.com> wrote in
message
>news:0cf001c39d5d$a3068a20$a401280a@.phx.gbl...
>> Hello,
>>
>> I have a table with 2 indexes.
>> My C++ program deletes some data from this table and
then
>> does bcp data in. It does it twice in one run.
>> After I run my program for the first time I get the
>> correct result. When I run it again, the first bcp is
>> successful, however there is no data from the second
bcp.
>> If I repeat it again, the result is correct; one more
>> time - the data from the first bcp only.
>> If I try to debug it, everything works fine.
>> If I run it without break points in the program, I
>> duplicate a problem.
>> SQL Server log records an error:
>> Failed Assertion = '(logMode != nonlogged) || (dbt-
>> >dbt_dbid == TEMPDBID)'
>> and creates a SQLdump file, which I don't know how to
>> interprit.
>> If I remove indexes from the table, everything works
fine.
>> Does anyone understand what's going on?
>> I would appriciate any help.
>> Thanks.
>>
>
>.
>|||Any replication on the tables involved?
How about triggers?
If the answer to the above is "no", the only thing I can think of is that
you're running out of space in the logfile and you have configured for
"Simple" recovery model. It would work in "debug" because SQLServer would
have time to remove the previous checkpoint...
Bruce
"Tanya Bardakh" <anonymous@.discussions.microsoft.com> wrote in message
news:0de201c39d64$5d354b10$a401280a@.phx.gbl...
> Thank you for the reply.
> My indexes are not unique, nor cluster.
> Tanya.
>
> >--Original Message--
> >Are your indexes unique indexes? Chances are thats why
> it's failing the
> >second time, if you're using the same data in you're BCP
> load.
> >
> >-Morgan
> >
> >"Tanya Bardakh" <tbardakh@.dysanalytics.com> wrote in
> message
> >news:0cf001c39d5d$a3068a20$a401280a@.phx.gbl...
> >> Hello,
> >>
> >>
> >> I have a table with 2 indexes.
> >> My C++ program deletes some data from this table and
> then
> >> does bcp data in. It does it twice in one run.
> >>
> >> After I run my program for the first time I get the
> >> correct result. When I run it again, the first bcp is
> >> successful, however there is no data from the second
> bcp.
> >> If I repeat it again, the result is correct; one more
> >> time - the data from the first bcp only.
> >>
> >> If I try to debug it, everything works fine.
> >>
> >> If I run it without break points in the program, I
> >> duplicate a problem.
> >>
> >> SQL Server log records an error:
> >> Failed Assertion = '(logMode != nonlogged) || (dbt-
> >> >dbt_dbid == TEMPDBID)'
> >> and creates a SQLdump file, which I don't know how to
> >> interprit.
> >>
> >> If I remove indexes from the table, everything works
> fine.
> >>
> >> Does anyone understand what's going on?
> >>
> >> I would appriciate any help.
> >> Thanks.
> >>
> >>
> >>
> >
> >
> >.
> >|||Thank you, Bruce
I don't have any triggers & replications.
Space should not be an issue, since I have plenty of it
(30 GB). Actually I am reloading same data (about 200
rows) over and over again. The only thing is it's
successful the first time and crashes SQL server on the
subsequent run.
>--Original Message--
>Any replication on the tables involved?
>How about triggers?
>If the answer to the above is "no", the only thing I can
think of is that
>you're running out of space in the logfile and you have
configured for
>"Simple" recovery model. It would work in "debug"
because SQLServer would
>have time to remove the previous checkpoint...
>Bruce
>"Tanya Bardakh" <anonymous@.discussions.microsoft.com>
wrote in message
>news:0de201c39d64$5d354b10$a401280a@.phx.gbl...
>> Thank you for the reply.
>> My indexes are not unique, nor cluster.
>> Tanya.
>>
>> >--Original Message--
>> >Are your indexes unique indexes? Chances are thats why
>> it's failing the
>> >second time, if you're using the same data in you're
BCP
>> load.
>> >
>> >-Morgan
>> >
>> >"Tanya Bardakh" <tbardakh@.dysanalytics.com> wrote in
>> message
>> >news:0cf001c39d5d$a3068a20$a401280a@.phx.gbl...
>> >> Hello,
>> >>
>> >>
>> >> I have a table with 2 indexes.
>> >> My C++ program deletes some data from this table and
>> then
>> >> does bcp data in. It does it twice in one run.
>> >>
>> >> After I run my program for the first time I get the
>> >> correct result. When I run it again, the first bcp is
>> >> successful, however there is no data from the second
>> bcp.
>> >> If I repeat it again, the result is correct; one more
>> >> time - the data from the first bcp only.
>> >>
>> >> If I try to debug it, everything works fine.
>> >>
>> >> If I run it without break points in the program, I
>> >> duplicate a problem.
>> >>
>> >> SQL Server log records an error:
>> >> Failed Assertion = '(logMode != nonlogged) || (dbt-
>> >> >dbt_dbid == TEMPDBID)'
>> >> and creates a SQLdump file, which I don't know how to
>> >> interprit.
>> >>
>> >> If I remove indexes from the table, everything works
>> fine.
>> >>
>> >> Does anyone understand what's going on?
>> >>
>> >> I would appriciate any help.
>> >> Thanks.
>> >>
>> >>
>> >>
>> >
>> >
>> >.
>> >
>
>.
>|||You should contact Product Support (http://support.microsoft.com) who will
be able to help you figure this out.
Regards,
Paul.
--
Paul Randal
DBCC Technical Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"bcarson@.asgoth.com" <anonymous@.discussions.microsoft.com> wrote in message
news:027e01c39d82$9d9c2070$a301280a@.phx.gbl...
> Thank you, Bruce
> I don't have any triggers & replications.
> Space should not be an issue, since I have plenty of it
> (30 GB). Actually I am reloading same data (about 200
> rows) over and over again. The only thing is it's
> successful the first time and crashes SQL server on the
> subsequent run.
>
> >--Original Message--
> >Any replication on the tables involved?
> >How about triggers?
> >
> >If the answer to the above is "no", the only thing I can
> think of is that
> >you're running out of space in the logfile and you have
> configured for
> >"Simple" recovery model. It would work in "debug"
> because SQLServer would
> >have time to remove the previous checkpoint...
> >
> >Bruce
> >
> >"Tanya Bardakh" <anonymous@.discussions.microsoft.com>
> wrote in message
> >news:0de201c39d64$5d354b10$a401280a@.phx.gbl...
> >> Thank you for the reply.
> >>
> >> My indexes are not unique, nor cluster.
> >>
> >> Tanya.
> >>
> >>
> >> >--Original Message--
> >> >Are your indexes unique indexes? Chances are thats why
> >> it's failing the
> >> >second time, if you're using the same data in you're
> BCP
> >> load.
> >> >
> >> >-Morgan
> >> >
> >> >"Tanya Bardakh" <tbardakh@.dysanalytics.com> wrote in
> >> message
> >> >news:0cf001c39d5d$a3068a20$a401280a@.phx.gbl...
> >> >> Hello,
> >> >>
> >> >>
> >> >> I have a table with 2 indexes.
> >> >> My C++ program deletes some data from this table and
> >> then
> >> >> does bcp data in. It does it twice in one run.
> >> >>
> >> >> After I run my program for the first time I get the
> >> >> correct result. When I run it again, the first bcp is
> >> >> successful, however there is no data from the second
> >> bcp.
> >> >> If I repeat it again, the result is correct; one more
> >> >> time - the data from the first bcp only.
> >> >>
> >> >> If I try to debug it, everything works fine.
> >> >>
> >> >> If I run it without break points in the program, I
> >> >> duplicate a problem.
> >> >>
> >> >> SQL Server log records an error:
> >> >> Failed Assertion = '(logMode != nonlogged) || (dbt-
> >> >> >dbt_dbid == TEMPDBID)'
> >> >> and creates a SQLdump file, which I don't know how to
> >> >> interprit.
> >> >>
> >> >> If I remove indexes from the table, everything works
> >> fine.
> >> >>
> >> >> Does anyone understand what's going on?
> >> >>
> >> >> I would appriciate any help.
> >> >> Thanks.
> >> >>
> >> >>
> >> >>
> >> >
> >> >
> >> >.
> >> >
> >
> >
> >.
> >
crash recovery (huge rollback) going on over 24 hours! How can I stop it?
I want to stop it!
One of the databases in our server is in recovery mode after a huge
delete job (started as a job) did not complete ( I suspect due to
lack of transaction log sapce.) the log file size is 120 GB.
Whenever the server restarted the recovery for this database starts.
After 20 hours, analysis done 100% and recovery done up to
76%. Then after “the percentage of recovery done” went down to
16% and it is still running.
How can I get rid of this database without damaging the master database and other database in the same instance?
I don’t mind to lose this database.
There are 4 user databases in this instance and msdb and the recovery mode database are not operational.(I cannot connect)
Your best option is to let recovery complete. Anything else you try to do is not supported and could end up causing you bigger problems.
I also recommend batching up your delete job in some way to avoid having a single, huge transaction that could cause the log file to run out of space.
Thanks
Crash Recovery
installation with a small database (say) DATA. The file DATA.MDF has gone
missing during the crash. The file DATA.LDF has been recovered. There is
also a backup file DATA.BAK. This backup is about 4 MB and I suspect it was
used to install the database in the first place, as it is several months
old. The log file LDF has been recently updated and is 47 Mb.
Is there any way to recover this database to a reasonable up to date version
using DATA.BAK and DATA.LDF. All suggestions are welcome?
BobHi,
Since the MDF file is not avaible you will not able be use the LDF.
But using DATA.BAK file you can recover the database back to the time in
whcih backup is created.
How to restore the BAK file.
From Query analyzer execute the below command
1. Copy the DATA.BAK to c:\backup folder
Restore database <dbname> from disk='c:\backup\data.bak'
You may need to use WITH Move option along with restore statement.
Thanks
Hari
MCDBA
"Bob Morris" <bmorris@.kenyaonline.com> wrote in message
news:#fVLgrcBEHA.3348@.TK2MSFTNGP11.phx.gbl...
> I am trying to restore a crashed server. The server has an SQL2K
> installation with a small database (say) DATA. The file DATA.MDF has gone
> missing during the crash. The file DATA.LDF has been recovered. There is
> also a backup file DATA.BAK. This backup is about 4 MB and I suspect it
was
> used to install the database in the first place, as it is several months
> old. The log file LDF has been recently updated and is 47 Mb.
> Is there any way to recover this database to a reasonable up to date
version
> using DATA.BAK and DATA.LDF. All suggestions are welcome?
> Bob
>
>|||Thanks,
But I need to know if there's any way to apply the LDF. The MDB file was
probably created on this machine from the BAK file. (i.e. the database was
created elsewhere and "restored" to this machine with the force restore
option). The LDF will reflect changes since that was done, and that's what I
want to try and do.
Regards
Bob
"Hari" <hari_prasad_k@.hotmail.com> wrote in message
news:eAF4v9cBEHA.3568@.tk2msftngp13.phx.gbl...
> Hi,
> Since the MDF file is not avaible you will not able be use the LDF.
> But using DATA.BAK file you can recover the database back to the time in
> whcih backup is created.
> How to restore the BAK file.
> From Query analyzer execute the below command
> 1. Copy the DATA.BAK to c:\backup folder
> Restore database <dbname> from disk='c:\backup\data.bak'
> You may need to use WITH Move option along with restore statement.
> Thanks
> Hari
> MCDBA
>
>
>
> "Bob Morris" <bmorris@.kenyaonline.com> wrote in message
> news:#fVLgrcBEHA.3348@.TK2MSFTNGP11.phx.gbl...
gone
> was
> version
>|||Thanks, but what I need is to try and apply the LDF after I restore the
backup.
Regards
"Hari" <hari_prasad_k@.hotmail.com> wrote in message
news:eAF4v9cBEHA.3568@.tk2msftngp13.phx.gbl...
> Hi,
> Since the MDF file is not avaible you will not able be use the LDF.
> But using DATA.BAK file you can recover the database back to the time in
> whcih backup is created.
> How to restore the BAK file.
> From Query analyzer execute the below command
> 1. Copy the DATA.BAK to c:\backup folder
> Restore database <dbname> from disk='c:\backup\data.bak'
> You may need to use WITH Move option along with restore statement.
> Thanks
> Hari
> MCDBA
>
>
>
> "Bob Morris" <bmorris@.kenyaonline.com> wrote in message
> news:#fVLgrcBEHA.3348@.TK2MSFTNGP11.phx.gbl...
gone
> was
> version
>|||You can't apply an LDF file to a restored database backup. If you're lucky,
you might be able to dig something out of the LDF file using some log reader
program. See my signature, the links.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"Bob Morris" <bmorris@.kenyaonline.com> wrote in message
news:eiZLHtfBEHA.2768@.tk2msftngp13.phx.gbl...
> Thanks, but what I need is to try and apply the LDF after I restore the
> backup.
> Regards
> "Hari" <hari_prasad_k@.hotmail.com> wrote in message
> news:eAF4v9cBEHA.3568@.tk2msftngp13.phx.gbl...
> gone
is
it
months
>
Crash of Enterprise Manager.
Every time I try to use enterprise manager it suddenlly crashes.
The server is on, I can access it in other ways but without using
enterprise manager.
I removed sqlserver from the system, and installed it again.
I also installed the service pack 4.
Any hint?
Thanks
Massimo
Hi,
sounds like you have some problems with Microsoft Management Console (MMC).
Danijel Novak
"mappopo" <massimo.petrillo@.gmail.com> wrote in message
news:1135000434.876224.255900@.g14g2000cwa.googlegr oups.com...
> Hi,
> Every time I try to use enterprise manager it suddenlly crashes.
> The server is on, I can access it in other ways but without using
> enterprise manager.
> I removed sqlserver from the system, and installed it again.
> I also installed the service pack 4.
> Any hint?
> Thanks
> Massimo
>
|||What have I to do?
|||Hi,
Try reinstalling MMC from
%CD%:\x86\other\instmmc.exe
%CD% is a letter of SQL Server CD-ROM.
Danijel Novak
"mappopo" <massimo.petrillo@.gmail.com> wrote in message
news:1135065562.406941.165770@.g44g2000cwa.googlegr oups.com...
> What have I to do?
>
|||I already done that.
If I log in (to the machine) as a different user, Enterprise manager
runs well. Only with my account it crashes.
Have you more hints for me?
Thanks for your help.
|||Hi,
It couldbe a problem with profile for this user.
Are other MMC consoles running OK?
Maybe you can try deleting the profile and creating one from the scratch for
this user.
Danijel Novak
"mappopo" <massimo.petrillo@.gmail.com> wrote in message
news:1135098033.010474.95190@.g49g2000cwa.googlegro ups.com...
>I already done that.
> If I log in (to the machine) as a different user, Enterprise manager
> runs well. Only with my account it crashes.
> Have you more hints for me?
> Thanks for your help.
>
|||My profile come from active directory domain. I have no permission to
delete it and create it again.
Other mmc are ok, in effect I use "manage computer" (I hope the
translation is correct, I get it with a right click on "my computer")
to connect to the local instace of sql server.
I am preatty sure that the problem is in some settings but I do noty
know where are those settiongs.
Do you know it?
Thanks
Crash of Enterprise Manager.
Every time I try to use enterprise manager it suddenlly crashes.
The server is on, I can access it in other ways but without using
enterprise manager.
I removed sqlserver from the system, and installed it again.
I also installed the service pack 4.
Any hint?
Thanks
MassimoHi,
sounds like you have some problems with Microsoft Management Console (MMC).
--
Danijel Novak
"mappopo" <massimo.petrillo@.gmail.com> wrote in message
news:1135000434.876224.255900@.g14g2000cwa.googlegroups.com...
> Hi,
> Every time I try to use enterprise manager it suddenlly crashes.
> The server is on, I can access it in other ways but without using
> enterprise manager.
> I removed sqlserver from the system, and installed it again.
> I also installed the service pack 4.
> Any hint?
> Thanks
> Massimo
>|||What have I to do?|||Hi,
Try reinstalling MMC from
%CD%:\x86\other\instmmc.exe
%CD% is a letter of SQL Server CD-ROM.
--
Danijel Novak
"mappopo" <massimo.petrillo@.gmail.com> wrote in message
news:1135065562.406941.165770@.g44g2000cwa.googlegroups.com...
> What have I to do?
>|||I already done that.
If I log in (to the machine) as a different user, Enterprise manager
runs well. Only with my account it crashes.
Have you more hints for me?
Thanks for your help.|||Hi,
It couldbe a problem with profile for this user.
Are other MMC consoles running OK?
Maybe you can try deleting the profile and creating one from the scratch for
this user.
--
Danijel Novak
"mappopo" <massimo.petrillo@.gmail.com> wrote in message
news:1135098033.010474.95190@.g49g2000cwa.googlegroups.com...
>I already done that.
> If I log in (to the machine) as a different user, Enterprise manager
> runs well. Only with my account it crashes.
> Have you more hints for me?
> Thanks for your help.
>|||My profile come from active directory domain. I have no permission to
delete it and create it again.
Other mmc are ok, in effect I use "manage computer" (I hope the
translation is correct, I get it with a right click on "my computer")
to connect to the local instace of sql server.
I am preatty sure that the problem is in some settings but I do noty
know where are those settiongs.
Do you know it?
Thanks
Crash of Enterprise Manager.
Every time I try to use enterprise manager it suddenlly crashes.
The server is on, I can access it in other ways but without using
enterprise manager.
I removed sqlserver from the system, and installed it again.
I also installed the service pack 4.
Any hint?
Thanks
MassimoHi,
sounds like you have some problems with Microsoft Management Console (MMC).
Danijel Novak
"mappopo" <massimo.petrillo@.gmail.com> wrote in message
news:1135000434.876224.255900@.g14g2000cwa.googlegroups.com...
> Hi,
> Every time I try to use enterprise manager it suddenlly crashes.
> The server is on, I can access it in other ways but without using
> enterprise manager.
> I removed sqlserver from the system, and installed it again.
> I also installed the service pack 4.
> Any hint?
> Thanks
> Massimo
>|||What have I to do?|||Hi,
Try reinstalling MMC from
%CD%:\x86\other\instmmc.exe
%CD% is a letter of SQL Server CD-ROM.
Danijel Novak
"mappopo" <massimo.petrillo@.gmail.com> wrote in message
news:1135065562.406941.165770@.g44g2000cwa.googlegroups.com...
> What have I to do?
>|||I already done that.
If I log in (to the machine) as a different user, Enterprise manager
runs well. Only with my account it crashes.
Have you more hints for me?
Thanks for your help.|||Hi,
It couldbe a problem with profile for this user.
Are other MMC consoles running OK?
Maybe you can try deleting the profile and creating one from the scratch for
this user.
Danijel Novak
"mappopo" <massimo.petrillo@.gmail.com> wrote in message
news:1135098033.010474.95190@.g49g2000cwa.googlegroups.com...
>I already done that.
> If I log in (to the machine) as a different user, Enterprise manager
> runs well. Only with my account it crashes.
> Have you more hints for me?
> Thanks for your help.
>|||My profile come from active directory domain. I have no permission to
delete it and create it again.
Other mmc are ok, in effect I use "manage computer" (I hope the
translation is correct, I get it with a right click on "my computer")
to connect to the local instace of sql server.
I am preatty sure that the problem is in some settings but I do noty
know where are those settiongs.
Do you know it?
Thanks
Crash of Enterprise Manager, strange solution
Every time I try to use enterprise manager it suddenlly crashes.
The server is on, I can access it in other ways but without using
enterprise manager.
I removed sqlserver from the system, and installed it again.
I also installed the service pack 4.
I made many attempt to solve the problem.
At last I renamed the file "C:\Program files\Microsoft SQL
Server\80\Tools\BINN\SQL Server Enterprise Manager.MSC", double click
et voila EM runs well again.
Does anyone know why?
Thanks
MassimoHi
I presume copying the MMC back to the original file name MMC still fails? In
which case MMC there must be some configuration information linked to the
file name.
John
"mappopo" wrote:
> Hi,
> Every time I try to use enterprise manager it suddenlly crashes.
> The server is on, I can access it in other ways but without using
> enterprise manager.
> I removed sqlserver from the system, and installed it again.
> I also installed the service pack 4.
> I made many attempt to solve the problem.
> At last I renamed the file "C:\Program files\Microsoft SQL
> Server\80\Tools\BINN\SQL Server Enterprise Manager.MSC", double click
> et voila EM runs well again.
> Does anyone know why?
> Thanks
> Massimo
>|||I think so. Where are those informations?|||Hi
I would have expected it to be in the registry, but searching it didn't seem
to turn up anything!
John
"mappopo" wrote:
> I think so. Where are those informations?
>
Crash of Enterprise Manager, strange solution
Every time I try to use enterprise manager it suddenlly crashes.
The server is on, I can access it in other ways but without using
enterprise manager.
I removed sqlserver from the system, and installed it again.
I also installed the service pack 4.
I made many attempt to solve the problem.
At last I renamed the file "C:\Program files\Microsoft SQL
Server\80\Tools\BINN\SQL Server Enterprise Manager.MSC", double click
et voila EM runs well again.
Does anyone know why?
Thanks
Massimo
Hi
I presume copying the MMC back to the original file name MMC still fails? In
which case MMC there must be some configuration information linked to the
file name.
John
"mappopo" wrote:
> Hi,
> Every time I try to use enterprise manager it suddenlly crashes.
> The server is on, I can access it in other ways but without using
> enterprise manager.
> I removed sqlserver from the system, and installed it again.
> I also installed the service pack 4.
> I made many attempt to solve the problem.
> At last I renamed the file "C:\Program files\Microsoft SQL
> Server\80\Tools\BINN\SQL Server Enterprise Manager.MSC", double click
> et voila EM runs well again.
> Does anyone know why?
> Thanks
> Massimo
>
|||I think so. Where are those informations?
|||Hi
I would have expected it to be in the registry, but searching it didn't seem
to turn up anything!
John
"mappopo" wrote:
> I think so. Where are those informations?
>
Crash of Enterprise Manager, strange solution
Every time I try to use enterprise manager it suddenlly crashes.
The server is on, I can access it in other ways but without using
enterprise manager.
I removed sqlserver from the system, and installed it again.
I also installed the service pack 4.
I made many attempt to solve the problem.
At last I renamed the file "C:\Program files\Microsoft SQL
Server\80\Tools\BINN\SQL Server Enterprise Manager.MSC", double click
et voila EM runs well again.
Does anyone know why?
Thanks
Massimo
Hi
I presume copying the MMC back to the original file name MMC still fails? In
which case MMC there must be some configuration information linked to the
file name.
John
"mappopo" wrote:
> Hi,
> Every time I try to use enterprise manager it suddenlly crashes.
> The server is on, I can access it in other ways but without using
> enterprise manager.
> I removed sqlserver from the system, and installed it again.
> I also installed the service pack 4.
> I made many attempt to solve the problem.
> At last I renamed the file "C:\Program files\Microsoft SQL
> Server\80\Tools\BINN\SQL Server Enterprise Manager.MSC", double click
> et voila EM runs well again.
> Does anyone know why?
> Thanks
> Massimo
>
|||I think so. Where are those informations?
|||Hi
I would have expected it to be in the registry, but searching it didn't seem
to turn up anything!
John
"mappopo" wrote:
> I think so. Where are those informations?
>
Crash of Enterprise Manager, strange solution
Every time I try to use enterprise manager it suddenlly crashes.
The server is on, I can access it in other ways but without using
enterprise manager.
I removed sqlserver from the system, and installed it again.
I also installed the service pack 4.
I made many attempt to solve the problem.
At last I renamed the file "C:\Program files\Microsoft SQL
Server\80\Tools\BINN\SQL Server Enterprise Manager.MSC", double click
et voila EM runs well again.
Does anyone know why?
Thanks
MassimoHi
I presume copying the MMC back to the original file name MMC still fails? In
which case MMC there must be some configuration information linked to the
file name.
John
"mappopo" wrote:
> Hi,
> Every time I try to use enterprise manager it suddenlly crashes.
> The server is on, I can access it in other ways but without using
> enterprise manager.
> I removed sqlserver from the system, and installed it again.
> I also installed the service pack 4.
> I made many attempt to solve the problem.
> At last I renamed the file "C:\Program files\Microsoft SQL
> Server\80\Tools\BINN\SQL Server Enterprise Manager.MSC", double click
> et voila EM runs well again.
> Does anyone know why?
> Thanks
> Massimo
>|||I think so. Where are those informations?|||Hi
I would have expected it to be in the registry, but searching it didn't seem
to turn up anything!
John
"mappopo" wrote:
> I think so. Where are those informations?
>
Crash in Execute() method of _ConnectionPtr
I have a piece of code where object of _ConnectionPtr is used. When I
call the Execute() method for this object I get an debug error stating
that "The Value of ESP could be saved...".
If I ignore the message this leads to crash with "Access violation
error".
Following is the code snippet i use.
void ExecuteSQLCmd( unsigned short *sqlCmd)
{
_ConnectionPtr ConnPtr ;
_bstr_t cmd ;
_RecordsetPtr ptrRS("ADODB.Recordset");Ashish choudhari (ashishtchaudhari@.gmail.com) writes:
> I have a piece of code where object of _ConnectionPtr is used. When I
> call the Execute() method for this object I get an debug error stating
> that "The Value of ESP could be saved...".
> If I ignore the message this leads to crash with "Access violation
> error".
> Following is the code snippet i use.
> void ExecuteSQLCmd( unsigned short *sqlCmd)
> {
> _ConnectionPtr ConnPtr ;
> _bstr_t cmd ;
> _RecordsetPtr ptrRS("ADODB.Recordset");
> .
> .
> cmd = sqlCmd ;
> //occassionally crash here
> pRS = ConnPtr->Execute(cmd,NULL,enumtextCmd) ; //enumtextCmd = 1
> }
> The crash at the above mentioned statement occurs sometimes, I am not
> sure why the error is occuring I am using m
Extremely stupid question: should you not assign ConnPtr some value
before using it?
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||Hi,
I did forgot to mention in the above code.
I have used CreateInstance() and Open() method of _ConnectionPtr before
actually calling Execute().
The code looks as follows
void ExecuteSQLCmd( unsigned short *sqlCmd, char *ConnStr)
{
_ConnectionPtr ConnPtr ;
_bstr_t cmd ;
_RecordsetPtr ptrRS("ADODB.Recordset");
CoInitialize(NULL) ;
ConnPtr.CreateInstance(__uuidof( Connection ));
ConnPtr.Open(ConnStr,"","",adoConnectUnSpecified) ; //
adoConnectUnspecified = -1|||
I can't see anything obviously wrong with your code, although
the CoInitialize should be called only once per thread and
before any COM calls, including the line
_RecordsetPtr ptrRS("ADODB.Recordset");
When debugging what does the call stack tell you when you
get the "The Value of ESP could be saved..." message?
Occasional crashes may indicate memory overwrites/array bounds
exceeded etc. Is you app multi-threaded? If so are there thread
safety related issues? There are 3rd party tools available
to help with these kinds of problems (e.g. BoundsChecker).|||Hi,
First, I would like to let you know actually how my code is
implemented.
I have a C++ class "CRdbms". The public member variable "ptrConn" in
class "CRdbms" is an object of class "_ConnectionPtr. The object of
these class "CRdbms" is passed to function "ExecuteSQLCmd()". Before
calling ExecuteSQLCmd(), _ConnectionPtr is initialized. Then the
function ExecuteSQLCmd () is called. ExecuteSQLCmd() looks as follows:
void ExecuteSQLCmd(CRdbms &objRdbms, unsigned short *sqlCmd)
{
bstr_t cmd;
cmd = sqlCmd;
CoInitialize(NULL);
try
{
_RecordsetPtr ptrRs("ADODB.Recordset");
if ( objRdbms.RdbmsCmdTimeOut() != -1 )
{
objRdbms.ptrConn->CommandTimeout = objRdbms.RdbmsCmdTimeOut();
}
//Occassionally crash here
ptrRs = objRdbms.ptrConn->Execute(cmd,
NULL, enumtextCmd) ; //enumtextCmd = 1
}
catch (_com_error &e)
{
status = false;
wsprintf("Code = %08lx\n", e.Error());
wsprintf("Code meaning = %s\n", (char*) e.ErrorMessage());
wsprintf("Source = %s\n", (char*) e.Source());
wsprintf("Description = %s\n", (char*) e.Description());
wsprintf ( objRdbms.errMsg, L"%s", (unsigned short *)
e.Description());
}
CoUninitialize();
}
The application is running in multi-threaded environment. The debug
error is coming will executing Execute() function of "_ConnectionPtr"
and if we ignore the message the crash occurs while results are
returned and assigned to ptrRs. i.e. statement
ptrRs = objRdbms.ptrConn->Execute(cmd, NULL, enumtextCmd) ;
//enumtextCmd = 1
It seems that the memory overwrite is taking place in this situation
but not sure why is it happening so.
Please help me to solve the problem.
Thanks and Regards,
Ashish Choudhari|||
A couple of things to try...
Do you have a single instance of your "CRdbms" class that
is shared between all threads? If so, then you may need
to serialise any access to "objRdbms.ptrConn" (use a
critical section inside your ExecuteSQLCmd function)
or create a new connection per thread.
Try moving the CoInitialize/CoUninitialize so that
they happen once per thread.|||I do not have single instance of "CRdbms" object. It is created one per
thread and not shared between any other thread.
There are multiple functions called by each thread and each function
have CoInitialize and CoUnitilize.
I will try moving them so that it occurs only one per thread.
Thanks for your comments.
Regards,
Ashish Choudhary|||Ashish choudhari (ashishtchaudhari@.gmail.com) writes:
> I do not have single instance of "CRdbms" object. It is created one per
> thread and not shared between any other thread.
> There are multiple functions called by each thread and each function
> have CoInitialize and CoUnitilize.
> I will try moving them so that it occurs only one per thread.
I would not say that I know this stuff too well, but I've written
a DLL in C++ that implements a general interface for running queries
from Perl. When the DLL is loaded the first time, I do:
CoInitializeEx(NULL, COINIT_MULTITHREADED);
And I, eh, never call CoUnitialize.
But I would like to stress that I'm a not regular programmer of COM
application, so the above may very well be an example of poor practice.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||I modified my code so that CoInitialize is called only once per thread.
Doing this reduced the number of crash locations. But the code still
crash in Open() function of _ConnectionPtr. My Code looks as follows.
bool AdoConnect (CRdbms &objRdbms )
{
bool status = true;
if(FAILED(CoInitialize(NULL)))
{
status = false ;
return status ;
}
try
{
HRESULT hR = objRdbms.Pcn.CreateInstance(__uuidof( Connection ));
if (!SUCCEEDED(hR))
{
_com_issue_error(hR);
status = false;
}
else
{
char *sqlCmd ;
sqlCmd = rdbms.RdbmsConnStr() ;
if (sqlCmd == NULL)
{
printf("Error: No Connection String present") ;
status = false ;
}
else
{
bstr_t cmd(sqlCmd) ;
objRdbms.Pcn->Open ( cmd, "", "", adConnectUnspecified);
status = true;
}
}
}
catch (_com_error &e)
{
if ( status )
{
objRdbms.Pcn.Release();
}
status = false;
printf("Error:\n");
printf("Code = %08lx\n", e.Error());
printf("Code meaning = %s\n", (char*) e.ErrorMessage());
printf("Source = %s\n", (char*) e.Source());
printf("Description = %s\n", (char*) e.Description());
//wcscpy ( rdbms.errMsg, ERR_CONN_FAILED );
wsprintf ( rdbms.errMsg, L"%s", (unsigned short *) e.Description());
}
return status;
}
In the above code SOMETIMES when the statement objRdbms.Pcn->Open() is
execute the application crashes here. Internally, when the function
Open() returns it destroys the object of _bstr_t and it is here it
crashes.
Please do let me know if you have any suggestions.
Thanks and Regards,
Ashish Choudhary