oracle Ubuntu 14.04 中 SQL*Plus 的默认用户名和密码?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/31910964/
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
Default username and password for SQL*Plus in Ubuntu 14.04?
提问by sanchitkum
I followed the instructions mentioned to install SQL*Plus from Oracle Instant Clientand How to Install SQLPlus.
我按照提到的说明从Oracle Instant Client安装 SQL*Plus和如何安装 SQLPlus。
SQL*Plus is successfully installed on my system but I cannot login and use it. There is a similar question hereand here, but it is does not solve my problem.
SQL*Plus 已成功安装在我的系统上,但我无法登录和使用它。这里和这里有一个类似的问题,但它不能解决我的问题。
On googling, most sources said that we enter a password upon installation, but I was neither prompted nor displayed any password. (I can attach terminal screen shots if it is required)
在谷歌上搜索,大多数消息来源说我们在安装时输入密码,但我既没有提示也没有显示任何密码。(如果需要,我可以附上终端屏幕截图)
Is there any way I can login and start using SQL*Plus? Is there any default username or password?
有什么方法可以登录并开始使用 SQL*Plus?是否有任何默认用户名或密码?
I am stuck here: sqlplus username/password@//dbhost:1521/SID
我被困在这里: sqlplus username/password@//dbhost:1521/SID
I need a valid username and password. scott/tiger
was of no help.
我需要一个有效的用户名和密码。scott/tiger
没有帮助。
sqlplus / as sysdba
gives this -> ERROR: ORA-12162: TNS:net service name is incorrectly specified
and prompts me to enter username and password which I don't have.
sqlplus / as sysdba
给出这个 ->ERROR: ORA-12162: TNS:net service name is incorrectly specified
并提示我输入我没有的用户名和密码。
I originally asked this question on AskUbuntufeeling its more appropriate there. If this question does not belong here, please comment and I will remove it.
我最初在AskUbuntu上问了这个问题,感觉在那里更合适。如果这个问题不属于这里,请发表评论,我会删除它。
EDIT:
编辑:
I executed these statements after reading from here:
我从这里阅读后执行了这些语句:
ORACLE_HOME=/u01/oracle; export ORACLE_HOME
ORACLE_HOME=/u01/oracle; export ORACLE_HOME
ORACLE_SID=asdb; export ORACLE_SID
ORACLE_SID=asdb; export ORACLE_SID
Now, On executing sqlplus / as sysdba
I get the error message
ERROR: ORA-12545: Connect failed because target host or object does not exist
现在,在执行时sqlplus / as sysdba
我收到错误消息
ERROR: ORA-12545: Connect failed because target host or object does not exist
On executing sqlplus64 scott/tiger@//dbhost:1521/SID
I get the error message
ERROR: ORA-12154: TNS:could not resolve the connect identifier specified
在执行时,sqlplus64 scott/tiger@//dbhost:1521/SID
我收到错误消息
ERROR: ORA-12154: TNS:could not resolve the connect identifier specified
回答by stee1rat
It does not have anything to do with Ubuntu. When you enter sqlplus / as sysdba
sqlplus tries to connect to the local database, which sid and oracle home should be specified by the environment variables ORACLE_SID
and ORACLE_HOME
. You, obviously, have not defined these variables.
它与 Ubuntu 没有任何关系。进入sqlplus / as sysdba
sqlplus尝试连接本地数据库时,环境变量ORACLE_SID
和ORACLE_HOME
. 显然,您还没有定义这些变量。
All you need is to get the username, password, host name, where your database is located, port for the listener (the default port is 1521) and the Oracle SID. Then connect with sqlplus username/password@//dbhost:1521/SID
. If you know the password for SYS user and have orapwSID file in the $ORACLE_HOME/dbs directory on the server side, you can connect with sys with the following command: sqlplus sys/password@//dbhost:1521/SID as sysdba
.
您只需要获取用户名、密码、主机名、数据库所在的位置、侦听器的端口(默认端口为 1521)和 Oracle SID。然后与sqlplus username/password@//dbhost:1521/SID
. 如果您知道 SYS 用户的密码并且在服务器端的 $ORACLE_HOME/dbs 目录中有 orapwSID 文件,您可以使用以下命令与 sys 连接:sqlplus sys/password@//dbhost:1521/SID as sysdba
.
回答by Farah Shaikh
moving everything into instant_client_11_*
directory worked for me.
将所有内容移动到instant_client_11_*
目录中对我有用。