• No results found

RDBMS notes

N/A
N/A
Protected

Academic year: 2021

Share "RDBMS notes"

Copied!
6
0
0

Loading.... (view fulltext now)

Full text

(1)

Schema

:- A database schema is described in a formal language supported by the database management system (DBMS). In a relational database, the schema defines the tables, the fields in each table, and the relationships between fields and tables. Schemas are generally stored in a data dictionary. Although a schema is defined in text database language, the term is often used to refer to a graphical depiction of the database structure Levels of database schema.

Table alias :-The use of table aliases means to rename a table in a particular SQL statement. The renaming is a temporary change and the actual table name does not change in the database

Syn : SELECT column1, column2.... FROM table_name AS alias_name WHERE [condition];

Database integrity :-

ensures that data entered into the database is accurate, valid, and consistent. Any applicable integrity constraints and data validation rules must be satisfied before permitting a change to the database.

Data integrity refers to the overall completeness, accuracy and consistency of data. This can be indicated by the absence of alteration between two instances or between two updates of a data record, meaning data is intact and unchanged. Data integrity is usually imposed during the database design phase through the use of standard procedures and rules. Data integrity can be maintained through the use of various error

checking methods and validation procedures.

Three basic types of database integrity constraints are:

 Entity integrity, not allowing multiple rows to have the same identity within a table.  Domain integrity, restricting data to predefined data types, e.g.: dates.

 Referential integrity, requiring the existence of a related row in another table, e.g. a customer for a given customer ID.

Procedure are supported in (PL/SQL)

Invocation references to PL/SQL procedures within PL/SQL contexts can be compiled by the DB2® data server.

A valid PL/SQL procedure reference consists of the procedure name followed by its parameters, if any.

Syntax

>>-procedure-name--+---+--->< | .-,---. | | V | | '-(----+---+-+--)-' '-parameter-value-'

Description

procedure-name

Specifies an identifier for the procedure. parameter-value

Specifies a parameter value. If no parameters are to be passed, the procedure can be called either with or without parentheses.

Example

The following example shows how to call a PL/SQL procedure within a PL/SQL context: BEGIN

simple_procedure; END;

After a PL/SQL procedure has been created in a DB2 database, it can also be called using the CALL statement, which is supported in DB2 SQL contexts and applications using supported DB2 application programming interfaces.

LITERALS :- The terms literal and constant value are synonymous and refer to a fixed data value. For example, 'JACK', 'BLUE ISLAND', and '101' are all character literals; 5001 is a numeric literal. Character literals are enclosed in single quotation marks so that Oracle can distinguish them from schema object names.

This section contains these topics:1-Text Literals 2-Numeric Literals 3-Datetime Literals 4- Interval Literals

(2)

DB2 architecture

DB2 is one of the leading (R)DBMS products in the market. As any other powerful software product it has complex architecture. Here I’d like to introduce some basic terminology of it in series of posts because sometimes this terminology can become somewhat vague.

Lets kick off by explaining some general view of DB2. Each IBM DB2 installation has following basic levels of architecture:

Instance can be understood as a completely independent environment with it’s own

security configuration, resource allocation and contains databases and partitions isolated from all other instances. Each instance has its own system processes which manage data. Instance may contain several databases.

Database is a most familiar term. It’s a logical unit which holds your data. It has

complicated structure which we will explain later on. Database can reside in one or more partitions.

Partitions (or nodes) is a way of creating DB2 database cluster for the sake of higher

performance. You can split your database onto several servers where each of them will have their own chunk of data. Since more servers means more CPU cores, memory and disk I/O it’s a natural way of scaling DB2. Particular storage resource is called Container.

Database is then mapped onto several Tablespaces. Tablespace allows you to manage how database tables are held on your storage resources. For example you can hold your data in files as well as on raw hard drives (which is faster). In addition it’s possible to put frequently used data on SAS hard drives and rarely used on SATA by means of creating two different tablespaces. On top of that you can set up a different page size for each of your tablespaces.

Here is the basic idea of what DB2 represents from the view of systems administrator. To better understand a folding of different levels please refer to this well-known among dbtwoers picture

VIEWS OF RDBMS

:-Basically there are are two Views regarding to DBMS. (1)Regression based Views

(2) Interpolation based Views

1- Regression based Views:

Regression techniques are routinely and very successfully used in many application domains to model the values of a continuous dependent variable as a function of the values of a set of independent or predictor variables. These models are thus a natural fit in many environmental monitoring applications that use sensor networks to monitor physical properties such as temperature, humidity, light etc

2-Interpolation based Views:

We describe a second type of view in this section, the interpolation

view. In an interpolation view an interpolation function is used to estimate the missing values from known values that bracket the missing value. The process is similar

to table lookup: given a table T of tuples of the form (T, V ), and a set of T0 values with unknown V 0 values, we can estimate the v0 2 V 0 value that corresponds to a particular t0 2 T0 by looking up two pairs (t1, v1) and (t2, v2)

in T such that t1 _ t0 _ t2. We then use the interpolation function to compute the value v0 from v1 and v2..

