如何使用 sqlplus 作为 sysdba 连接到不同的 oracle 实例?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/38744591/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to connect to different oracle instance as sysdba using sqlplus?
提问by jcubic
When I run sqlplus it connect to orcl2 instance but I need to connect to orcl I can connect to my normal user using this:
当我运行 sqlplus 它连接到 orcl2 实例但我需要连接到 orcl 我可以使用这个连接到我的普通用户:
sqlplus user/passowrd@//localhost:1521/orcl
but how can I connect as sysdba? I've try:
但是我怎样才能以 sysdba 的身份连接呢?我试过:
sqlplus / as sysdba@orcl
but it connect to orcl2 instance.
但它连接到 orcl2 实例。
回答by sstan
Set the ORACLE_SID
environment variable to orcl
.
将ORACLE_SID
环境变量设置为orcl
.
Then sqlplus / as sysdba
will connect to orcl
as expected.
然后sqlplus / as sysdba
将按orcl
预期连接。