简体   繁体   English

Oracle - 一台服务器上的多个数据库,连接问题

[英]Oracle - multiple databases on one server, connect issue

I'm new in Oracle Database and so far I was using only MS SQL Server. 我是Oracle数据库的新手,到目前为止我只使用MS SQL Server。 I created two databases on my laptop (habit from MS), which is running Windows 8. 我在笔记本电脑上创建了两个数据库(来自MS的习惯),它运行的是Windows 8。

I stoped those two databases using SQL Plus and "shutdown normal" command. 我使用SQL Plus和“shutdown normal”命令停止了这两个数据库。 Before stoping those databases, I connected to them using "user/password@database_SID" syntax. 在停止这些数据库之前,我使用“user / password @ database_SID”语法连接到它们。 After shutdown I can't choose which database I want to connect because when using "@Database_SID" I've got this error: 关机后我无法选择要连接的数据库,因为使用“@Database_SID”时出现此错误:

"ORA-12514: TNS:listener does not currently know of service requested in connect descriptor". “ORA-12514:TNS:监听器当前不知道连接描述符中请求的服务”。

How can I define which database I want to connect whithout "@Database_SID" syntax? 如何在没有“@Database_SID”语法的情况下定义要连接的数据库?

Thanks a lot for help! 非常感谢您的帮助!

Locally on your machine, you use IPC - Inter Process Communication to login to your database in order to do administrative work. 在您的机器上,您使用IPC - 进程间通信登录到您的数据库以执行管理工作。 (startup, shutdown, mount, etc) (启动,关闭,挂载等)

C:\>set ORACLE_SID=DB1
C:\>sqlplus / as sysdba -- make sure you are member of group "ORA_DBA"
SQL>startup

C:\>set ORACLE_SID=DB2
C:\>sqlplus / as sysdba 
SQL>startup

ORA-12514 indicates the database has not registered with the listener because database status is shutdown ORA-12514表示数据库尚未向侦听器注册,因为数据库状态已关闭

Note. 注意。 The Windows Service OracleService<SID> can have status "Running", but the database can be stopped (shutdown) Windows服务OracleService<SID>状态为“正在运行”,但数据库可以停止(关闭)

There is no need to have two physical databases running on your laptop. 您的笔记本电脑上无需运行两个物理数据库。 Waste of resources. 浪费资源。 In Oracle terms you need two schemas. 在Oracle术语中,您需要两个模式。

Make sure the listener is running. 确保侦听器正在运行。

On Windows, Oracle seems to use the networking layer, even when connecting locally. 在Windows上,Oracle似乎使用网络层,即使在本地连接时也是如此。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM