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

Tuesday, March 27, 2012

Encryption of trasaction logs

Is it possible to encrypt the transaction log during log shipping? How?

While there is no explicit log encryption in SQL Server 2005, any entries that are encrypted will be treated as binary data so it will remain encrypted during log shipping as well.

We do plan on offering enhanced encryption features for SQL Server 2008, we will post any further info as soon as they are publicly available.

Hope this helps, please let us know if you have any further questions.

Sung

|||is there any third party utilites that support encryption that are supported by Microsoft ?|||

Hi,

I'm not currently aware of any third party utilities that are supported by Microsoft. We may have a few partners that we perhaps recommend. I am currently checking up on this and will post any info that I find.

UPDATE: While we don't have any specific recommedations in this space, we do have a large number of third parties who have developed solutions in this area. They would be the ones who would directly support any solutions that they may have. Please contact software vendors to discuss any options that they may have or perhaps may provide.

Thanks,

Sung

Encryption of trasaction logs

Is it possible to encrypt the transaction log during log shipping? How?

While there is no explicit log encryption in SQL Server 2005, any entries that are encrypted will be treated as binary data so it will remain encrypted during log shipping as well.

We do plan on offering enhanced encryption features for SQL Server 2008, we will post any further info as soon as they are publicly available.

Hope this helps, please let us know if you have any further questions.

Sung

|||is there any third party utilites that support encryption that are supported by Microsoft ?|||

Hi,

I'm not currently aware of any third party utilities that are supported by Microsoft. We may have a few partners that we perhaps recommend. I am currently checking up on this and will post any info that I find.

UPDATE: While we don't have any specific recommedations in this space, we do have a large number of third parties who have developed solutions in this area. They would be the ones who would directly support any solutions that they may have. Please contact software vendors to discuss any options that they may have or perhaps may provide.

Thanks,

Sung

Monday, March 26, 2012

Encryption Key Errors

I got error as below:

Failure sending mail: The report server has encountered a configuration error. See the report server log files for more information.

Then i found error in log file as below:

ERROR: Throwing Microsoft.ReportingServices.Diagnostics.Utilities.ServerConfigurationErrorException: The report server has encountered a configuration error. See the report server log files for more information., AuthzInitializeContextFromSid: Win32 error: 5; possible reason - service account doesn't have rights to check domain user SIDs.;
Info:

Does that mean sth to do with SQL agent running account or SQl Server Report Service running account ?

Thanks

Nick

http://support.microsoft.com/?kbid=842423|||

Thanks for you information. Teo

when i change the Local account for running SQL Server Report Services to dominon account, then i got http://servername/reports to view report, then i got error below:

An error has occurred during report processing. (rsProcessingAborted)
The report server cannot decrypt the symmetric key used to access sensitive or encrypted data in a report server database. You must either restore a backup key or delete all encrypted content. Check the documentation for more information. (rsReportServerDisabled) (rsRPCError)
Bad Data. (Exception from HRESULT: 0x80090005)

What i am understand is that when i create this report it's under local system account , so this report doesn't work when i change the user account. is that right? and how can i handle it ?

Cheers

Nick

|||You will need to re-initialize the server. Assuming RS 2005, use the Reporting Services Configuration (found under the Configuration Tools program group in Microsoft SQL Server 2005 group) to do so. Or, you can drop the decrypted content by running rskeymgmt -d (you will need to reset your data source connection strings after this).|||

when you say re-initialize the server , does that mean i need to delete the existing isntance from reporting service configruation , and create a new one. not just click the initialize button .

is that right understanding?

Cheers

Nick

|||By just clicking on the Initialization button in the Reporting Services Configuration tool.|||

i got erroer when i click initialize button in Report service configuration tool,

"Joining report server ac553f4....... to the web farm of the local instance" The task failed.

Exception Details"

ReportServicesConfigUI.WMIProvider.WMIProviderException: The report server cannot decrypt the symmetric key used to access sensitive or encrypted data in a report server database. You must either restore a backup key or delete all encrypted content. Check the documentation for more information. (rsReportServerDisabled)
at ReportServicesConfigUI.WMIProvider.RSReportServerAdmin.ThrowOnError(ManagementBaseObject mo)
at ReportServicesConfigUI.WMIProvider.RSReportServerAdmin.InitializeReportServer(String installationId)

Thanks

Nick

|||it looks like the only option is to drop the encryption content using rskeymgmt -d. You will need to reset your data source credentials after this.|||

Hi all, I have seen that I have a similar problem with Encryption Key working with reports. My problem is that I′m working with VSt2003 and I have some reports made, but yesterday I was just testing some ASP.NET examples with VS2005. This morning when I continued working with reports in VS2003, I recieved this error:

The report server cannot decrypt the symmetric key used to access sensitive or encrypted data in a report server database. You must either restore a backup key or delete all encrypted content. Check the documentation for more information. (rsReportServerDisabled)

And it wasn′t possible to see the reports.

Do you now the way to fix this problem?

Thanks in Advance

|||I don't know what happened yesterday but somehow you managed to deactivate the server. Re-initializing ASP.NET (aspnet_regiis) will do the trick. Anyway, if you have backed up the encryption key (you did, didn't you?), now is the perfect time to use the Reporting Services Configuration utility and restore it. If you haven't, do rskeymgmt -d.sql

Sunday, March 11, 2012

Encrypt/Decrypt SQL Server 2005 data files

We are trying to encrypt/decrypt a SQL Server 2005 database file.
It is my understanding that you can encrypt the main database, but not
its log file. The database file was successfully encrypted, but SQL
Server failed to decrypt it on opening after a many minutes delay. The
database was subsequently decrypted with a manual command, but the
database had been damaged and couldn't be re-opened. It had to be
deleted and restored.
It appears that there is no practical way to use an encrypted SQL
database because of apparent glitches and the extremely slow decryption
process.
We have considered backing up the database, encrypting the backup copy,
deleting the database from the SQL directory on shutdown and then
restoring it on startup. Another alternative is to store the data on
removable media.
I would greatly appreciate a suggestion as to how to best protect the
data. We use SecuriKey to protect OS system startup. This works, but it
doesn't protect the data if, for example, the hard drive is moved to
another computer.
I have read the following article:
[url]http://msdn.microsoft.com/msdnmag/issues/05/06/SQLServerSecurity/default.aspx[/url
]
Thank you very much.
Robert RobinsonHave you looked at using Windows Encrypted File System? That's the supported
way of protecting your data at the filesystem level. There are a few things
to be careful with paticularly with login/permissions management when
encrypting the folder but it's not rocket science (and well document in
msdn/technet).
As for losing the drive, well, not much you can do there really. Even if you
encrypt the filesystem, that generally just delays the would-be thief. When
you lose the hardware, pretty much all bets are off. If you're thinking of
notebooks, you can implement both EFS and secure the hard disk with a
password (go to setup when you boot). That makes is REALLY hard to get
through and will probably buy you enough time to initiate all kinds of
remedial defense actions (e.g. place credit alerts, cancel credit cards,
update resume & post on monster.com, etc...) before they get to your data.
joe.
"Robert Robinson" <robbiex@.bellsouth.net> wrote in message
news:e9fdHUdDHHA.3660@.TK2MSFTNGP06.phx.gbl...
> We are trying to encrypt/decrypt a SQL Server 2005 database file.
> It is my understanding that you can encrypt the main database, but not its
> log file. The database file was successfully encrypted, but SQL Server
> failed to decrypt it on opening after a many minutes delay. The database
> was subsequently decrypted with a manual command, but the database had
> been damaged and couldn't be re-opened. It had to be deleted and restored.
> It appears that there is no practical way to use an encrypted SQL database
> because of apparent glitches and the extremely slow decryption process.
> We have considered backing up the database, encrypting the backup copy,
> deleting the database from the SQL directory on shutdown and then
> restoring it on startup. Another alternative is to store the data on
> removable media.
> I would greatly appreciate a suggestion as to how to best protect the
> data. We use SecuriKey to protect OS system startup. This works, but it
> doesn't protect the data if, for example, the hard drive is moved to
> another computer.
> I have read the following article:
> [url]http://msdn.microsoft.com/msdnmag/issues/05/06/SQLServerSecurity/default.aspx[/u
rl]
> Thank you very much.
> Robert Robinson|||Hi Joe,
Thank you very much for the reply. EFS is what we tried. There are two
unfortunate limitations. First, according to Microsoft, you cannot use
SQL if the log file is encrypted. Second, decrypt takes many minutes and
the long required time makes the technology impractical to use.
I agree that there is no absolute way to prevent access to data once an
expert has physical possession of a computer or a hard drive.
SecuriKey does work as advertised. There are ways to circumvent the
technology, but it provides some protection.
Robbie|||> Thank you very much for the reply. EFS is what we tried. There are two
> unfortunate limitations. First, according to Microsoft, you cannot use SQL
> if the log file is encrypted. Second, decrypt takes many minutes and the
> long required time makes the technology impractical to use.
> I agree that there is no absolute way to prevent access to data once an
> expert has physical possession of a computer or a hard drive.
> SecuriKey does work as advertised. There are ways to circumvent the
> technology, but it provides some protection.
Maybe you can encrypt just the snsitive part of the data? Try to look at the
EncryptByKey and other encryption functions in BOL. Together with carefully
set NTFS permissions and encrypted backup you might get what you need.
Dejan Sarka
http://www.solidqualitylearning.com/blogs/|||Hi Dejan,
Thank you very much for the suggestions.
Robbie
Dejan Sarka wrote:
> Maybe you can encrypt just the snsitive part of the data? Try to look at t
he
> EncryptByKey and other encryption functions in BOL. Together with carefull
y
> set NTFS permissions and encrypted backup you might get what you need.
>|||We decided on the following to provide a reasonable level of protection.
First, computer access is limited by using the SecuriKey.
SQL database files are protected as follows:
Setup
1. The SQL databases to be protected are backed up and are then deleted
from SQL Server.
2. PGP Desktop 9.5 is used to create a new Virtual Disk.
3. This disk is mounted.
4. A new SQL database is created with its data and log files assigned to
be resident on the virtual disk.
5. The data are restored from the backup file.
Start-Up
1. The virtual disk is mounted automatically on start-up or under manual
or programmatic control.
2. A PGP passphrase is entered manually.
3. The SQL database is attached.
Shut-Down
1. The SQL database is detached.
2. The virtual disk is unmounted under manual or programmatic control.
Note that the attach/detach steps are required because SQL Server locks
access to the Log files and the virtual disk cannot not be unmounted
until this lock is released.|||"Robert Robinson" <robbiex@.bellsouth.net> wrote in message
news:uibht4IEHHA.3600@.TK2MSFTNGP06.phx.gbl...
> We decided on the following to provide a reasonable level of protection.
> First, computer access is limited by using the SecuriKey.
> SQL database files are protected as follows:
> Setup
> 1. The SQL databases to be protected are backed up and are then deleted
> from SQL Server.
Are you concerned that fragments of unencrypted data might be lying around
on the storage device even after deletion? Just curious. Thanks.|||Hi Mike,
We are interested in providing a reasonable level of protection for
laptop data. The backup file is created on a server and doesn't have to
be installed on a laptop. The data can be transferred by LAN or
removable media. Your point is, however, well taken. There is no way to
absolutely delete data from a hard drive short of physical destruction
of the platters.
On a slightly different subject, we have run into some interesting
issues involved in using SQL Server data files that are resident in an
encrypted disk volume.
SQL Server locks a database's log file and it is not possible to unmount
a "secure" volume without first releasing this lock. The lock can be
released by an ALTER DATABASE <its name> SET OFFLINE followed by
sp_detach_db.
The database is attached by a SQL script as follows:
Use Master
GO
EXEC sp_attach_db @.dbname = N'database name',
@.filename1 = N'S:\SQLServerData\database name.mdf',
@.filename2 = N'S:\SQLServerData\database name_log.ldf'
GO
The script is executed by:
Shell("sqlcmd -i C:\AttachDetach.sql -U <owner name> -P
<password> -s <server name>")
One interesting glitch is that the above command fails if the owner
name/password precedes the command file.
Another issue is that one needs to know what is shutting down the
application program that is accessing the database. For example, it
might be a normal program exit, a logoff, a battery low warning, or a
system suspend or shutdown.
We had to do some hunting to find the appropriate events. The following
are helpful: Microsoft.Win32.SystemEvents.SessionEnding,
Microsoft.Win32.SystemEvents.PowerModeChanged
and an interesting control called sysinfo.ocx.
Robbie

Friday, March 9, 2012

encrypt database physical files?

I'm just thinking loud. I'm investigating if there are any suspicious
operations that have taken place on our databases by using Log Explorer from
Lumigent. All of a sudden, I thought that now that the databases are stored
on the server as physical files, hackers probably can just copy the files
(*.MDF, *.LDF) to their machines without connecting to and doing anything on
the SQL server itself, right? Would it be a common practice to get those
databases encrypted?
Bing
bing wrote:
> I'm just thinking loud. I'm investigating if there are any suspicious
> operations that have taken place on our databases by using Log
> Explorer from Lumigent. All of a sudden, I thought that now that the
> databases are stored on the server as physical files, hackers
> probably can just copy the files (*.MDF, *.LDF) to their machines
> without connecting to and doing anything on the SQL server itself,
> right? Would it be a common practice to get those databases
> encrypted?
> Bing
The files are kept locked by SQL Server while they are in use. How would
a hacker access the files anyway? Presumably, they are not made
accessible through Windows security to user accounts. If a hacker was
able to connect to the server as an admin, they could just stop the SQL
service and copy the database files.
David Gugick
Quest Software
www.imceda.com
www.quest.com
|||Hi,
You can use the Encrypted File System Support on Windows 2000
Windows 2000 support encrypted file system property.
Below are the steps encrypt the data files:
1) Logon with the SQL Server startup account
2) Stop SQL Server and sql agent service
3) Right click the data files, select properties, click Advance button,
check the "Encrypt contents to secure data"
4) Start the SQL Server service
See the below KB for more information:-
HOW TO: Encrypt Data Using EFS in Windows 2000
http://support.microsoft.com/dXefaul...;en-us;2305X20
Note:
If you change the SQL Server startup accout you have to redo the same,
otherwise SQL Server service will not start.
"With EFS, database files are encrypted under the identity of the account
running SQL Server. Only this account can decrypt the files. If you need to
change the account that runs SQL Server, you should first decrypt the files
under the old account, then re-encrypt them under the new account."
Thanks
Hari
SQL Server MVP
"bing" <bing@.discussions.microsoft.com> wrote in message
news:D338A20C-C191-4886-8520-35A876FFE926@.microsoft.com...
> I'm just thinking loud. I'm investigating if there are any suspicious
> operations that have taken place on our databases by using Log Explorer
> from
> Lumigent. All of a sudden, I thought that now that the databases are
> stored
> on the server as physical files, hackers probably can just copy the files
> (*.MDF, *.LDF) to their machines without connecting to and doing anything
> on
> the SQL server itself, right? Would it be a common practice to get those
> databases encrypted?
> Bing
|||Hi
If the hacker can get that far into your box, he owns every other server
already, has created himself a domain account, and has access to your SQL
Server via any tool of his choice. He has also let his 5 friends in, and
they are reading your mail before you do.
Secure your perimeter, apply proper permissioning at OS level that only SQL
Server and domain admins can touch the files on the OS. Make sure your
applications are not susceptible to SQL Injection and apply the least
permissions to users in the DB.
Regards
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"bing" <bing@.discussions.microsoft.com> wrote in message
news:D338A20C-C191-4886-8520-35A876FFE926@.microsoft.com...
> I'm just thinking loud. I'm investigating if there are any suspicious
> operations that have taken place on our databases by using Log Explorer
> from
> Lumigent. All of a sudden, I thought that now that the databases are
> stored
> on the server as physical files, hackers probably can just copy the files
> (*.MDF, *.LDF) to their machines without connecting to and doing anything
> on
> the SQL server itself, right? Would it be a common practice to get those
> databases encrypted?
> Bing

