Category Archives: network

Set Linux Network Adapters to startup automatically

1. Logon as the root user to your Linux Server.

[larry@linux1 ~]$ sudo su
[root@linux1 larry]#

2. Execute the command: ip -o link show | awk -F’: ‘ ‘{print “ip link set dev “$2″ up”}’ >ip_up.sh

[root@linux1 larry]# ip -o link show | awk -F’: ‘ ‘{print “ip link set dev “$2″ up”}’ >ip_up.sh
[root@linux1 larry]#

3. Change Permission to 775 on file ip_up.sh

[root@linux1 larry]# chmod 770 ip_up.sh
[root@linux1 larry]#

4. Execute file ip_up.sh

[root@linux1 larry]# ./ip_up.sh
[root@linux1 larry]#

5. Execute the command:

find /etc/sysconfig/network-scripts -name “ifcfg-*” -not -name “*bak”| awk -F’: ‘ ‘{print “perl -pi.bak -e ‘”‘”‘s/ONBOOT=no/ONBOOT=yes/g'”‘”‘ “$1}’ > net_ifcfg_update.sh

6. Change the permissions to 775 on file net_ifcfg_update.sh.

[root@linux1 ~]# chmod 775 net_ifcfg_update.sh
[root@linux1 ~]#

7. Execute file net_ifcfg_update.sh.

[root@linux1 ~]# ./net_ifcfg_update.sh
[root@linux1 ~]#

8. Now restart your linux server with the command: reboot.

[root@linux1 larry]# reboot

9. This completes changing your Network adapters to automatically start at system start.

Larry Catt, OCP

ORACLE 12c – Configure server and client network for database

Oracle Net Services are the elements that provides connection for distributed services. This article covers the methods of: Oracle Net; Local Naming Method; Easy Connect Naming Method; Directory Naming Method; and External Naming Methods

 

 

Oracle Net Method:

Oracle Net acts as the data courier, it establishes and maintains the connection between client and server.   In Oracle Net configuration a client is setup to connect to a listener process on the server via an alias name in the configuration file.   The Listener process on the server performs connection to database and client.  Oracle Net Services can handle non Oracle data source connections such as SQL Server, DB2 and external code libraries through EXTPROC.  Database server receives initial connection through the Listener and then hands off connection from client to a server process, once handoff has occurred the client communicates directly with database server.   Listener failure will not stop currently connected sessions, only new ones.  Client must configure a descriptor to give the database location, service name and port.  In order to connect, the tnsnames.ora file descriptor must have a matching entry in listener.ora of the listener process on server.

 

There are several other types of network connections besides Oracle Net:

  1. Java Application Connections
  2. Web Client connections by Application Web Server.
  3. OCI

 

 

Client TNSNAMES.ORA file:

 

ORCL =

  (DESCRIPTION =

    (ADDRESS_LIST =

      (ADDRESS = (PROTOCOL = TCP)

(HOST = mylinux.localdomain.com)

(PORT = 1521))

    )

    (CONNECT_DATA =

      (SERVER = DEDICATED)

      (SERVICE_NAME = ORCL)

      (SID = ORCL)

    )

  )

 

Address Section:

Protocol – defines protocal being used by listener device, TCP is for TCP/IP

Host – can use name or IP, identifies IP of Listener

Port – Defines port listener is listening on, default is 1521

Connect data Section:

SID – Name of SID for database you wish to connect to.

SERVICE_NAME – Name given in the SERVICE_NAMES initialization parameter is the global database name.

INSTANCE_NAME – Id the database instance, it is optional and default is the SID.

DEDICATED SERVER – listener will start a dedicated server process for each incoming connection.  Each client will have its own server process which will terminate upon exit of the session.

 

Steps for listener connection:

  1. Listener receives client request.
  2. Listener starts dedicated server process and passes connection request to process.
  3. Client now connected directly to server process.
  4. Server process checks client’s credentials for authentication.
  5. If credentials are good, session is created for client.

 

 

Local Naming Method:

Local naming method uses TNSNAMES.ORA file to provide client with connection address, file is normally located in $ORACLE_HOME/network/admin

 

Easy Connect Naming Method:

Bypasses lookup in TNSNAMES.ORA file and uses simple string to connect to database server.  You can use Easy Connect if the following conditions are met:

  1. Oracle Net Services software installed
  2. TCP/IP supported on server and client.
  3. No add-ons like external procedure calls or heterogeneous services exist.
  4. EZCONNECT is listed in NAMES.DIRECTORY_PATH of SQLNET.ORA file.

 

CONNECT username/password@host/ORCL

 

Directory Naming Method:

Uses LDAP compliant technology such as Oracle Internet Directory, connection are mapped to connection descriptors in directory server.   LDAP server provides central management of network connection services.  Directory service is created during database creation and use EM Cloud or Oracle Net Manager to configure client for directory method.

 

External Naming Methods:

Third part method such as Network Information Services (NIS), allows client to resolve service to network service name and prevents local configuration of database connections.

 

 

Larry Catt

OCP

Configure tnsnames.ora file for PDB

Oracle 12c multitenant database normally uses the same oracle networking files as other Oracle RDBMS implementations.    This article covers the configuration of the tnsnames.ora file for connection to a PDB database cdb1.

 

  1. Connect to your oracle database server as the oracle software owner.

 

[larry@linux2 ~]$ su – oracle

Password:

Last login: Mon Apr 24 10:45:22 EDT 2016 on pts/1

[oracle@linux2 ~]$

 

  1. You can use the following code to create the appropriate tnsnames.ora entries in the file $ORACLE_HOME/network/admin/tnsnames.ora or manually insert into the file knowing the machine IP, Port, SID, and service name.

 

NOTE:  You have to edit the parameter SERVICE_NAME and Alias, in below example they are pdb1 and PDB1 respectively.   PDBs do not have SID listings because they are Services which are contained within a CDB and only CDBs have SIDs in multitenant architecture.

 

echo -e “PDB1 =\n” \

”  (DESCRIPTION =\n” \

”    (ADDRESS_LIST =\n” \

”      (ADDRESS = (PROTOCOL = TCP)(HOST = “`hostname -i`”)(PORT = 1521))\n” \

”    )\n” \

”    (CONNECT_DATA =\n” \

”      (SERVER = DEDICATED)\n”  \

”      (SERVICE_NAME = pdb1)\n” \

”      (SID = “$ORACLE_SID”)\n” \

”    )\n” \

”  )\n” >> $ORACLE_HOME/network/admin/tnsnames.ora

 

Execution Example:

 

[oracle@linux2 admin]$ echo -e “PDB1 =\n” \

> ”  (DESCRIPTION =\n” \

> ”    (ADDRESS_LIST =\n” \

> ”      (ADDRESS = (PROTOCOL = TCP)(HOST = “`hostname -i`”)(PORT = 1521))\n” \

> ”    )\n” \

> ”    (CONNECT_DATA =\n” \

> ”      (SERVER = DEDICATED)\n”  \

> ”      (SERVICE_NAME = pdb1)\n” \

> ”      (SID = “$ORACLE_SID”)\n” \

> ”    )\n” \

> ”  )\n” >> $ORACLE_HOME/network/admin/tnsnames.ora

[oracle@linux2 admin]

 

 

  1. After execution or editing, you can view the contains of the tnsnames.ora file with the cat command as shown below:

 

 

[oracle@linux2 admin]$ cat tnsnames.ora

CDB1 =

   (DESCRIPTION =

     (ADDRESS_LIST =

       (ADDRESS = (PROTOCOL = TCP)(HOST = 10.30.15.75)(PORT = 1521))

     )

     (CONNECT_DATA =

       (SERVER = DEDICATED)

       (SERVICE_NAME = cdb1)

       (SID = cdb1)

     )

   )

 

PDB1 =

   (DESCRIPTION =

     (ADDRESS_LIST =

       (ADDRESS = (PROTOCOL = TCP)(HOST = 10.30.15.75)(PORT = 1521))

     )

     (CONNECT_DATA =

       (SERVER = DEDICATED)

       (SERVICE_NAME = pdb1)

       (SID = cdb1)

     )

   )

 

[oracle@linux2 admin]$

  1. As long as the listener processes is started, the container database is up and running, and the respective PDB is up; you can test the connection through the tnsping utility by suppling the reference alias name in the tnsnames.ora file. In this example the reference name is PDB1, as shown below.

 

[oracle@linux2 admin]$ tnsping PDB1

 

TNS Ping Utility for Linux: Version 12.1.0.2.0 – Production on 24-APR-2016 11:56:34

 

Copyright (c) 1997, 2014, Oracle.  All rights reserved.

 

Used parameter files:

 

 

Used TNSNAMES adapter to resolve the alias

Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.30.15.75)(PORT = 1521))) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = pdb1) (SID = cdb1)))

