Skip to main content

Setting up Network on Database server using the Command Line



Sometimes as a DBA you may find yourself in a database server environment without any graphical interface and you are forced to use the command line to setup the network. The procedure below shows you how to do that:-

You setup a dynamic IP by editing the file:

/etc/sysconfig/network-scripts/ifcfg-eth0 as root user

It should look like this:

DEVICE=eth0
HWADDR=08:00:27:37:A4:23 -------- ( ! replace with your network device macc addr )
TYPE=Ethernet
UUID=6c8852cb-7819-46a3-9d ------- ( ! must not be the same)
ONBOOT=yes --- ( ! very important)
NM_CONTROLLED=yes
BOOTPROTO=dhcp

For static ip edit the same file if you are using the device eth0 and just add the following:

DEVICE=eth0
BOOTPROTO=STATIC
IPADDR=192.168.0.5
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
ONBOOT=yes

After saving the changes, you need to restart the network daemon using the following command:-

$ sudo /etc/init.d/network stop
$ sudo /etc/init.d/network start

This should provide IP address to eth0 interface also. And ifconfig command should list eth0 also.

After you configure the ip address run the following commands:-

# service NetworkManager stop
# chkconfig NetworkManager off

It will retain the provided ip even after booting.
Also if you just want to quickly setup a network device run the command ifconfig -a to get the device name.
Once you get the name you want to setup use the following command:-

ifconfig eth0 192.168.0.5 netmask 255.255.255.0

Comments

Popular posts from this blog

RESOLVING SHUTDOWN IMMEDIATE HANG SITUATIONS

Many times Oracle DBA's are often faced with situation where shutting down the instance with shutdown immediate seems to take infinite time and gives an impression that the session in hung. In most of the cases this is not a hang. Hang can be defined as a scenario when few sessions/processes are waiting on some action and in turn blocking other session/processes to complete their tasks. Now the original sessions could be waiting because of resource issues or Oracle Bugs. Shutdown immediate can take long time to complete (appear to be hung) because of three reasons: Uncommitted transactions are being rolled back. SMON is cleaning temp segments or performing delayed block clean-outs. Processes still continue to be connected to the database and do not terminate. 1. Uncommitted transactions are being rolled back: This is the case when the message 'Waiting for smon  to disable tx recovery' is posted in the alert log after we issue shutdown immediate. There ...

Oracle Database 19c Step by Step Installation On Oracle Linux 7.6

This post describes the installation of Oracle Database 19c 64-bit on Oracle Linux 7.6  x86-64 bit. The Linux server needs a minimum of 3G swap and secure Linux set to permissive. An example of this type of Linux installation can be seen here . Download Software Download the Oracle software from oracle edelivery . Oracle Installation Prerequisites Automatic Setup Use the "oracle-database-preinstall-19c" package to perform all your prerequisite setup. # yum install -y oracle-database-preinstall-19c If you are using RHEL7 or CentOS7, you can pick up the PRM from the OL7 repository and install it. It will pull the dependencies from your normal repositories. # yum install -y https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm Hosts File Set a fully qualified name for the server in the "/etc/hosts" file. < IP-address > < fully-qualified-machine-name > < machin...

Step by Step Installation of Oracle Database 12c on Solaris 10

In this article we will look at Installing Oracle 12C database on Solaris x86 64bit version. This article assumes that you already had Solaris 10 installed on Virtualbox. Preparing System for Installation The first step toward Oracle installation is to perform the pre-installation tasks. Configuring hosts file The first step is to properly name your host machine. The hostname should properly be provided with IP address for installation to continue. Ideally, your /etc/hosts file should look something like this. 192.168.34.47   sol10.cm 127.0.0.1 localhost Kernel Parameters The default installation of Solaris 10 is normally good enough for oracle database installation. You just have to configure one parameter. Use the command below to set the required kernel parameters. Remember that you will have to use the root login to run the commands. # projadd  -K "project.max-shm-memory=(privileged,4G,deny)" user.oracle To confirm that parameter has be...