用了网上的办法:
1、修改listener.ora的参数,把动态的参数设置为静态的参数,红色标注部分
位置D:\oracle\product\10.2.0\db_1\NETWORK\ADMIN
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = D:\oracle\product\10.1.0\db_1)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME = orcl) //如果已经有这个orcl了,这个文件就不用修改
(ORACLE_HOME = D:\oracle\product\10.1.0\db_1) //这里要根据你的实际路径来
(SID_NAME = orcl)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = lypch )(PORT = 1521))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
)
)
)
2、通过修改tnsnames.ora的参数,红色表注部分
# tnsnames.ora Network Configuration File: D:\oracle\product\10.1.0\db_1
\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
AMMICLY =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = lypch )(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
(UR=A) //加上这个,不知道是什么意思
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
3、然后 sqlplus /nolog
SQL>alter database mount;
SQL>alter database open;
发现报错,SP2-0640: Not connected
4、然后我去服务里面重新启动了OracleServiceORACLEDB和OracleServiceORCL
不放心的话也可以重启一下OracleOraDb11g_home3TNSListener服务
然后登录就不报错了,我也不知道是为什么