Two-tier Databases
All database management systems are two-tier (or implementations of the client-server model). They have a server and a client. The server runs a listener and the listener runs as a background process listening for client calls to the database. The client runs the software that lets you send messages to the server.
The client-side interface is frequently called the Oracle client, MySQL client, et cetera. It is always deployed on the server-tier but can be deployed as a standalone application on a separate client- or middle-tier server. This type of deployment lets you connect to work on server-side components or administer the server from a remote machine.
The client-side application software provides the interface. It allows you to create an Internet socket between two computers. This type of connection is often labeled persistent or pessimistic. It is persistent because it’s like a traditional handshake, unbroken until the reply and acknowledgment transaction completes. It is pessimistic because you remain connected until you confirm the completion of an action, which is known as a transaction. The supporting Internet socket is often described as state-aware. This type of communication allows interactive and batch communication to lock data changes until you want to make them publicly available in a multiple-user system. All database management systems are designed to be multiple-user systems and ACID-compliant machines.
While transactions may involve inserting, updating, or deleting data from a table or view, they may also involve transactions against multiple tables or views in the database. The perspective of a change or multiple changes to several objects is a transaction. Individual table changes in the context of a series of changes may be considered subtransaction. Likewise, a transaction may be broken up into smaller pieces, which are known as subtransactions. Subtransactions may contain one or more Data Definition Language (DDL) or Data Manipulation (DML) commands.
Anytime you have a client-side application communicating across an Internet socket, you have what’s known as client-server computing or multitier computing. The best definition I’ve run across for client-server computing is: “Two computers sharing resources across a network.” While you can implement this without TCP/IP, most applications implement it on top of TCP/IP.
Oracle® Client SQL*Plus →
This segment describes and illustrates the SQL*Plus environment that supports all command-line, Open Database Connectivity (ODBC), and Java Database Connectivity (JDBC) interactions.
The Oracle client is known as sqlplus
, and it is an elaborate interactive and batch shell. sqlplus
supports customizable environment variables and a set of very useful reporting tools. The complete documentation on the SQL*Plus environment can be found in Oracle SQL*Plus User’s Guide and Reference.
The basic architecture of the Oracle SQL*Plus environment is rather complex, which is why they’ve built such a competitive edge over the last two decades in the database market. The following drawing illustrates the flow of control for the Oracle SQL*Plus environment.
The ability to read and write external tables is not shown in the drawing and will be covered in Lesson 7 on Aggregation. It’s there because that’s where you learn how to create external tables, and import comma separated value files. Oracle also provides the ability to read and write proprietary files through a utility known as Oracle Data Pump, which is beyond the scope of the course.
There are two Oracle server-side components. They are the oracle
daemon process that runs the RDBMS, and tnslsnr
daemon process that runs the Oracle Listener.
You can find the documentation on the Oracle listener service in the Oracle Database Net Services Administrator’s Guide. The tnslsnr
relies on the listener.ora
server-side file to start and stop itself. The sqlplus
executable uses the tnsnames.ora
client- and server-side file to locate a database listener. The listener hears the sqlplus
request and connects it to the oracle
engine.