Oracle Course archive, Day Nineth

Source: Internet
Author: User
Tags sqlplus

Lsnrctl Status: View listening status

Oracle Network configuration consists of three parts: client, Listener, database

Configuration file:
$ VI $ORACLE _home/network/admin/listener.ora

VI listener.ora the same command as above

Netstat-tln|grep 1521

Add a new listener service via NETCA Listener15210, port using 15210

Lsnrctl status listener15210 view 15210 listening status (specifies the name of the listening state)

NETCA Enter a system first to create a new listener second parse the third to create a host link string (personal understanding) to delete then continue into NETCA Delete (delete)

Netmgr Configuring advanced Options

Start/stop/view/Reload Listener/service via LSNRCTL command

Lsnrctl start |stop |status |reload |service


IP address information: #cat/etc/hosts

#cat/etc/sysconfig/network-scripts/ifcfg-eth0


Host name information: #cat/etc/hosts

#cat/etc/sysconfig/network

$cat $oracle _home/network/admin/listener.ora


Port (port number)


Write the Listener alias:

$ cd $ORACLE _home/network/admin★


VI Tnsnames.ora (query configuration listens to all things, personal understanding.) )


Static registration and dynamic registration for dynamic registrations with more

Three configurations of Local_listener Remote_listener

Modify Parameters:
sql> ALTER SYSTEM SET local_listener=listener15210;
sql> ALTER SYSTEM Register; Register Now (optional)

The service information has been added to the new listener:
$ LSNRCTL Status listener15210

The client specifies a new port connection:
$ sqlplus sys/[email PROTECTED]:1521/ORCL as SYSDBA error
$ sqlplus sys/[email PROTECTED]:15210/ORCL as Sysdba

To delete a configuration:
sql> ALTER SYSTEM SET local_listener= ";
sql> ALTER SYSTEM Register;
$ vi Tnsnames.ora Delete listener15210 alias
NETCA Delete 15210-port monitoring


Client Configuration


String followed by the host link

Easy Connect/local naming Tnsnames.ora netca/netmgr/tnsping

Easy connection:
$ sqlplus sys/[email PROTECTED]:1521/ORCL as Sysdba
Suitable for temporary connections


Local naming:
To view an existing host connection string
$ cd $ORACLE _home/network/admin
$ VI Tnsnames.ora

Add a new host connection string using NETCA orcl192
$ sqlplus sys/[email protected] as Sysdba
Sql> select name from V$database;


Tnsping Test tnsping orcl192 When the query appears OK is successful ★


Order of parsing methods:
$ VI Sqlnet.ora
NETCA can be modified

Restore default settings:
Sql> alter system set local_listener= ";
sql> Alter SYTEM Register;

NETCA Delete unwanted listening and connection configuration ★

The configuration of the shared server is configured by initializing the parameter dispatchers DBCA into a system and NETCA is the same
Can be modified by DBCA.
$ LSNRCTL Service
Sql> Show Parameter disp
Sql> Show Parameter Shared_server

Shared Server (server)

Proprietary and shared modes are compatible with each other.
At this point, we see how users choose


Restore the original settings:
DBCA modified to dedicated mode


DB Link: Database links

Connect: Connect

Identified: OK

Using: Using

DB link
Database A accesses the table above remote database B:
In database A, use NETCA to create a host description string Orcl_dblink point to Database B
$ netca
$ tnsping Orcl_dblink
To create a database link in database A:
Sql> CREATE DATABASE link orcl_dblink_hr connect to HR identified by HR using ' orcl_dblink ';
Using the host descriptor string Orcl_dblink
Both the user and the password are on database b
The name of the DB link does not require the same as the host description string

To access tables in database B:
Sql> Select COUNT (*) from [email protected]_dblink_hr;
Sql> Select COUNT (*) from hr.employees, [email protected]_dblink_hr;

Oracle Course archive, Day Nineth

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.