All technological notes.
start an instance:
Methods 方法:
SQL*Plus STARTUP command,Oracle Enterprise Manager (Enterprise Manager),SRVCTL utility.Prerequisites:
Oracle Net listener.SYSDBA privilege.The listener creates a dedicated server, which can start the database instance.

| Database | Files | User | sqlplus Command | Use Case | |
|---|---|---|---|---|---|
| 1 | NOMOUNT: not yet associated | parameter file | N/A | STARTUP NOMOUNT |
Create DB/BK/REC |
| 2 | MOUNTED: associated | control file | closed | STARTUP MOUNTED |
Full REC/Maintaince |
| 3 | OPEN: associated,accessible | data file | accessible | STARTUP OPEN |
Normal operation |
No mountNo mount:
The instance performs: 搜索 SPF/PF>读取初始化参数>加载内存+背景进程>打开 alert log+trace file
server parameter file(SPFILE) that contains database’s parameters, such as the SGA size, in a platform-specific default location.
text initialization parameter file(PFILE)STARTUP with the SPFILE or PFILE parameters overrides the default behaviorSGA based on the initialization parameter settings.alert log) and the trace file trace files and writes all explicit parameter settings to the alert log in valid parameter syntaxUse case:
MountedMounted
control file.The instance performs: 联系之前的实例>获取 cf 名>读取 cf 文件>获取 df+redo log
CDB) with the previously started database instancedatabase control files specified in the CONTROL_FILES initialization parameter and opens the files.read the control files to find:
data filesonline redo log files that it will attempt to access when opening the database.data files and online redo log files at this time. 只获取,不验证.Use case:
CLUSTER_DATABASE initialization parameter setting can make the database available to multiple instances. Database behavior depends on the setting:
CLUSTER_DATABASE is false (default) for the first instance that mounts a database, then only this instance can mount the database.CLUSTER_DATABASE is true for the first instance, then other instances can mount the database if their CLUSTER_DATABASE parameter settings are set to true.OpenOpen:
CBD is started, butPDBs are not when you open the database.The instance performs: 打开 DF>获取 undo tbsp> 打开 redo log
online data files in tablespaces other than undo tablespaces
data files will be offline when the database reopens.Acquires an undo tablespace
UNDO_TABLESPACE initialization parameter designates the undo tablespace to use.online redo log filesdata files or redo log files are not present when the instance attempts to open the database, 文件不存在Media recovery may be required.Database startup and shutdown are restricted to users who connect to Oracle Database with administrator privileges.
Depending on the operating system, one of the following conditions establishes administrator privileges for a user:
special system privileges, and the database uses password files to authenticate database administrators over the network.授权+密码文件认证The following special system privileges enable access to a database instance even when the database is not open: 即使 DB 未打开也可以 access
| privilege | Description | Schema |
|---|---|---|
SYSDBA(System Database Administrator) |
full control over the Oracle Database instance | SYS |
SYSOPER(System Operator) |
a subset of SYSDBA privileges, can perform basic operational tasks, cannot look as user data | SYS |
SYSBACKUP |
can perform backup and recovery operations. | |
SYSDG(System Data Guard) |
can perform operations related to Data Guard | |
SYSKM(System Key Management) |
can manage encryption keys used for TDE(Transparent Data Encryption) |
SYS:
SYS schema stored the base tables and vies for the data dictionary.Command CONNECT sys as sysdba:
| SQL | Description |
|---|---|
ALTER DATABASE MOUNT; |
associate the database instance with a specific database without fully opening it |
ALTER DATABASE OPEN; |
open a previously mounted database. |
Command to get the status of the instance
SELECT INSTANCE_NAME, HOST_NAME, STATUS, DATABASE_STATUS FROM V$instance;:
OPEN, MOUNTED, NOMOUNTACTIVE, INACTIVE)