如何从WSL2连接到Windows Oracle数据库
我在Windows10中安装了Oracle 19C数据库,并且在同一笔记本电脑中启用了WSL2。 我想从我的WSL2-Ubuntu发行版中访问数据库。是否可以? 我已经在WSL2中安装了InstantClient和SQLPLUS软件包,但是当我尝试使用SQLPlus连接时,它无法连接到Windows数据库。 有人可以帮助我从WSL2连接到该数据库吗?
sqlplus hr/hr@//172.22.100.119/orcl
SQL*Plus: Release 21.0.0.0.0 - Production on Fri Jul 1 15:52:02 2022
Version 21.6.0.0.0
Copyright (c) 1982, 2022, Oracle. All rights reserved.
ERROR:
ORA-12170: TNS:Connect timeout occurred
Enter user-name:
sqlplus
SQL*Plus: Release 21.0.0.0.0 - Production on Fri Jul 1 15:50:31 2022
Version 21.6.0.0.0
Copyright (c) 1982, 2022, Oracle. All rights reserved.
Enter user-name: spdorcl@orcl
Enter password:
ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified
Enter user-name:
sqlplus
SQL*Plus: Release 21.0.0.0.0 - Production on Fri Jul 1 15:48:54 2022
Version 21.6.0.0.0
Copyright (c) 1982, 2022, Oracle. All rights reserved.
Enter user-name: SYSTEM
Enter password:
ERROR:
ORA-12162: TNS:net service name is incorrectly specified
Enter user-name: sys
Enter password:
ERROR:
ORA-12162: TNS:net service name is incorrectly specified
I have a Oracle 19c database installed in windows10 and also I have WSL2 enabled in same laptop.
I would like to access the database from my WSL2- ubuntu distro. is it possible?
I have installed instantclient and sqlplus package in wsl2 but when I try to connect using sqlplus it couldn't able to connect to the windows database.
can someone please help me to connect to that database from WSL2?
sqlplus hr/hr@//172.22.100.119/orcl
SQL*Plus: Release 21.0.0.0.0 - Production on Fri Jul 1 15:52:02 2022
Version 21.6.0.0.0
Copyright (c) 1982, 2022, Oracle. All rights reserved.
ERROR:
ORA-12170: TNS:Connect timeout occurred
Enter user-name:
sqlplus
SQL*Plus: Release 21.0.0.0.0 - Production on Fri Jul 1 15:50:31 2022
Version 21.6.0.0.0
Copyright (c) 1982, 2022, Oracle. All rights reserved.
Enter user-name: spdorcl@orcl
Enter password:
ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified
Enter user-name:
sqlplus
SQL*Plus: Release 21.0.0.0.0 - Production on Fri Jul 1 15:48:54 2022
Version 21.6.0.0.0
Copyright (c) 1982, 2022, Oracle. All rights reserved.
Enter user-name: SYSTEM
Enter password:
ERROR:
ORA-12162: TNS:net service name is incorrectly specified
Enter user-name: sys
Enter password:
ERROR:
ORA-12162: TNS:net service name is incorrectly specified
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论