Static and dynamic listening and error

Source: Internet
Author: User

today when playing the test environment, there are several listening ports, I am too troublesome, he redundant delete except. Leaving only a default LISTENER, the result has been an error.

Unable to connect, my server IP is:192.168.1.2

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/6C/29/wKiom1VA6RqgcLlcAAASsP_cl18008.gif "title=" 1.gif " alt= "Wkiom1va6rqgcllcaaassp_cl18008.gif"/>

Error: Target host unreachable,

The meaning is obvious, it is the IP problem. I looked at the local IP and two configuration listening parameters and found that there was no problem with the IP:

I'm going to use a grid user login to open the Listening configuration interface in netmgr to change the Listener instance name to a fixed IP address

Then there are new errors that appear:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/6C/25/wKioL1VA6u6RYEDyAAAWZRl-TgA672.gif "title=" 2.gif " alt= "Wkiol1va6u6ryedyaaawzrl-tga672.gif"/>

found the target address is in use???? I think, that's not nonsense, my server IP is the current configured IP address ah.

then go to Diag to view the logs below. See the reason. hos_addr target IP and its own native IP inconsistency, suddenly think there is no change in the hosts file the corresponding relationship, the previous period of time changed the IP address, forget to change The relationship within the hosts.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6C/29/wKiom1VA6e2ghS5iAAF0ELpvopI059.jpg "title=" 3.png " alt= "Wkiom1va6e2ghs5iaaf0elpvopi059.jpg"/>

then go to the /etc/hosts file inside the IP corresponding relationship modified. Change the IP to the current address of the server.

1. The target connection is not reached. IP Issues

2. The address is in use. the current system IP is correct: See if the IP address has been modified . See if the configuration IP associated with it is all changed, such as the hosts file,DNS, etc.

After the modification, I found out

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/6C/25/wKioL1VA68fxq0xBAAAeLLhf8Uo156.gif "title=" 4.gif " alt= "Wkiol1va68fxq0xbaaaellhf8uo156.gif"/>

is static registration, at this time I want to change it to dynamic.

Then you enter a command:

Dynamic registration:

Alter system setlocal_listener= ' (description= (address= (protocol=tcp) (host=192.168.11.2)) ' port=1111;

Then look at the listening state.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/6C/25/wKioL1VA7mug6dU7AAAKQfcCNLY771.gif "title=" Image 001.gif "alt=" Wkiol1va7mug6du7aaakqfccnly771.gif "/>

suddenly found that my orcl instance How to open two listening, a dynamic a static it??

What's the problem??? The heart is not happy again. Decided to kill one, because this is definitely not normal, in order to ensure that the service is normal, we require static cancellation.

First, let's take a look at the configuration file

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/6C/29/wKiom1VA7UKh0g6-AAAadH2xPq0716.gif "title=" Image 002.gif "alt=" Wkiom1va7ukh0g6-aaaadh2xpq0716.gif "/>

Oh ~ ~ ~ found the problem: static registration of the code is still in the configuration file inside it. With this sentence, he is a static registered listener:


Comment It out (the note is to precede him with the # number). And check it out again.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/6C/29/wKiom1VA7ZiR69rdAAAjhWVaKv8398.gif "title=" Image 003.gif "alt=" Wkiom1va7zir69rdaaajhwvakv8398.gif "/>

now we find that my orcl instance is dynamically registered. And there's only one.

Now it's back to normal.

To avoid making this mistake again,

Do a summary:

What if you want to register statically?

(Graphical operation is very simple, I will not say here, just say the configuration file registration)

1.

using a grid user to enter the configuration directory, cd/u01/app/grid/product/11.2.0/grid/network/admin/

Vim Listener.ora-- Modify this file and add the following statement

SID_LIST_LNS1 =--lns1 for the listening service name that you want to be statically registered

(Sid_list =

(Sid_desc =

(Global_dbname =orcl.example.com)-- refer to your service name

(Oracle_home =/u01/app/oracle/product/11.1.0/dbhome_1)-- refer to your own path

(Sid_name = ORCL)

)

)

LNS1 =--Listen for names

(DESCRIPTION =

(address = (PROTOCOL = TCP) (HOST = 192.168.1.2) (port = 1521))--host server IP address and port number

)

2.

Then go to the Oracle User and register for the listening service.

Similarly, Oracle modifies the corresponding configuration file:/u01/app/oracle/product/11.1.0/dbhome_1/network/admin

Vim Tnsnames.ora

ORCL = Instance Name, change the instance name of your database,

(DESCRIPTION =

(Address_list =

(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.1.2) (PORT = 1521))--Server IP and segment brackets

)

(Connect_data =

(SERVER = dedicated)

(service_name = orcl.example.com)

)

)


Do you check the service network configuration for problems?

Check to listen for boot no

Your data service name registration is not

LSNRCT status listener name

Lsnrctl start LNS1 initiates this interception.

Okay, OK.


What if you want to register dynamically?

First: Turn off the static registration, such as the above configuration, the above statement comments out, plus the # number on the front can be

As follows:

# (Sid_list =

# (Sid_desc =

# (Global_dbname = orcl.example.com)

# (Oracle_home =/u01/app/oracle/product/11.1.0/dbhome_1)

# (Sid_name = ORCL)

#    )

#  )


Then use the command:

Alter system set Local_listener= ' (Description= (address= (protocol=tcp) (host=192.168.1.2)) ' port=1111;

Scope =both Description is immediately effective

How can this be useful? Remember the previous alter system set local_listener= " is ready.

How does the path in the single quotation mark come from??

View your listening current status

Lsnrctl status

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/6C/26/wKioL1VA-EKzrFvtAAAjxAgsPoU073.gif "title=" Image 004.gif "alt=" Wkiol1va-ekzrfvtaaajxagspou073.gif "/>

That 's the sentence. Copy it up and you're ready to go.

This creates a dynamic listener.

To listen for related commands:

Lsnrctl status

Lsnrctl stop

Lsnrctl start

Sql>show parameter local can see whether the listener is dynamic or static

Grid Users:

Vim/u01/app/grid/product/11.2.0/grid/network/admin/listener.ora

Here is a file configured to listen for information, want to delete and listen here to configure

Oracle User change:

/u01/app/oracle/product/11.1.0/dbhome_1/network/admin/tnsnames.ora

This is turned on and off listening. For example, if I change the port number, then the interception will expire.

I made a metaphor:the Listener.ora of the grid is whether the service provider has a camera installed for you .

the Tnsname.ora of Oracle is if I want to start this camera.

Here are some simple listening configuration files


This article also has the shortcoming, also invites everybody to enlighten

This article is from the "and Treasure" blog, please be sure to keep this source http://zjwbk.blog.51cto.com/8740969/1640521

Static and dynamic listening and error

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.