返回顶部
首页 > 资讯 > 数据库 >Oracle学习笔记之第六节网络介绍及配置,会话
  • 696
分享到

Oracle学习笔记之第六节网络介绍及配置,会话

2024-04-02 19:04:59 696人浏览 八月长安
摘要

ps aux | grep ora_pmon 有几个数据库服务器就有几个这个进程(进程监控进程和外部打交道)vim sqlnet.ora 这个可以让数据库略微安全,让sqlplus 不能登陆sqlnet.a

ps aux | grep ora_pmon 有几个数据库服务器就有几个这个进程(进程监控进程和外部打交道)

vim sqlnet.ora 这个可以让数据库略微安全,让sqlplus 不能登陆

sqlnet.authentication_services=(none)


conn hr/oracle_4U@orcl 产生物理连接逻辑会话

host ps 查看终端是哪个

! ps 

然后通过windows的sqlplus plus 工具连接

select * from v_$session s where s.TERMINAL ='pts/2';

SADDR 会话地址 SGA共享池,控制新值的存放

PADDR 内存地址

TADDR 事物地址,旧值地址,如果更改就产生事物,也在共享池

这时候lsnrctl stop

select salary from employes; 还是连着的,但是进行一个新的连接就发现连不上了

lsnrctl

help

srvctl status listener

crs_stat -p | grep lsnr

crs_unreGISter ora.LISTENER.lsnr

srvctl add  listener -p 15210  手动增加监听器


crsctl stop has 关闭整个集群

emctl start dbconsole 启动图形页面

emca  重新生成图形页面

emca -deconfig dbcontrol db -repos drop

emca -config dbcontrol db -repos create 


配置第2个监听器

vim listener.ora

srvctl add  listener -l l2 -p 15211

srvctl start listener -l l2 

lsnrctl services l2

vim tnsnames.ora


sqlplus /nolog

alter system register; 强制系统去动态注册一下


动态注册远程开不了数据库

FOR15212 =

 (DESCRIPTION =

(ADDRESS_LIST=

        (ADDRESS = (PROTOCOL = tcp)(HOST = 192.168.0.55)(PORT = 15212))

        (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.55)(PORT = 15211))

))


conn hr/oracle_4U@192.168.0.55:15212/orcl.example.com 简单连接

shutdown abort强制关闭数据库


export LANG=en_US

netmgr 图形配置网络页面

netca


vim tnsnames.ora

conn hr/oracle_4U@192.168.0.55:TIGER/rcat.example.com

TIGER 负载均衡配置


让两个监听器认识lsnrctl services D000......


vim listener.ora

#动态注册LISTENER监听器

LISTENER =

  (DESCRIPTION_LIST =

    (DESCRIPTION =

      (ADDRESS = (PROTOCOL = TCP)(HOST = station90.example.com)(PORT = 15212))

    )

  )

#动态注册L2监听器

L2=

(DESCRIPTION_LIST =

    (DESCRIPTION =

      (ADDRESS = (PROTOCOL = TCP)(HOST = station90.example.com)(PORT = 15213))

    )

  )

  

  #使监听器LISTENER静态注册,使其能够与上面的监听器进行一动一静

SID_LIST_LISTENER =

        (SID_LIST =

                (SID_DESC =

                        (GLOBAL_DBNAME= rcat.example.com)

                        (SID_NAME= rcat)

                        (ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1/

        )

        )

        )

使监听器L2静态注册,使其能够与上面的监听器进行一动一静

SID_LIST_L2 =

        (SID_LIST =

                (SID_DESC =

                        (GLOBAL_DBNAME= rcat.example.com)

                        (SID_NAME= rcat)

                        (ORACLE_HOME= /u01/app/oracle/product/11.2.0/dbhome_1/

        )

        )

        )

vim tnsnames.ora

#tnsnames.ora所在的那台客户端认为在15212能找到注册服务,若不能找到就连不上。

RCAT =

  (DESCRIPTION =

    (ADDRESS = (PROTOCOL = TCP)(HOST = station90.example.com)(PORT = 15212))

    (CONNECT_DATA =

      (SERVER = DEDICATED)

      (SERVICE_NAME = rcat.example.com)

    )

  )


#tnsnames.ora所在的那台客户端认为在15212能找到注册服务,若不能找到就连不上。

RCAT2

(DESCRIPTION =

    (ADDRESS = (PROTOCOL = TCP)(HOST = station90.example.com)(PORT = 15213))

    (CONNECT_DATA =

      (SERVER = DEDICATED)

      (SERVICE_NAME = rcat.example.com)

    )

  )


  #动态注册FOR15212

FOR15212 =

  (DESCRIPTION =

  (ADDRESS_LIST=

  (ADDRESS = (PROTOCOL = TCP)(HOST = station90.example.com)(PORT = 15212))

  (ADDRESS = (PROTOCOL = TCP)(HOST = station90.example.com)(PORT = 15213))


  )

)


#tiger是给win客户端写的条目,负载均衡静态15212和15213这两个监听端口

TIGER =

    (DESCRIPTION =

        (ADDRESS_LIST =

        (ADDRESS = (PROTOCOL = TCP)(HOST = station90.example.com)(PORT = 15212))

        (ADDRESS = (PROTOCOL = TCP)(HOST = station90.example.com)(PORT = 15213))

        (LOAD_BALANCE = yes )

    )

    (CONNECT_DATA =

        (SERVICE_NAME = rcat.example.com)

    )

  )

  

  #以上需要使其动态注册生效,需要进sqlplus修改配置

. oraenv

rcat

sqlplus /nolog

conn /as sysdba

alter system set local_listener=FOR15212;

alter register;   #更快的让监听器动态注册,不然得等待2分钟以上

. oraenv

+ASM

sqplus /nolog

conn /as sysdba

alter system set local_listener=FOR15212;

#以上需要使其动态注册生效,需要进sqlplus修改配置

. oraenv

rcat

sqlplus /nolog

conn /as sysdba

alter system set local_listener=FOR15212;

alter system register;  #更快的让监听器动态注册,不然得等待2分钟以上

. oraenv

+ASM

sqplus /nolog

conn /as sysdba

alter system set local_listener=FOR15212;

alter system register; #更快的让监听器动态注册,不然得等待2分钟以上

#更快的让监听器动态注册,不然得等待2分钟以上


以上结束后查看LISTENER监听器状态

[oracle@station90 admin]$ lsnrctl services LISTENER;


LSNRCTL for linux: Version 11.2.0.3.0 - Production on 05-SEP-2016 23:16:52


Copyright (c) 1991, 2011, Oracle.  All rights reserved.


Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=station90.example.com)(PORT=15212)))

Services Summary...

Service "+ASM" has 1 instance(s).

  Instance "+ASM", status READY, has 1 handler(s) for this service... #是动态注册出现的

    Handler(s):

      "DEDICATED" established:0 refused:0 state:ready

         LOCAL SERVER

Service "rcat.example.com" has 2 instance(s).

  Instance "rcat", status UNKNOWN, has 1 handler(s) for this service... #是静态注册出现的

    Handler(s):

      "DEDICATED" established:0 refused:0

         LOCAL SERVER

  Instance "rcat", status READY, has 1 handler(s) for this service...  #是动态注册出现的

    Handler(s):

      "DEDICATED" established:0 refused:0 state:ready

         LOCAL SERVER

Service "rcatXDB.example.com" has 1 instance(s).                        #是动态注册出现的隐含服务,XMLDB

  Instance "rcat", status READY, has 1 handler(s) for this service...

    Handler(s):

      "D000" established:0 refused:0 current:0 max:1022 state:ready

         DISPATCHER <Machine: station90.example.com, pid: 12730>

         (ADDRESS=(PROTOCOL=tcp)(HOST=station90.example.com)(PORT=44903))

The command completed successfully


L2监听器的状态

[oracle@station90 admin]$ lsnrctl services l2


LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 05-SEP-2016 23:19:08


Copyright (c) 1991, 2011, Oracle.  All rights reserved.


Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=station90.example.com)(PORT=15213)))

Services Summary...

Service "rcat.example.com" has 2 instance(s).

  Instance "rcat", status UNKNOWN, has 1 handler(s) for this service...   #是静态注册出现的

    Handler(s):

      "DEDICATED" established:0 refused:0

         LOCAL SERVER

  Instance "rcat", status READY, has 1 handler(s) for this service...    #是动态注册出现的

    Handler(s):

      "DEDICATED" established:0 refused:0 state:ready

         LOCAL SERVER

Service "rcatXDB.example.com" has 1 instance(s).                          

  Instance "rcat", status READY, has 1 handler(s) for this service... #是动态注册出现的隐含服务,XMLDB

    Handler(s):

      "D000" established:0 refused:0 current:0 max:1022 state:ready  

#D000是受到这个参数影响 sqlplus alter system set dispatchers='(PROTOCOL=TCP) (dispatchers=3)';

         DISPATCHER <machine: station90.example.com, pid: 12730>

         (ADDRESS=(PROTOCOL=tcp)(HOST=station90.example.com)(PORT=44903))

The command completed successfully


小提示:crossdver软件可以让WINDOWNS程序装在linux上

您可能感兴趣的文档:

--结束END--

本文标题: Oracle学习笔记之第六节网络介绍及配置,会话

本文链接: https://lsjlt.com/news/44338.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

猜你喜欢
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作