Oracle SQL Fundamentals/Introduction
Appearance
This lesson introduces Oracle SQL database concepts, the SQL language, client tools, and sample schemas.
Objectives and Skills
[edit | edit source]Objectives and skills for Oracle SQL Fundamentals I certification are covered in detail in other lessons. This lesson helps you:
- Understand Oracle server technologies
- Understand relational database concepts
- Summarize the SQL language
- Use Oracle client tools
- Create example schemas for use in the course
Readings
[edit | edit source]- Read Wikipedia: Oracle Database.
- Read Wikipedia: Relational database.
- Read Wikipedia: Database normalization.
- Read Wikipedia: SQL.
- Read Wikipedia: SQL*Plus.
- Read Wikipedia: Oracle SQL Developer.
Multimedia
[edit | edit source]- YouTube: Oracle 11g SQL Tutorial & Exam 1Z0-051 : Introduction
- YouTube: How To Prepare For Your Oracle Certification Exam
Activities
[edit | edit source]- Install Oracle Express.
- Review Oracle: Oracle Database Express Edition Documentation and the the installation guide for your platform (Linux or Windows).
- On the system you plan to use as your database server, download and install Oracle Database Express.
- Use SQL*PLUS to verify the installation.
- Review Oracle: Identifying Your Oracle Database Software Release.
- At a command prompt on the database server, enter
sqlplus system
. - At the prompt, enter the password specified during installation.
- To display current version information, run the query
SELECT * FROM PRODUCT_COMPONENT_VERSION;
- Enter
exit
to exit SQL*PLUS.
- Use SQL*PLUS to create the HR and OE sample schemas.
- Review Oracle: Installing the Sample Schemas.
- Download and extract the sample schemas from Oracle:sample-schem-scripts.zip.
- At a command prompt, navigate to the schema/hr folder you just extracted.
- In the schema/hr folder, enter
sqlplus / as sysdba
to start SQL*PLUS. - Run the command
@hr_main.sql
. - Enter the system password. When the script finishes, if necessary enter
exit
to exit SQL*PLUS and return to the command prompt. - Navigate to the schema/oe folder you extracted.
- In the schema/oe folder, enter
sqlplus / as sysdba
to start SQL*PLUS. - Run the command
@oe_main.sql
. - Enter the system password. When the script finishes, if necessary enter
exit
to exit SQL*PLUS and return to the command prompt.
- Use SQL*PLUS to verify sample schema installation.
- At a command prompt, enter
sqlplus hr/hr
. - Run the query
show user;
to show that you are currently connected as hr. - Run the query
SELECT table_name FROM user_tables;
to see the tables that were created. - Run the command
connect OE/OE
to connect as OE. - Run the query
show user;
to show that you are currently connected as OE. - Run the query
SELECT table_name FROM user_tables;
to see the tables that were created. - Enter
exit
to exit SQL*PLUS.
- At a command prompt, enter
- Enable network connections to the server.
- Review Oracle: Database Postinstallation Tasks (Linux) or Oracle: Postinstallation Configuration Tasks on Windows.
- Configure the server firewall to allow access to the Oracle Listener on TCP port 1521.
- Install and test SQL*PLUS on a client computer.
- Review Oracle: SQL*Plus Instant Client.
- Download and install the Instant Client package for your system.
- Download and install the SQL*PLUS package for your system.
- At a command prompt, navigate to the folder where you installed the Instant Client and SQL*PLUS.
- Enter either
sqlplus system@hostname
orsqlplus system@ip address
, replacing hostname or ip address with the hostname or address of your server. If you are unable to connect, check the firewall settings on the server. - At the prompt, enter the password specified during installation.
- To display current version information, run the query
SELECT * FROM PRODUCT_COMPONENT_VERSION;
- Enter
exit
to exit SQL*PLUS.
- Install and test Oracle SQL Developer on a client computer.
- Review Oracle: Installing Oracle SQL Developer.
- Download and install Java SE Development Kit.
- Download and install Oracle SQL Developer.
- Run SQL Developer.
- Add a connection to your server. Include username, password, hostname or ip address, and port number. Test and save the connection.
- Double-click on the connection to connect.
- In the connection worksheet, enter
SELECT * FROM PRODUCT_COMPONENT_VERSION;
- Run the query.
- Close SQL Developer.
- Review HR and OE schema diagrams.
- Review the Oracle: HR and OE schema diagrams.
Lesson Summary
[edit | edit source]- Oracle Database (commonly referred to as Oracle RDBMS or simply as Oracle) is an object-relational database management system produced and marketed by Oracle Corporation.[1]
- A relational database is a digital database whose organization is based on the relational model of data.[2]
- The various software systems used to maintain relational databases are known as a relational database management system (RDBMS).[3]
- The relational model organizes data into one or more tables (or "relations") of columns and rows, with a unique key identifying each row. Rows are also called records or tuples.[4]
- Each table/relation represents one "entity type". The rows represent instances of that type of entity and the columns representing values attributed to that instance.[5]
- Database normalization, or simply normalization, is the process of organizing the columns (attributes) and tables (relations) of a relational database to minimize data redundancy.[6]
- Normalization involves decomposing a table into less redundant (and smaller) tables without losing information, and then linking the data back together by defining foreign keys in the old table referencing the primary keys of the new ones.[7]
- The objective of normalization is to isolate data so that additions, deletions, and modifications of an attribute can be made in just one table and then propagated through the rest of the database using the defined foreign keys.[8]
- Virtually all relational database systems use SQL (Structured Query Language) as the language for querying and maintaining the database.[9]
- SQL (Structured Query Language) is a special-purpose programming language designed for managing data held in a relational database management system (RDBMS), or for stream processing in a relational data stream management system (RDSMS).[10]
- SQL was originally based upon relational algebra and tuple relational calculus and consists of a data definition language, data manipulation language, and data control language.[11]
- Data Definition Language (DDL) commands include CREATE, ALTER, DROP, and RENAME.[12]
- Data Manipulation Language (DML) commands include SELECT, INSERT, UPDATE, and DELETE.[13]
- Data Control Language (DCL) commands include GRANT and REVOKE.[14]
- Transaction Control Language (TCL) commands include COMMIT, ROLLBACK, and SAVEPOINT.[15]
- Tools available for managing Oracle databases include SQL*Plus, Oracle SQL Developer, and Oracle Enterprise Manager.[16]
Key Terms
[edit | edit source]- entity relationship diagram
- A diagram that demonstrates the relationships between entities in a relational database.[17]
- foreign key
- A field in a relational table that matches the primary key column of another table.[18]
- grid computing
- The collection of computer resources from multiple locations to reach a common goal.[19]
- instance
- Refers to any running process.[20]
- Oracle Enterprise Manager (OEM or EM)
- A set of web-based tools aimed at managing software and hardware produced by Oracle Corporation as well as by some non-Oracle entities.[21]
- Oracle SQL Developer (SQLDeveloper)
- An Integrated development environment (IDE) for working with SQL in Oracle databases using the Java Development Kit.[22]
- PGA (Program Global Area)
- Memory-area of an Oracle instance that contains data and control-information for Oracle's server-processes.[23]
- PL/SQL (Procedural Language/Structured Query Language)
- Oracle Corporation's procedural extension for SQL and the Oracle relational database.[24]
- primary key
- A field or fields that uniquely specifies a record or tuple within a table.[25]
- schema
- The structure of a database described in a formal language supported by the database management system (DBMS). An Oracle database associates a separate schema with each database user.[26]
- SGA (System Global Area)
- Forms the part of the system memory (RAM) shared by all the processes belonging to a single Oracle database instance.[27]
- SQL*Plus
- An Oracle Database utility, with a basic command-line interface, commonly used by users, administrators, and programmers.[28]
Assessments
[edit | edit source]- Flashcards: Quizlet: Oracle 1Z0-051 Exam - General
See Also
[edit | edit source]References
[edit | edit source]- ↑ Wikipedia: Oracle Database
- ↑ Wikipedia: Relational database
- ↑ Wikipedia: Relational database
- ↑ Wikipedia: Relational database
- ↑ Wikipedia: Relational database
- ↑ Wikipedia: Database normalization
- ↑ Wikipedia: Database normalization
- ↑ Wikipedia: Database normalization
- ↑ Wikipedia: Relational database
- ↑ Wikipedia: SQL
- ↑ Wikipedia: SQL
- ↑ Wikipedia: Data definition language
- ↑ Wikipedia: Data manipulation language
- ↑ Wikipedia: Data control language
- ↑ Wikipedia: Transaction Control Language
- ↑ Wikipedia: Oracle Database
- ↑ Wikipedia: Entity-relationship model
- ↑ Wikipedia: Relational database
- ↑ Wikipedia: Grid computing
- ↑ Wikipedia: Instantiation
- ↑ Wikipedia: Oracle Enterprise Manager
- ↑ Wikipedia: Oracle SQL Developer
- ↑ Wikipedia: Oracle Database
- ↑ Wikipedia: PL/SQL
- ↑ Wikipedia: Relational database
- ↑ Wikipedia: Database schema
- ↑ Wikipedia: System Global Area
- ↑ Wikipedia: SQL*Plus