關於環境變數 ORACLE_SID 簡單談下,環境變數oracle_sid

來源:互聯網
上載者:User

關於環境變數 ORACLE_SID 簡單談下,環境變數oracle_sid
[oracle10g@lixora ~]$ export ORACLE_SID=12323
[oracle10g@lixora ~]$ !sql
sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Thu Nov 6 02:24:04 2014

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to an idle instance.


SQL> startup
ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u02/app/oracle/product/10.2.0/db_1/dbs/init12323.ora'

SQL> 


首先對oracle_sid 隨便設定一個,然後登入到sqlplus 然後敲下 “startup” ,這時oracle 會根據環境變數 oracle_sid 去 $ORACLE_HOME/dbs 下去安裝這個順序

spfile12323.ora  ——》

pfile.ora  ——》

init12323.ora ——》

init.ora ——》

去尋找oracle 的初始化參數檔案。既然是初始化參數檔案,當然是為oracle 配置一些東西——》 共用記憶體,後台進程

一個正常的執行個體(instance)被初始化後能看到這些資訊:

1》。共用記憶體段:

[oracle10g@lixora ~]$ ipcs -a


------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status      
0x00000000 2785281    root      644        80         2                       
0x00000000 2818050    root      644        16384      2                       
0x00000000 2850819    root      644        280        2                       
0xa1728964 3244037    oracle10g  640        216006656   20                      ---這裡oracle10g 是oracle 軟體的使用者


------ Semaphore Arrays --------
key                      semid      owner        perms      nsems     
0x17ee0b04 1441793    oracle10g    640        154       


------ Message Queues --------
key        msqid      owner      perms      used-bytes   messages   


當指定一個pfile 時,這是就可以啟動一個執行個體了:

[oracle10g@lixora dbs]$ ipcs -a


------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status      
0x00000000 2785281    root      644        80         2                       
0x00000000 2818050    root      644        16384      2                       
0x00000000 2850819    root      644        280        2                       
0xa1728964 3244037    oracle10g 640        216006656  20                      
0xb4c20568 3276806    oracle10g 640        169869312  10                      


------ Semaphore Arrays --------
key        semid      owner      perms      nsems     
0x17ee0b04 1441793    oracle10g 640        154       
0x65dc2878 1572866    oracle10g 640        44        


------ Message Queues --------
key        msqid      owner      perms      used-bytes   messages    


[oracle10g@lixora dbs]$ ps -ef|grep smon
54322    17981     1  0 Nov05 ?        00:00:02 ora_smon_ora10g
54322    22649     1  0 02:41 ?        00:00:00 ora_smon_12323
54322    22660 22299  0 02:42 pts/3    00:00:00 grep smon
[oracle10g@lixora dbs]$ 


這裡再次強調下 oracle_sid 和oracle 的db_name 是兩碼事; ORALCE_SID 僅僅是為來唯一標識oracle 的執行個體(instance)!


相關文章

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.