32
5 Copyright © 2007, Oracle. All rights reserved. Configuring the Oracle Network Environment

5 Copyright © 2007, Oracle. All rights reserved. Configuring the Oracle Network Environment

Embed Size (px)

Citation preview

Page 1: 5 Copyright © 2007, Oracle. All rights reserved. Configuring the Oracle Network Environment

5Copyright © 2007, Oracle. All rights reserved.

Configuring the Oracle Network Environment

Page 2: 5 Copyright © 2007, Oracle. All rights reserved. Configuring the Oracle Network Environment

Copyright © 2007, Oracle. All rights reserved.5 - 2

Objectives

After completing this lesson, you should be able to:

• Use Enterprise Manager to:– Create additional listeners– Create Oracle Net Service aliases– Configure connect-time failover– Control the Oracle Net Listener

• Use tnsping to test Oracle Net connectivity

• Identify when to use shared servers and when to use dedicated servers

Page 3: 5 Copyright © 2007, Oracle. All rights reserved. Configuring the Oracle Network Environment

Copyright © 2007, Oracle. All rights reserved.5 - 3

Oracle Net Services

Application

Oracle Net

RDBMS

Oracle Net

Client or middle tier

Database server

TCP/IP network

Listener

Oracle Net configuration files

Oracle Net configuration files

Page 4: 5 Copyright © 2007, Oracle. All rights reserved. Configuring the Oracle Network Environment

Copyright © 2007, Oracle. All rights reserved.5 - 4

Oracle Net Listener

Listener

<oracle_home>/network/admin/listener.ora sqlnet.ora

Oracle databases

Oracle Net configuration files

Enterprise ManagerDatabaseControl

Page 5: 5 Copyright © 2007, Oracle. All rights reserved. Configuring the Oracle Network Environment

Copyright © 2007, Oracle. All rights reserved.5 - 5

Establishing Net Connections

To make a client or middle-tier connection, Oracle Net requires the client to know the:

• Host where the listener is running

• Port that the listener is monitoring

• Protocol that the listener is using

• Name of the service that the listener is handling

Names resolution

Page 6: 5 Copyright © 2007, Oracle. All rights reserved. Configuring the Oracle Network Environment

Copyright © 2007, Oracle. All rights reserved.5 - 6

Listener

Establishing a Connection

Incoming connection request

Page 7: 5 Copyright © 2007, Oracle. All rights reserved. Configuring the Oracle Network Environment

Copyright © 2007, Oracle. All rights reserved.5 - 7

Serverprocess

User Sessions

PGA

Listener

User session

User process

Page 8: 5 Copyright © 2007, Oracle. All rights reserved. Configuring the Oracle Network Environment

Copyright © 2007, Oracle. All rights reserved.5 - 8

Tools for Configuring and Managing the Oracle Network

• Enterprise Manager Net Services Administration page

• Oracle Net Manager

• Oracle Net Configuration Assistant launched by Oracle Universal Installer

• Command line

Page 9: 5 Copyright © 2007, Oracle. All rights reserved. Configuring the Oracle Network Environment

Copyright © 2007, Oracle. All rights reserved.5 - 10

Listener Control Utility

Oracle Net listeners can be controlled with the lsnrctl command-line utility (or from EM).

[oracle@edrsr17p1 ~]$ lsnrctl

LSNRCTL for Linux: Version 11.1.0.3.0 - Beta on 30-MAY-2007 22:38:19

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

Welcome to LSNRCTL, type "help" for information.

LSNRCTL> help

The following operations are available

An asterisk (*) denotes a modifier or extended command:

start stop status

services version reload

save_config trace spawn

change_password quit exit

set* show*

Page 10: 5 Copyright © 2007, Oracle. All rights reserved. Configuring the Oracle Network Environment

Copyright © 2007, Oracle. All rights reserved.5 - 11

Listener Control Utility Syntax

Commands from the listener control utility can be issued from the command line or from the LSNRCTL prompt.

• UNIX or Linux command-line syntax:

• Prompt syntax:

$ lsnrctl <command name>

$ lsnrctl start

$ lsnrctl status

LSNRCTL> <command name>

LSNRCTL> start

LSNRCTL> status

Page 11: 5 Copyright © 2007, Oracle. All rights reserved. Configuring the Oracle Network Environment

Copyright © 2007, Oracle. All rights reserved.5 - 13

Listener Home Page

Page 12: 5 Copyright © 2007, Oracle. All rights reserved. Configuring the Oracle Network Environment

Copyright © 2007, Oracle. All rights reserved.5 - 14

Net Services Administration Pages

Page 13: 5 Copyright © 2007, Oracle. All rights reserved. Configuring the Oracle Network Environment

Copyright © 2007, Oracle. All rights reserved.5 - 15

Creating a Listener

1

3

4

1

2

Page 14: 5 Copyright © 2007, Oracle. All rights reserved. Configuring the Oracle Network Environment

Copyright © 2007, Oracle. All rights reserved.5 - 16

Adding Listener Addresses

56

7

Page 15: 5 Copyright © 2007, Oracle. All rights reserved. Configuring the Oracle Network Environment

Copyright © 2007, Oracle. All rights reserved.5 - 17

Database Service Registration

Page 16: 5 Copyright © 2007, Oracle. All rights reserved. Configuring the Oracle Network Environment

Copyright © 2007, Oracle. All rights reserved.5 - 19

Naming Methods

Oracle Net supports several methods of resolving connection information:

• Easy connect naming: Uses a TCP/IP connect string

• Local naming: Uses a local configuration file

• Directory naming: Uses a centralizedLDAP-compliant directory server

• External naming: Uses a supported non-Oracle naming service

Client/application serverOracle Net

Oracle Net configuration files

Page 17: 5 Copyright © 2007, Oracle. All rights reserved. Configuring the Oracle Network Environment

Copyright © 2007, Oracle. All rights reserved.5 - 20

Easy Connect

• Is enabled by default

• Requires no client-side configuration

• Supports only TCP/IP (no SSL)

• Offers no support for advanced connection options such as:– Connect-time failover– Source routing– Load balancing

SQL> CONNECT hr/[email protected]:1521/dba11g

No Oracle Net configuration files

Page 18: 5 Copyright © 2007, Oracle. All rights reserved. Configuring the Oracle Network Environment

Copyright © 2007, Oracle. All rights reserved.5 - 21

Local Naming

• Requires a client-side Names Resolution file

• Supports all Oracle Net protocols

• Supports advanced connection options such as:– Connect-time failover– Source routing– Load balancing

SQL> CONNECT hr/hr@orcl

Oracle Net configuration files

Page 19: 5 Copyright © 2007, Oracle. All rights reserved. Configuring the Oracle Network Environment

Copyright © 2007, Oracle. All rights reserved.5 - 22

Directory Naming

• Requires LDAP with Oracle Net Names Resolution information loaded:– Oracle Internet Directory– Microsoft Active Directory Services

• Supports all Oracle Net protocols

• Supports advanced connection options

SQL> CONNECT hr/hr@orcl

LDAP directory

Oracle Net configuration files

Page 20: 5 Copyright © 2007, Oracle. All rights reserved. Configuring the Oracle Network Environment

Copyright © 2007, Oracle. All rights reserved.5 - 23

External Naming Method

• Uses a supported non-Oracle naming service

• Includes:– Network Information Service (NIS) External Naming– Distributed Computing Environment (DCE) Cell Directory

Services (CDS)

Oracle Net

Non-Oracle naming service

Page 21: 5 Copyright © 2007, Oracle. All rights reserved. Configuring the Oracle Network Environment

Copyright © 2007, Oracle. All rights reserved.5 - 24

Configuring Service Aliases

Create oredit

Page 22: 5 Copyright © 2007, Oracle. All rights reserved. Configuring the Oracle Network Environment

Copyright © 2007, Oracle. All rights reserved.5 - 25

Advanced Connection Options

Oracle Net supports the following advanced connection options with local and directory naming:

• Connect-time failover

• Load balancing

• Source routing

Page 23: 5 Copyright © 2007, Oracle. All rights reserved. Configuring the Oracle Network Environment

