码迷,mamicode.com
首页 > 数据库 > 详细

关于环境变量 ORACLE_SID 简单谈下

时间:2014-11-25 23:37:20      阅读:312      评论:0      收藏:0      [点我收藏+]

标签:style   io   ar   color   sp   strong   文件   on   2014   

[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)!


关于环境变量 ORACLE_SID 简单谈下

标签:style   io   ar   color   sp   strong   文件   on   2014   

原文地址:http://blog.csdn.net/lixora/article/details/41490421

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!