Internet:
Server-side: Be sure to start the listener
No Configuration Boot listener: rm-f $ORACLE _home/network/admin/listener.ora
View listening status: Lsnrctl status
Start monitoring: Lsnrctl start
Client: Using service naming (network connection string)
Cat/etc/hosts
------------------------------------------------------------
# don't remove the following line, or various programs
# that require network functionality would fail.
127.0.0.1 localhost.localdomain localhost
:: 1 localhost6.localdomain6 Localhost6
172.25.254.250 foundation0.ilt.example.com
------------------------------------------------------------
The client uses a simple connection:
Sqlplus Scott/[email Protected]:1521/primary
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Using a listening profile: You can control IP, port, listener name
VI $ORACLE _home/network/admin/listener.ora
-------------------------------------------------------------
Listener=
(description=
(Address= (PROTOCOL=TCP) (host=172.25.254.250) (port=1521))
)
-------------------------------------------------------------
To use the client configuration file:
VI $ORACLE _home/network/admin/tnsnames.ora
-------------------------------------------------------------
250=
(description=
(Address= (PROTOCOL=TCP) (host=172.25.254.250) (port=1521))
(Connect_data=
(service_name = primary)
)
)
-------------------------------------------------------------
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To modify the port number of the listener:
VI $ORACLE _home/network/admin/listener.ora
-------------------------------------------------------------
Listener=
(description=
(Address= (PROTOCOL=TCP) (host=172.25.254.250) (port=7788))
)
-------------------------------------------------------------
Pmon can only register instances with 1521 by default!
Use Local_listener to specify the details of the registered instance:
Alter system set Local_listener= ' (Description= (address= (protocol=tcp) (host=172.25.254.250))) ';
Registering an instance to a remote listener using Remote_listener
Alter system set Remote_listener= ' (Description= (address= (protocol=tcp) (host=172.25.0.10))) ';
The port number of the client needs to be modified synchronously:
VI $ORACLE _home/network/admin/tnsnames.ora
-------------------------------------------------------------
250=
(description=
(Address= (PROTOCOL=TCP) (host=172.25.254.250) (port=7788))
(Connect_data=
(service_name = primary)
)
)
-------------------------------------------------------------
Modify the Listener name: No effect on the client
VI $ORACLE _home/network/admin/listener.ora
-------------------------------------------------------------
LISTENER_DB01 =
(description=
(Address= (PROTOCOL=TCP) (host=172.25.254.250) (port=7788))
)
-------------------------------------------------------------
To operate a non-default named listener:
Lsnrctl Status Listener_db01
Lsnrctl Status Listener_db01
Lsnrctl Status Listener_db01
Activating Pmon Registering instance information to the listener
Sql> alter system register;
Use Pmon to register the instance information to the listener, which belongs to the dynamic registration, no instance of the case is unable to use the Oracle Network!!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The state of the database is stopped if you want to use a network with Oracle, you need to register statically
VI $ORACLE _home/network/admin/listener.ora
-------------------------------------------------------------
Listener=
(description=
(Address= (PROTOCOL=TCP) (host=172.25.254.250) (port=7788))
)
Sid_list_listener =
(Sid_list =
(Sid_desc =
(Global_dbname = primary) #数据库唯一名 + domain name, db_unique_name+db_domain
(Oracle_home =/u01/app/oracle/product/11.2.0/db_1)
(Sid_name = db01) # $ORACLE _sid, decide to find the suffix of the password file and the parameter file
)
)
-------------------------------------------------------------
Client-side failover configuration: Client connections are not interrupted when server exceptions
VI $ORACLE _home/network/admin/tnsnames.ora
-------------------------------------------------------------
250=
(description=
(Address= (PROTOCOL=TCP) (host=172.25.254.250) (port=7788))
(Connect_data=
(SERVER = dedicated)
(service_name = primary)
(Failover_mode =
(TYPE = Select)
(METHOD = Basic)
(retries = 180)
(DELAY = 5)
)
)
)
-------------------------------------------------------------
To see if a session supports failover:
Select Username,failover_type,failover_method,failed_over
From v$session where username= ' SCOTT ';
Pre-derivative service process:
VI $ORACLE _home/network/admin/listener.ora
-------------------------------------------------------------
Listener=
(description=
(Address= (PROTOCOL=TCP) (host=172.25.254.250) (port=7788))
)
Sid_list_listener =
(Sid_list =
(Sid_desc =
(Global_dbname = primary)
(Oracle_home =/u01/app/oracle/product/11.2.0/db_1)
(Sid_name = db01)
(Prespawn_max = 10)
(Prespawn_list =
(Prespawn_desc =
(PROTOCOL = tcp)
(pool_size = 10)
(TIMEOUT = 1)
)
)
)
)
-------------------------------------------------------------
To configure a shared connection:
1. Allow the server to start the shared services process
alter system set SHARED_SERVERS=5;
2. Allow client side to connect to server in shared mode
alter system set shared_server_sessions=2000;
3. Allow the server to start the scheduler
Sql> select * from V$dispatcher;
Alter system set dispatchers= ' (Address= (PROTOCOL=TCP) (host=172.25.254.250) (port=56352) (dispatchers=5)) ';
VI $ORACLE _home/network/admin/tnsnames.ora
-------------------------------------------------------------
Test =
(description=
(Address= (PROTOCOL=TCP) (host=172.25.254.250) (port=7788))
(Connect_data=
# (server = dedicated)
# (server = SHARED)
(service_name = primary)
)
)
-------------------------------------------------------------
Database Link: You can establish a network connection at the SQL statement level and get data from multiple databases at the same time
Sql> Grant CREATE DATABASE link to Scott;
Use local username password to remotely perform security audits: Dynamic security audits
Sql> CREATE DATABASE link Link_254_scott using ' 250 ';
Static security Audits
Sql> CREATE DATABASE link Link_254_scott
Connect to Scott identified by Lion
Using ' 250 ';
Common Database Links:
Sql> Conn/as SYSDBA
sql> Create public database link Link_254_scott using ' 250 ';
This article is from the "Liang blog" blog, make sure to keep this source http://7038006.blog.51cto.com/7028006/1847126
Oracle Network Configuration (1)