又发现一个有趣问题(instance_name)

[复制链接]
查看11 | 回复9 | 2007-7-8 18:54:59 | 显示全部楼层 |阅读模式
查看参数信息
SQL> show parameter instance_name;
NAME
TYPEVALUE
------------------------------------ ----------- ------------------------------
instance_name
stringora1
SQL> show parameter db_name;
NAME
TYPEVALUE
------------------------------------ ----------- ------------------------------
db_name
stringora1
3、修改实例名
SQL> alter system set instance_name=ORA3 scope=spfile;
System altered.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area134217728 bytes
Fixed Size
1278928 bytes
Variable Size
96472112 bytes
Database Buffers 33554432 bytes
Redo Buffers
2912256 bytes
Database mounted.
Database opened.
SQL> show parameter instance_name;
NAME
TYPEVALUE
------------------------------------ ----------- ------------------------------(实例名已修改)
instance_name
stringORA3
SQL> show parameter db_name;
NAME
TYPEVALUE
------------------------------------ ----------- ------------------------------
db_name
stringora1
SQL> alter session set sql_trace=true;
Session altered.
SQL> alter database backup controlfile to trace;
Database altered.
SQL> @gettrcname.sql
TRACE_FILE_NAME
--------------------------------------------------------------------------------
/export/home/oracle/product/10.0/admin/ora1/udump/ora1_ora_20210.trc
SQL> !more /export/home/oracle/product/10.0/admin/ora1/udump/ora1_ora_20210.trc
/export/home/oracle/product/10.0/admin/ora1/udump/ora1_ora_20210.trc
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
ORACLE_HOME = /export/home/oracle/product/10.0
System name:SunOS
Node name:solaris
Release:5.10
Version:Generic
Machine:i86pc
Instance name: ora1
Redo thread mounted by this instance: 1
Oracle process number: 13
Unix process pid: 20210, image: oracle@solaris (TNS V1-V3)
*** SERVICE NAME

SYS$USERS) 2007-10-17 09:14:35.768
发现了没???instance name还是ora1, 奇怪???
回复

使用道具 举报

千问 | 2007-7-8 18:54:59 | 显示全部楼层
这里显示的Instance name: ora1应该是sid
回复

使用道具 举报

千问 | 2007-7-8 18:54:59 | 显示全部楼层
最初由 warehouse 发布
[B]这里显示的Instance name: ora1应该是sid [/B]


修改ORACLE_SID=ora4
$ vi .profile
# This is the default standard profile provided to a user.
# They are expected to edit it to meet their own needs.
ORACLE_BASE=/export/home/oracle
ORACLE_HOME=$ORACLE_BASE/product/10.0
ORACLE_SID=ora4
NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
PATH=$ORACLE_HOME/bin:/bin:/sbin:/usr/ccs/bin:/usr/local/bin
LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/network/lib:/usr/local/lib:/usr/lib
DISPLAY=192.168.1.66:0.0
TMPDIR=/var/tmp
export ORALCE_BASE ORACLE_HOME ORACLE_SID NLS_LANG PATH LD_LIBRARY_PATH DISPLAY TMPDIR
umask 022
MAIL=/usr/mail/${LOGNAME:?}
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORA-32004: obsolete and/or deprecated parameter(s) specified[/COLOR]
ORACLE instance started.
Total System Global Area134217728 bytes
Fixed Size
1278928 bytes
Variable Size
96472112 bytes
Database Buffers 33554432 bytes
Redo Buffers
2912256 bytes
Database mounted.
Database opened.
$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.2.0 - Production on Wed Oct 17 09:47:31 2007
Copyright (c) 1982, 2005, Oracle.All Rights Reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> alter session set sql_trace=true;
Session altered.
SQL> alter database backup controlfile to trace;
Database altered.
SQL> @gettrcname.sql
TRACE_FILE_NAME
--------------------------------------------------------------------------------
/export/home/oracle/product/10.0/admin/ora1/udump/ora1_ora_21011.trc
SQL> !more /export/home/oracle/product/10.0/admin/ora1/udump/ora1_ora_21011.trc
/export/home/oracle/product/10.0/admin/ora1/udump/ora1_ora_21011.trc
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
ORACLE_HOME = /export/home/oracle/product/10.0
System name:SunOS
Node name:solaris
Release:5.10
Version:Generic
Machine:i86pc
Instance name: ora1
回复

使用道具 举报

千问 | 2007-7-8 18:54:59 | 显示全部楼层
修改了环境变量后有重新执行过 .profile 么
回复

使用道具 举报

千问 | 2007-7-8 18:54:59 | 显示全部楼层
v$instance 里面的instance_name =环境变量 ORACLE_SID
init parameter 里面的instance_name 相当于 lsnrctl service 里面的 动态注册的 instance_name
Instance".....", statusREADY, has 1 handler(s) for this service...
回复

使用道具 举报

千问 | 2007-7-8 18:54:59 | 显示全部楼层
最初由 rollingpig 发布
[B]v$instance 里面的instance_name =环境变量 ORACLE_SID
init parameter 里面的instance_name 相当于 lsnrctl service 里面的 动态注册的 instance_name
Instance".....", statusREADY, has 1 handler(s) for this service... [/B]

正解
回复

使用道具 举报

千问 | 2007-7-8 18:54:59 | 显示全部楼层
最初由 biti_rainy 发布
[B]修改了环境变量后有重新执行过 .profile 么 [/B]


忘了


重新在执行,发现不startup了


发现oracle会找spfileora4.ora的init parameter file!找不到了,就报错了
spfileora4.ora的文件名的一部分的是从ORACLE_SID那里来的>>>>

ora4[/COLOR]
回复

使用道具 举报

千问 | 2007-7-8 18:54:59 | 显示全部楼层
报这个错误,原理来是不小心把在全局启用了sql_trace=true.ORA-32004: obsolete and/or deprecated parameter(s) specified[/COLOR]
回复

使用道具 举报

千问 | 2007-7-8 18:54:59 | 显示全部楼层
最初由 warehouse 发布
[B]这里显示的Instance name: ora1应该是sid [/B]


证实了,的确是ORACLE_SID!

谢谢大家!
回复

使用道具 举报

千问 | 2007-7-8 18:54:59 | 显示全部楼层
最初由 stronghearted 发布
[B]报这个错误,原理来是不小心把在全局启用了sql_trace=true.ORA-32004: obsolete and/or deprecated parameter(s) specified[/COLOR] [/B]

alter system reset sql_trace scope=spfile;
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行