oracle 中如何获取本机ip地址,根据IP地址获取域名?

-----解析ip 地址

SQL> select utl_inaddr.get_host_address(‘google.com‘) from dual;

UTL_INADDR.GET_HOST_ADDRESS(‘GOOGLE.COM‘)

--------------------------------------------------------------------------------

122.229.30.202

-----获取本机IP地址

SQL> select utl_inaddr.get_host_address from dual;

GET_HOST_ADDRESS

--------------------------------------------------------------------------------

10.80.18.241

-----根据IP地址反向解析主机名

SQL> select utl_inaddr.get_host_name(‘10.80.18.241‘) from dual;

UTL_INADDR.GET_HOST_NAME(‘10.80.18.241‘)

--------------------------------------------------------------------------------

lixora

SQL> select utl_inaddr.get_host_name(‘10.80.18.243‘) from dual;

UTL_INADDR.GET_HOST_NAME(‘10.80.18.243‘)

--------------------------------------------------------------------------------

oracle11g-dagi

SQL> select utl_inaddr.get_host_name(‘8.8.8.8‘) from dual;

UTL_INADDR.GET_HOST_NAME(‘8.8.8.8‘)

--------------------------------------------------------------------------------

google-public-dns-a.google.com

SQL> select utl_inaddr.get_host_name(‘10.80.18.210‘) from dual;

select utl_inaddr.get_host_name(‘10.80.18.210‘) from dual

*

ERROR at line 1:

ORA-29257: host 10.80.18.210 unknown

ORA-06512: at "SYS.UTL_INADDR", line 4

ORA-06512: at "SYS.UTL_INADDR", line 35

ORA-06512: at line 1

SQL> select utl_inaddr.get_host_name(‘10.80.19.210‘) from dual;

select utl_inaddr.get_host_name(‘10.80.19.210‘) from dual

*

ERROR at line 1:

ORA-29257: host 10.80.19.210 unknown

ORA-06512: at "SYS.UTL_INADDR", line 4

ORA-06512: at "SYS.UTL_INADDR", line 35

ORA-06512: at line 1

版权声明:本文为博主原创文章,未经博主允许不得转载。

时间: 2024-11-05 19:36:40

oracle 中如何获取本机ip地址,根据IP地址获取域名?的相关文章

Py获取本机指定网卡的ip地址

前段时间需要批量修改服务器的配置文件,里面包含本机的IP地址,由于服务器有多块网卡并且配置多个ip地址,一开始想写shell脚本批量修改,但是既然现在正在学Python,何不研究下使用Python写,在网络上搜了相关文章,根据自己实际情况,便有了下面的脚本: 利用Python获取本机指定网卡的ip地址: #!/usr/bin/env python # -.- coding: utf-8 -.- # By Sandler import socket import fcntl import stru

获取本机的内外网ip

package tool; import java.net.InetAddress;import java.net.UnknownHostException; /** * @description * @author: 123.com * @create: 2019-01-17 17:34:52 **/ public class GetIp { public static void getip() { try { InetAddress address = InetAddress.getLoca

node 获取本机主机名和ip

/**获取本机ip**/function getIPAdress(){    var interfaces = require('os').networkInterfaces();    for(var devName in interfaces){        var iface = interfaces[devName];        for(var i=0;i<iface.length;i++){            var alias = iface[i];           

C# 获取本机CPU序列号,MAC地址,硬盘ID,本机IP地址,计算机名,物理内存,PC类型

首先引入服务 然后 调用 本文转载自http://blog.sina.com.cn/s/blog_7eeb43210101hf7f.html public class Computer { public static string CpuID; //1.cpu序列号 public static string MacAddress; //2.mac序列号 public static string DiskID; //3.硬盘id public static string IpAddress; //

C#获取本机的外网IP

/// <summary> /// 功能:获取本地的外网IP地址 /// 作者:黄海 /// 时间:2016-07-22 /// </summary> /// <returns></returns> private static string GetPublicIp() { var urlList = new List<string> { "http://ip.qq.com/", "http://pv.sohu.co

Linux 编程获取本机所有网卡和IP

#include <unistd.h> #include <stdio.h> #include <sys/types.h> #include <ifaddrs.h> #include <arpa/inet.h> #include <sys/socket.h> #include <netinet/in.h> #include <errno.h> #include <string.h> int main

获取本机的第一个IP(常用例程:1)

上曳净俾仕JOY献星佬突http://weibo.com/p/1001604186887362322984?8O=UK/24_2017_12 兹辉彰缺惹GBG忻霞善兄http://weibo.com/p/1001604186887370711632?06=Ei/24_2017_12 献酥茄挥前OFW孔喜南际http://weibo.com/p/1001604186887391683230?uo=2w/24_2017_12 喜汲谝埔夏PZP嘏弥泻胁http://weibo.com/p/100160

LabVIEW 获取本机多个ip地址

图 1 网上见了好多设置的,都没讲清楚,在这里整理一下本机ip地址的获取问题.关键在"字符串向ip地址转换"函数的设置上面,见下图2,选择多输出就能获取本机的多个ip地址,若不选多输出模式,则只能获取本机的一个ip. 图 2 前面板如图3所示 图 3

获取本机的ip

获取本机的ipv4的ip地址 public static IPAddress[] GetLocalIpAddress() { //显示本机内网IPv4地址 win7系统 var hostName = Dns.GetHostName(); var hostEntry = Dns.GetHostEntry(hostName); var addressList = hostEntry.AddressList; var ipv4Addresses = addressList.Where(x => x.A

Qt获取本机网络信息

目的: 获取本机的主机名.IP地址.硬件地址等网络信息. 工具: 使用Qt提供的网络模块QtNetwork: 使用Qt提供的类QHostInfo.QNetworkInterface.QNetworkAddressEntry. 代码: 获取本机主机名和IP地址 void NetworkInformation::getHostInformation() { //获取本机主机名 QString localHostName = QHostInfo::localHostName(); LineEditLo