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.
客户端验证

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

上一篇:网站快照收录的内容不一样被攻击篡改了


下一篇:使用阿里云对象存储OSS搭建个人网盘和企业网盘的方法