Copyright © 2007, Oracle. All rights reserved.5 - 27

Testing Oracle Net Connectivity

The tnsping utility that tests Oracle Net service aliases:

• Ensures connectivity between the client and the Oracle Net Listener

• Does not verify that the requested service is available

• Supports Easy Connect Names Resolution:

• Supports local and directory naming:

tnsping db.us.oracle.com:1521/dba11g

tnsping orcl

Page 24: 5 Copyright © 2007, Oracle. All rights reserved. Configuring the Oracle Network Environment

Copyright © 2007, Oracle. All rights reserved.5 - 28

User Sessions: Dedicated Server

Server process

Server process

User sessions

Server process

Listener

Page 25: 5 Copyright © 2007, Oracle. All rights reserved. Configuring the Oracle Network Environment

Copyright © 2007, Oracle. All rights reserved.5 - 29

User Sessions: Shared Servers

Listener

Dispatcher

Server process

Server process

Server process

User sessions

Page 26: 5 Copyright © 2007, Oracle. All rights reserved. Configuring the Oracle Network Environment

Copyright © 2007, Oracle. All rights reserved.5 - 30

SGA

Large pool and other memory

structures

Stackspace

PGA

SGA and PGA

Oracle Shared Server: User session data is held in the SGA.

Remember to consider shared server memory requirements when sizing the SGA.

User session

data

Cursorstate

Sortdata

Page 27: 5 Copyright © 2007, Oracle. All rights reserved. Configuring the Oracle Network Environment

Copyright © 2007, Oracle. All rights reserved.5 - 31

Shared Server: Connection Pooling

The client application has been idle past the specified time, and an

incoming client requests a connection.

The maximum number of connections is configured to 255.

This client connection is the 256th

connection into the server. Connection pooling is turned on so that this connection can be accepted.

Databaseserver

Idle client

Active client

New client

Page 28: 5 Copyright © 2007, Oracle. All rights reserved. Configuring the Oracle Network Environment

Copyright © 2007, Oracle. All rights reserved.5 - 32

When Not to Use a Shared Server

Certain types of database work must not be performed using shared servers:

• Database administration

• Backup and recovery operations

• Batch processing and bulk load operations

• Data warehouse operations

Dispatcher Dedicated server process

Page 29: 5 Copyright © 2007, Oracle. All rights reserved. Configuring the Oracle Network Environment

Copyright © 2007, Oracle. All rights reserved.5 - 33

Configuring CommunicationBetween Databases

• Sending data or messages between sites requires network configuration on both sites.

• You must configure the following:– Network connectivity (for example, TNSNAMES.ora)– Database links

CREATE DATABASE LINK <remote_global_name>CONNECT TO <user> IDENTIFIED BY <pwd>USING '<connect_string_for_remote_db>';

Page 30: 5 Copyright © 2007, Oracle. All rights reserved. Configuring the Oracle Network Environment

Copyright © 2007, Oracle. All rights reserved.5 - 34

Connecting to Another Database

CREATE DATABASE LINK hq.oracle.comCONNECT TO HR IDENTIFIED BY HRUSING 'hq';

CONNECT hr/hr@hq

SELECT * from HR.employees@hq;

HQ = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = edtdr8p1.us.oracle.com)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl.us.oracle.com) ) )

tnsnames.ora

SQL*Plus

Page 31: 5 Copyright © 2007, Oracle. All rights reserved. Configuring the Oracle Network Environment

Copyright © 2007, Oracle. All rights reserved.5 - 35

Summary

In this lesson, you should have learned how to:

• Use Enterprise Manager to:– Create additional listeners– Create Oracle Net Service aliases– Configure connect-time failover– Control the Oracle Net Listener

• Use tnsping to test Oracle Net connectivity

• Identify when to use shared servers and when to use dedicated servers

Page 32: 5 Copyright © 2007, Oracle. All rights reserved. Configuring the Oracle Network Environment

Copyright © 2007, Oracle. All rights reserved.5 - 36

Practice 5 Overview: Working with Oracle Network Components

This practice covers the following topics:

• Configuring local Names Resolution to connect to another database

• Creating a second listener for connect-time failover