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问题处理