Início
Conheça mais
Enviar pesquisa
Carregar
Entrar
Cadastre-se
Anúncio
Check these out next
Les09
Abrianto Nugraha
Intro
Abrianto Nugraha
Introduction to SQL, SQL*Plus
Chhom Karath
sql-commands.pdf
Prof. Dr. K. Adisesha
Sql commands
Prof. Dr. K. Adisesha
Sql commands
Prof. Dr. K. Adisesha
Cursores.ppt
Alan737817
SQL PPT.pptx
Kulbir4
1
de
27
Top clipped slide
Manage schema object.ppt
21 de Mar de 2023
•
0 gostou
0 gostaram
×
Seja o primeiro a gostar disto
mostrar mais
•
19 visualizações
visualizações
×
Vistos totais
0
No Slideshare
0
De incorporações
0
Número de incorporações
0
Baixar agora
Baixar para ler offline
Denunciar
Educação
DBA
AhmadUsman79
Seguir
Anúncio
Anúncio
Anúncio
Recomendados
Less07 schema
Imran Ali
1.5K visualizações
•
36 slides
Creating and Managing Tables -Oracle Data base
Salman Memon
2.5K visualizações
•
33 slides
Les09.ppt
PrathameshSingh15
7 visualizações
•
33 slides
SQL SERVER Training in Pune Slides
enosislearningcom
179 visualizações
•
40 slides
plsql Les09
sasa_eldoby
504 visualizações
•
33 slides
Dbms oracle
Abrar ali
73 visualizações
•
33 slides
Mais conteúdo relacionado
Similar a Manage schema object.ppt
(20)
Les09
Abrianto Nugraha
•
1.5K visualizações
Intro
Abrianto Nugraha
•
272 visualizações
Introduction to SQL, SQL*Plus
Chhom Karath
•
1.3K visualizações
sql-commands.pdf
Prof. Dr. K. Adisesha
•
116 visualizações
Sql commands
Prof. Dr. K. Adisesha
•
6.3K visualizações
Sql commands
Prof. Dr. K. Adisesha
•
374 visualizações
Cursores.ppt
Alan737817
•
10 visualizações
SQL PPT.pptx
Kulbir4
•
12 visualizações
Database Objects
Salman Memon
•
1.8K visualizações
Introduction to (sql)
Dattatray Ghorpade
•
120 visualizações
intro for sql
mahmoud mones
•
291 visualizações
Oracle SQL Part1
Gurpreet singh
•
489 visualizações
SQl-1.pptx
kingVox
•
8 visualizações
Module02
Sridhar P
•
828 visualizações
dbs class 7.ppt
MARasheed3
•
3 visualizações
Islamic University Previous Year Question Solution 2018 (ADBMS)
Rakibul Hasan Pranto
•
38 visualizações
SQL Intro
koppenolski
•
57 visualizações
SQL 3.pptx
Rishab Saini
•
13 visualizações
Introduction to Oracle Database
puja_dhar
•
19.7K visualizações
plsql Les08
sasa_eldoby
•
790 visualizações
Último
(20)
Unit 3 IBM - Global Competive Advantage (1).pdf
ShoDp
•
0 visão
EdmundJr_Kenny_BEB_PBI_2023-05.pptx
KennyEdmund
•
0 visão
How To Write A Essay In Apa Format
Missy Willis
•
0 visão
causesofmentaldisorders-141121074310-conversion-gate01 (1).pdf
Musaargungu
•
0 visão
PRESENTATION-3-1.pptx
SibelUurlu
•
0 visão
Pump (Centrifugal and Reciprocating).pptx
MdMeshkatHasan213331
•
0 visão
Government_ok.pptx
6ogelacharnesacharne
•
0 visão
Dependent-Prepositions-Verbs-Open-cloze.pdf
SonsolesMollinedo
•
0 visão
Part 1.pptx
ChevonneOates1
•
0 visão
Domestic Violence.pptx
PranavNUnnithan1
•
0 visão
ARTHRITIS.pptx
PaulMarkPilar2
•
0 visão
Radiactive process.pptx
Jabir Hussain
•
0 visão
LEMON GRASS.pptx
Vijayakathir
•
0 visão
Part 2.pptx
ChevonneOates1
•
0 visão
HIV & AIDS L1.pptx
Brigidkiplagat
•
0 visão
LASERS IN ENDODONTICS
RITIKAMUNDHRA4
•
0 visão
1-190128092525.pdf
ssuserbf4af22
•
0 visão
Example Essay Thesis Statement
Karen Metcalf
•
0 visão
aLZHEIMER'S.pptx
PaulMarkPilar2
•
0 visão
Groundhog Day Essay
Missy Willis
•
0 visão
Anúncio
Manage schema object.ppt
7-1 Copyright ©
2005, Oracle. All rights reserved. Managing Schema Objects
7-2 Copyright ©
2005, Oracle. All rights reserved. Objectives After completing this lesson, you should be able to do the following: • Define schema objects and data types • Create and modify tables • Define constraints • User • User accounts • Create indexes • Naming Schema Object • Object Namespaces • Explain the use of temporary tables
7-3 Copyright ©
2005, Oracle. All rights reserved. Database Schema A database schema defines how data is organized within a relational database. This is inclusive of logical constraints such as, table names, fields, data types, and the relationships between these entities.
7-4 Copyright ©
2005, Oracle. All rights reserved. What Is a Schema? HR schema HR user owns > Schema Constraints Indexes Views Temp Tables
7-5 Copyright ©
2005, Oracle. All rights reserved. Schema Objects
7-6 Copyright ©
2005, Oracle. All rights reserved. Naming Database Objects • The length of names must be from 1 to 30 bytes, with these exceptions: – Names of databases are limited to 8 bytes. – Names of database links can be as long as 128 bytes. • Nonquoted names cannot be Oracle-reserved words. • Nonquoted names must begin with an alphabetic character from your database character set. • Quoted names are not recommended.
7-7 Copyright ©
2005, Oracle. All rights reserved. Object Namespaces A Namespace is a container for a set of identifiers(symbols or names). A namespace defines a group of object types, within which all names must be uniquely identified, by schema and name. Objects in different namespaces can share the same name. These object types all share the same namespace: Tables Views Sequences Private synonyms
7-8 Copyright ©
2005, Oracle. All rights reserved. Data Types in Tables Common data types: • CHAR(size [BYTE|CHAR]): Fixed-length character data of size bytes or characters • VARCHAR2(size [BYTE|CHAR]): Variable-length character string having a maximum length of size bytes or characters • DATE: Valid date ranging from January 1, 4712 B.C. through A.D. December 31, 9999 • NUMBER(p,s): Number with precision p and scale s
7-9 Copyright ©
2005, Oracle. All rights reserved. Creating and Modifying Tables Specify the table name and schema. Specify the column names, data types, and lengths.
7-10 Copyright ©
2005, Oracle. All rights reserved. DBA User A database administrator is a database user of the database user class DBA. Database administrators can manage database users and database objects. The database system administrator is a special database user of database user class SYSDBA (administrator).
7-11 Copyright ©
2005, Oracle. All rights reserved. User Accounts For users to access your database, you must create user accounts and grant appropriate database access privileges to those accounts. A user account is identified by a user name and defines the attributes of the user, including the following: Authentication method Password for database authentication Default tablespaces for permanent and temporary data storage Tablespace quotas Account status (locked or unlocked) Password status (expired or not)
7-12 Copyright ©
2005, Oracle. All rights reserved. Defining Constraints
7-13 Copyright ©
2005, Oracle. All rights reserved. Constraint Violations Examples of how a constraint can be violated are: • Inserting a duplicate primary key value • Deleting the parent of a child row in a referential integrity constraint • Updating a column to a value that is out of the bounds of a check constraint 101 … 102 … 103 … 101 X … 22 … 49 … 16 … 5 ID AGE –30
7-14 Copyright ©
2005, Oracle. All rights reserved. Constraint States ENABLE NOVALIDATE ENABLE VALIDATE Existing data New data DISABLE NOVALIDATE DISABLE VALIDATE No DML
7-15 Copyright ©
2005, Oracle. All rights reserved. Constraint Checking Case: DML statement, followed by COMMIT Nondeferred constraints checked COMMIT issued Deferred constraints checked COMMIT complete 1 3 2 4 Constraints are checked at the time of: • Statement execution, for nondeferred constraints • COMMIT, for deferred constraints
7-16 Copyright ©
2005, Oracle. All rights reserved. Creating Constraints with SQL: Examples ALTER TABLE countries ADD (UNIQUE(country_name) ENABLE NOVALIDATE); ALTER TABLE employees ADD CONSTRAINT pk PRIMARY KEY (employee_id) CREATE TABLE t1 (pk NUMBER PRIMARY KEY, fk NUMBER, c1 NUMBER, c2 NUMBER, CONSTRAINT ri FOREIGN KEY (fk) REFERENCES t1,CONSTRAINT ck1 CHECK (pk > 0 and c1 > 0)); a c b
7-17 Copyright ©
2005, Oracle. All rights reserved. Viewing the Columns in a Table
7-18 Copyright ©
2005, Oracle. All rights reserved. Viewing the Contents of a Table
7-19 Copyright ©
2005, Oracle. All rights reserved. Indexes 22 22 Index Table Key Row pointer … WHERE key = 22 Schema Constraints > Indexes Views Temp Tables
7-20 Copyright ©
2005, Oracle. All rights reserved. Types of Indexes These are several types of index structures available to you, depending on the need: • A B-tree index is in the form of a binary tree and is the default index type. • A bitmap index has a bitmap for each distinct value indexed, and each bit position represents a row that may or may not contain the indexed value. This is best for low-cardinality columns.
7-21 Copyright ©
2005, Oracle. All rights reserved. B-Tree Index Index entry header Key column length Key column value ROWID Root Branch Leaf Index entry
7-22 Copyright ©
2005, Oracle. All rights reserved. Bitmap Indexes <Blue, 10.0.3, 12.8.3, 1000100100010010100> <Green, 10.0.3, 12.8.3, 0001010000100100000> <Red, 10.0.3, 12.8.3, 0100000011000001001> <Yellow, 10.0.3, 12.8.3, 0010001000001000010> Key Start ROWID End ROWID Bitmap Table Index Block 10 Block 11 Block 12 File 3
7-23 Copyright ©
2005, Oracle. All rights reserved. Index Options • A unique index ensures that every indexed value is unique. • An index can have its key values stored in ascending or descending order. • A reverse key index has its key value bytes stored in reverse order. • A composite index is one that is based on more than one column. • A function-based index is an index based on a function’s return value. • A compressed index has repeated key values removed.
7-24 Copyright ©
2005, Oracle. All rights reserved. Creating Indexes CREATE INDEX my_index ON employees(last_name, first_name);
7-25 Copyright ©
2005, Oracle. All rights reserved. Temporary Tables A temporary table: • Provides storage of data that is automatically cleaned up when the session or transaction ends • Provides private storage of data for each session • Is available to all sessions for use without affecting each other’s private data Schema Constraints Indexes Temp Tables
7-26 Copyright ©
2005, Oracle. All rights reserved. Temporary Tables: Considerations • Use the GLOBAL TEMPORARY clause to create temporary tables: • Use the TRUNCATE TABLE command to delete the contents of the table. • You can create the following on temporary tables: – Indexes – Views – Triggers CREATE GLOBAL TEMPORARY TABLE employees_temp ON COMMIT PRESERVE ROWS AS SELECT * FROM employees;
7-27 Copyright ©
2005, Oracle. All rights reserved. Thank You
Anúncio