今天重新搭建了DB虚拟机,启动数据库以后,使用sqlplus pacscde/passtest888@vmdev命令进行登陆,居然报错了饿,
报错信息如下:
SQL*Plus: Release 10.2.0.5.0 - Production on Tue Apr 9 17:46:49 2013
[vm10g@Test-Dev9-043_db10g admin]$ sqlplus pacscde/passtest888@vmdev
SQL*Plus: Release 10.2.0.5.0 - Production on Tue Apr 9 17:47:02 2013
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified
Enter user-name:
-----------------------------------------------------------------------------------------------------------------------------
解决办法如下:
在 $ORACLE_HOMEt/network/admin/目录下建立tnsnames.ora文件,其内容如下:
vmdev=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.6.165)(PORT=1532))(CONNECT_DATA=(SID=vmdev)))
再次连接数据库成功!
[vm10g@Test-Dev9-043_db10g admin]$ sqlplus pacscde/passtest888@vmdev
SQL*Plus: Release 10.2.0.5.0 - Production on Tue Apr 9 17:49:03 2013
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
SQL>
SQL>
SQL>