OK (0 msec)

[oracle@linux2 admin]$

 

  1. This completes setup of tnsnames.ora file for PDB connection in Oracle 12c.

 

Larry Catt

OCP

 

Configure tnsnames.ora file for CDB

Oracle 12c multitenant database normally uses the same oracle networking files as other Oracle RDBMS implementations.    This article covers the configuration of the tnsnames.ora file for connection to a CDB database cdb1.

 

  1. Connect to your oracle database server as the oracle software owner.

 

[larry@linux2 ~]$ su – oracle

Password:

Last login: Mon Apr 24 10:45:22 EDT 2016 on pts/1

[oracle@linux2 ~]$

 

  1. You can use the following code to create the appropriate tnsnames.ora entries in the file $ORACLE_HOME/network/admin/tnsnames.ora or manually insert into the file knowing the machine IP, Port, SID, and service name.

 

echo -e “CDB1 =\n” \

”  (DESCRIPTION =\n” \

”    (ADDRESS_LIST =\n” \

”      (ADDRESS = (PROTOCOL = TCP)(HOST = “`hostname -i`”)(PORT = 1521))\n” \

”    )\n” \

”    (CONNECT_DATA =\n” \

”      (SERVER = DEDICATED)\n”  \

”      (SERVICE_NAME = “$ORACLE_SID”)\n” \

”      (SID = “$ORACLE_SID”)\n” \

”    )\n” \

”  )\n” >> $ORACLE_HOME/network/admin/tnsnames.ora

 

Execution Example:

 

[oracle@linux2 admin]$ echo -e “CDB1 =\n” \

> ”  (DESCRIPTION =\n” \

> ”    (ADDRESS_LIST =\n” \

> ”      (ADDRESS = (PROTOCOL = TCP)(HOST = “`hostname -i`”)(PORT = 1521))\n” \

> ”    )\n” \

> ”    (CONNECT_DATA =\n” \

> ”      (SERVER = DEDICATED)\n”  \

> ”      (SERVICE_NAME = “$ORACLE_SID”)\n” \

> ”      (SID = “$ORACLE_SID”)\n” \

> ”    )\n” \

> ”  )\n” >> $ORACLE_HOME/network/admin/tnsnames.ora

[oracle@linux2 admin]

 

 

  1. After execution or editing, you can view the contains of the tnsnames.ora file with the cat command as shown below:

 

 

oracle@linux2 admin]$ cat tnsnames.ora

CDB1 =

   (DESCRIPTION =

     (ADDRESS_LIST =

       (ADDRESS = (PROTOCOL = TCP)(HOST = 10.30.15.75)(PORT = 1521))

     )

     (CONNECT_DATA =

       (SERVER = DEDICATED)

       (SERVICE_NAME = cdb1)

       (SID = cdb1)

     )

   )

 

  1. As long as the listener process and database is up and running, you can test the connection through the tnsping utility by suppling the reference name in the tnsnames.ora file. In this example the reference name is CDB1, as shown below.

 

[oracle@linux2 ~]$ tnsping CDB1

 

TNS Ping Utility for Linux: Version 12.1.0.2.0 – Production on 24-APR-2016 11:49:44

 

Copyright (c) 1997, 2014, Oracle.  All rights reserved.

 

Used parameter files:

 

 

Used TNSNAMES adapter to resolve the alias

Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.30.15.75)(PORT = 1521))) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = cdb1) (SID = cdb1)))

OK (0 msec)

[oracle@linux2 ~]$

 

 

  1. This completes setup of tnsnames.ora file for CDB connection in Oracle 12c.

 

Larry Catt

OCP

 

Configure listener.ora for PDB

With Oracle 12c multitenant databases connection is still normally performed through the Oracle networking files of listener.ora, tnsnames.ora, and sqlnet.ora.   PDBs are contained within a specific CDBs thus no configuration of the listener is needed.   The listener process will pick up all active PDBs on startup if the PDB is started within its CDB.  However, you can test the connection to a PDB through the listener process as shown below.

 

 

  1. Logon to your Oracle Server as the oracle software owner.

 

[larry@linux2 ~]$ su – oracle

Password:

Last login: Mon Feb 24 09:57:56 EDT 2016 on pts/0

