Showing posts with label company. Show all posts
Showing posts with label company. Show all posts

Wednesday, March 28, 2012

information on securing SQL Server

My company is going to be rolling out a .Net application soon. I have been tasked with assisting on the security side of things. Basic setup for now will be a web server (IIS) in the DMZ, Cisco pix firewall then the SQL Server databases (2000, sp3a).

Can you all point out any good documentation that would cover things such as

a. using a Cisco Pix firewall with SQL Server

b. using client protocal encryption with a SQL Server website

c. testing how secure your SQL Server website really is?

Thanks all!

frank

For b), check the following links:

http://support.microsoft.com/default.aspx?scid=kb;en-us;316898
http://blogs.msdn.com/sql_protocols/archive/2005/10/4.aspx

For c), take a look at MBSA:

http://www.microsoft.com/technet/security/tools/mbsahome.mspx

Thanks
Laurentiu

INFO/SUGGESTIONS Please : SQL performance (fragmented disk)

I'm a developer at my company, but I've worked with hardware quite abit at my last job. I'm finding it hard to talk to one of our system admins here.

I'm running into what looks like disk issues on our SQL Server, I know the DB files all reside on a large SCSI Raid, the only files on the RAID are the DB files, no OS or program files.

Also the disks have never been defragmented, he wants to say :

1. SCSI and RAID eliminate the impact of fragmentation.
2. SQL doesn't get impacted by physical fragmentation.

I know both to be false statements but don't want to start an argument, nor go over his head.

I would like to "find" some reputable articles dealing with disk fragmentation and SQL(database) performance..

If anyone has a good site that displays good information I would greatly appreciate it.

OR

If anyone has some personal experience with issues like this, please share them..

