Oracle Fundamentals Overview

Source: Internet
Author: User
Tags sqlplus

This section focuses on Oracle's introductory video for "wind brother".

I. An overview of the architecture

1. Physical structure (file structure)

Oracle has four types of files: control files, data files, log files, parameter files

There are two types of log files: Online log files, archived log files.

① Data files

DataFile is a file that physically stores Oracle database data

A. Each database file is associated with only one database.

B. A table space contains one or more data files.

② Log files:

Records all modifications to data data for use in response to data.

A. Each database contains at least two log file groups.

B. log file groups are written in a circular manner.

C. Each log file member corresponds to a physical file.

③ Control files

Controlfile is a small binary file that describes the structure of the database. such as the date the database was established, the name of the database, the file name and path of all data and log files in the database, the synchronization information needed to recover the database, and access to the file when the database was opened and accessed.

The parameters for the record control file name and path are: Control_files

④ parameter files (Parameter file)

Role: Determine the size of the storage structure, set all default values for the database, set the scope of the database, set various physical properties of the database, and optimize database performance.

Storage location: $ORACLE _home/dbs/init.ora

Note: After oracle9i, the parameter file is SPFile, or it may be pfile.

SPFile is a binary file that can be modified dynamically after the database is started. (Recommended use)

Pfile is a static text file that modifies parameters when the database is closed.

SPFile first Pfile, when the database is started, if both are present, use SPFile to start.

2. Memory structure

SGA: The system global area is an essential part of Oracle instance and is allocated when the instance is started. A memory area that is primarily used to store database information that is shared by the database process.

PGA: The program Global Zone is a memory area that contains data and control information for a service process. Oracle is created at the start of a service process, not shared. can only be accessed by the service process that he is using

3. Logical Structure

Tablespace (tablespace)--segment (Segment)--Zone (Extent)--Data block (block)

Tablespace: Contains a data dictionary (a table that describes the structure of the database itself, all objects, users, and roles). The SYSTRM table space is the location of the data dictionary in the Library and one of the foundations of the database operation. After you create the database, you need to create additional table spaces that store the data.

Segment: A table space is assigned to several segments, which are stored objects, such as a table or an index.

Zone: is a collection of several contiguous blocks of data allocated for a segment.

Data BLOCK: The smallest unit of I/O in the database.

4. The relationship between Oracle physical structure and logical structure

Logic: Database--tablespace--Segment--Extent--Oracle block

| |

Physical: Data File-------OS block

Second, the background process

DBWR Database Write process

LGWR Log Write process

CKPT Check Point Write process

Smon System Monitoring Process

Pmon Process Monitoring Process

ARCH Archive Process

RECO recovery process

LCKN Lock Process

Third, Enterprise Manager--management instance

Function: Modify parameter file, data start and close, log of database logs, manage by sqlplus

Command:

echostart  dbconsoleecho  off Emctl stop Dbconsole

Iv. start-Up and shutdown

1. Start Oracle Instance

Shutdown-->nomout-->mount-->open

Nmount:instance started.

Mount:control file opened for this instance

Open:all files opened as described by the control file for this instance.

Start command:

  

$su - Oracle$sqlplus "/as sysdba"
Sql>starup
$LSNRCRL start

2. Database shutdown mode

--a = ABORT

I. = IMMEDIATE

--t = Transactional

--n = NORMAL

Stop command:

$su - Oracle$sqlplus"/as Sysdba"SQL>Startup  $lsnrctl start

V. Basic Concepts

1. SQL language

2. Database Base objects: Table, view, index (index), serial number (Sequence), stored procedures and functions (Procedures & Functions), triggers (Trigger), Synonyms (sysnonym), package, Database link, snapshot (Snapshot)

3. Data user Rights

Super User: Sys,system

Permissions: SYSDBA,DBA

4. Oracle NET Configuration

Configuration file: Listner.ora Tnsnames.ora

Configure Image command: NETCA

Start/close/view commands: Lsnrctl start/stop/status

Connect to the database via Oracle client Configuration Tnsname.ora

Vi. Database Backup

1. Backup is important

2, General database failure type:

SQL statement failed, thread failed, instance failed (database automatic error correction)

User operation failed, storage device failed (restored by backup file)

3. Backup Type

--Logical Backup: Exp, EXPDP

Exp Backup: Easy to recover data for user operation failure

Advantages: Table-level backup, simple operation

Cons: Recovery is slow when database files are compromised

--Physical backup: Cold backup, Hot backup

RMAN (Recovery Manager)

Requirements: Archive Log Catalog DB

Recovering data is convenient for database failure caused by storage device failure.

When the database is running, the data files and control files are backed up, and the database must be run with a hot backup (Archive Log) archive mode.

4. Backup strategy

--Fully ready (full backup)

--Archive log backups (Archivelog backup)

--Incremental backups (Increment backup)

Develop a reasonable backup strategy based on your business needs.

  

Example: Archive backups once per night

Incremental backup next day (large data volume)

Weekly Full-time

  

Common scenarios for Rman hot backup

-Veritas NetBackUp + RMAN

--IBM TSM + RMAN

--EMC Legato + RMAN

--Rman Script

--Other ...

Backup software uses:

--Management with library

--Develop a backup strategy

--Automatic backup

Common Rman Scripts

  

1 --fully prepared2 run{3 Allocate channel C1 type disk;4 Backup  Fulltag ' dbfull ' Format5‘/Oraarch/Db_%d_t%t_s%S_p%p.dbf '6 DatabaseInclude CurrentControlfile;7 release channel C1;8}

-- Archive Log  disk; Backup  Level 1 1  '/itpux/logfull_d%d_t%t_s%s_p%p.dbf' all  Delete  input;release channel Dev1;}

Vii. Database Recovery

1. Recovery type

Full recovery, incomplete recovery

2. Recovery method

IMP, IMPDP Import data through the logical backup file DMP.

Rman recovery, which is restored by backing up the data image on the tape library or on the disk.

3. Data Pump

EXPDP and IMPDP commands:

① Checking ulimit parameters

Ii

mkdir expdircd Expdir/Sqlplus "/ assysdba "Sqlplus>CreateDirectory Expdir as"/Soft/Bak/Expdir "; Sqlplus>Grant Read, write onDirectory Expdir toSYSTEM;--BackupEXPDP system/Oracle Full=Y Directory=Epdir DumpFile=20151023_%U.dmp LOGFILE=20151023_.LogParallel=3FileSize=50g--If you add the parallel parameter error, you need to go home parameter cluster=n--Recovery:IMPDP system/System Full=Y Directory=Expdir DumpFile=Orcl_%U.dmp logfile=1.LogParallel=3

  

Oracle Fundamentals Overview

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.