Q EXCEPTION :-DBMS_SQL defines a single exception in its specification as follows: inconsistent_type EXCEPTION;

pragma exception_init(inconsistent_type, -6562);

This exception can be raised by either the COLUMN_VALUE or the VARIABLE_VALUE procedure if the type of the specified OUT argument is different from the type of the value which is being returned.You may encounter other exceptions when working with dynamic SQL (in fact, there will be times when you believe that all you can do with DBMS_SQL is raise exceptions). The table below lists some of the most common errors.

(3)

Q HOW THESE ARE DIFFER FROM CONSTRAINTS:-

1- Data Integrity - Constraints and Triggers

All data stored in a database must adhere to certain business rules.

For example, there may be a business rule specifying a minimum hourly wage for any employee or another rule stating that the discount for sale items cannot be more than 100%.

In either case if an INSERT or UPDATE statement attempts to violate the integrity rule, Oracle must roll back the statement and return an error.

2- Integrity Constraints

An integrity constraint defines a business rule for a table column. When enabled, the rule will be enforced by oracle (and so will always be true.) To create an integrity constraint all existing table data must satisfy the constraint.

Default values are also subject to integrity constraint checking (defaults are included as part of an INSERT statement before the statement is parsed.)

If the results of an INSERT or UPDATE statement violate an integrity constraint, the statement will be rolled back.

3- Constraint States

The current status of an integrity constraint can be changed to any of the following 4 options using the

CREATE TABLE or ALTER TABLE statement.

ENABLE - Ensure that all incoming data conforms to the constraint

DISABLE - Allow incoming data, regardless of whether it conforms to the constraint VALIDATE - Ensure that existing data conforms to the constraint

NOVALIDATE - Allow existing data to not conform to the constraint 4- Effect of constraint failure

Any SQL INSERT, UPDATE or DELETE command applied to a table with constraints enabled has the possibility of failing.

For example updates applied to a Parent Table may fail if the statement leaves orphaned rows in a child table, INSERTs against a Child Table may fail if a matching foreign key value does not exist in the parent table

5- Deferring a constraint

You can defer checking constraints for validity until the end of the transaction, so the constraint rules don't have to be met until the whole transaction is committed.

This can be defined for each constraint with keywords in the CONSTRAINT clause: 6- Pros and Cons

Constraints are preferable to application code, database triggers or stored procedures. Because a constraint is defined once for each table (in the data dictionary) changes to business rules can be applied in one place.

7- Database Triggers

A database trigger is a procedure written in PL/SQL, Java, or C that will run implicitly when data is modified or when some user or system actions occur.

8- Data Integrity

A database trigger is not the same as an integrity constraint. A database trigger defined to enforce an integrity rule does not check data already loaded into a table. Therefore, it is recommended that you use a trigger only when the integrity rule cannot be enforced by an integrity constraint.

Access control

is the selective restriction of access to a place or other resource. The act of

accessing may mean consuming, entering, or using. Permission to access a resource is called authorization.

Locks and login credentials are two analogous mechanisms of access control.

1 Physical security

1.1 Access control system operation

1.2 Credential

1.3 Access control system components

1.4 Access control topology 1.5 Types of readers

1.6 Access control system topologies

1.7 Security risks

2 Computer security 2.1 Authorization

2.2 Identification and authentication (I&A) 2.3 Access approval

2.4 Accountability

2.5 Access control models

2.5.1 Attribute-based access control 2.5.2 Discretionary access control 2.5.3 Mandatory access control 2.5.4 Role-based access control 3 Telecommunication

(4)

1. External view : this is a highest level of abstraction as seen by user. This level of abstraction describes only the part of entry database. It is based on the conceptual model, is the end us

Ims architecture

:-The IP-Multimedia Subsystem (IMS) defines the functional architecture for a managed IP-based network. It aims to provide a means for carriers to create an open, standards-based network that delivers integrated multimedia services to increase revenue, while also reducing network CapEx and OpEx.

IMS was originally designed for third-generation mobile phones, but it has already been extended to handle access from WiFi networks, and is continuing to be extended into an access-independent platform for service delivery, including broadband fixed-line access. It promises to provide seamless roaming between mobile, public WiFi and private networks for a wide range of services and devices. The IMS architecture has been designed to enable operators to provide a wide range of real-time, packet-based services and to track their use in a way that allows both traditional time-based charging as well as packet and service-based charging. It has become increasingly popular both with wireline and wireless service providers as it is designed to increase carrier revenues, deliver integrated multimedia services, and create an open, standards-based network.

IMS Physical Databases

The physical database record is a basic building block in IMS. A physical database record (PDBR) consists of a hierarchical arrangement of segments. A segment, in turn, consists of a set of related fields. The top segment (or entry point) in a PDBR is called the root segment. A PDBR, then, consists of a root segment plus a hierarchical arrangement of subordinate

segments called child segments.

Figure 1 shows a typical IMS physical database record. This PDBR contains information about departments, about equipment that is assigned to each department, and about

