我的编程空间,编程开发者的网络收藏夹
学习永远不晚

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

短信预约 -IT技能 免费直播动态提醒
省份

北京

  • 北京
  • 上海
  • 天津
  • 重庆
  • 河北
  • 山东
  • 辽宁
  • 黑龙江
  • 吉林
  • 甘肃
  • 青海
  • 河南
  • 江苏
  • 湖北
  • 湖南
  • 江西
  • 浙江
  • 广东
  • 云南
  • 福建
  • 海南
  • 山西
  • 四川
  • 陕西
  • 贵州
  • 安徽
  • 广西
  • 内蒙
  • 西藏
  • 新疆
  • 宁夏
  • 兵团
手机号立即预约

请填写图片验证码后获取短信验证码

看不清楚,换张图片

免费获取短信验证码

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

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上

免责声明:

① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。

② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341

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

下载Word文档到电脑,方便收藏和打印~

下载Word文档

编程热搜

目录