2天DBA -4 Configuring the Network Environment

一、理解网络配置 Understanding Network Configuration

For a client application and a database to communicate, the client application must be able to identify the database it wants to connect to, and the database must provide some sort of identification or address. You can use a service name to connect to a database. A service name is a logical representation of a database, which is the way a database is presented to clients. A single database can be presented as multiple services.

 

represent:表现、描述、象征

 

Using service names can provide location transparency such that the client application does not need to know the server's location. When the database is moved to another location, you need to reconfigure only Oracle Net. No changes are necessary to client applications.

 

transparency :透明、透明度

 

1、配置监听器 Oracle Net Listener Configuration

Listener is a process that listens for client connection requests. It receives incoming client connection requests and manages the traffic of these requests to the database server.

The default listener configuration file is called listener.ora, and it is located in the Oracle_home/network/admin directory

 

>> 查看监听器配置

在 HOME PAGE中查看:

On the Database Home page, click the Listener link under General.

The Listener page appears, displaying the following information about the listener:

  • Current status

  • Availability over the last 24 hours

  • Alias

  • Version

  • Oracle home

  • Net address

  • Configuration file (listener.ora) location

  • Start time

  • Host

用命令行查看:

  1. Open a command window.

  2. (Linux and UNIX systems only) Set the required environment variables by running the script oraenv (for the Bourne, Korn, or Bash shells) or coraenv (for the C shell).

    These scripts are typically located in the /usr/local/bin directory. They may prompt you for the desired value of the ORACLE_SID environment variable. If so, supply the system ID (SID) that you chose when you installed Oracle Database. The default SID that the installer typically suggests is orcl. 可以用export ORACLE_SID=orcl来指定。

  3. (Linux and UNIX systems only) Either ensure that the Oracle_home/bin directory is in your PATH environment variable, or change the directory to Oracle_home/bin.

  4. Enter the following command:

    lsnrctl status
    

>> 启停止 Listener

在 home page中:

On the Database Home page, click the Listener link under General.The Listener page appears.

Click start or stop

 

以命令行方式:

lsnrctl stop
lsnrctl start

 

2、链接描述 Connect Descriptors

The client uses a connect descriptor to specify the database to which it wants to connect. This connect descriptor contains a protocol and a database service name. A database can have multiple service names defined, so a specific service name must be specified for the connect descriptor. In a preconfigured database, there is only one service name, which defaults to the global database name.

 

3、链接请求 Connection Requests

Users initiate a connection request by providing a connect string. A connect string includes a user name and password, and a connect identifier

就是平时用的 conn rms/rms@jldev 这种形式的串

4、Naming Methods

Oracle Net provides support for the following naming methods:

 

The easy connect naming method enables clients to connect to an Oracle database by using only a TCP/IP connect string consisting of a host name and service name. The easy connect naming method requires no configuration.这种形式不需要配置

使用 easy connect Naming链接的步骤:

 

第一步:命令行输入 sqlplus

第二步:在提示输入用户名时,按如下格式输入

user@"[//]host[:port]/service_name"
比如:nick@"db.us.example.com/orcl.us.example.com"

第三步:输入 密码 

The local naming method stores connect descriptors, identified by their net service names, in a configuration file on the client named tnsnames.ora. This file is located in the Oracle_home/network/admin directory. 这种形式比较常用

Directory naming resolves a database service, net service name, or net service alias to a connect descriptor stored in an LDAP-compliant directory server. 没用过啊。。。

 

 

5、网络配置的工具 Tools for Network Configuration

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值