[oracle@linux2 ~]$

 

  1. Now start the listener with the command: lsnrctl start

 

[oracle@linux2 ~]$ lsnrctl start

 

LSNRCTL for Linux: Version 12.1.0.2.0 – Production on 24-FEB-2016 10:58:06

 

Copyright (c) 1991, 2014, Oracle.  All rights reserved.

 

Starting /opt/app/oracle/product/12.1.0.2/db_1/bin/tnslsnr: please wait…

 

TNSLSNR for Linux: Version 12.1.0.2.0 – Production

System parameter file is /opt/app/oracle/product/12.1.0.2/db_1/network/admin/listener.ora

Log messages written to /opt/app/oracle/diag/tnslsnr/linux2/listener/alert/log.xml

Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.30.15.75)(PORT=1521)))

 

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.30.15.75)(PORT=1521)))

STATUS of the LISTENER

————————

Alias                     LISTENER

Version                   TNSLSNR for Linux: Version 12.1.0.2.0 – Production

Start Date                24-FEB-2016 10:58:06

Uptime                    0 days 0 hr. 0 min. 0 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Parameter File   /opt/app/oracle/product/12.1.0.2/db_1/network/admin/listener.ora

Listener Log File         /opt/app/oracle/diag/tnslsnr/linux2/listener/alert/log.xml

Listening Endpoints Summary…

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.30.15.75)(PORT=1521)))

Services Summary…

Service “cdb1” has 1 instance(s).

  Instance “cdb1”, status UNKNOWN, has 1 handler(s) for this service…

The command completed successfully

[oracle@linux2 ~]$

 

  1. List all serviced SIDs and Services with the command: lsnrctl status.

 

[oracle@linux2 admin]$ lsnrctl status

 

LSNRCTL for Linux: Version 12.1.0.2.0 – Production on 24-FEB-2016 11:08:45

 

Copyright (c) 1991, 2014, Oracle.  All rights reserved.

 

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.30.15.75)(PORT=1521)))

STATUS of the LISTENER

————————

Alias                     LISTENER

Version                   TNSLSNR for Linux: Version 12.1.0.2.0 – Production

Start Date                24-FEB-2016 10:58:06

Uptime                    0 days 0 hr. 10 min. 39 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Parameter File   /opt/app/oracle/product/12.1.0.2/db_1/network/admin/listener.ora

Listener Log File         /opt/app/oracle/diag/tnslsnr/linux2/listener/alert/log.xml

Listening Endpoints Summary…

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.30.15.75)(PORT=1521)))

Services Summary…

Service “cdb1” has 2 instance(s).

  Instance “cdb1”, status UNKNOWN, has 1 handler(s) for this service…

  Instance “cdb1”, status READY, has 1 handler(s) for this service…

Service “cdb1XDB” has 1 instance(s).

  Instance “cdb1”, status READY, has 1 handler(s) for this service…

Service “pdb1” has 1 instance(s).

  Instance “cdb1”, status READY, has 1 handler(s) for this service…

The command completed successfully

[oracle@linux2 admin]$

 

NOTE:  The Service pdb1 is being handled by the Instance cdb1.   The SID you will see at the OS layer will be cdb1 and you will not see any SID named pdb1.   PDB1 is a service which is handled by the SID cdb1.

 

  1. You can test the listener configuration by suppling the tnsping utility with the <machine_IP>:<Port>/<service_name> as below:

 

[oracle@linux2 admin]$ tnsping 10.30.15.75:1521/pdb1

 

TNS Ping Utility for Linux: Version 12.1.0.2.0 – Production on 24-FEB-2016 11:38:30

 

Copyright (c) 1997, 2014, Oracle.  All rights reserved.

 

Used parameter files:

 

Used HOSTNAME adapter to resolve the alias

Attempting to contact (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=pdb1))(ADDRESS=(PROTOCOL=TCP)(HOST=10.30.15.75)(PORT=1521)))

OK (10 msec)

[oracle@linux2 admin]$

 

  1. This completes configuration of listener.ora file for PDB.

 

 

Larry Catt

OCP

 

 

Configure listener.ora for CDB

With Oracle 12c multitenant databases connection is still normally performed through the Oracle networking files of listener.ora, tnsnames.ora, and sqlnet.ora.   This articles shows the configuration of listener.ora file to support connection to a CDB database called cdb1.

 

 

  1. Logon to your Oracle Server as the oracle software owner.

 

