Showing posts with label logfile. Show all posts
Showing posts with label logfile. Show all posts

Wednesday, March 7, 2012

How to get logfile of SQL statements?

Hi,
on SQL Server Version 8.0, is it possible to get a logfile of the SQL
statements for a certain database? If not built in, is there a tool?
Thank you
Adrian
I guess you want to get a trace of what SQL statements have been run against
a particular database. For that, you can use SQL Profiler (a GUI tool) or SQL
Trace without GUI.
Linchi
"Adrian Schmitt" wrote:

> Hi,
> on SQL Server Version 8.0, is it possible to get a logfile of the SQL
> statements for a certain database? If not built in, is there a tool?
> Thank you
> Adrian
>
|||You could use the way Linchi recommended, but I suggest you execute the SQL
Trace or Profiler only when required.
Thanks
Hari
"Linchi Shea" <LinchiShea@.discussions.microsoft.com> wrote in message
news:74E8236E-70F9-4237-B9D4-EB6C8B0D439D@.microsoft.com...[vbcol=seagreen]
>I guess you want to get a trace of what SQL statements have been run
>against
> a particular database. For that, you can use SQL Profiler (a GUI tool) or
> SQL
> Trace without GUI.
> Linchi
> "Adrian Schmitt" wrote:
|||On 22 Jun., 18:21, Linchi Shea <LinchiS...@.discussions.microsoft.com>
wrote:
> I guess you want to get a trace of what SQL statements have been run against
> a particular database. For that, you can use SQL Profiler (a GUI tool)
Thank you Linchi, thank you Hari.
I created a new database user in the end and assigned the
"sysadmin" server role to this user. Then I was able to log the
requests
that the client application was doing (but as a different user) with
the Profiler.
I could understand some parts of what this logging shows, like SELECT
and
UPDATE commands, because I recognized also the fields and table-names,
although this is not in the form of SQL like I have seen it before.
Can someone tell me what is the name of this language and is there a
reference
manual online?
This is just a few lines from it that I did not understand:
exec sp_cursorexecute 41, @.P1 output, @.P2 output, @.P3 output, @.P4
output, 4, 'address'
select @.P1, @.P2, @.P3, @.P4
go
exec sp_cursorfetch 180150096, 2, 1, 1
go
declare @.P1 int
set @.P1=42
declare @.P2 int
set @.P2=180150097
declare @.P3 int
set @.P3=1
declare @.P4 int
set @.P4=4
declare @.P5 int
set @.P5=1
The long numbers that start with 180... seem like some refence to
database cursors or statements,
and statements are maybe prepared here over several lines and stuffed
with parameters like it seems?
Maybe someone can point me to some documentation?
Thank you
Adrian
|||Hi
You may want to take a look into Notifications or/and DDL Triggers in the
BOL
"Adrian Schmitt" <Adrian.Schmitt@.googlemail.com> wrote in message
news:1182649654.408598.172770@.g4g2000hsf.googlegro ups.com...
> On 22 Jun., 18:21, Linchi Shea <LinchiS...@.discussions.microsoft.com>
> wrote:
> Thank you Linchi, thank you Hari.
> I created a new database user in the end and assigned the
> "sysadmin" server role to this user. Then I was able to log the
> requests
> that the client application was doing (but as a different user) with
> the Profiler.
> I could understand some parts of what this logging shows, like SELECT
> and
> UPDATE commands, because I recognized also the fields and table-names,
> although this is not in the form of SQL like I have seen it before.
> Can someone tell me what is the name of this language and is there a
> reference
> manual online?
> This is just a few lines from it that I did not understand:
> --
> exec sp_cursorexecute 41, @.P1 output, @.P2 output, @.P3 output, @.P4
> output, 4, 'address'
> select @.P1, @.P2, @.P3, @.P4
> go
> exec sp_cursorfetch 180150096, 2, 1, 1
> go
> declare @.P1 int
> set @.P1=42
> declare @.P2 int
> set @.P2=180150097
> declare @.P3 int
> set @.P3=1
> declare @.P4 int
> set @.P4=4
> declare @.P5 int
> set @.P5=1
> --
> The long numbers that start with 180... seem like some refence to
> database cursors or statements,
> and statements are maybe prepared here over several lines and stuffed
> with parameters like it seems?
> Maybe someone can point me to some documentation?
> Thank you
> Adrian
>
|||> Adrian wrote[vbcol=seagreen]
On 24 Jun., 09:35, Uri Dimant wrote:
> You may want to take a look into Notifications or/and DDL
> Triggers in the BOL
Thank you, Uri. I download Books Online from Microsoft.
The content of the Profiler-Logfile is specific to how the
connection is made, in my case ODBC.
Additionally I found these threads on the subject:
http://webservertalk.com/showpost.php?p=1324627&postcount=5
http://tek-tips.com/viewthread.cfm?qid=832355
Cheers
Adrian

