1. First describe a connection to Oracle 10g error: "shared memory realm does not exist"
This error occurs when the Sqlplus is connected;
2. Oracle Server main Component analysis
The main components of the Oracle server are shown:
As shown in: Oracle server component structure, Oracle Server can be seen as a two-part: Oracle instance and Oracle database, the bold line is divided into two parts, the upper part of the line represents the Oracle instance, The Oracle database is represented by a straight line. As stated in Oracle Start up 1, the Oracle database can be physically viewed as a file system composed of different files, logically as a four-dimensional structure composed of tablespace, Segment, Extent and blocks;
About Oracle Instances:
is a way to access the Oracle database, an Oracle instance can only open one Oracle database;
Consists of memory and background processes;
exists in memory, a database corresponds to a shared memory area, and the shared memory area is shared by the Oracle background process;
Establish a connection to the client (connecting to an Oracle server essentially connecting to an Oracle instance of the Oracle server)
Decomposition from the following aspects:
(1) Oracle two major processes
User process:
A program that runs on client memory to access the Oracle database;
Establish a connection with the database instance and cannot directly connect with the database;
such as the SQL PLUS running on the client, Enterprise Manager;
The user process requests an operation from the service process;
Server process:
A process that directly talks to the database server;
Responds to the action request made by the user process and returns the result;
(2) Oracle's main memory structure consists of two parts
Program Global Zone Programs Global Area (PGA): Allocated when the server process is started.
Each user connects to the memory area of the Oracle database;
Assigned separately when the process is established;
Released when the process terminates;
Can only be used for a process that is private and cannot be shared
System global Area (SGA): Allocated When the instance is started, is the basic component of the DB instance, and the SGA section is isolated from the structural framework diagram, such as:
The SGA includes several memory structures:
Shared pool
Database Buffer Cache Fast
Redo Log buffers (Redo log buffer)
Candidates (Large Pool)
Java pools (Java pool)
Other structures (lock), latch management (LATCH), statistics (statistical data)
Several features of the SGA:
Dynamic allocation
Size determined by sga_max_size
Sometimes called shared global area
Allocation of memory particles (granules) within the SGA
SGA each memory part function key The following table:
Library Cache |
Library Quick Buffers Storing information for most recently used SQL and PL + + statements Share the most recently used SQL statement Manage with "least recently used" (least Recently Used (LRU)) algorithm Includes two structures: Shared SQL area and shared PL/SQL area Size determined by the size of the shared pool |
| Data Dictionary Cache |
Data dictionary Buffers A collection of recently used definitions in the database Information that includes database files, tables, indexes, columns, users, permissions, and other objects During the parsing phase, the server process looks for data dictionary information to parse the object's name and access rights Load data dictionary information into memory to improve response time for queries and DML (data manipulation Language) Manipulation language statements Size determined by the size of the shared pool |
| Database Buffer Cache |
Database buffer Fast Cache Store a copy of the data block extracted from the data file When extracting data or modifying data, it can greatly improve performance. The LRU (Least recently used) algorithm is used to manage Db_block_size determines the size of the main data block |
| Redo Log Buffer |
Redo Log Buffers All changes to the data block are recorded The main purpose is to restore the database The change is recorded in the object that becomes the Redo directory (redo entries) Redo Directory (Redo entries) contains information about rebuilding or re-making changes Size is defined by Log_buffer. |
| Java Pool |
Java Pool Used to parse Java commands When installing and using Java, you need to use Size OK: java_pool_size |
| Large Pool |
Candidates An optional piece of memory area in the SGA Reduced burden on shared pool |
(3) Background processes for Oracle instances
The feeling is very complicated, will do in the future special explanation;
3.Oracle Database Start-up
To start and shut down a database, you must log in as a user with Oracle Administrator privileges, typically logged in as a user with SYSDBA permissions
Starting a database requires three steps:
(1), create an Oracle instance (non-installation phase)
(2), install the database by instance (Installation phase)
(3), open the database (open phase)
The following three phases are practiced from an experimental perspective:
Step one: Log in as a user with Oracle Administrator privileges
Sqlplus command
Java code
- Sqlplus/nolog
- Conn User/password as Sysdba
Java code
- Sqlplus/nolog
- Conn User/password as Sysdba
:
Step One: Create an Oracle instance (non-installation phase)
Sqlplus command
Java code
- Startup Nomount
Java code
- Startup Nomount
:
As shown above: The Nonount option creates only one Oracle instance. Reads the Init.ora initialization parameter file, initiates a background process, initializes the system global Zone (SGA). The Init.ora file defines the configuration of the instance, including the size of the memory structure and the number and type of background processes that are started. When the instance is open, the system displays a list of the structure and size of the SGA memory, as shown above
Step Three: Install the database by instance (Installation phase)
Command:
Java code
- ALTER DATABASE Mount;
Java code
- ALTER DATABASE Mount;
:
The command creates an instance and installs the database, but does not open the database. The Oracle system reads the contents of the control file about the data file and the redo log file, but does not open the file.
Step Four: Open the database (open stage)
Command:
ALTER DATABASE open;
:
This command completes all three steps to create an instance, install an instance, and open a database. At this point the database makes the data files and redo log files online, and typically requests one or more rollback segments. In addition to the system can see the previous startup Mount mode of all the hints, but also give a "database has been opened" prompt. At this point, the database system is in a normal working state and can accept user requests.
Note that:
Of course, you can open it with a single command.
Java code
- Startup
Java code
- Startup
Give the following:
The three parts separated by the red line represent three start-up stages
4, solve a problem
This article starts with a question, here to solve, why the problem arises because the Oracle database is not started, the solution is to open the database as shown in the above 3 operation;
The most direct phenomenon of the above problem is: Check the memory of Oracle.exe under the Task manager, when Oracle.exe accounted for dozens of trillion memory, the Oracle database does not start, the normal Oracle.exe memory is as follows:
Restore error Now: Connect to Database After closing database, view Oracle.exe memory
To view memory:
Compared with the normal start-up time difference, so summarize the solution "shared memory realm does not exist" method:
(1) Task Manager to view the memory of Oracle.exe, when Oracle.exe accounted for only dozens of megabytes of memory, the problem is that the database is not started
(2) Start Oracle database, administrator login, start
Java code
- Sqlplus/nolog
- Conn User/password as Sysdba
- Startup
Java code
- Sqlplus/nolog
- Conn User/password as Sysdba
- Startup
Shared memory realm does not exist