Adding IP address in Oracle Linux can be done by editing the network-scripts. While this procedure is tested on Oracle Linux, i'm sure it should work on Redhat Enterprise Linux and other versions of Redhat . Editing network - scripts The network interface configuration files are found in the directory: /etc/sysconfig/network-scripts/ To add an IP address to an interface eth0 # cd /etc/sysconfig/network-scripts/ # vi ifcfg-eth0 Enter the below parameters for static configuration DEVICE="eth0" BOOTPROTO="static" BROADCAST="192.168.2.255" HWADDR="00:0C:29:DS:22:26" IPADDR="192.168.2.2" NETMASK="255.255.255.0" NETWORK="192.168.2.0" ONBOOT="yes" TYPE="Ethernet" Save the file by typing ESC :wq R estart the network service for the changes to take effect. # service network restart
Oracle offers two ways for a session to read or write operating system files. 1.Oracle directories 2. UTL_FILE package UTL_FILE package contains many PL/SQL procedures for manipulating directory objects. Operating system directories that can be accessed by UTL_FILE are only those listed in UTL_FILE_DIR instance parameter. This parameter default to NULL but can be set to any comma separated list as well as * (wildcard) which means any directory in operating system. SQL > SELECT NAME, VALUE FROM V$PARAMETER WHERE UPPER(NAME) = 'UTL_FILE_DIR' Result --------------------------------------------------------------------------------------------------- utl_file_dir NULL All the directories listed will be visible to all sessions. To give a value for UTL_FILE_DIR parameter file use the following command. SQL > sqlplus /...
Understanding TIME INTERVAL Data Types in Oracle INTERVAL YEAR TO MONTH and INTERVAL DAY TO SECOND are two data types added to store interval of two dates. They can be use both in SQL and PL/SQL. The syntax is as below: INTERVAL YEAR[(year_precision)] TO MONTH INTERVAL DAY[(day_precision)] TO SECOND[(fractional_seconds_precision)] There are defaults for precision. Two digest for year and day and six digest for fractional seconds. SQL> SELECT INTERVAL '5-9' YEAR TO MONTH FROM DUAL Result: +05-09 Cover a time interval of 5 years and 9 months SQL> SELECT INTERVAL '7 15:20:07.7' DAY TO SECOND FROM DUAL Result: +07 15:20:07.700000 Cover a time interval of 7 days, 15 hours, 20 minutes, 7 seconds and 7 milliseconds. SQL> SELECT INTERVAL '7 15:20:07.7' DAY TO SECOND(1) FROM DUAL Result: +07 15:20:07.7 Cover a time interval of 7 days, 15 hours, 20 minutes, 7 seconds and 7 milliseconds.
Comments
Post a Comment