当前位置: 首页 > java >正文

ORA-12547: TNS:lost contact

[oracle@euler02 admin]$ cat /etc/os-release 
NAME="openEuler"
VERSION="24.03 (LTS-SP2)"
ID="openEuler"
VERSION_ID="24.03"
PRETTY_NAME="openEuler 24.03 (LTS-SP2)"
ANSI_COLOR="0;31"

欧拉系统openEuler 24.03 (LTS-SP2)可成功安装oracle11g

[oracle@euler02 ~]$ echo $LD_LIBRARY_PATH
/home/db/oracle/product/11.2.0/dbhome_1/lib:/home/db/oracle/product/11.2.0/dbhome_1/oracm/lib:/lib:/usr/lib:/usr/local/lib
[oracle@euler02 ~]$ ll $ORACLE_HOME/rdbms/lib/config.o
-rw-r--r--. 1 oracle oinstall 1256 Sep  4 10:14 /home/db/oracle/product/11.2.0/dbhome_1/rdbms/lib/config.o
[oracle@euler02 ~]$ ll $ORACLE_HOME/bin/oracle
-rwsr-s--x 1 oracle oinstall 239336848 Sep  4 10:41 /home/db/oracle/product/11.2.0/dbhome_1/bin/oracle
[oracle@euler02 ~]$ chmod 6751 $ORACLE_HOME/bin/oracle
[oracle@euler02 ~]$ ll $ORACLE_HOME/bin/oracle
-rwsr-s--x 1 oracle oinstall 239336848 Sep  4 10:41 /home/db/oracle/product/11.2.0/dbhome_1/bin/oracle

[oracle@euler02 ~]$ cd /home/db/oracle/product/11.2.0/dbhome_1/assistants/dbca/templates
[oracle@euler02 templates]$ dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbname bims -sid bims -sysPassword abcd1234 -systemPassword abcd1234 -responseFile NO_VALUE -datafileDestination /home/db/oracle/oradata -redoLogFileSize 200 -recoveryAreaDestination NO_VALUE -storageType FS -characterSet ZHS16GBK -nationalCharacterSet AL16UTF16 -sampleSchema false -memoryPercentage 60 -databaseType OLTP -emConfiguration NONE
Copying database files
1% complete
2% complete
4% complete
37% complete
Creating and starting Oracle instance
38% complete
40% complete
45% complete
50% complete
51% complete
56% complete
57% complete
61% complete
62% complete
Completing Database Creation
66% complete
70% complete
73% complete
74% complete
85% complete
86% complete
98% complete
100% complete
Look at the log file "/home/db/oracle/cfgtoollogs/dbca/bims/bims8.log" for further details.
[oracle@euler02 templates]$ more /home/db/oracle/cfgtoollogs/dbca/bims/bims8.log
Following parameters do not meet the recommended minimum size requirements:

An SGA size of at least 210MB is recommended.

Do you want Database Configuration Assistant to change the parameters?.
Copying database files
DBCA_PROGRESS : 1%
DBCA_PROGRESS : 2%
ORA-12547: TNS:lost contact

ORA-12547: TNS:lost contact

DBCA_PROGRESS : 4%
DBCA_PROGRESS : 37%
Creating and starting Oracle instance
ORA-12547: TNS:lost contact

DBCA_PROGRESS : 38%
ORA-12547: TNS:lost contact

DBCA_PROGRESS : 40%
ORA-12547: TNS:lost contact

DBCA_PROGRESS : 45%
DBCA_PROGRESS : 50%
DBCA_PROGRESS : 51%
ORA-12547: TNS:lost contact

DBCA_PROGRESS : 56%
ORA-12547: TNS:lost contact

ORA-12547: TNS:lost contact

ORA-12547: TNS:lost contact

DBCA_PROGRESS : 57%
ORA-12547: TNS:lost contact

DBCA_PROGRESS : 61%
DBCA_PROGRESS : 62%
Completing Database Creation
DBCA_PROGRESS : 66%
DBCA_PROGRESS : 70%
ORA-12547: TNS:lost contact

DBCA_PROGRESS : 73%
DBCA_PROGRESS : 74%
ORA-12547: TNS:lost contact

DBCA_PROGRESS : 85%
ORA-12547: TNS:lost contact

DBCA_PROGRESS : 86%
ORA-12547: TNS:lost contact

ORA-12547: TNS:lost contact

ORA-12547: TNS:lost contact

DBCA_PROGRESS : 98%
DBCA_PROGRESS : 100%
Database creation complete. For details check the logfiles at:
 /home/db/oracle/cfgtoollogs/dbca/bims.
Database Information:
Global Database Name:bims
System Identifier(SID):bims
[oracle@euler02 templates]$ 

[oracle@euler02 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Thu Sep 4 10:50:11 2025

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

ERROR:
ORA-12547: TNS:lost contact


Enter user-name: ^C

检查了所有可能性:

造成错误“ORA-12547: TNS:lost contact”的常见原因有哪些?-CSDN博客

最后发现原因是/etc/sysctl.conf的kernel.shmmax = 8388608给的太小了,本来是8G的少乘了一个1024,太大意了。

[oracle@euler02 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Thu Sep 4 10:55:21 2025

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> exit
Disconnected

成功dbca

[oracle@euler02 templates]$ dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbname bims -sid bims -sysPassword abcd1234 -systemPassword abcd1234 -responseFile NO_VALUE -datafileDestination /home/db/oracle/oradata -redoLogFileSize 200 -recoveryAreaDestination NO_VALUE -storageType FS -characterSet ZHS16GBK -nationalCharacterSet AL16UTF16 -sampleSchema false -memoryPercentage 60 -databaseType OLTP -emConfiguration NONE
Copying database files
1% complete
3% complete
11% complete
18% complete
26% complete
37% complete
Creating and starting Oracle instance
40% complete
45% complete
50% complete
55% complete
56% complete
60% complete
62% complete
Completing Database Creation
66% complete
70% complete
73% complete
85% complete
96% complete
100% complete
Look at the log file "/home/db/oracle/cfgtoollogs/dbca/bims/bims10.log" for further details.
[oracle@euler02 templates]$ netca -silent -responsefile /home/db/oracle/product/11.2.0/dbhome_1/assistants/netca/netca.rsp

Parsing command line arguments:
    Parameter "silent" = true
    Parameter "responsefile" = /home/db/oracle/product/11.2.0/dbhome_1/assistants/netca/netca.rsp
Done parsing command line arguments.
Oracle Net Services Configuration:
Profile configuration complete.
Oracle Net Listener Startup:
    Running Listener Control: 
      /home/db/oracle/product/11.2.0/dbhome_1/bin/lsnrctl start LISTENER
    Listener Control complete.
    Listener started successfully.
Listener configuration complete.
Oracle Net Services configuration successful. The exit code is 0
[oracle@euler02 templates]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 04-SEP-2025 11:09:33

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                04-SEP-2025 11:09:27
Uptime                    0 days 0 hr. 0 min. 6 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /home/db/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File         /home/db/oracle/diag/tnslsnr/euler02/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=euler02)(PORT=1521)))
The listener supports no services
The command completed successfully
[oracle@euler02 templates]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Thu Sep 4 11:09:37 2025

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> show parameter name;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
cell_offloadgroup_name               string
db_file_name_convert                 string
db_name                              string      bims
db_unique_name                       string      bims
global_names                         boolean     FALSE
instance_name                        string      bims
lock_name_space                      string
log_file_name_convert                string
processor_group_name                 string
service_names                        string      bims
SQL> alter system register;

System altered.

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@euler02 templates]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 04-SEP-2025 11:09:54

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                04-SEP-2025 11:09:27
Uptime                    0 days 0 hr. 0 min. 27 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /home/db/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File         /home/db/oracle/diag/tnslsnr/euler02/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=euler02)(PORT=1521)))
Services Summary...
Service "bims" has 1 instance(s).
  Instance "bims", status READY, has 1 handler(s) for this service...
Service "bimsXDB" has 1 instance(s).
  Instance "bims", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@euler02 templates]$ sqlplus sys/abcd1234@bims as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Thu Sep 4 11:10:10 2025

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified


Enter user-name: ^C
[oracle@euler02 templates]$ tnsping bims

TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 04-SEP-2025 11:10:22

Copyright (c) 1997, 2013, Oracle.  All rights reserved.

Used parameter files:
/home/db/oracle/product/11.2.0/dbhome_1/network/admin/sqlnet.ora

TNS-03505: Failed to resolve name

[oracle@euler02 templates]$ cd /home/db/oracle/product/11.2.0/dbhome_1/network/admin/
[oracle@euler02 admin]$ ll
total 16
-rw-r--r--  1 oracle oinstall  372 Sep  4 11:09 listener.ora
drwxr-xr-x. 2 oracle oinstall 4096 Sep  4 10:07 samples
-rw-r--r--. 1 oracle oinstall  381 Dec 17  2012 shrept.lst
-rw-r--r--  1 oracle oinstall  223 Sep  4 11:09 sqlnet.ora

[oracle@euler02 admin]$ vi tnsnames.ora 
BIMS =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.207.48)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = bims)
    )
  )

[oracle@euler02 admin]$ sqlplus sys/abcd1234@bims as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Thu Sep 4 11:11:38 2025

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

参考:

oracle11g+linux7.x快速静默安装_specify a instance name that starts with an alphab-CSDN博客

欧拉适配ORACLE

Euler系统安装oracle问题处理

http://www.xdnf.cn/news/20027.html

相关文章:

  • 算法模板(Java版)_字符串、并查集和堆
  • matlab版本粒子群算法(PSO)在路径规划中的应用
  • PDF批量加盖电子骑缝章的方法!高效办公必备
  • 每天学习一点点之湿敏等级以及肖特基二极管
  • C#之LINQ
  • wps的excel如何转为谷歌在线表格
  • testng.xml
  • Opencv: cv::LUT()深入解析图像块快速查表变换
  • sqlserver2008导入excel表数据遇到的问题
  • 无线路由器:从家庭上网到智慧互联的核心设备
  • 人工智能学习:LR和SVM的联系与区别?
  • AI助力软件UI概念设计:卓伊凡收到的客户设计图引发的思考
  • Node.js轻松生成动态二维码
  • C++对象模型的底层逻辑
  • 【数据分享】土地利用矢量shp数据分享-福建
  • 从关键词到语义理解:小陌引擎如何重构AI搜索优化逻辑?
  • Android 12 在 Rockchip 平台上的分区表parametet.txt 自动生成机制解析
  • 【单片机day03】
  • vue3存储/获取本地或会话存储,封装存储工具,结合pina使用存储
  • 电子病历空缺句的语言学特征描述与自动分类探析(以GPT-5为例)(下)
  • LLM重排器落地难题:如何破解速度与精度的工程困局?
  • Claude Code Router实现默认回复中文回复
  • 轻量级的磁盘碎片整理程序-开箱急用快速清理磁盘垃圾和碎片-供大家学习研究参考
  • Redis 客户端与服务器:银行的 “客户服务系统” 全流程
  • LeetCode 面试经典 150_矩阵_螺旋矩阵(35_54_C++_中等)(按层模拟)
  • K8S容器POD内存快照导出分析处理方案
  • Nano-Banana使用教程
  • websocket的key和accept分别是多少个字节
  • Widget 生命周期
  • 【Python基础】 13 Rust 与 Python 注释对比笔记