Showing posts with label log. Show all posts
Showing posts with label log. Show all posts

Friday, March 30, 2012

How to Audit Login, Log off, and Login failure attempts

Hi,
Can anyone provide a pointer on how to enable login, log out, and=
login failure attempts without using the SQL Profiler? I want=
to enable this type of auditing at all times and store the=
results to a table. SQL Profiler does it however I would have=
to keep this tool open all the time in order to get the audit=
results.
Any advice is greatly appreciated. Thanks!
-Lorinda
User submitted from AEWNET (http://www.aewnet.com/)Take a look at sp_trace_create and sp_trace_status in Books Online. You can
create a SQL Agent job to start these on startup or create your own procedur
e
that preps and calls these and mark that proc to start up when SQL Server
does. It basically does the same thing as profiler but is script based
instead of the interactive GUI.
Hope this helps.
Sincerely,
Anthony Thomas
"Guest" wrote:

> Hi,
> Can anyone provide a pointer on how to enable login, log out, and login failure at
tempts without using the SQL Profiler? I want to enable this type of auditing at al
l times and store the results to a table. SQL Profiler does it however I would have
to
keep this tool open all the time in order to get the audit results.
> Any advice is greatly appreciated. Thanks!
> -Lorinda
> User submitted from AEWNET (http://www.aewnet.com/)
>|||Hi,
See this article by Vyas.
http://vyaskn.tripod.com/server_sid..._sql_server.htm
Thanks
Hari
SQL Server MVP
"AnthonyThomas" <AnthonyThomas@.discussions.microsoft.com> wrote in message
news:7938CF87-6D42-43FD-8A54-7F7288BEE53A@.microsoft.com...[vbcol=seagreen]
> Take a look at sp_trace_create and sp_trace_status in Books Online. You
> can
> create a SQL Agent job to start these on startup or create your own
> procedure
> that preps and calls these and mark that proc to start up when SQL Server
> does. It basically does the same thing as profiler but is script based
> instead of the interactive GUI.
> Hope this helps.
> Sincerely,
>
> Anthony Thomas
>
> "Guest" wrote:
>|||Also in SQL Enterprise Manager, right click your server and go to properties
( I think the security tab) ... IN the middle you can set some login
auditing parameters..
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Guest" <Guest@.aew_nospam.com> wrote in message
news:%23prHz3gwEHA.1400@.TK2MSFTNGP11.phx.gbl...
Hi,
Can anyone provide a pointer on how to enable login, log out, and login
failure attempts without using the SQL Profiler? I want to enable this type
of auditing at all times and store the results to a table. SQL Profiler
does it however I would have to keep this tool open all the time in order to
get the audit results.
Any advice is greatly appreciated. Thanks!
-Lorinda
User submitted from AEWNET (http://www.aewnet.com/)|||What you require is also what C2 auditing in SQL Server offers (and much
more). This might also help:
http://www.databasejournal.com/feat...cle.php/3399241
Sasan Saidi, MSc in CS
Senior DBA
Brascan Business Services
"I saw it work in a cartoon once so I am pretty sure I can do it."
"Guest" wrote:

> Hi,
> Can anyone provide a pointer on how to enable login, log out, and login failure at
tempts without using the SQL Profiler? I want to enable this type of auditing at al
l times and store the results to a table. SQL Profiler does it however I would have
to
keep this tool open all the time in order to get the audit results.
> Any advice is greatly appreciated. Thanks!
> -Lorinda
> User submitted from AEWNET (http://www.aewnet.com/)
>|||Server side tracing is exactly what I need. Thank you for all your response
s!
-Lorinda
User submitted from AEWNET (http://www.aewnet.com/)

How to Audit Login, Log off, and Login failure attempts

Hi,
Can anyone provide a pointer on how to enable login, log out, and= login failure attempts without using the SQL Profiler? I want= to enable this type of auditing at all times and store the= results to a table. SQL Profiler does it however I would have= to keep this tool open all the time in order to get the audit= results.
Any advice is greatly appreciated. Thanks!
-Lorinda
User submitted from AEWNET (http://www.aewnet.com/)Take a look at sp_trace_create and sp_trace_status in Books Online. You can
create a SQL Agent job to start these on startup or create your own procedure
that preps and calls these and mark that proc to start up when SQL Server
does. It basically does the same thing as profiler but is script based
instead of the interactive GUI.
Hope this helps.
Sincerely,
Anthony Thomas
"Guest" wrote:
> Hi,
> Can anyone provide a pointer on how to enable login, log out, and login failure attempts without using the SQL Profiler? I want to enable this type of auditing at all times and store the results to a table. SQL Profiler does it however I would have to keep this tool open all the time in order to get the audit results.
> Any advice is greatly appreciated. Thanks!
> -Lorinda
> User submitted from AEWNET (http://www.aewnet.com/)
>|||Hi,
See this article by Vyas.
http://vyaskn.tripod.com/server_side_tracing_in_sql_server.htm
Thanks
Hari
SQL Server MVP
"AnthonyThomas" <AnthonyThomas@.discussions.microsoft.com> wrote in message
news:7938CF87-6D42-43FD-8A54-7F7288BEE53A@.microsoft.com...
> Take a look at sp_trace_create and sp_trace_status in Books Online. You
> can
> create a SQL Agent job to start these on startup or create your own
> procedure
> that preps and calls these and mark that proc to start up when SQL Server
> does. It basically does the same thing as profiler but is script based
> instead of the interactive GUI.
> Hope this helps.
> Sincerely,
>
> Anthony Thomas
>
> "Guest" wrote:
>> Hi,
>> Can anyone provide a pointer on how to enable login, log out, and login
>> failure attempts without using the SQL Profiler? I want to enable this
>> type of auditing at all times and store the results to a table. SQL
>> Profiler does it however I would have to keep this tool open all the time
>> in order to get the audit results.
>> Any advice is greatly appreciated. Thanks!
>> -Lorinda
>> User submitted from AEWNET (http://www.aewnet.com/)|||Also in SQL Enterprise Manager, right click your server and go to properties
( I think the security tab) ... IN the middle you can set some login
auditing parameters..
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Guest" <Guest@.aew_nospam.com> wrote in message
news:%23prHz3gwEHA.1400@.TK2MSFTNGP11.phx.gbl...
Hi,
Can anyone provide a pointer on how to enable login, log out, and login
failure attempts without using the SQL Profiler? I want to enable this type
of auditing at all times and store the results to a table. SQL Profiler
does it however I would have to keep this tool open all the time in order to
get the audit results.
Any advice is greatly appreciated. Thanks!
-Lorinda
User submitted from AEWNET (http://www.aewnet.com/)|||What you require is also what C2 auditing in SQL Server offers (and much
more). This might also help:
http://www.databasejournal.com/features/mssql/article.php/3399241
--
Sasan Saidi, MSc in CS
Senior DBA
Brascan Business Services
"I saw it work in a cartoon once so I am pretty sure I can do it."
"Guest" wrote:
> Hi,
> Can anyone provide a pointer on how to enable login, log out, and login failure attempts without using the SQL Profiler? I want to enable this type of auditing at all times and store the results to a table. SQL Profiler does it however I would have to keep this tool open all the time in order to get the audit results.
> Any advice is greatly appreciated. Thanks!
> -Lorinda
> User submitted from AEWNET (http://www.aewnet.com/)
>|||Server side tracing is exactly what I need. Thank you for all your responses!
-Lorinda
User submitted from AEWNET (http://www.aewnet.com/)sql

How to Audit Login, Log off, and Login failure attempts

Hi,
Can anyone provide a pointer on how to enable login, log out, and=
login failure attempts without using the SQL Profiler? I want=
to enable this type of auditing at all times and store the=
results to a table. SQL Profiler does it however I would have=
to keep this tool open all the time in order to get the audit=
results.
Any advice is greatly appreciated. Thanks!
-Lorinda
User submitted from AEWNET (http://www.aewnet.com/)
Take a look at sp_trace_create and sp_trace_status in Books Online. You can
create a SQL Agent job to start these on startup or create your own procedure
that preps and calls these and mark that proc to start up when SQL Server
does. It basically does the same thing as profiler but is script based
instead of the interactive GUI.
Hope this helps.
Sincerely,
Anthony Thomas
"Guest" wrote:

> Hi,
> Can anyone provide a pointer on how to enable login, log out, and login failure attempts without using the SQL Profiler? I want to enable this type of auditing at all times and store the results to a table. SQL Profiler does it however I would have to
keep this tool open all the time in order to get the audit results.
> Any advice is greatly appreciated. Thanks!
> -Lorinda
> User submitted from AEWNET (http://www.aewnet.com/)
>
|||Hi,
See this article by Vyas.
http://vyaskn.tripod.com/server_side...sql_server.htm
Thanks
Hari
SQL Server MVP
"AnthonyThomas" <AnthonyThomas@.discussions.microsoft.com> wrote in message
news:7938CF87-6D42-43FD-8A54-7F7288BEE53A@.microsoft.com...[vbcol=seagreen]
> Take a look at sp_trace_create and sp_trace_status in Books Online. You
> can
> create a SQL Agent job to start these on startup or create your own
> procedure
> that preps and calls these and mark that proc to start up when SQL Server
> does. It basically does the same thing as profiler but is script based
> instead of the interactive GUI.
> Hope this helps.
> Sincerely,
>
> Anthony Thomas
>
> "Guest" wrote:
|||Also in SQL Enterprise Manager, right click your server and go to properties
( I think the security tab) ... IN the middle you can set some login
auditing parameters..
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Guest" <Guest@.aew_nospam.com> wrote in message
news:%23prHz3gwEHA.1400@.TK2MSFTNGP11.phx.gbl...
Hi,
Can anyone provide a pointer on how to enable login, log out, and login
failure attempts without using the SQL Profiler? I want to enable this type
of auditing at all times and store the results to a table. SQL Profiler
does it however I would have to keep this tool open all the time in order to
get the audit results.
Any advice is greatly appreciated. Thanks!
-Lorinda
User submitted from AEWNET (http://www.aewnet.com/)
|||What you require is also what C2 auditing in SQL Server offers (and much
more). This might also help:
http://www.databasejournal.com/featu...le.php/3399241
Sasan Saidi, MSc in CS
Senior DBA
Brascan Business Services
"I saw it work in a cartoon once so I am pretty sure I can do it."
"Guest" wrote:

> Hi,
> Can anyone provide a pointer on how to enable login, log out, and login failure attempts without using the SQL Profiler? I want to enable this type of auditing at all times and store the results to a table. SQL Profiler does it however I would have to
keep this tool open all the time in order to get the audit results.
> Any advice is greatly appreciated. Thanks!
> -Lorinda
> User submitted from AEWNET (http://www.aewnet.com/)
>
|||Server side tracing is exactly what I need. Thank you for all your responses!
-Lorinda
User submitted from AEWNET (http://www.aewnet.com/)

How to attach db with missing log file?

I jad detached a larg db with multiple empty log files.
While moving the db to another server, a drive array onthe
first one went bad, taking one of my log files with it.
How can I re-attach the db and have it ignore that its
missing a log file?
Thank you in advance!Hi
You may be able to use sp_attach_single_file_db, although this would not be
guaranteed.
John
"Merlin" <anonymous@.discussions.microsoft.com> wrote in message
news:bc7201c40dfc$f3419e20$a001280a@.phx.gbl...
> I jad detached a larg db with multiple empty log files.
> While moving the db to another server, a drive array onthe
> first one went bad, taking one of my log files with it.
> How can I re-attach the db and have it ignore that its
> missing a log file?
> Thank you in advance!|||Thank you for your help. sp_attach_single_file_db is not
allowing me to get past the missing log file, either. is
there any other way?

>--Original Message--
>Hi
>You may be able to use sp_attach_single_file_db, although
this would not be
>guaranteed.
>John
>"Merlin" <anonymous@.discussions.microsoft.com> wrote in
message
>news:bc7201c40dfc$f3419e20$a001280a@.phx.gbl...
onthe
>
>.
>|||Hi
Not that I know off. You may want to call Microsoft PSS if going back to the
last backup is not a viable option.
John
"Merlin" <anonymous@.discussions.microsoft.com> wrote in message
news:d87301c40e01$69052ec0$a601280a@.phx.gbl...
> Thank you for your help. sp_attach_single_file_db is not
> allowing me to get past the missing log file, either. is
> there any other way?
>
>
> this would not be
> message
> onthe|||Not supported etc and make sure you have a copy of the mdf before starting
this. Also replace the relavent database,drive letters and filenames with
your particulars as this answer was for a specific case.
1) Make sure you have a copy of PowerDVD301_2_Data.MDF
2) Create a new database called fake (default file locations)
3) Stop SQL Service
4) Delete the fake_Data.MDF and copy PowerDVD301_2_Data.MDF
to where fake_Data.MDF used to be and rename the file to fake_Data.MDF
5) Start SQL Service
6) Database fake will appear as suspect in EM
7) Open Query Analyser and in master database run the following :
sp_configure 'allow updates',1
go
reconfigure with override
go
update sysdatabases set
status=-32768 where dbid=DB_ID('fake')
go
sp_configure 'allow updates',0
go
reconfigure with override
go
This will put the database in emergency recovery mode
8) Stop SQL Service
9) Delete the fake_Log.LDF file
10) Restart SQL Service
11) In QA run the following (with correct path for log)
dbcc rebuild_log('fake','h:\fake_log.ldf')
go
dbcc checkdb('fake') -- to check for errors
go
12) Now we need to rename the files, run the following (make sure
there are no connections to it) in Query Analyser
(At this stage you can actually access the database so you could use
DTS or bcp to move the data to another database .)
use master
go
sp_helpdb 'fake'
go
/* Make a note of the names of the files , you will need them
in the next bit of the script to replace datafilename and
logfilename - it might be that they have the right names */
sp_renamedb 'fake','PowerDVD301'
go
alter database PowerDVD301
MODIFY FILE(NAME='datafilename', NEWNAME = 'PowerDVD301_Data')
go
alter database PowerDVD301
MODIFY FILE(NAME='logfilename', NEWNAME = 'PowerDVD301_Log')
go
dbcc checkdb('PowerDVD301')
go
sp_dboption 'PowerDVD301','dbo use only','false'
go
use PowerDVD301
go
sp_updatestats
go
13) You should now have a working database. However the log file
will be small so it will be worth increasing its size
Unfortunately your files will be called fake_Data.MDF and
fake_Log.LDF but you can get round this by detaching the
database properly and then renaming the files and reattaching
it
14) Run the following in QA
sp_detach_db PowerDVD301
--now rename the files then reattach
sp_attach_db 'PowerDVD301','h:\dvd.mdf','h:\DVD.ldf'
HTH
Jasper Smith (SQL Server MVP)
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Merlin" <anonymous@.discussions.microsoft.com> wrote in message
news:d87301c40e01$69052ec0$a601280a@.phx.gbl...
> Thank you for your help. sp_attach_single_file_db is not
> allowing me to get past the missing log file, either. is
> there any other way?
>
>
> this would not be
> message
> onthe|||I fixed this by running dbcc rebuild_log and then running
dbcc checkdb. all is good now. sp_attach_single_file_db
didnt work for me, it was still looking for the missing
log file before letting me attach the db. Thank you for
the help, I appreciated it!!!

