1 Oracle Administration(V2.0)-En

79
Solutions & Engineering of Defense and Security Information Systems 1

description

Capacitación operadores

Transcript of 1 Oracle Administration(V2.0)-En

Page 1: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems1

Page 2: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Oracle Administration

Page 3: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Add a Database to the TreeAdd a Database to the Tree

enter the host name or IP address of the Oracle database server

enter the SID

click the “OK” button

Page 4: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Connect to the DatabaseConnect to the Database

enter user name

enter password

click the “OK” button

Page 5: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

View the TreeView the Tree

click a plus icon or double-click a node to expand child node

Page 6: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

View ParameterView Parameter

double-click the “Instance” node

click the “Configration” node

click “All Initialization Parameter”

Page 7: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

View ParameterView Parameter

click the “Cancel” button

Page 8: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

View SessionView Session

click the “Session” button

Page 9: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

View UserView User

click a use name node

view a user’s tablespaces,role

privileges and object privileges

Page 10: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

View ChemaView Chema

double-click the “Schema” node

Page 11: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

View Table StructureView Table Structure

right-click a table name’s node and then click the “view/edit details” menu

Page 12: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

View DataView Data

right-click the table name’s node and then click the “View/Edit contents” menu

Page 13: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

View TablespaceView Tablespace

click the “Tablespace” node

Page 14: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

View DatafileView Datafile

click the “Datafile” node

Page 15: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Create Permanent TablespaceCreate Permanent Tablespace

right-click the

“Tablespace” node

and then click the

“Create”

enter the

name,directory and

size

click the “Create”

button

Page 16: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Create Temporary TablespaceCreate Temporary Tablespace

right-click the

“Tablespace” node

and then click the

“Create”

enter the

name,directory and

size

Select the

“Temporary ” type

Page 17: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Create UserCreate User

right-click the

“User” node and

then click the

“Create”

enter the

name,password

select tablespace

Page 18: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Create UserCreate User

double-click the role privilege which you want to grant to the user

Page 19: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Create UserCreate User

double-click the system privilege which you want to grant to the user

Page 20: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Create Table:GeneralCreate Table:General

right-click the “Table” node under the schema node

enter table name

define columns

Page 21: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Create Table:ConstraintsCreate Table:Constraints

right-click the “Table” node under the schema node

enter table name

define columns

Page 22: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Oracle Data Types• Character Data Type• Number Data Type• Date Data Type• LOB Data Type

Page 23: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Oracle Data Types Character Data Type

― Char― Varchar2

Number Data Type― Number(p, s)

Page 24: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Oracle Data Types Date Data Type

― Date― Timestamp

LOB Data Type― CLOB― BLOB

Page 25: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

SQL & PL/SQL

SQL:Structured Query Language

PL/SQL:Procedural Language/Structured Query Language

Page 26: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

SQL & PL/SQLData Retrieval Language (DRL):

Data Manipulation Language (DML):

Data Definition Language (DDL):

Data Control Language (DCL):

Transaction Control:

SELECT

INSERTUPDATEDELETE

CREATEALTERDROPRENAMETRUNCATE

GRANTREVOKE

COMMITROLLBACKSAVEPOINT

Page 27: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

EMP Table

Page 28: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

DEPT Table

Page 29: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Basic SELECT Statement

Page 30: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Selecting All Columns

Page 31: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Selecting Specific Columns

Page 32: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Arithmetic Expressions

Page 33: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Using Arithmetic Operators

Page 34: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Using Arithmetic Operators on Multiple columns

Page 35: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Operator Precedence

Page 36: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Operator Precedence

Page 37: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Using Parentheses

Page 38: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Using Column Aliases

Page 39: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Using the Concatenation Operator

Page 40: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Using Literal Character Strings

Page 41: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Duplicate Rows

Page 42: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Eliminating Duplicate Rows

Page 43: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Using the WHERE Clause

Page 44: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Character Strings and Dates

Page 45: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Comparison Operators

Page 46: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Using the Comparison Operator

Page 47: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Using the Comparison Operators

Page 48: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Other SQL Comparison Operators

Page 49: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Using the BETWEEN Operator

Page 50: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Using the IN Operator

Page 51: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Using the IN Operator with Strings

Page 52: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Using the LIKE Operator

Page 53: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Using the LIKE Operator

Page 54: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Using the IS NULL Operator

Page 55: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Logical Operators

Page 56: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Using the AND Operator

Page 57: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Using the AND Operator

Page 58: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Using the OR Operator

Page 59: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Using the OR Operator

Page 60: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Using the NOT Operator

Page 61: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Using the NOT Operator

Page 62: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Using the NOT Operator

Page 63: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Using the NOT Operator

Page 64: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Rules of Precedence

Page 65: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Rules of Precedence

Page 66: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Rules of Precedence

Page 67: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

ORDER BY Clause

Page 68: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Sorting in Descending Order

Page 69: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Sorting by Column Alias

Page 70: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Sorting by Multiple Columns

Page 71: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Sorting by a Column Not in the SELECT List

Page 72: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Joining Tables

Page 73: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Retrieving Records with an Equijoin

Page 74: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

INSERTINSERT INTO table_name

VALUES(value1,value2,…...)

INSERT INTO dept VALUES (50,'DEVELOPMENT','GUAYAQUIL')

COMMIT

Page 75: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

UPDATEUPDATE table_name

SET column_name = 'value'[WHERE condition]

UPDATE deptSET dname='SEGURIDAD' WHERE dname='DEVELOPMENT'

COMMIT

Page 76: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

DELETEDELETE FROM table_name

[WHERE condition]

DELETE FROM deptWHERE dname='SEGURIDAD'

COMMIT

Page 77: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

PL/SQL

Page 78: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Benefits of PL/SQL

Page 79: 1 Oracle Administration(V2.0)-En

Solutions & Engineering of Defense and Security Information Systems

Gracias