Title, Topic

Datenbank Tuning in Oracle (Page 2).doc

®
Page 2 of 2
[1] [2]
Faculty
Information Science
Discipline
Information Technology / Computer Science
Document category
Notes
University, School
HTL Villach
Additional information
1998
Responsible User
This text has been add by user odom262 on 2008-10-01. Disclaimer
Popularity
835  visits
Document length
~1.708  Words
~10.124  Chars
Rating
Networking




















More documents
Information Technology / Computer Science

Grundlagen der EDV, Raster und Vektordaten
Hausübung GEDV – Teil 2 Untersuchen sie verschiedene digitale Karten aus dem Internet im Hinblick auf Überlagerungen von Raster und Vektordaten. Projekt 1: google-maps Projekt 2: California Coa

SELECT * from VERK

WHERE Gehalt > 0;

Denn Verkäufer die kein Gehalt haben erscheinen nicht im Index

Einem Index eine spezielle Festplatte zuweisen

 

Der Vorteil von verschieden Platten für Daten und Indexes ist, daß es keine Zugriffsbehauptungen auf die Dateien gibt.

Create index xx on table (column1,...)

tablespace TABLESPACENAME

Der Tablespacename wird vom Administrator vergeben.

Üblicherweise sollte diese Option zur Optimierung von sehr großen Datenbanken verwendet werden.

Erzeugt man einen neuen Table mit create table so wird der Primary-Key Index standardmäßig jedoch auf der selben Platte abgelegt. Um dem Index eine andere Platte zuzuweisen muß man die USING INDEX Klausel verwenden.

Beispiel:

Create table stock (

Company VARCHAR2(20),

Symbol VARCHAR2(6),

Industry VARCHAR2(15),

Volume NUMBER),

constraint PK_STOCK primary key (Company)

using index tablespace INDEXES

storage (initial 20K next 20K),

constraint UQ_STOCK unique (Symbol)

using index tablespace INDEXES

storage (initial 20K next 20K),

tablespace TALBOT

;

Hier wird zuerst ein Primary Key Constraint mit dem Namen PK_STOCK erzeugt. Dem Index des Primary Key wird der tablespace INDEXES zugewiesen, zusätzlich sind noch storage Parameter angegeben.

Der 2 Constraint erzeugt einen Index für die unique Spalte Symbol.

Die Option tablespace weist den Table dem Tablespace TALBOT zu.

 

Tablespace und Datenbankstruktur

 

This paragraph has been concealed!
Download the complete document for free!
Datenbank Tuning in Oracle.doc
• Click on download to get complete and readable text
• This is a free of charge document sharing network
• First upload your own document, and you get a word document per email
• No registration necessary, gratis
Swap homeworks and notes at no charge!
Gratis scripts for students and pupils!

Database: TALBOT


Tablespace: Tablespace: Tablespace

ADAH GEORGE SYSTEM

File File File

ADAH.ONE HOME.ONE DBS.ORA


Initial

extent

Worker Comfort Worker Weather

Index

Worker

Weather Worker


Comfort Hockey Comfort next

Weather Cluster extents

Next Comfort

extent

Tablespace: GEORG Tablespace: GEORG

File: HOME.ONE File: HOME.TWO

Jeder Tablespace enthält eigene Tables, Indexes und Cluster. Jeder Table startet mit einem initial extent, dem zum Start zugewiesenen Speicherplatz. Wächst ein Table über seinen reservierten Platz hinaus, wird ihm ein next extend zugewiesen.

Die Tables füllen den gesamten Platz des initial Files HOME.ONE und haben sich ausgeweitet auf das File HOME.TWO

Tablespace erzeugen

 

Beispiel:

Create tablespace TALBOT datafile ´home.one‛ size 1000K

Default storage (initial 25K next 10K

minextents 1 maxextents 100

pcincrease 0);

Die Datei home.one wird dem Tablespace TALBOT zugeordnet. Die Dateigröße wird auf 1000 Kbyte begrenzt (auch M für Mbyte möglich). Die Option Default Storage wird für jene create table Befehle angewendet die keine storage option enthalten. Es wird dabei festgelegt, daß der initial Platz 25K beträgt, jeder weiter next extent erhält 10K.

Auch wird mit min und maxextents die Anzahl der Extents festgelegt.

This paragraph has been concealed!
Download the complete document for free!
Datenbank Tuning in Oracle.doc
• Click on download to get complete and readable text
• This is a free of charge document sharing network
• First upload your own document, and you get a word document per email
• No registration necessary, gratis
Swap homeworks and notes at no charge!
Gratis scripts for students and pupils!

Cluster

 

Clustering ist eine Methode um Tabellen zu speichern die eng ineinander verknüpft sind, oder oft durch joins verbunden werden.

Der Cluster-Key besteht aus jenen Spalten nach denen üblicherweise der Join durchgeführt wird.

Bsp.:

Create cluster WorkerandSkill (xyz CHAR(25));

Create table WORKER(

Name VARCHAR2(25) not null,

Age NUMBER,

)

cluster WorkerandSkill (Name)

;

create table WORKERSKILL (

Name VARCHAR2(25)not null,

Skill VARCHAR(25) not null,

Ability VARCHAR2(15)

)

cluster WorkerandSkill (Name)

;

Gespeichert werden nun die gemeinsamen Spalten in einer Tabelle

Age Name Skill Ability

23 Adah Talbo Work Good

29 Andrew Dye

22 Dick Jones Smithy Excellent

25 Roland Brandt


Worker Tabel


Workerskill Tabel

Cluster Key

Sequences

 

Um das Problem der Zuweisung von eindeutigen Nummern, z.B. bei Kundennummern zu lösen, ohne extra Tabellen anlegen zu müssen, hat Oracle Sequences eingeführt.

Create sequence Kundennummer increment by 1 start with 1000;

Dieser Befehl erzeugt eine Sequence auf die mit insert,update und select zugegriffen werden kann.

Beispiel:

Insert into Kunden (Name, Kontaktperson, Nummer)

Values (‚Brauerei AG‛, ‚Karl Moik‛, Kundennummer.NextVal);

 

Durch den NextVal Hinweis bekommt man die nächste eindeutige Nummer zugewiesen.

Um die gleiche Nummer öfters verwenden zu können (z.B in foreign Key Tables) benutzt man den Hinweis CurrVal

 

 

This paragraph has been concealed!
Download the complete document for free!
Datenbank Tuning in Oracle.doc
• Click on download to get complete and readable text
• This is a free of charge document sharing network
• First upload your own document, and you get a word document per email
• No registration necessary, gratis
Swap homeworks and notes at no charge!
Gratis scripts for students and pupils!

Page 2 of 2
[1] [2]


swopdoc.com ist not responsible for the content of this text provided by third parties

Legal info - Copyright - Terms - Partner - Statistik - Contact
antiblock.org adblockdetector.com

Swap your documents