Friday, February 24, 2012

How to get logfile of SQL statements?

Hi,
on SQL Server Version 8.0, is it possible to get a logfile of the SQL
statements for a certain database? If not built in, is there a tool?
Thank you
AdrianI guess you want to get a trace of what SQL statements have been run against
a particular database. For that, you can use SQL Profiler (a GUI tool) or SQ
L
Trace without GUI.
Linchi
"Adrian Schmitt" wrote:

> Hi,
> on SQL Server Version 8.0, is it possible to get a logfile of the SQL
> statements for a certain database? If not built in, is there a tool?
> Thank you
> Adrian
>|||You could use the way Linchi recommended, but I suggest you execute the SQL
Trace or Profiler only when required.
Thanks
Hari
"Linchi Shea" <LinchiShea@.discussions.microsoft.com> wrote in message
news:74E8236E-70F9-4237-B9D4-EB6C8B0D439D@.microsoft.com...[vbcol=seagreen]
>I guess you want to get a trace of what SQL statements have been run
>against
> a particular database. For that, you can use SQL Profiler (a GUI tool) or
> SQL
> Trace without GUI.
> Linchi
> "Adrian Schmitt" wrote:
>|||On 22 Jun., 18:21, Linchi Shea <LinchiS...@.discussions.microsoft.com>
wrote:
> I guess you want to get a trace of what SQL statements have been run again
st
> a particular database. For that, you can use SQL Profiler (a GUI tool)
Thank you Linchi, thank you Hari.
I created a new database user in the end and assigned the
"sysadmin" server role to this user. Then I was able to log the
requests
that the client application was doing (but as a different user) with
the Profiler.
I could understand some parts of what this logging shows, like SELECT
and
UPDATE commands, because I recognized also the fields and table-names,
although this is not in the form of SQL like I have seen it before.
Can someone tell me what is the name of this language and is there a
reference
manual online?
This is just a few lines from it that I did not understand:
exec sp_cursorexecute 41, @.P1 output, @.P2 output, @.P3 output, @.P4
output, 4, 'address'
select @.P1, @.P2, @.P3, @.P4
go
exec sp_cursorfetch 180150096, 2, 1, 1
go
declare @.P1 int
set @.P1=42
declare @.P2 int
set @.P2=180150097
declare @.P3 int
set @.P3=1
declare @.P4 int
set @.P4=4
declare @.P5 int
set @.P5=1
The long numbers that start with 180... seem like some refence to
database cursors or statements,
and statements are maybe prepared here over several lines and stuffed
with parameters like it seems?
Maybe someone can point me to some documentation?
Thank you
Adrian|||Hi
You may want to take a look into Notifications or/and DDL Triggers in the
BOL
"Adrian Schmitt" <Adrian.Schmitt@.googlemail.com> wrote in message
news:1182649654.408598.172770@.g4g2000hsf.googlegroups.com...
> On 22 Jun., 18:21, Linchi Shea <LinchiS...@.discussions.microsoft.com>
> wrote:
> Thank you Linchi, thank you Hari.
> I created a new database user in the end and assigned the
> "sysadmin" server role to this user. Then I was able to log the
> requests
> that the client application was doing (but as a different user) with
> the Profiler.
> I could understand some parts of what this logging shows, like SELECT
> and
> UPDATE commands, because I recognized also the fields and table-names,
> although this is not in the form of SQL like I have seen it before.
> Can someone tell me what is the name of this language and is there a
> reference
> manual online?
> This is just a few lines from it that I did not understand:
> --
> exec sp_cursorexecute 41, @.P1 output, @.P2 output, @.P3 output, @.P4
> output, 4, 'address'
> select @.P1, @.P2, @.P3, @.P4
> go
> exec sp_cursorfetch 180150096, 2, 1, 1
> go
> declare @.P1 int
> set @.P1=42
> declare @.P2 int
> set @.P2=180150097
> declare @.P3 int
> set @.P3=1
> declare @.P4 int
> set @.P4=4
> declare @.P5 int
> set @.P5=1
> --
> The long numbers that start with 180... seem like some refence to
> database cursors or statements,
> and statements are maybe prepared here over several lines and stuffed
> with parameters like it seems?
> Maybe someone can point me to some documentation?
> Thank you
> Adrian
>|||> Adrian wrote
On 24 Jun., 09:35, Uri Dimant wrote:[vbcol=seagreen]
> You may want to take a look into Notifications or/and DDL
> Triggers in the BOL
Thank you, Uri. I download Books Online from Microsoft.
The content of the Profiler-Logfile is specific to how the
connection is made, in my case ODBC.
Additionally I found these threads on the subject:
http://webservertalk.com/showpost.p...627&postcount=5
http://tek-tips.com/viewthread.cfm?qid=832355
Cheers
Adrian

