Date post: | 14-Jul-2015 |
Category: |
Software |
Upload: | santosh-kumar |
View: | 27 times |
Download: | 0 times |
CONTENTS1 Indexing
1.1 Problem
1.2 What is Indexing
1.3 Types
1.4 Clustered Index
1.5 Non-Clustered Index
1.6 Unique Index
1.7 When To Create Index And When Not
2 Hashing
2.1 Problem
2.2 What is Hashing
2.3 Algorithms Used In Hashing
2.4 Hash Function
3 Encryption
3.1 What is Encryption
3.2 Asymmetric Encryption
3.3 Symmetric Encryption
3.4 Which one is better.
3.5 Why Use Encryption
3.6 Transparent Data Encryption
WHAT IS INDEXING
An index can be created in a table to find data
more quickly and efficiently.
great indexing can make your application nimble
and fast.
CLUSTERED INDEX
It sorts and stores data rows in a table, based
on key values.
Sytax to create Clustered Index:
CREATE CLUSTERED INDEX Index_Name ON
Schema.TableName(Column);
CLUSTERED INDEX
This is also called implicit index because It is
automatically created by creating primary key.
Why Clustered Index can not created more than
one column???
NON-CLUSTERED INDEX
It contains a key value and a pointer to the data
in the heap or clustered index.
Syntax to create non-clustered Index:
CREATE INDEX Index_Name ON Schema.T
ableName(Column);
Can it be created more than one column in a
table???
UNIQUE INDEX A unique index ensures that the index key
contains no duplicate values.
The basic system to create :
CREATE UNIQUE INDEX index_name on
table_name (column_name);
Uniqueness can be a property of both
clustered and nonclustered indexes.
WHEN TO CREATE INDEX AND
WHEN NOT
Indexes should not be used on small tables.
Tables that have frequent, large batch update or
insert operations.
Indexes should not be used on columns that
contain a high number of NULL values.
Columns that are frequently manipulated should
not be indexed.
HASH FUNCTION
A hash function takes in data and returns back a
fixed length block of bits such that any change to
the data should result in a different block.
HASHBYTES ( '<algorithm>', { @input | 'input' } )
<algorithm>::= MD2 | MD4 | MD5 | SHA | SHA1 |
SHA2_256 | SHA2_512
WHAT IS ECRYPTION
A process that converts original information ,
plain text to difficult to interpret.
Done by using encryption algorithm.
WHICH ONE IS BETTER?Although, symmetric encryption is fast, it is not assafe as asymmetric encryption because someonecould “steal” the key and decode the messages. Butbecause of its speed, it's commonly used for e-commerce transactions.
Asymmetric encryption is more complex--and
more secure. Asymmetric encryption's added
safety comes at a price: More computation is
required, so the process takes longer.
WHY USE ENCRYPTION?
Privacy Provides for confidentiality of private information.
Integrity Ensures that a document or file has not been altered.
Accountability Prevents denial or plagiarism.
AuthenticationProtects personal data such as passwords.
TRANSPARENT DATA
ENCRYPTIONTDE is a new feature in SQL Server 2008; it
provides real time encryption of data and log
files. Data is encrypted before it is written to disk;
data is decrypted when it is read from disk. The
"transparent" aspect of TDE is that the encryption is
performed by the database engine and SQL Server
clients are completely unaware of it. There is
absolutely no code that needs to be written to
perform the encryption and decryption. There are a
couple of steps to be performed to prepare the
database for TDE, then the encryption is turned on
at the database level via an ALTER DATBASE
command.
TRANSPARENT DATA
ENCRYPTION
Create a master key
Create or obtain a certificate protected by the
master key
Create a database encryption key and protect it
by the certificate
Set the database to use encryption
CREATE A MASTER KEY
A master key is a symmetric key that is used to
create certificates and asymmetric keys. Execute
the following script to create a master key:
USE master;
CREATE MASTER KEY
ENCRYPTION BY PASSWORD = 'Pass@word1';
GO
CREATE A CERTIFICATE
Certificates can be used to create symmetric keys
for data encryption or to encrypt the data
directly. Execute the following script to create a
certificate:
USE master;
CREATE CERTIFICATE TDECert
WITH SUBJECT = 'TDE Certificate'
GO
CREATE A DATABASE
ENCRYPTION KEY
A database encryption key is required for TDE. Executethe following script to create a new database and adatabase encryption key for it:
CREATE DATABASE mssqltips_tde
GO
USE mssqltips_tde;
CREATE DATABASE ENCRYPTION KEY
WITH ALGORITHM = AES_256
ENCRYPTION BY SERVER CERTIFICATE TDECert
GO
ENABLE TDE
The final step required to implement TDE is to
execute the following script:
ALTER DATABASE mssqltips_tde
SET ENCRYPTION ON