You may want to read the following white paper: 'Microsoft SQL Server 2000 Index Defragmentation Best Practices' (http://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/ss2kidbp.mspx), which may give you more idea about fragmentation.

Thanks

Stephen

Monday, March 19, 2012

Indexing problem and slow data retrieve

I have two tables that stores company information in a database. Since
retrieving data from the tables is too slow, the structure need to be
improved. The current structure of the tables is as follows:
First table contains
table1
companyNo : unique field that is created by sequence
companyTaxNumber:have a unique index
companyName : have an index, but not unique
companyAddress
companyCountry
timestamp
trigger on table1:
if insertion occurs: timestamp:0
if update occurs : increment timestamp by 1
Second Table Contains
table2
Up_companyNo2 : unique field that is created by sequence
Up_companyTaxNumber2:have a unique index
Up_companyName2 : have an index, but not unique
Up_companyAddress2
Up_companyCountry2
timestamp
trigger on table2:
if insertion occurs: timestamp:0
if update occurs : increment timestamp by 1
update table1 where table1.companyTaxNumber=table2.Up_companyTaxNumber 2
and timestamp=1
the problem is the application uses table1 details, and give reference to
"companyTaxNumber" in forms. When the company information is updated (rows
are not updated, inserted with a new companyNo via sequence) and inserted
into table1 from table2, the new forms will use the updated information.
However, old forms cannot use updated ones, since reports cannot be changed.
in conclusion,
table2 contains last updated company information, the initial information
before updates are not stored in table2
table 1 contains all the updates as new entries since forms that use these
entries cannot change the references. So, table1 gets bigger and datas
retrieved slowly.
Can you give me clear advices about the improvement techniques about indexes
and triggers? How can I handle this situation?
It is still not clear as to the logical seperation or business uses between
the two tables. Some clarification would be helpful.
Nevertheless, in both tables, I would use a UNIQUE CONSTRAINT for the
companyTaxNumber and Up_companyTaxNumber2 attributes instead of just a
UNIQUE INDEX. Now, all SQL Server tables should have a CLUSTERED INDEX
defined. Normally, I see users choose these IDENTITY surrogate primary
keys, or none at all. Both are bad choices. You have three candidates, or
a combination, that would server you better and, perhaps, assist you in your
querying issues: companyTaxNumber (my choice), companyName, or timestamp.
The other thing I noticed was your use of triggers. I would be careful
about this; I think I understand why you went this route instead of the
timestamp datatype, but it is serving the same purpose, just at the record
instead of the table level. That being said, you need to be careful when
using triggers because they execute T-SQL statements, that is, they are
SET-BASED, NOT ROW-BASED. A trigger is fired--ONECE--whenever an indicated
CRUD statement type is executed regardless of the number of rows impacted.
This means that your INSERTED and/or DELETED tables could be NULL, 1, or
many records with each trigger exectution. DO NOT ASSUME 1 RECORD.
In the trigger on Table2, the timestamp field is ambiguous as you are
joining Table1 and Table2, each with its own timestamp fields.
With the number of fields you have, and if you add the Clustered Index to
the correct attribute, I could see these sets of tables being able to
service several millions of records each with negligble query reporting
duration, dependent on your hardware, of course.
Are you joining these tables to others in your queries that would be
affecting your performance? Could you provide an example of a badly
performing query with the associated shcemea of any referenced tables.
Hope this helps.
Sincerely,
Anthony Thomas

"Sinem" <Sinem@.discussions.microsoft.com> wrote in message
news:2095306F-37BF-43F4-9ECC-C873E71ACAEF@.microsoft.com...
I have two tables that stores company information in a database. Since
retrieving data from the tables is too slow, the structure need to be
improved. The current structure of the tables is as follows:
First table contains
table1
companyNo : unique field that is created by sequence
companyTaxNumber:have a unique index
companyName : have an index, but not unique
companyAddress
companyCountry
timestamp
trigger on table1:
if insertion occurs: timestamp:0
if update occurs : increment timestamp by 1
Second Table Contains
table2
Up_companyNo2 : unique field that is created by sequence
Up_companyTaxNumber2:have a unique index
Up_companyName2 : have an index, but not unique
Up_companyAddress2
Up_companyCountry2
timestamp
trigger on table2:
if insertion occurs: timestamp:0
if update occurs : increment timestamp by 1
update table1 where table1.companyTaxNumber=table2.Up_companyTaxNumber 2
and timestamp=1
the problem is the application uses table1 details, and give reference to
"companyTaxNumber" in forms. When the company information is updated (rows
are not updated, inserted with a new companyNo via sequence) and inserted
into table1 from table2, the new forms will use the updated information.
However, old forms cannot use updated ones, since reports cannot be changed.
in conclusion,
table2 contains last updated company information, the initial information
before updates are not stored in table2
table 1 contains all the updates as new entries since forms that use these
entries cannot change the references. So, table1 gets bigger and datas
retrieved slowly.
Can you give me clear advices about the improvement techniques about indexes
and triggers? How can I handle this situation?
|||Hi,
As I mentioned in the problem, I have two tables called table1 and table2. In
the application, there are numerous references in the fields belong to
table1,
while creating a report. After a report have been created, no changes can be
done on the reports. However, details on table1 can be changed and updated
occasionally. On each change, a new row inserted into table1. Old rows never
changes. By the way, while viewing old reports, references are not lost. This
results in decrease of the performance. Since table1 gets larger.
There is a problem with performance not the query. The real problem is how to
design these two tables in oracle database and find an appropriate solution?
Thanks for your convenience..
I'll post a piece of code in an hour..
sozmen
"AnthonyThomas" wrote:

> It is still not clear as to the logical seperation or business uses between
> the two tables. Some clarification would be helpful.
> Nevertheless, in both tables, I would use a UNIQUE CONSTRAINT for the
> companyTaxNumber and Up_companyTaxNumber2 attributes instead of just a
> UNIQUE INDEX. Now, all SQL Server tables should have a CLUSTERED INDEX
> defined. Normally, I see users choose these IDENTITY surrogate primary
> keys, or none at all. Both are bad choices. You have three candidates, or
> a combination, that would server you better and, perhaps, assist you in your
> querying issues: companyTaxNumber (my choice), companyName, or timestamp.
> The other thing I noticed was your use of triggers. I would be careful
> about this; I think I understand why you went this route instead of the
> timestamp datatype, but it is serving the same purpose, just at the record
> instead of the table level. That being said, you need to be careful when
> using triggers because they execute T-SQL statements, that is, they are
> SET-BASED, NOT ROW-BASED. A trigger is fired--ONECE--whenever an indicated
> CRUD statement type is executed regardless of the number of rows impacted.
> This means that your INSERTED and/or DELETED tables could be NULL, 1, or
> many records with each trigger exectution. DO NOT ASSUME 1 RECORD.
> In the trigger on Table2, the timestamp field is ambiguous as you are
> joining Table1 and Table2, each with its own timestamp fields.
> With the number of fields you have, and if you add the Clustered Index to
> the correct attribute, I could see these sets of tables being able to
> service several millions of records each with negligble query reporting
> duration, dependent on your hardware, of course.
> Are you joining these tables to others in your queries that would be
> affecting your performance? Could you provide an example of a badly
> performing query with the associated shcemea of any referenced tables.
> Hope this helps.
> Sincerely,
>
> Anthony Thomas
>
> --
> "Sinem" <Sinem@.discussions.microsoft.com> wrote in message
> news:2095306F-37BF-43F4-9ECC-C873E71ACAEF@.microsoft.com...
> I have two tables that stores company information in a database. Since
> retrieving data from the tables is too slow, the structure need to be
> improved. The current structure of the tables is as follows:
> First table contains
> table1
> companyNo : unique field that is created by sequence
> companyTaxNumber:have a unique index
> companyName : have an index, but not unique
> companyAddress
> companyCountry
> timestamp
> trigger on table1:
> if insertion occurs: timestamp:0
> if update occurs : increment timestamp by 1
> Second Table Contains
> table2
> Up_companyNo2 : unique field that is created by sequence
> Up_companyTaxNumber2:have a unique index
> Up_companyName2 : have an index, but not unique
> Up_companyAddress2
> Up_companyCountry2
> timestamp
> trigger on table2:
> if insertion occurs: timestamp:0
> if update occurs : increment timestamp by 1
> update table1 where table1.companyTaxNumber=table2.Up_companyTaxNumber 2
> and timestamp=1
> the problem is the application uses table1 details, and give reference to
> "companyTaxNumber" in forms. When the company information is updated (rows
> are not updated, inserted with a new companyNo via sequence) and inserted
> into table1 from table2, the new forms will use the updated information.
> However, old forms cannot use updated ones, since reports cannot be changed.
> in conclusion,
> table2 contains last updated company information, the initial information
> before updates are not stored in table2
> table 1 contains all the updates as new entries since forms that use these
> entries cannot change the references. So, table1 gets bigger and datas
> retrieved slowly.
>
> Can you give me clear advices about the improvement techniques about indexes
> and triggers? How can I handle this situation?
>
>

Indexing problem and slow data retrieve

I have two tables that stores company information in a database. Since
retrieving data from the tables is too slow, the structure need to be
improved. The current structure of the tables is as follows:
First table contains
table1
companyNo : unique field that is created by sequence
companyTaxNumber:have a unique index
companyName : have an index, but not unique
companyAddress
companyCountry
timestamp
trigger on table1:
if insertion occurs: timestamp:0
if update occurs : increment timestamp by 1
Second Table Contains
table2
Up_companyNo2 : unique field that is created by sequence
Up_companyTaxNumber2:have a unique index
Up_companyName2 : have an index, but not unique
Up_companyAddress2
Up_companyCountry2
timestamp
trigger on table2:
if insertion occurs: timestamp:0
if update occurs : increment timestamp by 1
update table1 where table1.companyTaxNumber=table2.Up_companyTaxNumber2
and timestamp=1
the problem is the application uses table1 details, and give reference to
"companyTaxNumber" in forms. When the company information is updated (rows
are not updated, inserted with a new companyNo via sequence) and inserted
into table1 from table2, the new forms will use the updated information.
However, old forms cannot use updated ones, since reports cannot be changed.
in conclusion,
table2 contains last updated company information, the initial information
before updates are not stored in table2
table 1 contains all the updates as new entries since forms that use these
entries cannot change the references. So, table1 gets bigger and datas
retrieved slowly.
Can you give me clear advices about the improvement techniques about indexes
and triggers? How can I handle this situation?It is still not clear as to the logical seperation or business uses between
the two tables. Some clarification would be helpful.
Nevertheless, in both tables, I would use a UNIQUE CONSTRAINT for the
companyTaxNumber and Up_companyTaxNumber2 attributes instead of just a
UNIQUE INDEX. Now, all SQL Server tables should have a CLUSTERED INDEX
defined. Normally, I see users choose these IDENTITY surrogate primary
keys, or none at all. Both are bad choices. You have three candidates, or
a combination, that would server you better and, perhaps, assist you in your
querying issues: companyTaxNumber (my choice), companyName, or timestamp.
The other thing I noticed was your use of triggers. I would be careful
about this; I think I understand why you went this route instead of the
timestamp datatype, but it is serving the same purpose, just at the record
instead of the table level. That being said, you need to be careful when
using triggers because they execute T-SQL statements, that is, they are
SET-BASED, NOT ROW-BASED. A trigger is fired--ONECE--whenever an indicated
CRUD statement type is executed regardless of the number of rows impacted.
This means that your INSERTED and/or DELETED tables could be NULL, 1, or
many records with each trigger exectution. DO NOT ASSUME 1 RECORD.
In the trigger on Table2, the timestamp field is ambiguous as you are
joining Table1 and Table2, each with its own timestamp fields.
With the number of fields you have, and if you add the Clustered Index to
the correct attribute, I could see these sets of tables being able to
service several millions of records each with negligble query reporting
duration, dependent on your hardware, of course.
Are you joining these tables to others in your queries that would be
affecting your performance? Could you provide an example of a badly
performing query with the associated shcemea of any referenced tables.
Hope this helps.
Sincerely,
Anthony Thomas
"Sinem" <Sinem@.discussions.microsoft.com> wrote in message
news:2095306F-37BF-43F4-9ECC-C873E71ACAEF@.microsoft.com...
I have two tables that stores company information in a database. Since
retrieving data from the tables is too slow, the structure need to be
improved. The current structure of the tables is as follows:
First table contains
table1
companyNo : unique field that is created by sequence
companyTaxNumber:have a unique index
companyName : have an index, but not unique
companyAddress
companyCountry
timestamp
trigger on table1:
if insertion occurs: timestamp:0
if update occurs : increment timestamp by 1
Second Table Contains
table2
Up_companyNo2 : unique field that is created by sequence
Up_companyTaxNumber2:have a unique index
Up_companyName2 : have an index, but not unique
Up_companyAddress2
Up_companyCountry2
timestamp
trigger on table2:
if insertion occurs: timestamp:0
if update occurs : increment timestamp by 1
update table1 where table1.companyTaxNumber=table2.Up_companyTaxNumber2
and timestamp=1
the problem is the application uses table1 details, and give reference to
"companyTaxNumber" in forms. When the company information is updated (rows
are not updated, inserted with a new companyNo via sequence) and inserted
into table1 from table2, the new forms will use the updated information.
However, old forms cannot use updated ones, since reports cannot be changed.
in conclusion,
table2 contains last updated company information, the initial information
before updates are not stored in table2
table 1 contains all the updates as new entries since forms that use these
entries cannot change the references. So, table1 gets bigger and datas
retrieved slowly.
Can you give me clear advices about the improvement techniques about indexes
and triggers? How can I handle this situation?|||Hi,
As I mentioned in the problem, I have two tables called table1 and table2. In
the application, there are numerous references in the fields belong to
table1,
while creating a report. After a report have been created, no changes can be
done on the reports. However, details on table1 can be changed and updated
occasionally. On each change, a new row inserted into table1. Old rows never
changes. By the way, while viewing old reports, references are not lost. This
results in decrease of the performance. Since table1 gets larger.
There is a problem with performance not the query. The real problem is how to
design these two tables in oracle database and find an appropriate solution?
Thanks for your convenience..
I'll post a piece of code in an hour..
sozmen
"AnthonyThomas" wrote:
> It is still not clear as to the logical seperation or business uses between
> the two tables. Some clarification would be helpful.
> Nevertheless, in both tables, I would use a UNIQUE CONSTRAINT for the
> companyTaxNumber and Up_companyTaxNumber2 attributes instead of just a
> UNIQUE INDEX. Now, all SQL Server tables should have a CLUSTERED INDEX
> defined. Normally, I see users choose these IDENTITY surrogate primary
> keys, or none at all. Both are bad choices. You have three candidates, or
> a combination, that would server you better and, perhaps, assist you in your
> querying issues: companyTaxNumber (my choice), companyName, or timestamp.
> The other thing I noticed was your use of triggers. I would be careful
> about this; I think I understand why you went this route instead of the
> timestamp datatype, but it is serving the same purpose, just at the record
> instead of the table level. That being said, you need to be careful when
> using triggers because they execute T-SQL statements, that is, they are
> SET-BASED, NOT ROW-BASED. A trigger is fired--ONECE--whenever an indicated
> CRUD statement type is executed regardless of the number of rows impacted.
> This means that your INSERTED and/or DELETED tables could be NULL, 1, or
> many records with each trigger exectution. DO NOT ASSUME 1 RECORD.
> In the trigger on Table2, the timestamp field is ambiguous as you are
> joining Table1 and Table2, each with its own timestamp fields.
> With the number of fields you have, and if you add the Clustered Index to
> the correct attribute, I could see these sets of tables being able to
> service several millions of records each with negligble query reporting
> duration, dependent on your hardware, of course.
> Are you joining these tables to others in your queries that would be
> affecting your performance? Could you provide an example of a badly
> performing query with the associated shcemea of any referenced tables.
> Hope this helps.
> Sincerely,
>
> Anthony Thomas
>
> --
> "Sinem" <Sinem@.discussions.microsoft.com> wrote in message
> news:2095306F-37BF-43F4-9ECC-C873E71ACAEF@.microsoft.com...
> I have two tables that stores company information in a database. Since
> retrieving data from the tables is too slow, the structure need to be
> improved. The current structure of the tables is as follows:
> First table contains
> table1
> companyNo : unique field that is created by sequence
> companyTaxNumber:have a unique index
> companyName : have an index, but not unique
> companyAddress
> companyCountry
> timestamp
> trigger on table1:
> if insertion occurs: timestamp:0
> if update occurs : increment timestamp by 1
> Second Table Contains
> table2
> Up_companyNo2 : unique field that is created by sequence
> Up_companyTaxNumber2:have a unique index
> Up_companyName2 : have an index, but not unique
> Up_companyAddress2
> Up_companyCountry2
> timestamp
> trigger on table2:
> if insertion occurs: timestamp:0
> if update occurs : increment timestamp by 1
> update table1 where table1.companyTaxNumber=table2.Up_companyTaxNumber2
> and timestamp=1
> the problem is the application uses table1 details, and give reference to
> "companyTaxNumber" in forms. When the company information is updated (rows
> are not updated, inserted with a new companyNo via sequence) and inserted
> into table1 from table2, the new forms will use the updated information.
> However, old forms cannot use updated ones, since reports cannot be changed.
> in conclusion,
> table2 contains last updated company information, the initial information
> before updates are not stored in table2
> table 1 contains all the updates as new entries since forms that use these
> entries cannot change the references. So, table1 gets bigger and datas
> retrieved slowly.
>
> Can you give me clear advices about the improvement techniques about indexes
> and triggers? How can I handle this situation?
>
>