首页 > 数据库 > Oracle > 我对于ORACLE_SID的理解
ORACLE_SID和ORACLE_HOME是最基本的必须设置的两个环境变量。
Tom大师如是说
If
you’re unfamiliar with the term SID or ORACLE_SID, a full definition is
called for. The SID is a site identifier. It and ORACLE_HOME (where the
Oracle software is installed) are hashed together in UNIX to create a
unique key name for attaching an SGA. If your ORACLE_SID or ORACLE_HOME
is not set correctly, you’ll get the ORACLE NOT AVAILABLE error, since you can’t attach to a shared memory segment that is identified by this unique key. On Windows, shared memory isn’t used in the same fashion as UNIX, but the SID is stillimportant.
You can have more than one database on the same ORACLE_HOME, so you
need a way to uniquely identify each one, along with their configuration
files.
根据Tom大师所说的,在Unix/Linux下,Oracle的实例是有一块共享内存(SGA)和一组后台进程组成的,
Oracle使用ORACLE_HOME和ORACLE_SID进行hash,得到一个key,
Oracle根据这个key来寻找SGA,如果不设置这两个环境变量,oracle就无法找到分配的SGA,
也就无法连接到实例。这也是这两个环境变量为什么必须设置的原因。
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/10896118/viewspace-1044094/ ,如需转载,请注明出处,否则将追究法律责任。