encrypt database physical files?

I'm just thinking loud. I'm investigating if there are any suspicious
operations that have taken place on our databases by using Log Explorer from
Lumigent. All of a sudden, I thought that now that the databases are stored
on the server as physical files, hackers probably can just copy the files
(*.MDF, *.LDF) to their machines without connecting to and doing anything on
the SQL server itself, right? Would it be a common practice to get those
databases encrypted?
Bingbing wrote:
> I'm just thinking loud. I'm investigating if there are any suspicious
> operations that have taken place on our databases by using Log
> Explorer from Lumigent. All of a sudden, I thought that now that the
> databases are stored on the server as physical files, hackers
> probably can just copy the files (*.MDF, *.LDF) to their machines
> without connecting to and doing anything on the SQL server itself,
> right? Would it be a common practice to get those databases
> encrypted?
> Bing
The files are kept locked by SQL Server while they are in use. How would
a hacker access the files anyway? Presumably, they are not made
accessible through Windows security to user accounts. If a hacker was
able to connect to the server as an admin, they could just stop the SQL
service and copy the database files.
--
David Gugick
Quest Software
www.imceda.com
www.quest.com|||Hi,
You can use the Encrypted File System Support on Windows 2000
Windows 2000 support encrypted file system property.
Below are the steps encrypt the data files:
1) Logon with the SQL Server startup account
2) Stop SQL Server and sql agent service
3) Right click the data files, select properties, click Advance button,
check the "Encrypt contents to secure data"
4) Start the SQL Server service
See the below KB for more information:-
HOW TO: Encrypt Data Using EFS in Windows 2000
http://support.microsoft.com/d­efault.aspx?scid=kb;en-us;2305­20
Note:
If you change the SQL Server startup accout you have to redo the same,
otherwise SQL Server service will not start.
"With EFS, database files are encrypted under the identity of the account
running SQL Server. Only this account can decrypt the files. If you need to
change the account that runs SQL Server, you should first decrypt the files
under the old account, then re-encrypt them under the new account."
Thanks
Hari
SQL Server MVP
"bing" <bing@.discussions.microsoft.com> wrote in message
news:D338A20C-C191-4886-8520-35A876FFE926@.microsoft.com...
> I'm just thinking loud. I'm investigating if there are any suspicious
> operations that have taken place on our databases by using Log Explorer
> from
> Lumigent. All of a sudden, I thought that now that the databases are
> stored
> on the server as physical files, hackers probably can just copy the files
> (*.MDF, *.LDF) to their machines without connecting to and doing anything
> on
> the SQL server itself, right? Would it be a common practice to get those
> databases encrypted?
> Bing|||Hi
If the hacker can get that far into your box, he owns every other server
already, has created himself a domain account, and has access to your SQL
Server via any tool of his choice. He has also let his 5 friends in, and
they are reading your mail before you do.
Secure your perimeter, apply proper permissioning at OS level that only SQL
Server and domain admins can touch the files on the OS. Make sure your
applications are not susceptible to SQL Injection and apply the least
permissions to users in the DB.
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"bing" <bing@.discussions.microsoft.com> wrote in message
news:D338A20C-C191-4886-8520-35A876FFE926@.microsoft.com...
> I'm just thinking loud. I'm investigating if there are any suspicious
> operations that have taken place on our databases by using Log Explorer
> from
> Lumigent. All of a sudden, I thought that now that the databases are
> stored
> on the server as physical files, hackers probably can just copy the files
> (*.MDF, *.LDF) to their machines without connecting to and doing anything
> on
> the SQL server itself, right? Would it be a common practice to get those
> databases encrypted?
> Bing

