当前位置:Gxlcms > 数据库问题 > CentOS7 Mini安装Oracle后用PL/SQL连接数据库

CentOS7 Mini安装Oracle后用PL/SQL连接数据库

时间:2021-07-01 10:21:17 帮助过:2人阅读

= (SID_LIST = (SID_DESC = (SID_NAME = orcl) (ORACLE_HOME = /opt/oracle/product/11gR2) ) ) LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.36.133)(PORT = 1521)) ) ) ADR_BASE_LISTENER = /opt/oracle

这个文件改好后,又把tnsnames.ora文件中localhost改为本地IP,不知这个是否起了作用,反正改了也没错

# tnsnames.ora Network Configuration File: /opt/oracle/product/11gR2/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.36.133)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )

修改完这些后,停止监听,启动监听

[oracle@localhost root]$ lsnrctl stop
[oracle@localhost root]$ lsnrctl start

3、再用oracle net manager测试连接数据库,报错

ORA-01034: ORACLE not available

ORA-27101: shared memory realm does not exist Linux-x8

解决方法:

centos7本机系统oracle用户登录,连接数据库

[oracle@localhost ~]$ sqlplus /nolog

SQL> conn / as sysdba

SQL> startup

如果startup报已经启动,则先关闭,再启动

SQL> shutdown immediate

SQL> startup

 

CentOS7 Mini安装Oracle后用PL/SQL连接数据库

标签:

人气教程排行