How to get logfile of SQL statements?

Hi,
on SQL Server Version 8.0, is it possible to get a logfile of the SQL
statements for a certain database? If not built in, is there a tool?
Thank you
AdrianI guess you want to get a trace of what SQL statements have been run against
a particular database. For that, you can use SQL Profiler (a GUI tool) or SQL
Trace without GUI.
Linchi
"Adrian Schmitt" wrote:
> Hi,
> on SQL Server Version 8.0, is it possible to get a logfile of the SQL
> statements for a certain database? If not built in, is there a tool?
> Thank you
> Adrian
>|||You could use the way Linchi recommended, but I suggest you execute the SQL
Trace or Profiler only when required.
Thanks
Hari
"Linchi Shea" <LinchiShea@.discussions.microsoft.com> wrote in message
news:74E8236E-70F9-4237-B9D4-EB6C8B0D439D@.microsoft.com...
>I guess you want to get a trace of what SQL statements have been run
>against
> a particular database. For that, you can use SQL Profiler (a GUI tool) or
> SQL
> Trace without GUI.
> Linchi
> "Adrian Schmitt" wrote:
>> Hi,
>> on SQL Server Version 8.0, is it possible to get a logfile of the SQL
>> statements for a certain database? If not built in, is there a tool?
>> Thank you
>> Adrian
>>|||On 22 Jun., 18:21, Linchi Shea <LinchiS...@.discussions.microsoft.com>
wrote:
> I guess you want to get a trace of what SQL statements have been run against
> a particular database. For that, you can use SQL Profiler (a GUI tool)
Thank you Linchi, thank you Hari.
I created a new database user in the end and assigned the
"sysadmin" server role to this user. Then I was able to log the
requests
that the client application was doing (but as a different user) with
the Profiler.
I could understand some parts of what this logging shows, like SELECT
and
UPDATE commands, because I recognized also the fields and table-names,
although this is not in the form of SQL like I have seen it before.
Can someone tell me what is the name of this language and is there a
reference
manual online?
This is just a few lines from it that I did not understand:
--
exec sp_cursorexecute 41, @.P1 output, @.P2 output, @.P3 output, @.P4
output, 4, 'address'
select @.P1, @.P2, @.P3, @.P4
go
exec sp_cursorfetch 180150096, 2, 1, 1
go
declare @.P1 int
set @.P1=42
declare @.P2 int
set @.P2=180150097
declare @.P3 int
set @.P3=1
declare @.P4 int
set @.P4=4
declare @.P5 int
set @.P5=1
--
The long numbers that start with 180... seem like some refence to
database cursors or statements,
and statements are maybe prepared here over several lines and stuffed
with parameters like it seems?
Maybe someone can point me to some documentation?
Thank you
Adrian|||Hi
You may want to take a look into Notifications or/and DDL Triggers in the
BOL
"Adrian Schmitt" <Adrian.Schmitt@.googlemail.com> wrote in message
news:1182649654.408598.172770@.g4g2000hsf.googlegroups.com...
> On 22 Jun., 18:21, Linchi Shea <LinchiS...@.discussions.microsoft.com>
> wrote:
>> I guess you want to get a trace of what SQL statements have been run
>> against
>> a particular database. For that, you can use SQL Profiler (a GUI tool)
> Thank you Linchi, thank you Hari.
> I created a new database user in the end and assigned the
> "sysadmin" server role to this user. Then I was able to log the
> requests
> that the client application was doing (but as a different user) with
> the Profiler.
> I could understand some parts of what this logging shows, like SELECT
> and
> UPDATE commands, because I recognized also the fields and table-names,
> although this is not in the form of SQL like I have seen it before.
> Can someone tell me what is the name of this language and is there a
> reference
> manual online?
> This is just a few lines from it that I did not understand:
> --
> exec sp_cursorexecute 41, @.P1 output, @.P2 output, @.P3 output, @.P4
> output, 4, 'address'
> select @.P1, @.P2, @.P3, @.P4
> go
> exec sp_cursorfetch 180150096, 2, 1, 1
> go
> declare @.P1 int
> set @.P1=42
> declare @.P2 int
> set @.P2=180150097
> declare @.P3 int
> set @.P3=1
> declare @.P4 int
> set @.P4=4
> declare @.P5 int
> set @.P5=1
> --
> The long numbers that start with 180... seem like some refence to
> database cursors or statements,
> and statements are maybe prepared here over several lines and stuffed
> with parameters like it seems?
> Maybe someone can point me to some documentation?
> Thank you
> Adrian
>|||> Adrian wrote
> > Can someone tell me what is the name of this language
> > and is there a reference manual online?
On 24 Jun., 09:35, Uri Dimant wrote:
> You may want to take a look into Notifications or/and DDL
> Triggers in the BOL
Thank you, Uri. I download Books Online from Microsoft.
The content of the Profiler-Logfile is specific to how the
connection is made, in my case ODBC.
Additionally I found these threads on the subject:
http://dbforums.com/showpost.php?p=1324627&postcount=5
http://tek-tips.com/viewthread.cfm?qid=832355
Cheers
Adrian