encrypt database physical files?

I'm just thinking loud. I'm investigating if there are any suspicious
operations that have taken place on our databases by using Log Explorer from
Lumigent. All of a sudden, I thought that now that the databases are stored
on the server as physical files, hackers probably can just copy the files
(*.MDF, *.LDF) to their machines without connecting to and doing anything on
the SQL server itself, right? Would it be a common practice to get those
databases encrypted?
Bingbing wrote:
> I'm just thinking loud. I'm investigating if there are any suspicious
> operations that have taken place on our databases by using Log
> Explorer from Lumigent. All of a sudden, I thought that now that the
> databases are stored on the server as physical files, hackers
> probably can just copy the files (*.MDF, *.LDF) to their machines
> without connecting to and doing anything on the SQL server itself,
> right? Would it be a common practice to get those databases
> encrypted?
> Bing
The files are kept locked by SQL Server while they are in use. How would
a hacker access the files anyway? Presumably, they are not made
accessible through Windows security to user accounts. If a hacker was
able to connect to the server as an admin, they could just stop the SQL
service and copy the database files.
David Gugick
Quest Software
www.imceda.com
www.quest.com|||Hi,
You can use the Encrypted File System Support on Windows 2000
Windows 2000 support encrypted file system property.
Below are the steps encrypt the data files:
1) Logon with the SQL Server startup account
2) Stop SQL Server and sql agent service
3) Right click the data files, select properties, click Advance button,
check the "Encrypt contents to secure data"
4) Start the SQL Server service
See the below KB for more information:-
HOW TO: Encrypt Data Using EFS in Windows 2000
http://support.microsoft.com/d_efau...b;en-us;2305_20
Note:
If you change the SQL Server startup accout you have to redo the same,
otherwise SQL Server service will not start.
"With EFS, database files are encrypted under the identity of the account
running SQL Server. Only this account can decrypt the files. If you need to
change the account that runs SQL Server, you should first decrypt the files
under the old account, then re-encrypt them under the new account."
Thanks
Hari
SQL Server MVP
"bing" <bing@.discussions.microsoft.com> wrote in message
news:D338A20C-C191-4886-8520-35A876FFE926@.microsoft.com...
> I'm just thinking loud. I'm investigating if there are any suspicious
> operations that have taken place on our databases by using Log Explorer
> from
> Lumigent. All of a sudden, I thought that now that the databases are
> stored
> on the server as physical files, hackers probably can just copy the files
> (*.MDF, *.LDF) to their machines without connecting to and doing anything
> on
> the SQL server itself, right? Would it be a common practice to get those
> databases encrypted?
> Bing|||Hi
If the hacker can get that far into your box, he owns every other server
already, has created himself a domain account, and has access to your SQL
Server via any tool of his choice. He has also let his 5 friends in, and
they are reading your mail before you do.
Secure your perimeter, apply proper permissioning at OS level that only SQL
Server and domain admins can touch the files on the OS. Make sure your
applications are not susceptible to SQL Injection and apply the least
permissions to users in the DB.
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"bing" <bing@.discussions.microsoft.com> wrote in message
news:D338A20C-C191-4886-8520-35A876FFE926@.microsoft.com...
> I'm just thinking loud. I'm investigating if there are any suspicious
> operations that have taken place on our databases by using Log Explorer
> from
> Lumigent. All of a sudden, I thought that now that the databases are
> stored
> on the server as physical files, hackers probably can just copy the files
> (*.MDF, *.LDF) to their machines without connecting to and doing anything
> on
> the SQL server itself, right? Would it be a common practice to get those
> databases encrypted?
> Bing

