Oracle Networking Connecting two Nodes

Node1 :
——-

#vi /etc/hosts

172.16.128.151 node1.oracle.com node1
172.16.128.152 node2.oracle.com node2

:wq

Node2 :
——-

#vi /etc/hosts

172.16.128.151 node1.oracle.com node1
172.16.128.152 node2.oracle.com node2

:wq

Note:If two systems are in networking , we can configure one system in to another.

i.e: ssh node2 (ssh= secured shell)

root@node1> # ping node2.oracle.com (or) ping node2

root@node1> ssh node2
password: ********

root@node2> # su – oracle
password: ********

root@node2># su – oracle

oracle@node2> $ export ORACLE_SID=hrms

oracle@node2> $ sqlplus / as sysdba

SQL> startup

sql> exit

oracle@node2>$ cd $ORACLE_HOME/network/admin

admin>$ ls
listener.ora samples

admin>$ which netca

admin>$ netca

admin>$ exit

node2> xhost +

node2> exit ( enter into client machine)

node1> xhost +

root@node1># ssh -Y oracle@node2

oracle@node2>$ netca

.listener configuration > next
.add > next
.Listener name= listener > next
.TCP > next
.use standard port number=1521 >next
.would you like to configure another listener = no > next
.Listener configuration complete > next
.Finish

oracle@node2>$ cd /u01/app/oracle/product/11.2.0/db_home/network/admin

admin> ls
listener.ora samples

oracle@node2 admin> vi listener.ora

Note: Dynamic listener no contains SID, so if the listener can provide
accesibility to all databases.
and when we use static listener we mentioned SID manually.

oracle@node2 admin>$ cd samples

oracle@node2 samples>$ ls
listener.ora tnsnames.ora sqlnet.ora

After opening the file set the line numbers:
:set nu

:33,46 w >> /u01/app/oracle/product/11.2.0/db_home/network/admin/listener.ora
:q

oracle@node2 samples>$ cd ..

oracle@node2 admin>$ vi listener.ora

LISTENER=
(DESCRIPTION_LIST=
(DESCRIPTION=
(ADDRESS=(PROTOCOL=TCP)(HOST=node2.oracle.com)(PORT=1521)
)
)
ADR_BASE_LISTENER=/u01/app/oracle
SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=
(SID_NAME=hrms)
(ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_home)
)
)
:wq

oracle@node2 admin>$ lsnrctl start listener
admin>$ lsnrctl status listener

To connect to client Machine:
——————————–

root@node1># su – oracle

oracle@node1>$ cd /u01/app/oracle/product/11.2.0/db_home/network/admin/

oracle@node1 admin>$ netca

.click on local net service name configuration > next
.Add > next
.service=hrms > next
.TCP > next
.Hostname:node2.oracle.com
.use standard port=1521 > next
.no doesnt > next
.Net service name=to _hrms > next
( we can write any name)

.next
.finish

oracle@node1 admin> $ vi tnsnames.ora

TO_HRMS=
(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=TCP)(HOST=node2.oracle.com)(PORT=1521))
)

(CONNECT_DATA=
(SERVICE_NAME=hrms)
)
)

oracle@node1 admin>$ tnsping to_hrms

oracle@node2 admin>$ stop listener

oracle@node1 admin>$ tnsping to_hrms

oracle@node2>$ ps -ef|grep smon

oracle@node1>$ sqlplus scott/tiger@to_hrms

(Now we can enter as an scott user)

SQL> exit

Now we will enter as sys user but we forget my password of sys user.

oracle@node2>$ cd $ORACLE_HOME/dbs

oracle@node2 dbs> orapwd file=orapwdhrms password=oracle entries=3 force=y

oracle@node2 dbs>$ cd

oracle@node1>$ sqlplus sys/oracle@to_hrms as sysdba

SQL>

Advertisements
Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: