Please send your Questions & Answers or Feedback to "dvmadhavreddy@javabook.org"

Please send your Questions & Answers or Feedback to "mohan@javabook.org"

Oracle Networking : Connecting Server and Client


root> ifconfig -->to see the ip address
root> hostname -->to see the hostname
root> hostname -i -->to see ip address
root> cat /etc/hosts --> to see the connected hosts
root> ping 172.16.128.151
root> ping 172.16.128.152
root> ping venu1.oracle.com
root> ping venu2.oracle.com
root> ssh venu2 --> to connect to the client
root> exit

root> ssh 172.16.128.152
root> exit
root@venu1> su - oracle
oracle@venu1> cat /etc/oratab
oracle@venu1> export ORACLE_SID=venu
oracle@venu1> sqlplus / as sysdba
SQL> startup

oracle@venu1> which netca
oracle@venu1> netca
oracle@venu1> su
root@venu1> xhost +
root@venu1> su - oracle
oracle@venu1> xclock
oracle@venu1> netca
1.select 'Listener Configuration'
2.select 'Add'
3.enter name
4.By default protocol is TCP
5.select 'use the standard port number of 1521' (or) select 'another port'
6.click 'NO' for another listener
7.finish.
If we create a listener using netca it is dynamic listener without SID and it is for all the databases.By default we get dynamic listener.
oracle@venu1> cd $ORACLE_HOME/network/admin
oracle@admin> ls
oracle@admin> vi listener.ora
:wq!
oracle@admin> cd samples
oracle@samples> ls
oracle@samples> vi listener.ora
:se nu --> to set line numbers.
esc shift + 33,46w >> /u01/app/oracle/product/11.2.0/db_home/network/admin/listener.ora
:se nonu
:q!
oracle@samples> cd..
oracle@admin> ls
oracle@admin> vi listener.ora
SID_LIST_LISTENER=(SID_LIST=(SID_DESC=(SID_NAME=venu (ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_home)))
:wq!

Now this listener.ora is static.
Static listener.ora will have its own specific SID.
Comment the IPC Address entry in the Listener.ora.
When we create listener.ora using netca oracle automatically starts the listener.
We need to reload the listener as we have added the SID entries.
oracle@admin> lsnrctl reload listenername
oracle@admin> lsnrctl status listenername
root@venu1> xhost +
root@venu1> ssh -Y oracle@venu2
Provide oracle user password.In place of Y we can also specify X.
oracle@venu2> netca
1.select 'Local Net Service Name configuration'
2.select 'Add'
3.Give service as same like given in the listener.ora here'venu'
4.select 'TCP'
5.give host name 'venu1.oracle.com'
6.select 'use another port number 1522' as same like in the listener.ora
7.select 'test' or 'do not test'
8.give Net Service name 'to_venu'
9.select 'NO'
10.Finish
oracle@venu2> cd $ORACLE_HOME/network/admin
oracle@admin> ls
oracle@admin> vi tnsnames.ora
TO_VENU=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=venu1.oracle.com)(PORT=1522)))
(CONNECT_DATA=(SERVICE_NAME=venu)))
:wq!
oracle@venu2> tnsping to_venu

oracle@venu1> lsnrctl stop listenername
oracle@venu2> tnsping to_venu
oracle@venu1> lsnrctl start listenername
oracle@venu2> sqlplus scott/tiger@to_venu
scott> conn / as sysdba

oracle@venu1> cd $ORACLE_HOME/dbs
oracle@dbs> orapwd file=orapwvenu password=somepassword entries=3 force=y
oracle@venu2> sqlplus sys/somepassword@to_venu as sysdba
entries=3 --> limits to 3 terminals.
force=y --> overrides the old password if any.

Related Posts Plugin for WordPress, Blogger...

Flag Counter