Wednesday, March 7, 2012

Enabling SQL audit Logging for SELECT queries

Hi all,
We have a requirement in our project where we need to audit log any query
(SELECT queries inclusive) that are fired on a specific set of objects (Tabl
e
and views) in our database. We need to capture information like Who fired th
e
query, When and the actual query itself.
The approach we have thought of is:
Run SQL Profiler and log the output of the trace into a SQL table
Create an INSERT trigger on the SQL table.
Trigger should write data into a custom Audit table with limited information
.
However the divantages we see here are performance issues due to profiler
being run continuously, maintenance overhead to clear the SQL table where th
e
trace is written etc.
Can anyone suggest any other better alternative for this requirement?
Thanks
GSNot sure if it ius an option for you, but SQL 2005 contains DML
triggers which allow you to audit Select statements.
Markus|||How about using any of the 3:rd party tools put there? Check the log reader
tools, they tend to have
this support (possibly in special versions): http://www.karaszi.com/SQLServer/link
s.asp
These tools does use the transaction log to audit modifications and Profiler
to audit SELECT.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"GS" <GS@.discussions.microsoft.com> wrote in message
news:6A359D6A-CCD1-4EC5-AEA2-C74C7F551971@.microsoft.com...
> Hi all,
> We have a requirement in our project where we need to audit log any query
> (SELECT queries inclusive) that are fired on a specific set of objects (Ta
ble
> and views) in our database. We need to capture information like Who fired
the
> query, When and the actual query itself.
> The approach we have thought of is:
> Run SQL Profiler and log the output of the trace into a SQL table
> Create an INSERT trigger on the SQL table.
> Trigger should write data into a custom Audit table with limited informati
on.
> However the divantages we see here are performance issues due to profil
er
> being run continuously, maintenance overhead to clear the SQL table where
the
> trace is written etc.
> Can anyone suggest any other better alternative for this requirement?
> Thanks
> GS
>

Sunday, February 26, 2012

Enabling file growth

I am trying to keep my log file at unrestricted file growth, but every time
I save the settings it switches back to restricted growth with a default
file size. I tried to keep it restricted, and change the size llimit, but
it changed back to it'd default limit. Why is this changing automaically by
itself.
I want to keep file growth enabled at 5% with unrestricted growth, but it
keeps changing back to 5% and resticted file growth with a default size. I
don't understand why it changes!!!!ALTER DATABASE [database_name] MODIFY FILE ( NAME = 'file_name',
FILEGROWTH = 5%)
What do you get when you run the above statement with your
database_name and file_name changed?
On Jun 14, 9:35 am, "Matt Fritz" <mafr...@.state.pa.us> wrote:
> I am trying to keep my log file at unrestricted file growth, but every time
> I save the settings it switches back to restricted growth with a default
> file size. I tried to keep it restricted, and change the size llimit, but
> it changed back to it'd default limit. Why is this changing automaically by
> itself.
> I want to keep file growth enabled at 5% with unrestricted growth, but it
> keeps changing back to 5% and resticted file growth with a default size. I
> don't understand why it changes!!!!
On Jun 14, 9:35 am, "Matt Fritz" <mafr...@.state.pa.us> wrote:
> I am trying to keep my log file at unrestricted file growth, but every time
> I save the settings it switches back to restricted growth with a default
> file size. I tried to keep it restricted, and change the size llimit, but
> it changed back to it'd default limit. Why is this changing automaically by
> itself.
> I want to keep file growth enabled at 5% with unrestricted growth, but it
> keeps changing back to 5% and resticted file growth with a default size. I
> don't understand why it changes!!!!|||On 14 Jun, 14:35, "Matt Fritz" <mafr...@.state.pa.us> wrote:
> I am trying to keep my log file at unrestricted file growth, but every time
> I save the settings it switches back to restricted growth with a default
> file size. I tried to keep it restricted, and change the size llimit, but
> it changed back to it'd default limit. Why is this changing automaically by
> itself.
> I want to keep file growth enabled at 5% with unrestricted growth, but it
> keeps changing back to 5% and resticted file growth with a default size. I
> don't understand why it changes!!!!
Why do you want to grow the log at 5%? Log growth is something you
should try to avoid. My advice is to set it to a sufficient size so
that it won't grow.
If you need more help, please post the actual ALTER statements you
ran. Don't rely on the management tools to do it correctly for you.
--
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--

Enabling file growth

I am trying to keep my log file at unrestricted file growth, but every time
I save the settings it switches back to restricted growth with a default
file size. I tried to keep it restricted, and change the size llimit, but
it changed back to it'd default limit. Why is this changing automaically by
itself.
I want to keep file growth enabled at 5% with unrestricted growth, but it
keeps changing back to 5% and resticted file growth with a default size. I
don't understand why it changes!!!!ALTER DATABASE [database_name] MODIFY FILE ( NAME = 'file_name',
FILEGROWTH = 5%)
What do you get when you run the above statement with your
database_name and file_name changed?
On Jun 14, 9:35 am, "Matt Fritz" <mafr...@.state.pa.us> wrote:
> I am trying to keep my log file at unrestricted file growth, but every tim
e
> I save the settings it switches back to restricted growth with a default
> file size. I tried to keep it restricted, and change the size llimit, but
> it changed back to it'd default limit. Why is this changing automaically
by
> itself.
> I want to keep file growth enabled at 5% with unrestricted growth, but it
> keeps changing back to 5% and resticted file growth with a default size.
I
> don't understand why it changes!!!!
On Jun 14, 9:35 am, "Matt Fritz" <mafr...@.state.pa.us> wrote:
> I am trying to keep my log file at unrestricted file growth, but every tim
e
> I save the settings it switches back to restricted growth with a default
> file size. I tried to keep it restricted, and change the size llimit, but
> it changed back to it'd default limit. Why is this changing automaically
by
> itself.
> I want to keep file growth enabled at 5% with unrestricted growth, but it
> keeps changing back to 5% and resticted file growth with a default size.
I
> don't understand why it changes!!!!|||On 14 Jun, 14:35, "Matt Fritz" <mafr...@.state.pa.us> wrote:
> I am trying to keep my log file at unrestricted file growth, but every tim
e
> I save the settings it switches back to restricted growth with a default
> file size. I tried to keep it restricted, and change the size llimit, but
> it changed back to it'd default limit. Why is this changing automaically
by
> itself.
> I want to keep file growth enabled at 5% with unrestricted growth, but it
> keeps changing back to 5% and resticted file growth with a default size.
I
> don't understand why it changes!!!!
Why do you want to grow the log at 5%? Log growth is something you
should try to avoid. My advice is to set it to a sufficient size so
that it won't grow.
If you need more help, please post the actual ALTER statements you
ran. Don't rely on the management tools to do it correctly for you.
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--

Enabling file growth

I am trying to keep my log file at unrestricted file growth, but every time
I save the settings it switches back to restricted growth with a default
file size. I tried to keep it restricted, and change the size llimit, but
it changed back to it'd default limit. Why is this changing automaically by
itself.
I want to keep file growth enabled at 5% with unrestricted growth, but it
keeps changing back to 5% and resticted file growth with a default size. I
don't understand why it changes!!!!
ALTER DATABASE [database_name] MODIFY FILE ( NAME = 'file_name',
FILEGROWTH = 5%)
What do you get when you run the above statement with your
database_name and file_name changed?
On Jun 14, 9:35 am, "Matt Fritz" <mafr...@.state.pa.us> wrote:
> I am trying to keep my log file at unrestricted file growth, but every time
> I save the settings it switches back to restricted growth with a default
> file size. I tried to keep it restricted, and change the size llimit, but
> it changed back to it'd default limit. Why is this changing automaically by
> itself.
> I want to keep file growth enabled at 5% with unrestricted growth, but it
> keeps changing back to 5% and resticted file growth with a default size. I
> don't understand why it changes!!!!
On Jun 14, 9:35 am, "Matt Fritz" <mafr...@.state.pa.us> wrote:
> I am trying to keep my log file at unrestricted file growth, but every time
> I save the settings it switches back to restricted growth with a default
> file size. I tried to keep it restricted, and change the size llimit, but
> it changed back to it'd default limit. Why is this changing automaically by
> itself.
> I want to keep file growth enabled at 5% with unrestricted growth, but it
> keeps changing back to 5% and resticted file growth with a default size. I
> don't understand why it changes!!!!
|||On 14 Jun, 14:35, "Matt Fritz" <mafr...@.state.pa.us> wrote:
> I am trying to keep my log file at unrestricted file growth, but every time
> I save the settings it switches back to restricted growth with a default
> file size. I tried to keep it restricted, and change the size llimit, but
> it changed back to it'd default limit. Why is this changing automaically by
> itself.
> I want to keep file growth enabled at 5% with unrestricted growth, but it
> keeps changing back to 5% and resticted file growth with a default size. I
> don't understand why it changes!!!!
Why do you want to grow the log at 5%? Log growth is something you
should try to avoid. My advice is to set it to a sufficient size so
that it won't grow.
If you need more help, please post the actual ALTER statements you
ran. Don't rely on the management tools to do it correctly for you.
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx

Sunday, February 19, 2012

Enable query logging

Hi all,
Is there a way to make SQL Server 2000 log every SQL query sent to it?
-Oleg.Yes, but you will need to turn on server side tracing. Doing server side
tracing will write what every you tell it to a trace file. Look in BOL at
all the sp_trace* stored procedures.
--
----
----
--
Need SQL Server Examples check out my website at
http://www.geocities.com/sqlserverexamples
"Oleg Ogurok" <oleg@.ogurok.com.ihatespammers.ireallydo.co> wrote in message
news:1094nlms1ge0n74@.corp.supernews.com...
> Hi all,
> Is there a way to make SQL Server 2000 log every SQL query sent to it?
> -Oleg.
>

Enable query logging

Hi all,
Is there a way to make SQL Server 2000 log every SQL query sent to it?
-Oleg.
Yes, but you will need to turn on server side tracing. Doing server side
tracing will write what every you tell it to a trace file. Look in BOL at
all the sp_trace* stored procedures.
----
Need SQL Server Examples check out my website at
http://www.geocities.com/sqlserverexamples
"Oleg Ogurok" <oleg@.ogurok.com.ihatespammers.ireallydo.co> wrote in message
news:1094nlms1ge0n74@.corp.supernews.com...
> Hi all,
> Is there a way to make SQL Server 2000 log every SQL query sent to it?
> -Oleg.
>

Enable and disable websync.log

Hi, is there a way how to enable / disable logging on web merge synchronization into the file websync.log? The file exists in the ISAPI folder, on some machines there are some messages, on others there is nothing. There are Timeout messages on the client during synchronization and we need to find where is the problem, if it is on the server side or if it is a network error or something else.
Thanks, Pavel

The web sync log should be enabled by default.

On the IE replisapi.dll?diag page, what do you see the status as?

ReplIsapi Settings:

Property

Value

SNAC version (sqlncli.dll)

2005.90.1399.0

Logging Enabled

TRUE

Log Severity

2

Current Log Size

673542

Maximum Log Size

10485760

Log FileName

websync.log

Log Dir

D:\myVirtualDirectory

|||

ReplIsapi Settings:

Property

Value

SNAC version (sqlncli.dll)

2005.90.1399.0

Logging Enabled

FALSE

|||

Can you create a new virtual directory and try with that?

Also how did you come into this situation. Did anything change after you created the virtual directory.

|||

Yes, I have tried to create virtual directory few times and nothing has changed. I can't realize any change on the server, which could switch off logging.

Another thing is, that we need to monitor production system in which we cannot change virtual directory. In the test enviroment we have not any problems.

|||What about uninstalling and reinstalling the IIS side repl components? Could you try that?|||That's problem, It's production in which a thousands of subscribers are synchronizing and we cannot stop the system. All is working fine, but sometimes, say 1 day in months, there is problem with timeouts on some subscribers and the problem can be repeated on the client side in that moment. So we would like to enable logging in that moment to say, that the timeout is or is not on the server.|||

I dont know how you got into this situation, but here is what you can try:

Check if you have this key in your registry:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\90\Replication\WebSyncLoggingOff

Is this value 1?

If it is, reset it to 0. Then do iisreset.

That should solve your problem

Enable and disable websync.log

Hi, is there a way how to enable / disable logging on web merge synchronization into the file websync.log? The file exists in the ISAPI folder, on some machines there are some messages, on others there is nothing. There are Timeout messages on the client during synchronization and we need to find where is the problem, if it is on the server side or if it is a network error or something else.
Thanks, Pavel