>--Original Message--
>Hi
>You may be able to use sp_attach_single_file_db, although
this would not be
>guaranteed.
>John
>"Merlin" <anonymous@.discussions.microsoft.com> wrote in
message
>news:bc7201c40dfc$f3419e20$a001280a@.phx.gbl...
onthe
>
>.
>sql

how to attach a DB

I have database DB1 on Box1 and I have the full backup of that database and also have data file and log file.If I want to restore the database on a diff box How can do that.
1.How can I restore the Database?
2.How ca I attach the data file to the database on new Box?
Thanks.Check out the WITH REPLACE arguement of the RESTORE command.

or if you have a mdf and a ldf look at sp_attach_db.

Monday, March 26, 2012

How to analyzing db log?

Hi knights,
Pls tell me how to analyzing the db log. I'd appreciate your help!Analyze the log how?

Without knowing more about what you want, I'd suggest Lumigent's (http://www.lumigent.com/) Log Explorer.

-PatP|||Thanks PatP for good idea!!!

How to alter the transaction logfile size in MSDE 2000?

Hi there,

I recently saw that the transaction log files of user dbs grow undefinitely in SQL Server 2000 - one of our customers had a 11 GB log file which totally slowed down the server.
Another customer of ours uses one of my applications logging all actions in a MSDE database file and I fear that the corresponding transaction log file will grow and block the system too - is there any way that I could shrink and set the max size of the transaction log file through SQL?

I already know the command "SHRINK FILE ('filename')" but I haven't found a SQL command to set the max size.

Thank you for any hints!

SaschaTo set the growth, UOM for increment, increment value, allocated size, and max sizeeeee, you need to use ALTER DATABASE. However, the claim that the size of the log file slows down the server or even "block" it is somewhat strange. I've never heard of the size of the log file having such detremental effect on the system. Anyone has other opinion?|||hi rdjabarov,

thank you for your comment. How should the ALTER DATABASE command look like? It's not a part of the standard SQL command, that's why I haven't found any documentation in standard SQL books.
The server slowed down because there were only 180 kb free space on the drive and windows needs some space for swapping, running other programs and other stuff.
I'll try to see if I can get some info on ALTER DATABASE with MS SQL Server.|||Now THAT (!!!) is a different story! In other words, your db is on the verge of becoming Suspect. BTW, your OS doesn't need any more room for swap file, unless you're bogging down the memory as well.

BOL (ALTER DATABASE syntax):

MODIFY FILE
Specifies the given file that should be modified, including the FILENAME, SIZE, FILEGROWTH, and MAXSIZE options.

Wednesday, March 21, 2012

How to alert via email when Agent records errors/warning in log?

We are in on SQL2000 and our SQL Server Agent started to receive errors for
Mail Profile not available. It wasn't until we looked at the agent error log
we saw the problem.
Is there any way to report the SQL Server Agent Warnings/Errors via email or
alert as a pro-active stance?
Hi
Instead of using alerts you could have steps that send emails, to avoid mapi
you can use SMTP see http://www.sqldev.net/xp/xpsmtp.htm. The sending of the
email can be determined by the jobs workflow if necessary.
If you are looking for a product to monitor your server then you may want to
check out MOM.
John
"ssciarrino" wrote:

> We are in on SQL2000 and our SQL Server Agent started to receive errors for
> Mail Profile not available. It wasn't until we looked at the agent error log
> we saw the problem.
> Is there any way to report the SQL Server Agent Warnings/Errors via email or
> alert as a pro-active stance?

How to alert via email when Agent records errors/warning in log?

We are in on SQL2000 and our SQL Server Agent started to receive errors for
Mail Profile not available. It wasn't until we looked at the agent error lo
g
we saw the problem.
Is there any way to report the SQL Server Agent Warnings/Errors via email or
alert as a pro-active stance?Hi
Instead of using alerts you could have steps that send emails, to avoid mapi
you can use SMTP see http://www.sqldev.net/xp/xpsmtp.htm. The sending of the
email can be determined by the jobs workflow if necessary.
If you are looking for a product to monitor your server then you may want to
check out MOM.
John
"ssciarrino" wrote:

> We are in on SQL2000 and our SQL Server Agent started to receive errors fo
r
> Mail Profile not available. It wasn't until we looked at the agent error
log
> we saw the problem.
> Is there any way to report the SQL Server Agent Warnings/Errors via email
or
> alert as a pro-active stance?

How to alert via email when Agent records errors/warning in log?

We are in on SQL2000 and our SQL Server Agent started to receive errors for
Mail Profile not available. It wasn't until we looked at the agent error log
we saw the problem.
Is there any way to report the SQL Server Agent Warnings/Errors via email or
alert as a pro-active stance?Hi
Instead of using alerts you could have steps that send emails, to avoid mapi
you can use SMTP see http://www.sqldev.net/xp/xpsmtp.htm. The sending of the
email can be determined by the jobs workflow if necessary.
If you are looking for a product to monitor your server then you may want to
check out MOM.
John
"ssciarrino" wrote:
> We are in on SQL2000 and our SQL Server Agent started to receive errors for
> Mail Profile not available. It wasn't until we looked at the agent error log
> we saw the problem.
> Is there any way to report the SQL Server Agent Warnings/Errors via email or
> alert as a pro-active stance?sql

Monday, March 12, 2012

How to add message to sql server log?

Hi!
I use MSSQL 2000. I want add message to sql server log, i use raiserror with
log and it works, but it add unnecessary message about error, severity and
state. How can i add only my message? Thanks!
Best regards, Konstantin Knyazevtry using xp_logevent
"Konstantin Knyazev" <kknyazev_no_spam_@.mail.ru> wrote in message
news:eJUjx6FRGHA.224@.TK2MSFTNGP10.phx.gbl...
> Hi!
> I use MSSQL 2000. I want add message to sql server log, i use raiserror
> with
> log and it works, but it add unnecessary message about error, severity and
> state. How can i add only my message? Thanks!
> Best regards, Konstantin Knyazev
>|||xp_logevent also adds second message about error.
"Immy" <therealasianbabe@.hotmail.com> wrote in message
news:%23JzAU%23FRGHA.5296@.tk2msftngp13.phx.gbl...
> try using xp_logevent
>
> "Konstantin Knyazev" <kknyazev_no_spam_@.mail.ru> wrote in message
> news:eJUjx6FRGHA.224@.TK2MSFTNGP10.phx.gbl...
and
>

Sunday, February 19, 2012

how to access the Sql server ...

hi ,

I have the Data and log file of the pubs dataBase(pubs,pubs_log)...

Now i want access the pubs database through the C#.net without installing the Sql server in my system.. just like the Msaccess. please any body tell me.. is it possible.

Thanks & Regards,

S.Sajan

That is not possible.

You must have SQL Server installed to use the Northwind and Pubs SQL Server databases.

You can get an Access version of Northwind here:

http://www.microsoft.com/downloads/details.aspx?FamilyID=C6661372-8DBE-422B-8676-C632D66C529C&displaylang=EN

You can get an Access version of Pubs here:

http://authors.aspalliance.com/andrewmooney/53/pubs.zip

You could then use them in your C# application with the JET provider.

|||

hi Arnie Rowland,

Thanks for ur reply....my doubt is i want to deploye my project in client side.. in that time th don't see the data base... so..without installing the Sql server can access the database through the c#.net

|||

Your application can also install the SQL Server.

See these resources:

SQL Server 2005 UnAttended Installations
http://msdn2.microsoft.com/en-us/library/ms144259.aspx
http://www.devx.com/dbzone/Article/31648