[larry@linux2 ~]$ su – oracle

Password:

Last login: Mon FEB 24 09:57:56 EDT 2016 on pts/0

[oracle@linux2 ~]$

 

  1. Create the file listener.ora with the following statement:

 

echo -e “SID_LIST_LISTENER =\n” \

”  (SID_LIST =\n” \

”      (SID_DESC =\n” \

”      (SID_NAME = “$ORACLE_SID”)\n” \

”      (SERVICE_NAME = “$ORACLE_SID”)\n” \

”      (GLOBAL_DBNAME = “$ORACLE_SID”)\n” \

”      (ORACLE_HOME = “$ORACLE_HOME”)\n” \

”    )\n” \

”  )\n” \

“\nLISTENER =\n” \

”  (DESCRIPTION_LIST =\n” \

”    (DESCRIPTION =\n” \

”      (ADDRESS = (PROTOCOL = TCP)(HOST = “`hostname -i`”)(PORT = 1521))\n” \

”  ))\n” \

“\nADR_BASE_LISTENER = /opt/app/oracle\n” \

“\nLOGGING_LISTENER=ON\n” \

“\nTRACE_LEVEL_SERVER=SUPPORT\n” \

“\nSQLNET.INBOUND_CONNECT_TIMEOUT=240\n” >> $ORACLE_HOME/network/admin/listener.ora

 

 

Execution example:

 

 

[oracle@linux2 admin]$ echo -e “SID_LIST_LISTENER =\n” \

> ”  (SID_LIST =\n” \

> ”      (SID_DESC =\n” \

> ”      (SID_NAME = “$ORACLE_SID”)\n” \

> ”      (SERVICE_NAME = “$ORACLE_SID”)\n” \

> ”      (GLOBAL_DBNAME = “$ORACLE_SID”)\n” \

> ”      (ORACLE_HOME = “$ORACLE_HOME”)\n” \

> ”    )\n” \

> ”  )\n” \

> “\nLISTENER =\n” \

> ”  (DESCRIPTION_LIST =\n” \

> ”    (DESCRIPTION =\n” \

> ”      (ADDRESS = (PROTOCOL = TCP)(HOST = “`hostname -i`”)(PORT = 1521))\n” \

> ”  ))\n” \

> “\nADR_BASE_LISTENER = /opt/app/oracle\n” \

> “\nLOGGING_LISTENER=ON\n” \

> “\nTRACE_LEVEL_SERVER=SUPPORT\n” \

> “\nSQLNET.INBOUND_CONNECT_TIMEOUT=240\n” >> $ORACLE_HOME/network/admin/listener.ora

 

  1. Now start the listener with the command: lsnrctl start

 

[oracle@linux2 ~]$ lsnrctl start

 

LSNRCTL for Linux: Version 12.1.0.2.0 – Production on 24-FEB-2016 10:58:06

 

Copyright (c) 1991, 2014, Oracle.  All rights reserved.

 

Starting /opt/app/oracle/product/12.1.0.2/db_1/bin/tnslsnr: please wait…

 

TNSLSNR for Linux: Version 12.1.0.2.0 – Production

System parameter file is /opt/app/oracle/product/12.1.0.2/db_1/network/admin/listener.ora

Log messages written to /opt/app/oracle/diag/tnslsnr/linux2/listener/alert/log.xml

Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.30.15.75)(PORT=1521)))

 

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.30.15.75)(PORT=1521)))

STATUS of the LISTENER

————————

Alias                     LISTENER

Version                   TNSLSNR for Linux: Version 12.1.0.2.0 – Production

Start Date                24-FEB-2016 10:58:06

Uptime                    0 days 0 hr. 0 min. 0 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Parameter File   /opt/app/oracle/product/12.1.0.2/db_1/network/admin/listener.ora

Listener Log File         /opt/app/oracle/diag/tnslsnr/linux2/listener/alert/log.xml

Listening Endpoints Summary…

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.30.15.75)(PORT=1521)))

Services Summary…

Service “cdb1” has 1 instance(s).

  Instance “cdb1”, status UNKNOWN, has 1 handler(s) for this service…

The command completed successfully

[oracle@linux2 ~]$

 

  1. You can test the listener configuration by suppling the tnsping utility with the <machine_IP>:<Port>/<service_name> as below:

 

[oracle@linux2 admin]$ tnsping 10.30.15.75:1521/cdb1

 

TNS Ping Utility for Linux: Version 12.1.0.2.0 – Production on 24-FEB-2016 11:04:40

 

Copyright (c) 1997, 2014, Oracle.  All rights reserved.

 

Used parameter files:

 

Used HOSTNAME adapter to resolve the alias

Attempting to contact (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=cdb1))(ADDRESS=(PROTOCOL=TCP)(HOST=10.30.15.75)(PORT=1521)))

OK (10 msec)

[oracle@linux2 admin]$

 

  1. This completes configuration of listener.ora file for CDB.

 

 

Larry Catt

OCP

 

 

Oracle defining different name for SID and Database

There are a ton of reasons to define a different name for Oracle SID and database, however you must ensure that your network configuration is properly setup to support this function. The key is defining the variable GLOBAL_DBNAME in your tnsnames.ora file to match your init parameter db_name, which allows various applications to include EM to resolve the database regardless of names defined.

TNSNAMES.ora for orcl on both SID and DB_NAME.


(SID_LIST =
(SID_DESC =
(SID_NAME = orcl)
(SERVICE_NAME = orcl)
(ORACLE_HOME = C:\oracle\product\11.2.0\dbhome_orcl)
)
)

TNSNAMES.ora for orcl on SID and ORACLE on DB_NAME.

(SID_LIST =
(SID_DESC =
(SID_NAME = orcl)
(SERVICE_NAME = orcl)
(GLOBAL_DBNAME=ORACLE)
(ORACLE_HOME = C:\oracle\product\11.2.0\dbhome_orcl)
)
)

Larry Catt OCP

Changing network configuration on Linux

This procedure can be used to change anything related to your network card configuration and have that change be persistent on system reboot.

  1. Logon as the root user
  2. Change directory to /etc/sysconfig/network-scripts

 [root@oel1 ~]# cd /etc/sysconfig/network-scripts

[root@oel1 network-scripts]#

3. VI the file ifcfg-eth0 and make the changes you wish.   In the example below, we edited the IPADDR variable to value of 192.1638.1.220

DEVICE=eth0

HWADDR=08:00:27:8F:E8:7D

TYPE=Ethernet

UUID=3138ac97-98ca-40fe-b24a-adea56ab46a9

ONBOOT=yes

NM_CONTROLLED=yes

BOOTPROTO=static

BROADCAST=192.168.1.255

IPADDR=192.168.1.220

NETMASK=255.255.255.0

  1. Stop the network service

 service network stop

5. Start the network service

service network start

6.   See the new configuration detail of eth0 with ifconfig command.

[root@oel1 ~]# ifconfig eth0

eth0      Link encap:Ethernet  HWaddr 08:00:27:8F:E8:7D

          inet addr:19.168.1.220 Bcast:19.168.1.255  Mask:255.255.255.0

          inet6 addr: fe80::a00:27ff:fe8f:e87d/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:16595 errors:0 dropped:0 overruns:0 frame:0

          TX packets:659 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:3986311 (3.8 MiB) TX bytes:98819 (96.5 KiB)

 

[root@oel1 ~]#

 

Larry Catt

Oracle RAC and the NTP process

If you are installing Oracle Clusterware on a Linux or UNIX machine, the following error may occur if you have not turned on Slewing:

PRVF-5439: NTP daemon does not have slewing option “-x” set on the node

The following procedure will remedy this problem, as demonstrated in a RHEL 5.4 environment.

1. Logon to your Oracle cluster node as the root user

2. Open the file /etc/sysconfig/ntpd and ensuring that the line


OPTIONS=”-u ntp:ntp -p /var/run/ntpd.pid -x”

3. If the line does not contain the –x option, edit the file so it reads as above.

4. Then stop the service as below, with the command /sbin/service ntpd stop


[root@mylinux1 ~]# /sbin/service ntpd stop
Shutting down ntpd: [ OK ]

5. Restart the service as below, with the command /sbin/service ntpd start


[root@mylinux1 ~]# /sbin/service ntpd start
ntpd: Synchronizing with time server: [ OK ]
Starting ntpd: [ OK ]
[root@mylinux1 ~]#

6. Verify that the –x option has been implemented, with the command ps –ef|grep ntp


