首先配置监听,用netmgr配静态监听,用netca 配动态监听,监听文件listener.ora和tnsnames.ora如下 
*静态注册可以远程管理数据库,比如数据库的起停,而动态注册必须数据库启动才可以
*动态注册为 ready 从字面的意思理解为准备好,而静态注册为 unknow 也就是不知道数据库状态 

listener.ora

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = orcl)
(ORACLE_HOME = /home/oracle/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME = orcl)
)
)


LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.49.4)(PORT = 1522))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = bogon)(PORT = 1523))#bogon为虚拟机的hostname,输入hostname命令得到
)
)
ADR_BASE_LISTENER = /home/oracle/app

tnsnames.ora

ORCL_IC =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.49.4)(PORT = 1522))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl)
)
)

------------

linux下启动监听
lsnrctl start
连接数据库sqlplus / as sysdba@172.16.49.4:1522/orcl
启动startup
-----------
切换到宿主机
使用cmd输入命令sqlplus  scott/000000@172.16.49.4:1523/orcl
使用宿主机器PLSQL时用户名使用scott 密码000000 数据库172.16.49.4:1523/orcl
连接虚拟机数据库

注意:关掉防火墙和selinux

Oracle如何配置多个监听器