Linux 下 Oracle 11g 更改默认端口号

查看当前端口信息

进入 oracle 用户
[root@node2 ~]# su - oracle
进入 oracle 服务
[oracle@node2 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sun Nov 7 16:39:17 2021

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to an idle instance.

SQL>
启动 oracle 服务
SQL> startup       
ORACLE instance started.

Total System Global Area 1720328192 bytes
Fixed Size		    2214056 bytes
Variable Size		 1006634840 bytes
Database Buffers	  704643072 bytes
Redo Buffers		    6836224 bytes
Database mounted.
Database opened.
查看配置
SQL> show parameter local_listen

NAME				     TYPE	 VALUE
------------------------------------ ----------- ------------------------------
local_listener			     string

修改远程端口

更改 oracle 配置
  • 修改
# host -- 指定 ip,port -- 指定远程端口
SQL> alter system set local_listener='(address=(protocol=tcp)(host=10.10.200.49)(port=11521))';

System altered.
  • 查看结果
SQL> show parameter local_listen   

NAME				     TYPE	 VALUE
------------------------------------ ----------- ------------------------------
local_listener			     string	 (address=(protocol=tcp)(host=10.10.200.49)(port=11521))
更改 listener.ora
# host + port 配置
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = 10.10.200.49)(PORT = 11521))
    )
  )
更改 tnsnames.ora
# host + port 配置
ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 10.10.200.49)(PORT = 11521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )

重启服务

启动监听
[oracle@node2 ~]$ lsnrctl start
重启 oracle 服务
# 停止
SQL> shutdown
Database closed.
Database dismounted.
ORACLE instance shut down.

# 启动
SQL> startup
ORACLE instance started.

Total System Global Area 1720328192 bytes
Fixed Size		    2214056 bytes
Variable Size		 1006634840 bytes
Database Buffers	  704643072 bytes
Redo Buffers		    6836224 bytes
Database mounted.
Database opened.
SQL> 

增加远程用户

表空间创建
SQL> CREATE TABLESPACE test DATAFILE '/data/app/oracle/oradata/orcl/test.dbf' SIZE 50M AUTOEXTEND ON NEXT 50M MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL;

Tablespace created.
用户创建
# 指定表空间 -- 创建用户
SQL> CREATE USER lsr IDENTIFIED BY lsr DEFAULT TABLESPACE test ;

User created.
用户授权
# 管理员权限
SQL> GRANT CONNECT, RESOURCE, DBA TO lsr ;

Grant succeeded.
用户密码配置
SQL> ALTER USER lsr IDENTIFIED BY "123456" ;

User altered.
客户端验证

在这里插入图片描述

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值