[root@mylinux1 ~]# ps -ef|grep ntp
ntp 8301 1 0 20:33 ? 00:00:00 ntpd -u ntp:ntp -p /var/run/ntpd.pid -x
root 8792 28965 0 20:34 pts/1 00:00:00 grep ntp
[root@mylinux1 ~]#

This completes turning the NTPD slewing option on for Oracle clusteware.

Larry J. Catt, OCP 9i, 10g
oracle@allcompute.com
www.allcompute.com

Configuration of OCFS2 in LINUX

OCFS2 Oracle Cluster File System version 2 is a file system which allows for multiple machines to open the same files at the same time without corruption. This file system can be used for multiple reasons but is mostly seen in Oracle RAC systems. This article details the configuration of OCFS2 after the RPMs have been installed on your OS.

1. Logon to your Linux server as root.

2. Create the directory /etc/ocfs2 to house your oracle cluster.conf file. This file will contain the name of your cluster and all nodes with in that cluster.

[root@mylinux1 etc]# mkdir /etc/ocfs2
[root@mylinux1 etc]# chmod 775 /etc/ocfs2

3. Edit the file cluster.conf and enter the strings similar to below; changing the value of ip_address, name and cluster to values which are correct for your installation..

[root@mylinux1 etc]# vi /etc/ocfs2/cluster.conf

node:
ip_port = 7777
ip_address = 204.34.132.38
number = 0
name = mylinux1.mydomain.com
cluster = myrac

node:
ip_port = 7777
ip_address = 204.34.132.39
number = 1
name = mylinux2.mydomain.com
cluster = myrac

cluster:
node_count = 2
name = myrac

4. Configure the ocfs2 installed on each node of the RAC with the o2cb configure command. NOTE: Enter the following:


Load O2CB driver on boot (y/n) [y] = y
Cluster stack backing O2CB [o2cb] = o2cb
Cluster to start on boot (Enter “none” to clear) [ocfs2]: = name of the cluster in cluster.conf file for this example it is myrac
Specify heartbeat dead threshold (>=7) [31] = 31
Specify network idle timeout in ms (>=5000) [30000] = 30000
Specify network keepalive delay in ms (>=1000) [2000] = 2000
Specify network reconnect delay in ms (>=2000) [2000] = 2000

Example:
[root@mylinux1 etc]# /etc/init.d/o2cb configure
Configuring the O2CB driver.

This will configure the on-boot properties of the O2CB driver.
The following questions will determine whether the driver is loaded on
boot. The current values will be shown in brackets (‘[]’). Hitting
without typing an answer will keep that current value. Ctrl-C
will abort.

Load O2CB driver on boot (y/n) [y]:
Cluster stack backing O2CB [o2cb]:
Cluster to start on boot (Enter “none” to clear) [ocfs2]: myrac
Specify heartbeat dead threshold (>=7) [31]:
Specify network idle timeout in ms (>=5000) [30000]:
Specify network keepalive delay in ms (>=1000) [2000]:
Specify network reconnect delay in ms (>=2000) [2000]:
Writing O2CB configuration: OK
Starting O2CB cluster myrac: OK
[root@mylinux1 etc]#

[root@mylinux2 etc]# /etc/init.d/o2cb configure
Configuring the O2CB driver.

This will configure the on-boot properties of the O2CB driver.
The following questions will determine whether the driver is loaded on
boot. The current values will be shown in brackets (‘[]’). Hitting
without typing an answer will keep that current value. Ctrl-C
will abort.

Load O2CB driver on boot (y/n) [n]: y
Cluster stack backing O2CB [o2cb]:
Cluster to start on boot (Enter “none” to clear) [ocfs2]: myrac
Specify heartbeat dead threshold (>=7) [31]:
Specify network idle timeout in ms (>=5000) [30000]:
Specify network keepalive delay in ms (>=1000) [2000]:
Specify network reconnect delay in ms (>=2000) [2000]:
Writing O2CB configuration: OK
Loading filesystem “configfs”: OK
Mounting configfs filesystem at /sys/kernel/config: OK
Loading filesystem “ocfs2_dlmfs”: OK
Creating directory ‘/dlm’: OK
Mounting ocfs2_dlmfs filesystem at /dlm: OK
Starting O2CB cluster myrac: OK
[root@mylinux2 etc]#


This completes configuration of OCFS2 for Oracle RAC.

Larry J. Catt, OCP 9i, 10g
oracle@allcompute.com
www.allcompute.com