The Oracle 11GR2 database has recently been installed on the Red Hat 6.6 virtual machine and is installed with no problem, and the host can access the database on the virtual machine. However, after restarting the virtual machine, the host cannot access the database, prompting for an error:
PS c:\users\13842> sqlplus sys/[email protected] as Sysdbasql*plus:release 11.2.0.1.0 Production on Saturday February 25 16:56:47 2017Copyright (c) 1982, Oracle. All rights reserved. Error:ora-12541:tns: No listener Please enter user name:
Found no listener, and then to the virtual machine to view the listener status, the results are as follows:
Lsnrctl> statusconnecting to (description= (address= (PROTOCOL=IPC) (key=extproc1521)) Tns-12541:tns:no Listener Tns-12560:tns:protocol Adapter error Tns-00511:no listener Linux error:2: No such file or directoryconnecting t O (description= (address= (protocol=tcp) (Host=localhost) (port=1521)) Tns-12541:tns:no listener Tns-12560:tns: Protocol Adapter error Tns-00511:no listener Linux Error:111:connection refused
The discovery is that the listener is not started and can be started:
[[email protected] desktop]$ lsnrctl startlsnrctl for linux:version 11.2.0.1.0-production on 25-FEB-2017 18:13:56C Opyright (c) 1991, Oracle. All rights reserved. Starting/home/app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr:please wait ... Tnslsnr for linux:version 11.2.0.1.0-productionsystem parameter file is/home/app/oracle/product/11.2.0/dbhome_1/ Network/admin/listener.oralog messages Written to/home/app/oracle/diag/tnslsnr/localhost/listener/alert/ Log.xmllistening on: (Description= (Address= (PROTOCOL=IPC) (key=extproc1521)) Listening on: (Description= (ADDRESS= ( PROTOCOL=TCP) (Host=localhost) (port=1521)) Connecting to (Description= (address= (PROTOCOL=IPC) (KEY=EXTPROC1521))) STATUS of the LISTENER------------------------Alias listenerversion Tnslsnr for Linu X:version 11.2.0.1.0-productionstart Date 25-feb-2017 18:13:56uptime 0 days 0 hr. 0 m In. 0 Sectrace level Offsecurity On:local OS authenticationsnmp Offlistener Parameter file/home/app/oracle/product/11.2.0/db Home_1/network/admin/listener.oralistener Log File/home/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xml Listening Endpoints Summary ... (Description= (address= (PROTOCOL=IPC) (key=extproc1521))) (Description= (address= (protocol=tcp) (Host=localhost) (port=1521))) The listener supports no servicesthe command completed successfully
After the launch, the new problem appears again, in the bottom line 2nd, Tip: The Listener support no services. Indicates that the Oracle service is not registered with the listener, and the use of clients on the host to connect to the database will prompt an error:
Error:ora-12514:tns: Listener currently does not recognize the requested service in the connection descriptor
Next, configure the listening service information to open the network management interface on the virtual machine:
[Email protected] desktop]$ netmgr
The following interface appears, click Local->listeners->listener->database services->add Database:
Three parameter settings:
· Global Database Name:
Sql> select * from Global_name; Global_name--------------------------------------------------------------------ORCL
· Oracle Home dictionary:oracle installation path, typically: /app/oracle/product/11.2.0/dbhome_1
· SID: Default ORCL
Click File->save Network Configuration.
Restart the database to resolve.
Oracle Monitoring Service Configuration