oracle12c远处访问,Oracle12c部署,允许远程访问

论坛 期权论坛 脚本     
已经匿名di用户   2022-5-29 19:30   1247   0

首先需要说明该文档所使用的Oracle的版本及类型:12c,桌面版(desktop class,与之相对的是server class)

我们知道,Oracle本地访问host为localhost,和其他关系型数据库mysql,sql server一样,Oracle远程访问同样需要修改host等参数。

因此,在部署Oracle前,需要确认的事只有一个:确保安装Oracle的机器有静态ip(在局域网内是静态ip也行)

下面开始:

1.关闭windows防火墙,在linux环境下就关闭linux的防火墙

2.修改Oracle的net manager配置

打开oracle的net manager,配置如下(主要是讲连接类型修改为共享服务器):

b3dbbad09738ed148916dadfc7854309.png

1296748806611738624.htm

3.配置连接数

打开Database Configuration Assistant

2261ec8d381f56237dbf952eb98ad8ba.png

1296748806611738624.htm

1296748806611738624.htm33e72a75033edf3f858ca09b1cca5016.png

1296748806611738624.htm

1296748806611738624.htmfdb17ee703aba409fffeafc31fc16cac.png

1296748806611738624.htm

1296748806611738624.htm2f629d9aa9daa20141203e86a71820e2.png

接下来一直next就行了

4.修改监听ip 找到安装Oracle的ADMIN目录,笔者的目录为:

D:\app\orcl\product\12.1.0\dbhome_1\NETWORK\ADMIN

文件夹下打开下述文件:

修改如下(主要是修改HOST的值):

tnsnames.ora

# tnsnames.ora Network Configuration File:

# D:\app\orcl\product\12.1.0\dbhome_1\NETWORK\ADMIN\tnsnames.ora

# Generated by Oracle configuration tools.

ORACLR_CONNECTION_DATA =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))

)

(CONNECT_DATA =

(SID = CLRExtProc)

(PRESENTATION = RO)

)

)

LISTENER_ORCL =

(ADDRESS = (PROTOCOL = TCP)(HOST = 10.60.38.154)(PORT = 1521))

ORCL =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))

)

(CONNECT_DATA =

(SERVER = SHARED)

(SERVICE_NAME = orcl)

)

)

listener.ora

# listener.ora Network Configuration File:

# D:\app\orcl\product\12.1.0\dbhome_1\network\admin\listener.ora

# Generated by Oracle configuration tools.

SID_LIST_LISTENER =

(SID_LIST =

(SID_DESC =

(SID_NAME = CLRExtProc)

(ORACLE_HOME = D:\app\orcl\product\12.1.0\dbhome_1)

(PROGRAM = extproc)

(ENVS = "EXTPROC_DLLS=ONLY:D:\app\orcl\product\12.1.0\dbhome_1\bin\oraclr12.dll")

)

)

LISTENER =

(DESCRIPTION_LIST =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = 10.60.38.154)(PORT = 1521))

(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))

)

)

上面两份文件的代码加粗部分为需要修改的。可以看出,主要是把host从localhost修改为本机的静态ip。

5.修改完毕后重启所有服务(这点非常重要),之后通过sql developer测试成功

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:81
帖子:4969
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP