我在ubuntu 18.04中安装了oracle 12c r2,当我输入SqlPlus并执行查询时,它给我错误。
要安装Oracle,我遵循以下两个指南:
1- https://tutorialforlinux.com/2018/05/09/how-to-install-oracle-12c-r2-database-on-ubuntu-18-04-bionic-64bit-easy-guide/ 2- https://etc.to/confluence/pages/viewpage.action?pageId=20480023
给我的错误如下:
ERROR at line 1:
ORA-01034:ORACLE not available
Process ID:0
Session ID: Serial numbre:0
侦听器的状态(lsnrctl状态)给我以下错误:
Connectinc to (ADDRESS=(PROTOCOL=tcp)(HOST)(PORT=1521))
TNS-12541:TNS: no listener
tns-12560 TNS:protocol adapter error
TNS-00511: No listener
Linux error:111: Connection refused
有人可以帮助我吗?谢谢!
更多信息
现在,当我将lsnrctl设置为状态时,会得到此信息,但是在sqlplus中,仍然会出现上述错误
LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 19-OCT-2018 01:53:18
Copyright (c) 1991, 2016, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date 19-OCT-2018 01:52:14
Uptime 0 days 0 hr. 1 min. 5 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Log File /u01/app/oracle/diag/tnslsnr/andoni-VirtualBox/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=andoni-VirtualBox)(PORT=1521)))
The listener supports no services
The command completed successfully
启动错误:
Enter user-name: sys as sysdba
Enter password:
Connected to an idle instance.
SQL> startup
ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u01/app/oracle/product/12/dbhome_1/dbs/initSID.ora'
SQL>
答案 0 :(得分:0)
编辑tnsnames.ora文件 u01 / app / oracle / product / 12 / client_1 / network / admin / tnsnames.ora
MY_BASE_DEV = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.2.1) (PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = BASEDEV) ) ) MY_BASE_PROD = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.2.2) (PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = BASEPROD) ) )
答案 1 :(得分:0)
您可能必须设置ORACLE_HOME和ORACLE_SID环境变量:
需要执行以下操作:
export ORACLE_HOME='HOME PATH VARIABLE'
export ORACLE_SID=<SID>
sqlplus "/as sysdba"
startup
字段ORACLE_HOME, ORACLE_SID
应该匹配。诸如ORACLE_HOME
中没有尾部'/'之类的小事情很重要。