# listener.ora Network Configuration File: /u01/oracle/11G/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /u01/oracle/11G)
(PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.55.56)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
)
[oracle@Slave1Hadoop51 admin]$ vi listener.ora
[oracle@Slave1Hadoop51 admin]$ cat listener.ora
# listener.ora Network Configuration File: /u01/oracle/11G/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /u01/oracle/11G)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME =db01)
(ORACLE_HOME = /u01/oracle/11G)
(SID_NAME =db01)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.55.56)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
)
-- 不是远程连接
[oracle@Slave1Hadoop51 admin]$ sqlplus scott/scott@db01
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Feb 3 06:26:21 2015
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
[oracle@Slave1Hadoop51 admin]$ sqlplus scott/scott@192.168.55.56:1521/db01
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Feb 3 06:27:17 2015
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL> show parameter name
ORA-00942: table or view does not exist
SQL> select instance_name from v$instance;
select instance_name from v$instance
*
ERROR at line 1:
ORA-00942: table or view does not exist
SQL> conn / as sysdba
Connected.
SQL> select instance_name from v$instance;
INSTANCE_NAME
----------------
db01
SQL> show parameter name
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_file_name_convert string
db_name string db01
db_unique_name string db01
global_names boolean FALSE
instance_name string db01
lock_name_space string
log_file_name_convert string
service_names string db01
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
[oracle@Slave1Hadoop51 admin]$ sqlplus scott/scott@192.168.55.55:1521/db01
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Feb 3 06:30:31 2015
Copyright (c) 1982, 2005, Oracle. All rights reserved.
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor
Enter user-name:
ERROR:
ORA-01017: invalid username/password; logon denied
Enter user-name:
ERROR:
ORA-01017: invalid username/password; logon denied
SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
---------监听start-----------
Connecting to 192.168.55.55:22...
Connection established.
To escape to local shell, press 'Ctrl+Alt+]'.
Last login: Wed Feb 4 22:18:45 2015 from 192.168.55.100
[oracle@MasterHadoop50 ~]$ lsnrctl status
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 04-FEB-2015 23:55:25
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.55.55)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 04-FEB-2015 00:30:38
Uptime 0 days 23 hr. 24 min. 46 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/oracle/11G/network/admin/listener.ora
Listener Log File /u01/oracle/11G/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.55.55)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
[oracle@MasterHadoop50 ~]$ cd /u01/oracle/11G/network/admin/
[oracle@MasterHadoop50 admin]$ ll
total 72
drwxr-xr-x 3 oracle dba 4096 Feb 1 18:40 db01
-rw-r--r-- 1 oracle dba 469 Feb 1 18:20 listener.ora
-rw-r--r-- 1 oracle dba 475 Feb 1 18:16 listener.ora.bak
drwxr-x--- 2 oracle dba 4096 Feb 1 17:44 samples
-rw-r----- 1 oracle dba 172 Dec 26 2003 shrept.lst
-rw-r--r-- 1 oracle dba 1372 Feb 4 01:03 sqlnet.log
-rw-r----- 1 oracle dba 31373 Feb 4 01:00 sqlnet.ora
-rw-r--r-- 1 oracle dba 968 Feb 4 00:12 tnsnames.ora
-rw-r--r-- 1 oracle dba 516 Feb 1 17:10 tnsnames.ora.wallet
-rw-r--r-- 1 oracle dba 693 Feb 1 17:30 tnsnames.ora.wallet.lower
-rw-r--r-- 1 oracle dba 760 Feb 1 17:34 tnsnames.ora.wallet.lower.big
[oracle@MasterHadoop50 admin]$ cat listener.ora
# listener.ora Network Configuration File: /u01/oracle/11G/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /u01/oracle/11G)
(PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.55.55)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
)
[oracle@MasterHadoop50 admin]$ vi listener.ora
[1]+ Stopped vim listener.ora
[oracle@MasterHadoop50 admin]$ vi listener.ora
[oracle@MasterHadoop50 admin]$ lsnrctl status
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 04-FEB-2015 23:58:07
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.55.55)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 04-FEB-2015 00:30:38
Uptime 0 days 23 hr. 27 min. 28 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/oracle/11G/network/admin/listener.ora
Listener Log File /u01/oracle/11G/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.55.55)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
[oracle@MasterHadoop50 admin]$ lsnrctl stop
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 04-FEB-2015 23:58:13
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.55.55)(PORT=1521)))
The command completed successfully
[oracle@MasterHadoop50 admin]$ lsnrctl status
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 04-FEB-2015 23:58:21
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.55.55)(PORT=1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC0)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 2: No such file or directory
[oracle@MasterHadoop50 admin]$ lsnrctl start
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 04-FEB-2015 23:58:25
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Starting /u01/oracle/11G/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /u01/oracle/11G/network/admin/listener.ora
Log messages written to /u01/oracle/11G/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.55.55)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.55.55)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 04-FEB-2015 23:58:25
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/oracle/11G/network/admin/listener.ora
Listener Log File /u01/oracle/11G/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.55.55)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "db01" has 1 instance(s).
Instance "db01", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
[oracle@MasterHadoop50 admin]$ cd /u01/oracle/11G/network/admin/
[oracle@MasterHadoop50 admin]$ tnsping db01
TNS Ping Utility for Linux: Version 10.2.0.1.0 - Production on 04-FEB-2015 23:58:52
Copyright (c) 1997, 2005, Oracle. All rights reserved.
Used parameter files:
/u01/oracle/11G/network/admin/sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.55.55)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = db01)))
OK (10 msec)
[oracle@MasterHadoop50 admin]$ tnsping db02
TNS Ping Utility for Linux: Version 10.2.0.1.0 - Production on 04-FEB-2015 23:58:57
Copyright (c) 1997, 2005, Oracle. All rights reserved.
Used parameter files:
/u01/oracle/11G/network/admin/sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.55.56)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = db01)))
OK (80 msec)
[oracle@MasterHadoop50 admin]
--主要差在监听器里这段红色代码
[oracle@MasterHadoop50 admin]$ cat listener.ora
# listener.ora Network Configuration File: /u01/oracle/11G/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /u01/oracle/11G)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME =db01)
(ORACLE_HOME = /u01/oracle/11G)
(SID_NAME =db01)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.55.55)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
)
[oracle@MasterHadoop50 admin]$
--------监听end-----------
[oracle@Slave1Hadoop51 admin]$ sqlplus scott/scott@192.168.55.55:1521/db01SQL*Plus: Release 10.2.0.1.0 - Production on Tue Feb 3 06:35:10 2015
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL>