Chapter One Oracle 11g database system (2018.3.16)

Source: Internet
Author: User

An Oracle database server includes:

1. A physical database that stores Oracle data, which is a series of physical files that hold Oracle database data, including control files, data files, log files, and other files.

2. Oracle instance: This is a middle tier between the physical database and the user, used to allocate memory and run various background processes, collectively known as Oracle instances for the allocated memory areas and background processes.

The instance is not a database, the database mainly refers to the physical structure used to store the data, always exists. An instance is made up of an operating system's memory structure and a series of processes that can be started and shut down.

Multiple Oracle databases can be created on a single computer, but to use these databases, multiple instances need to be created, so the Oracle system requires that each instance be differentiated using SIDS, that is, the SID is specified when the database is created. The SID is the identity of the instance. The relationship between instances and data is one-to-one or many-to-many relationships, and a multi-pair architecture becomes a cluster (RAC, Oracle Real application clusters)

The PL/SQL statements are not case-sensitive, and each statement ends with a semicolon.

PL/SQL and two statements use two different engines for processing, and the PL/E engine can be consolidated on the server or client, and if PL/SQL contains a call to the server-side stored procedure when the engine is consolidated on the client, it still needs to be sent to the service side for processing, which means , the SQL and storage calls of PL/SQL must be handled by the server side.

When using SQL, you can end with a semicolon or use "/" after a carriage return.

When using PL/SQL, it is important to identify the beginning of the statement with declare or begin, the internal single statement ends with a semicolon, and the entire statement block ends with a "/" to identify and send.

The following PL/SQL statement blocks:

Declare          Date ; begin          Select sysdate to mnttime from dual;         Dbms_output.put_line ('time is:'| | Mnttime);    --Set Serveroutput on/off turns on or off the screen display         dbms_output.put_line ('ok, im fine'  ); end; /

You can save the statement to a file and then call it with the "@/path/filename.sql".

Substitution variables:

SELECT empno, ename from EMP WHERE deptno=& Department number;

If the replacement variable provides data for a numeric column, you can drink it directly, or if you provide data for a character type or a date type, you need to enclose the replacement variable in single quotation marks in the SQL statement.

SELECT &empno, ename from emp WHERE ename= ' &ename ';

Using double && is the global substitution variable, which is common in the current sql*plus environment.

Statement:

To enable a locked account:

ALTER USER Tom account UNLOCK;

Link database:

CONNECT tom/tom123;  --Sidconnect Tom/[email protected] specified by default with the ORACLE_SID variable; Manually specify the SID to link to

Chapter One Oracle 11g database system (2018.3.16)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.