How to get list of backup log files from msdb of standby server?

How do we retrieve log file names of primary backup from msdb of
standby database?
In case of primary server unavailable, I need to get the logfile names
from standby server for disater recovery test.
Thanks in advance
Tram
Msdb..backupfile gives you a list of data/log files that are backed up.
For logshipping, take a look at msdb..log_shipping_plan_databases.
-oj
"tram" <tram_e@.hotmail.com> wrote in message
news:1120079449.879078.169120@.o13g2000cwo.googlegr oups.com...
> How do we retrieve log file names of primary backup from msdb of
> standby database?
> In case of primary server unavailable, I need to get the logfile names
> from standby server for disater recovery test.
> Thanks in advance
> Tram
>

How to get list of backup log files from msdb of standby server?

How do we retrieve log file names of primary backup from msdb of
standby database?
In case of primary server unavailable, I need to get the logfile names
from standby server for disater recovery test.
Thanks in advance
TramMsdb..backupfile gives you a list of data/log files that are backed up.
For logshipping, take a look at msdb..log_shipping_plan_databases.
-oj
"tram" <tram_e@.hotmail.com> wrote in message
news:1120079449.879078.169120@.o13g2000cwo.googlegroups.com...
> How do we retrieve log file names of primary backup from msdb of
> standby database?
> In case of primary server unavailable, I need to get the logfile names
> from standby server for disater recovery test.
> Thanks in advance
> Tram
>

How to get list of backup log files from msdb of standby server?

How do we retrieve log file names of primary backup from msdb of
standby database?
In case of primary server unavailable, I need to get the logfile names
from standby server for disater recovery test.
Thanks in advance
TramMsdb..backupfile gives you a list of data/log files that are backed up.
For logshipping, take a look at msdb..log_shipping_plan_databases.
--
-oj
"tram" <tram_e@.hotmail.com> wrote in message
news:1120079449.879078.169120@.o13g2000cwo.googlegroups.com...
> How do we retrieve log file names of primary backup from msdb of
> standby database?
> In case of primary server unavailable, I need to get the logfile names
> from standby server for disater recovery test.
> Thanks in advance
> Tram
>