第一步,检查实例启动的状态
用sqlplus "/ as sysdba"进入sqlplus, 检查一下数据库实例的状态,
SQL>select status from v$instance.
如果实例没有启动,启动实例。如果实例已经启动, 运行alter system register.
启动实例时可能会碰到以下启动错误:
ORA-00119: invalid specification for system parameter LOCAL_LISTENER
ORA-00130: invalid listener address XIANGDE_LISTENER
解决方法如下:
$ ./sqlplus / as sysdba;
SQL> create pfile from spfil=‘D:\app\fy\product\11.2.0\dbhome_1\database\SPFILEXIANGDE.ORA';
执行该语句后在database下会生成INITxiangde.ORA文件
把INITxiangde.ORA文件中的*.local_listener的值改成,如:
*.local_listener='(ADDRESS_LIST=(Address=(Protocol=tcp) (Host=serverIP)(Port=1521)))'
再执行
SQL> create spfile from pfil=‘D:\app\fy\product\11.2.0\dbhome_1\database\INITxiangde.ORA';
SQL>startup
这样就启动了 (xiangde是SID)
11g和10g的区别是这个spfile的位置是放在dbs下,而11g是放在database下
第二步,修改LISTENER配置文件
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
(PROGRAM = extproc)
)
----------------
(SID_DESC =
(GLOBAL_DBNAME = ORCL)
(ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
(SID_NAME = ORCL)
)
----------------加上这部分,重启监听就ok了
)
--UNIX
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\app\Jose\product\11.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:C:\app\A\product\11.2.0\dbhome_1\bin\oraclr11.dll")
)
(SID_DESC =
(GLOBAL_DBNAME =PGARM)
(ORACLE_HOME =C:\app\A\product\11.2.0\dbhome_1)
(SID_NAME = PGARM)
)
)
--windows
第三步:重启监听服务