Tag Archives: change

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

Change hostname of your Linux server

Oracle RAC depends heavily on the network, hostnames, and DNS service within a network. In this article we will show how to change the hostname of a LINUX server for the use of Oracle RAC to include the domain name.
1. Logon to your LINUX server as the root user.
2. Open the file /etc/sysconfig/network.
3. Update the parameter HOSTNAME to include the domain name.
[root@mylinux1 ~]# cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=mylinux1.mydomain.com

[root@mylinux1 ~]#

4. Reboot the server.
5. Issue the command hostname and you will see it is updated.
[root@mylinux1 ~]# hostname
mylinux1.mydomain.com
[root@mylinux1 ~]#

This completes changing the hostname of a LINUX server for Oracle RAC.

Larry J. Catt, OCP9i, 10g
oracle@allcompute.com
www.allcompute.com

Changing the Date format of an Oracle database:

The date format of the oracle database normally defaults to DD-MON-YYYY in American Language standards. However, there are times when you want to see the hours, minutes and even seconds in which a transaction occurred. There are to ways of performing this task in the Oracle database: convert the date field to a char with the to_char function, specifying the desired format or changing the default NLS_DATE_FORMAT of the system or session. In this procedure we will demonstrate changing the NLS_DATE_FORMAT of the session.

1. Logon to you oracle database as an administrator.

mylinux:> sqlplus ‘/ as sysdba’

SQL*Plus: Release 10.2.0.4.0 – Production on Wed Apr 14 10:18:48 2010

Copyright (c) 1982, 2007, Oracle. All Rights Reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 – 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>

2. Perform a select on the V$INSTANCE view for startup_time to see the current default date format of your NLS_DATE_FORMAT parameter.

SQL> select startup_time from v$instance;

STARTUP_T
———
14-APR-10

SQL>

3. NOTE: The current format only shows the day-month-year of the instance startup.

4. Perform a select on the view NLS_SESSION_PARAMETERS and you can see that the format of NLS_DATE_FORMAT is DD-MON-RR.

SQL> select * from nls_session_parameters;

PARAMETER VALUE
—————————— —————————————-
NLS_LANGUAGE AMERICAN
NLS_TERRITORY AMERICA
NLS_CURRENCY $
NLS_ISO_CURRENCY AMERICA
NLS_NUMERIC_CHARACTERS .,
NLS_CALENDAR GREGORIAN
NLS_DATE_FORMAT DD-MON-RR
NLS_DATE_LANGUAGE AMERICAN
NLS_SORT BINARY
NLS_TIME_FORMAT HH.MI.SSXFF AM
NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
NLS_DUAL_CURRENCY $
NLS_COMP BINARY
NLS_LENGTH_SEMANTICS BYTE
NLS_NCHAR_CONV_EXCP FALSE

17 rows selected.

SQL>

5. Perform an alter session statement to change the default format to include hours, minutes, and seconds.

alter session set nls_date_format=’DD-MON-YYYY HH24:MI:SS’;

6. Again perform a select on the view NLS_SESSION_PARAMETERS.

SQL> select * from nls_session_parameters;

PARAMETER VALUE
—————————— —————————————-
NLS_LANGUAGE AMERICAN
NLS_TERRITORY AMERICA
NLS_CURRENCY $
NLS_ISO_CURRENCY AMERICA
NLS_NUMERIC_CHARACTERS .,
NLS_CALENDAR GREGORIAN
NLS_DATE_FORMAT DD-MON-YYYY HH24:MI:SS
NLS_DATE_LANGUAGE AMERICAN
NLS_SORT BINARY
NLS_TIME_FORMAT HH.MI.SSXFF AM
NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
NLS_DUAL_CURRENCY $
NLS_COMP BINARY
NLS_LENGTH_SEMANTICS BYTE
NLS_NCHAR_CONV_EXCP FALSE

17 rows selected.

SQL>

7. Now select the startup_time from the view V$INSTANCE and you will see the hours, minutes, and seconds of the instance startup. All date variables will be displayed in this format for the rest of the current session.

SQL> select startup_time from v$instance;

STARTUP_TIME
——————–
14-APR-2010 07:27:18

SQL>

NOTE: Changing this parameter at the system level will change the display of dates for all sessions in the database.

This completes changing the default date format in an Oracle database.

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

Changing init parameters with an SPFILE:

Since Oracle 9i, Oracle has introduced the use of SPFILE over INIT files for control of the RDBMS initialization parameters. The introduction of SPFILE was to allow for the dynamic changing of initialization parameters setting while the database is up and eliminating the need to open an OS layer file to make changes to the ORACLE initialization parameters. This article will cover: how to change initialization parameter from within an Oracle database. This procedure is the same on any OS.

1. Logon to your Oracle database server as the Oracle software owner.

2. Connect to SQLPLUS with SYSDBA privileges.

mylinux :> sqlplus ‘/ as SYSDBA’

SQL*Plus: Release 10.2.0.4.0 – Production on Sun Sep 27 09:49:04 2009

Copyright (c) 1982, 2007, Oracle. All Rights Reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 – 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>

3. We use the alter system command to change initialization parameters from within the Oracle database while an SPFILE is in use. The following is an example of the alter system command.

alter system set {initialization_parameter} = {new_value} scope = {scope}

4. The key here is the scope clause which can have three possible values:

MEMORY – No changes are made to the SPFILE at all and the change is only mode in the current instance. To use this option, the initialization parameter must be dynamic and modifiable.

BOTH – Changes are made both in the current instance and in the SPFILE for future restart of the database. To use this option, the initialization parameter must be dynamic and modifiable.

SPFILE – Changes are not made in the current instance and the SPFILE is updated with new initialization parameter setting; however it will only take affect on restart of the database.

5. Examples of changing initialization parameter with alter system command:

SQL> alter system set user_dump_dest = ‘/opt/oracle/udump’ scope=both;

System altered.

SQL> alter system set user_dump_dest = ‘/opt/oracle/udump ‘ scope=memory;

System altered.

SQL> alter system set audit_file_dest=’/opt/oracle/udump ‘ scope=spfile;

System altered.

This completes adjusting initialization parameters in an SPFILE.

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