首页>计算机>Oracle认证>学习教程>正文
Oracle的db_name和instance_name

www.zige365.com 2007-8-6 11:43:55 点击:发送给好友 和学友门交流一下 收藏到我的会员中心
 注意,此时试图加载数据库时出现错误,因为当前数据库被另外一个实例(instance)加载。在非并行模式(Ops/RAC)下,一个数据库同时只能被一个实例加载。

此时已经启动了两个数据库实例,从后台进程可以看出:

[oracle@jumper dbs]$ ps -ef|grep ora
oracle   27321     1  0 Jul14 ?        00:00:00 ora_pmon_eygle
oracle   27323     1  0 Jul14 ?        00:00:00 ora_dbw0_eygle
oracle   27325     1  0 Jul14 ?        00:00:00 ora_lgwr_eygle
oracle   27327     1  0 Jul14 ?        00:00:00 ora_ckpt_eygle
oracle   27329     1  0 Jul14 ?        00:00:32 ora_smon_eygle
oracle   27331     1  0 Jul14 ?        00:00:00 ora_reco_eygle
oracle   27333     1  0 Jul14 ?        00:00:00 ora_cjq0_eygle
root     15388   656  0 14:02 ?        00:00:00 sshd: oracle [priv]
oracle   15390 15388  0 14:02 ?        00:00:00 sshd: oracle@pts/2
oracle   15391 15390  0 14:02 pts/2    00:00:00 -bash
oracle   15445     1  0 14:04 ?        00:00:00 ora_pmon_julia
oracle   15447     1  0 14:04 ?        00:00:00 ora_dbw0_julia
oracle   15449     1  0 14:04 ?        00:00:00 ora_lgwr_julia
oracle   15451     1  0 14:04 ?        00:00:00 ora_ckpt_julia
oracle   15453     1  0 14:04 ?        00:00:00 ora_smon_julia
oracle   15455     1  0 14:04 ?        00:00:00 ora_reco_julia
oracle   15457     1  0 14:04 ?        00:00:00 ora_cjq0_julia
oracle   15459 15391  0 14:04 pts/2    00:00:00 ps -ef
oracle   15460 15391  0 14:04 pts/2    00:00:00 grep ora

我们关闭eygle这个数据库实例:

[oracle@jumper dbs]$ export ORACLE_SID=eygle
[oracle@jumper dbs]$ sqlplus "/ as sysdba"

SQL*Plus: Release 9.2.0.4.0 - Production on Tue Jul 25 14:04:39 2006

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.


Connected to:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning option
JServer Release 9.2.0.4.0 - Production

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning option
JServer Release 9.2.0.4.0 - Production

此时就可以通过实例julia加载并打开db_name=eygle的数据库了: 

[oracle@jumper dbs]$ export ORACLE_SID=julia
[oracle@jumper dbs]$ sqlplus "/ as sysdba"

SQL*Plus: Release 9.2.0.4.0 - Production on Tue Jul 25 14:05:06 2006

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.


Connected to:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning option
JServer Release 9.2.0.4.0 - Production

SQL> alter database mount;
alter database mount
*
ERROR at line 1:
ORA-01990: error opening password file '/opt/oracle/product/9.2.0/dbs/orapw'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3


SQL> alter database open;

Database altered.

SQL> select name from v$datafile;

NAME
----------------------------------------------------------------------------
/opt/oracle/oradata/eygle/system01.dbf
/opt/oracle/oradata/eygle/undotbs01.dbf
/opt/oracle/oradata/eygle/users01.dbf
/opt/oracle/oradata/eygle/eygle01.dbf

SQL> ! ps -ef|grep ora
root     15388   656  0 14:02 ?        00:00:00 sshd: oracle [priv]
oracle   15390 15388  0 14:02 ?        00:00:00 sshd: oracle@pts/2
oracle   15391 15390  0 14:02 pts/2    00:00:00 -bash
oracle   15445     1  0 14:04 ?        00:00:00 ora_pmon_julia
oracle   15447     1  0 14:04 ?        00:00:00 ora_dbw0_julia
oracle   15449     1  0 14:04 ?        00:00:00 ora_lgwr_julia
oracle   15451     1  0 14:04 ?        00:00:00 ora_ckpt_julia
oracle   15453     1  0 14:04 ?        00:00:00 ora_smon_julia
oracle   15455     1  0 14:04 ?        00:00:00 ora_reco_julia
oracle   15457     1  0 14:04 ?        00:00:00 ora_cjq0_julia
oracle   15513 15391  0 14:05 pts/2    00:00:00 sqlplus           
oracle   15514 15513  3 14:05 ?        00:00:01 oraclejulia (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle   15515 15513  0 14:05 pts/2    00:00:00 /bin/bash -c  ps -ef|grep ora
oracle   15516 15515  0 14:05 pts/2    00:00:00 ps -ef

SQL> show parameter instance_name

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
instance_name                        string      julia
SQL> show parameter db_name

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_name                              string      eygle

本新闻共3页,当前在第2页  1  2  3  

我要投稿 新闻来源:考试吧 编辑: 作者:
相关新闻
高手攻关心得:RHCE实战详细经验
如何学习Oracle?
我学Oracle和考OCP的经验与大家一起分享
使用Oracle9i数据库程序的相关注意事项
OCP DBA考证轻松过关详解
Oracle 的入门心得