The web sync log should be enabled by default.

On the IE replisapi.dll?diag page, what do you see the status as?

ReplIsapi Settings:

Property

Value

SNAC version (sqlncli.dll)

2005.90.1399.0

Logging Enabled

TRUE

Log Severity

2

Current Log Size

673542

Maximum Log Size

10485760

Log FileName

websync.log

Log Dir

D:\myVirtualDirectory

|||

ReplIsapi Settings:

Property

Value

SNAC version (sqlncli.dll)

2005.90.1399.0

Logging Enabled

FALSE

|||

Can you create a new virtual directory and try with that?

Also how did you come into this situation. Did anything change after you created the virtual directory.

|||

Yes, I have tried to create virtual directory few times and nothing has changed. I can't realize any change on the server, which could switch off logging.

Another thing is, that we need to monitor production system in which we cannot change virtual directory. In the test enviroment we have not any problems.

|||What about uninstalling and reinstalling the IIS side repl components? Could you try that?|||That's problem, It's production in which a thousands of subscribers are synchronizing and we cannot stop the system. All is working fine, but sometimes, say 1 day in months, there is problem with timeouts on some subscribers and the problem can be repeated on the client side in that moment. So we would like to enable logging in that moment to say, that the timeout is or is not on the server.|||

I dont know how you got into this situation, but here is what you can try:

Check if you have this key in your registry:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\90\Replication\WebSyncLoggingOff

Is this value 1?

If it is, reset it to 0. Then do iisreset.

That should solve your problem

Friday, February 17, 2012

Emptying Log file

Backup Log has Active and Inactive Portions. To Truncate Inactive
portion user the following command in SQL Query Analyser
USE The following Command
BACKUP LOG { database_name | @.database_name_var }
WITH TRUNCATE_ONLYThanx Rex
*** Sent via Developersdex http://www.examnotes.net ***

Emptying Log file


I have a database with mdf size 10 gb and ldf size 8 gb. i want to
reduce the size of ldf file how can i do it.
Regards,
Farid.
*** Sent via Developersdex http://www.examnotes.net ***You can shrink transaction log size.
1. DBCC ShrinkDatabase
2. Dbcc ShrinkFile --log
3. Auto shrink option
"Ghulam Farid"?? ??? ??:

>
> I have a database with mdf size 10 gb and ldf size 8 gb. i want to
> reduce the size of ldf file how can i do it.
> Regards,
> Farid.
> *** Sent via Developersdex http://www.examnotes.net ***
>

Empty trans log in Simple model

I have a database SQL Server 2005 Express, that's
using the Simple recovery model.
There's quite a big transaction log for this database,
how do I empty it when it's the Simple model?
Besides, the log file hasn't been updated (acc. to
the Windows file date) since yesterday while the MDF
file has. Is this normal?Run DBCC SQLPERF (logspace) on the instance to see if any of the space is actually being used. If it is, run DBCC OPENTRAN in the database to see who has the open transaction.

If the space is genuinely empty, and you do not suspect there are any giant transactions that run on this thing, you can safely shrink back the log. I find the Windows last updated dates generally doesn't mean a lot when it comes to database files.|||I couldn't manage to shrink the file. I tried setting the
initial file size down to 2MB but it remained 15MB as
it was (without any error message).
Finally, I re-created the database instead, it had
very little content anyway so it was quite easy.

Empty the transaction log

Hi i would like to know how to empty the transaction log programmaticly.

Someone got a clue? :)Maybe create a stored procedure that runs a transaction log backup and then calls DBCC ShrinkDatabase (If you want to shrink it)? The user you use to connect to the database will need the proper permissions.|||I think backing up the transaction log automatically truncates the inactive portion of the log. Or is that incorrect...?

-Ian|||i sure would like to know because i have a program that uses transactions and uses it extremely frquently so the log grows in size in a geometric rate :)|||Every change to the database is written to the log first whether it's within a transaction or not. The log grows depending on the write activity against the database, not whether or not a transaction is used.|||ok, but how do i empty it programmaticly?
i wanna build a page where the user can empty it.|||When you backup the transaction log it truncates it. You can even do a BACKUP LOG <dbname> WITH TRUNCATE_ONLY which just removes the extra log entries, but its not recommended. Either option will truncate the log, so it most likely will not grow for a while, but it does not shrink the actual log, which you need to do a DBCC SHRINKDATABASE or DBCC SHRINKFILE to do. The SQL Server Books Online tells you all about it onShrinking the Transaction Log andTruncating the Transaction Log.

empty temp log file

How do you empty the tempdb log file? I'm getting temp log file fullBACKUP LOG tempdb WITH TRUNCATE_ONLY
And then you can shrink it using DBCC SHRINKFILE if you need to reduce your
tempdb log file's size
http://msdn2.microsoft.com/en-us/library/ms189493.aspx
If you restart your SQL Server service, then your tempdb database will be
dropped and recreated from scratch. (just in case you need something like
this...)
--
Ekrem Ã?nsoy
"Logger" <Logger@.discussions.microsoft.com> wrote in message
news:46F322B7-C259-4C9B-AA15-7D4B8AED0C72@.microsoft.com...
> How do you empty the tempdb log file? I'm getting temp log file full