CentOS7中启动多个oracle12c实例(多端口)
listener.ora文件的内容如下:
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = centos7)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
TESTLIS =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = centos7)(PORT = 1522))
)
)
tnsnames.ora文件的内容如下:
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = centos7)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
ORCLTEST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = centos7)(PORT = 1522))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcltest)
)
)
在oracle用户的环境变量中,分别启动两个监听:
su - oracle
lsnrctl start
lsnrctl start TESTLIS
#启动第一个实例,指定数据库实例的变量与值,假设要建立的数据实例的SID是orcl
export ORACLE_SID=orcl
sqlplus / as sysdba
startup
exit
#启动第二个实例,指定数据库实例的变量与值,假设要建立的数据实例的SID是test
export ORACLE_SID=orcltest
sqlplus / as sysdba
startup
exit