employees assigned to each department. DEPARTMT is the name of the root segment type for this PDBR, and EQPMENT and EMPLOYEE are child segment types. The EMPLOYEE segment, in turn, has two child segments, DEPENDNT and SKILL. These segments contain information about each employee's dependents and skills, respectively.

IMS Logical Databases

External views of individual users in IMS are reflected in logical database records (LDBRs). A logical database (LDB) consists of all occurrences of a logical database record (LDBR) type. Each LDBR type is a subset of a corresponding PDBR type (or more than one PDBR type). An LDBR may differ from the corresponding PDBR in the following ways:

 Any segment type (except the root segment) of a PDBR may be omitted from an LDBR. If any segment type in the PDBR is omitted, then all of its dependents are also omitted.

 Any field types that occur in a PDBR may be omitted in the corresponding LDBR.

(5)

Cryptography:- Does increased security provide comfort to paranoid people? Or does security provide some very basic protections that we are naive to believe that we don't need? During this time when the Internet provides essential communication between tens of

millions of people and is being increasingly used as a tool for commerce, security becomes a tremendously important issue to deal with.

There are many aspects to security and many applications, ranging from secure commerce and payments to private communications and protecting passwords. One essential aspect for secure communications is that of cryptography, which is the focus of this chapter. But it is important to note that while cryptography is necessary for secure communications, it is not by itself sufficient. The reader is advised, then, that the topics covered in this chapter only describe the first of many steps necessary for better security in any number of situations. Types of criptography

3.1. Secret Key Cryptography

With secret key cryptography, a single key is used for both encryption and decryption. As shown in Figure 1A, the sender uses the key (or some set of rules) to encrypt the plaintext and sends the ciphertext to the receiver. The receiver applies the same key (or ruleset) to decrypt the message and recover the plaintext. Because a single key is used for both functions, secret key cryptography is also called symmetric encryption.

With this form of cryptography, it is obvious that the key must be known to both the sender and the receiver; that, in fact, is the secret. The biggest difficulty with this approach, of course, is the distribution of the key.

3.2 Public-Key Cryptography

Public-key cryptography has been said to be the most significant new development in

cryptography in the last 300-400 years. Modern PKC was first described publicly by Stanford University professor Martin Hellman and graduate student Whitfield Diffie in 1976. Their paper described a two-key crypto system in which two parties could engage in a secure communication over a non-secure communications channel without having to share a secret key.

PKC depends upon the existence of so-called one-way functions, or mathematical functions that are easy to compute whereas their inverse function is relatively difficult to compute.

3.3. Hash Functions

Hash functions, also called message digests and one-way encryption, are algorithms that, in

some sense, use no key (Figure 1C). Instead, a fixed-length hash value is computed based upon the plaintext that makes it impossible for either the contents or length of the plaintext to be recovered. Hash algorithms are typically used to provide a digital fingerprint of a file's contents, often used to ensure that the file has not been altered by an intruder or virus. Hash functions are also commonly employed by many operating systems to encrypt passwords. Hash functions, then, provide a measure of the integrity of a file

4.4.TRUST MODELS

Secure use of cryptography requires trust. While secret key cryptography can ensure message confidentiality and hash codes can ensure integrity, none of this works without trust. In SKC, Alice and Bob had to share a secret key. PKC solved the secret distribution problem, but how does Alice really know that Bob is who he says he is? Just because Bob has a public and private key, and purports to be "Bob," how does Alice know that a malicious person (Mallory) is not pretending to be Bob?

There are a number of trust models employed by various cryptographic schemes. This section will explore three of them:

 The web of trust employed by Pretty Good Privacy (PGP) users, who hold their own set of trusted public keys.

 Kerberos, a secret key distribution scheme using a trusted third party.

 Certificates, which allow a set of trusted third parties to authenticate each other and, by implication, each other's users.

(6)

References

Related documents

1 Display a strategy page for the controller containing the required node as described in the ‘Go to a Strategy Page’ section of this manual. 2 If the Command Line toolbar is

By changing the table when you do use a pivot tables used in row fields section of the data range you as recognising you may be part, minimum values area in another powerful when

This important control accounts for any temperature effects of the buffer on the amide exchange rates and also serves as a 0 time point for measuring the rate of change of the

The simplest way to use it is to start from a table already defined in a third-party RDBMS; in this case, simply define a connection to this database and use the Caché Link Table

a) Demonstração do experimento com o uso de lentes “biofísica da visão”. Foi desenvolvido um experimento com a utilização de lentes e lasers para trabalhar a Física

On average, a 0.1 higher carbon efficiency, i.e., realizing 10% lower carbon emissions while keeping constant the input-good output production structure, is associated with a

position for a number of clock cycles defined by Ncycles. TRIGGER 0xB The TRIGGER generates a hardware L1 trigger. Table 2.7: Instruction Table.. There are two possible modes:

158.Write a database trigger halt the transaction of EMP table if the deptno is does not exist in the dept table CREATE OR REPLACE TRIGGER DEPT_NO. BEFORE INSERT OR UPDATE OR DELETE