-
2021-05-01 07:50:20
不想再装客户端了,个太大了。
1、去下载你想要的Instance Clent版本,解压;
2、把以前备份的sqlnet.oratnsnames.ora放在解压后的目录;
3、配置环境变量
变量名:TNS_ADMIN
变量值:X:\XXXXXXXX\instantclient_10_2
4、用记事本保存为XX.reg,进行注册
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\KEY_OraClient10g_home]
"NLS_LANG"="SIMPLIFIED CHINESE_CHINA.ZHS16GBK"
"ORACLE_BUNDLE_NAME"="Enterprise"
"ORACLE_GROUP_NAME"="Oracle - OraClient10g_home"
"ORACLE_HOME"="E:\\软件\工作\instantclient_10_2"
"ORACLE_HOME_KEY"="SOFTWARE\\ORACLE\\KEY_OraClient10g_home"
"ORACLE_HOME_NAME"="OraClient10g_home"
5、设置PL/SQL
首选项--Oracle--连接--Oracle主目录名:E:\软件\工作\instantclient_10_2
首选项--Oracle--连接--OCI库:E:\软件\工作\instantclient_10_2\oci.dll
6、重新登陆PL/SQL,测试成功!
更多相关内容 -
oracleInstanceClient64位/32位
2017-11-07 10:14:29Oracle Instant Client是免安装的Oracle客户端,在连接远程主机或虚拟机时很有必要。 -
方案A:vpn-instance to vpn-instance(PE-CE)
2021-03-04 13:41:23vpn-instance to vpn-instance(PE-CE) 1.AS100 和AS200内部网络 (1)MPBGP [R2-ospf-1]dis this ospf 1 area 0.0.0.0 network 2.2.2.2 0.0.0.0 network 10.1.23.2 0.0.0.0 [R3-ospf-1]dis this ospf 1 ...方案A:vpn-instance to vpn-instance(PE-CE)
1.AS100 和AS200内部网络
(1)MPBGP[R2-ospf-1]dis this ospf 1 area 0.0.0.0 network 2.2.2.2 0.0.0.0 network 10.1.23.2 0.0.0.0 [R3-ospf-1]dis this ospf 1 area 0.0.0.0 network 3.3.3.3 0.0.0.0 network 10.1.23.3 0.0.0.0 network 10.1.34.3 0.0.0.0 [R4-ospf-1]dis this ospf 1 area 0.0.0.0 network 4.4.4.4 0.0.0.0 network 10.1.34.4 0.0.0.0 [R2]bgp 100 [R2-bgp]pee 4.4.4.4 as 100 [R2-bgp]pee 4.4.4.4 c l0 [R2-bgp]ipv4-family vpnv4 [R2-bgp-af-vpnv4]pee 4.4.4.4 enable [R4]bgp 100 [R4-bgp]pee 2.2.2.2 as 100 [R4-bgp]pee 2.2.2.2 c l0 [R4-bgp]ipv4-family vpnv4 [R4-bgp-af-vpnv4]pee 2.2.2.2 enable [R2]dis bgp vpnv4 all peer [R7-ospf-2]dis th ospf 2 area 0.0.0.0 network 7.7.7.7 0.0.0.0 network 10.1.67.7 0.0.0.0 [R6-ospf-2]dis th ospf 2 area 0.0.0.0 network 6.6.6.6 0.0.0.0 network 10.1.56.6 0.0.0.0 network 10.1.67.6 0.0.0.0 [R5-ospf-2]dis th ospf 2 area 0.0.0.0 network 5.5.5.5 0.0.0.0 network 10.1.56.5 0.0.0.0 [R7-bgp]dis th bgp 200 peer 5.5.5.5 as-number 200 peer 5.5.5.5 connect-interface LoopBack0 ipv4-family vpnv4 peer 5.5.5.5 enable [R5-bgp]dis th bgp 200 peer 7.7.7.7 as-number 200 peer 7.7.7.7 connect-interface LoopBack0 ipv4-family vpnv4 peer 7.7.7.7 enable
(2)MPLS LDP
[R2]mpls lsr-id 2.2.2.2 [R2]mpls [R2-mpls]mpls ldp [R2-mpls-ldp]int g0/0/1 [R2-GigabitEthernet0/0/1]mpls [R2-GigabitEthernet0/0/1]mpls ldp [R3]mpls lsr-id 3.3.3.3 [R3]mpls [R3-mpls]mpls ldp [R3]int g0/0/0 [R3-GigabitEthernet0/0/0]mpls [R3-GigabitEthernet0/0/0]mpls ldp [R3]int g0/0/1 [R3-GigabitEthernet0/0/1]mpls [R3-GigabitEthernet0/0/1]mpls ldp [R4]mpls lsr-id 4.4.4.4 [R4]mpls [R4-mpls]mpls ldp [R4]int g0/0/0 [R4-GigabitEthernet0/0/0]mpls [R4-GigabitEthernet0/0/0]mpls ldp
2.在PE和ASBR-PE上创建VPN-instance,绑定接口,并且建立相应的邻居
[R2/R4-vpn-instance-1]dis this ip vpn-instance 1 ipv4-family route-distinguisher 1:1 vpn-target 1:1 export-extcommunity vpn-target 1:1 import-extcommunity [R5-vpn-instance-1]dis this ip vpn-instance 1 ipv4-family route-distinguisher 2:2 vpn-target 2:2 export-extcommunity vpn-target 2:2 import-extcommunity [R2-GigabitEthernet0/0/0]dis this interface GigabitEthernet0/0/0 ip binding vpn-instance 1 ip address 10.1.12.2 255.255.255.0 [R5-GigabitEthernet0/0/0]dis this interface GigabitEthernet0/0/0 ip binding vpn-instance 1 ip address 10.1.45.5 255.255.255.0 [R4-GigabitEthernet0/0/1]dis this interface GigabitEthernet0/0/1 ip binding vpn-instance 1 ip address 10.1.45.4 255.255.255.0 [R7-GigabitEthernet0/0/1]dis this interface GigabitEthernet0/0/1 ip binding vpn-instance 1 ip address 10.1.78.7 255.255.255.0
CE-PE建立EBGP邻居
[R1-bgp]dis this bgp 300 peer 10.1.12.2 as-number 100
ASBR-PE设备(R4 和R5)建立VPN-instance的EBGP邻居
[R4]bgp 100 [R4-bgp]ipv4-family vpn-instance 1 [R4-bgp-1]dis this ipv4-family vpn-instance 1 peer 10.1.45.5 as-number 200 [R5]bgp 200 [R5-bgp]ipv4-family vpn-instance 1 [R5-bgp-1]dis this ipv4-family vpn-instance 1 peer 10.1.45.4 as-number 100 [R4-bgp]dis bgp vpnv4 all peer Peer of IPv4-family for vpn instance : VPN-Instance 1, Router ID 10.1.34.4: 10.1.45.5 4 200 60 60 0 00:57:30 Established
3.生成路由传递
[R1]bgp 300 [R1-bgp]network 1.1.1.1 32 [R8]bgp 400 [R8-bgp]network 8.8.8.8 32
4.测试
[R4]dis bgp vpnv4 all routing-table [R1]ping -a 1.1.1.1 8.8.8.8
-
Eureka之IpAddress:eureka.instance.prefer-ip-address = true
2019-09-24 08:32:32阅读本文你将了解 ... eureka.instance.prefer-ip-... 深度理解eureka.instance.ip-address和eureka.instance.prefer-ip-address = true。 杂谈 注:本篇较长、烧脑,并且涉及的范围相对广,建议选择一个舒服的姿势...阅读本文你将了解
- 微服务注册到Eureka Server上的粗粒度过程
eureka.instance.prefer-ip-address = true
时,发生的一些事- 深度理解
eureka.instance.ip-address
和eureka.instance.prefer-ip-address = true
。 - 杂谈
注:本篇较长、烧脑,并且涉及的范围相对广,建议选择一个舒服的姿势阅读。
分析,eureka.instance.prefer-ip-address
- 本节解释为什么配置eureka.instance.prefer-ip-address = true时,注册到Eureka Server上的是IP,以及是什么IP
老套路,定位问题从配置开始。
(1) 我们通过
eureka.instance.prefer-ip-address
配置项,可以找到源码org.springframework.cloud.netflix.eureka.EurekaInstanceConfigBean.preferIpAddress
(2) preferIpAddress被哪里调用,可以找到
org.springframework.cloud.netflix.eureka.EurekaInstanceConfigBean.getHostName(boolean)
代码如下:
@Override public String getHostName(boolean refresh) { if (refresh && !this.hostInfo.override) { this.ipAddress = this.hostInfo.getIpAddress(); this.hostname = this.hostInfo.getHostname(); } return this.preferIpAddress ? this.ipAddress : this.hostname; }
从这里我们可以知道,为什么配置
eureka.instance.prefer-ip-address = true
就可以将IP注册到Eureka Server上,而如果不配置就是机器的主机名。我们看到以上代码有个hostInfo,这是在哪里实例化的呢?
(3) hostInfo在
org.springframework.cloud.netflix.eureka.EurekaInstanceConfigBean
的构造方法中实例化!我们来阅读该类的构造方法:
public EurekaInstanceConfigBean(InetUtils inetUtils) { this.inetUtils = inetUtils; this.hostInfo = this.inetUtils.findFirstNonLoopbackHostInfo(); this.ipAddress = this.hostInfo.getIpAddress(); this.hostname = this.hostInfo.getHostname(); }
从中 可以看到,hostInfo是调用了
this.inetUtils.findFirstNonLoopbackHostInfo();
从中可以看到,原来hostInfo是调用了
org.springframework.cloud.commons.util.InetUtils.findFirstNonLoopbackHostInfo()
(4) 阅读
org.springframework.cloud.commons.util.InetUtils.findFirstNonLoopbackHostInfo()
可以看到以下代码:
public HostInfo findFirstNonLoopbackHostInfo() { InetAddress address = findFirstNonLoopbackAddress(); if (address != null) { return convertAddress(address); } HostInfo hostInfo = new HostInfo(); hostInfo.setHostname(this.properties.getDefaultHostname()); hostInfo.setIpAddress(this.properties.getDefaultIpAddress()); return hostInfo; }
我们再看一下该类的
org.springframework.cloud.commons.util.InetUtils.findFirstNonLoopbackAddress()
方法:
Eureka Client在com.netflix.appinfo包下的InstanceInfo类封装了本机信息,其中就包括了IP地址。
在 Spring Cloud 环境下,Eureka Client并没有自己实现探测本机IP的逻辑,而是交给Spring的InetUtils工具类的findFirstNonLoopbackAddress()方法完成的,具体如下:
public InetAddress findFirstNonLoopbackAddress() { InetAddress result = null; try { // 记录网卡最小索引 int lowest = Integer.MAX_VALUE; // 获取所有网卡 for (Enumeration<NetworkInterface> nics = NetworkInterface .getNetworkInterfaces(); nics.hasMoreElements();) { NetworkInterface ifc = nics.nextElement(); if (ifc.isUp()) { log.trace("Testing interface: " + ifc.getDisplayName()); if (ifc.getIndex() < lowest || result == null) { // 记录索引 lowest = ifc.getIndex(); } else if (result != null) { continue; } // @formatter:off // 是否是被忽略的网卡 if (!ignoreInterface(ifc.getDisplayName())) { for (Enumeration<InetAddress> addrs = ifc .getInetAddresses(); addrs.hasMoreElements();) { InetAddress address = addrs.nextElement(); if (address instanceof Inet4Address && !address.isLoopbackAddress() && !ignoreAddress(address)) { log.trace("Found non-loopback interface: " + ifc.getDisplayName()); result = address; } } } // @formatter:on } } } catch (IOException ex) { log.error("Cannot get first non-loopback address", ex); } if (result != null) { return result; } try { // 如果以上逻辑都没有找到合适的网卡,则使用JDK的InetAddress.getLocalhost() return InetAddress.getLocalHost(); } catch (UnknownHostException e) { log.warn("Unable to retrieve localhost"); } return null; }
通过源码可以看出,该工具类会获取所有网卡,依次进行遍历,取ip地址合理、索引值最小且不在忽略列表的网卡的ip地址作为结果。如果仍然没有找到合适的IP, 那么就将InetAddress.getLocalHost()做为最后的fallback方案。
至此,终于找到了获得IP的详细方法,原来只需要配置eureka.instance.prefer-ip-address = true,Spring就会自动为我们获取第一个非回环IP地址(这只是简单的说法,事实上这段代码有些容错的处理)。代码虽然长,但是很清晰。不做赘述。
eureka.instance.ip-address和eureka.instance.prefer-ip-address = true同时设置,会用自动获取的ip还是手动设置的?
上文是讨论设置
eureka.instance.prefer-ip-address = true
,但没有指定eureka.instance.ip-address
的情况。那么如果两者都被指定了,Spring会怎么处理呢?
是使用eureka.instance.ip-address手动设置的IP,还是用上面自动获取的IP呢?
答案是听eureka.instance.ip-address的。
原因是:在
org.springframework.cloud.netflix.eureka.EurekaInstanceConfigBean.setIpAddress(String)
中:
public void setIpAddress(String ipAddress) { this.ipAddress = ipAddress; this.hostInfo.override = true; }
这边设置了this.hostInfo.override,因此会导致getHostName方法不会进if语句,直接返回this.ipAddress。
@Override public String getHostName(boolean refresh) { if (refresh && !this.hostInfo.override) { this.ipAddress = this.hostInfo.getIpAddress(); this.hostname = this.hostInfo.getHostname(); } return this.preferIpAddress ? this.ipAddress : this.hostname; }
B.T.W
回到上文的
org.springframework.cloud.commons.util.InetUtils.findFirstNonLoopbackAddress()
方法,上面有很多ignoreXXX的代码。那么,如何配置想要忽略的网卡或者IP地址呢?
答案非常简单,详见Spring Cloud官方文档:
http://cloud.spring.io/spring-cloud-static/Camden.SR3/#ignore-network-interfaces
当然了,这些配置的本意并不是用来注册到Eureka上的,而是用作其他用途,只不过如果没有设置eureka.instance.ip-address时,这个IP就是注册到Eureka Server上的IP。
我们可以在应用的/env端点看到Spring为我们挑选的IP:
springCloudClientHostInfo: { spring.cloud.client.hostname: "itmuch", spring.cloud.client.ipAddress: "192.168.0.59" },
-
通过 Class.newInstance() 反射与Construtor.newInstance() 反射的区别
2022-04-01 17:02:45通过 Class.newInstance() 反射与Construtor.newInstance() 反射的区别 Constructor c2 = clazz.getDeclaredConstructor(String.class,int.class); //去除私有权限 c2.setAccessible(true); //创建对象 Object obj =...通过 Class.newInstance() 反射与Construtor.newInstance() 反射的区别
Constructor c2 = clazz.getDeclaredConstructor(String.class,int.class); //去除私有权限 c2.setAccessible(true); //创建对象 Object obj = c2.newInstance("李四",24); System.out.println(obj);
-
Constructor 除了可以反射任意参数的构造器以外,还可以反私有化构造器。
-
由于
Class.newInstance()
抛出的异常来自构造器,而Construtor.newInstance()
抛出的异常会被封装为InvocationTargetException,所以如spring、guava、zookeeper、Jackson、servlet 等框架都是使用的构造器反射方式获取对象。
此外用反射构造器来创建对象可以依靠工厂模式,来达到伸缩性和扩展性。很多配置文件里面都会出现全限定名,所以运用还是比较广的。
-
-
eureka.instance.hostname,instance-id,prefer-ip-address的作用及区别
2022-01-16 12:05:25eureka.instance.hostname,instance-id,prefer-ip-address的作用及区别 -
canal分库配置group-instance.xml
2018-10-30 17:57:55group-instance.xml介绍: 主要针对需要进行多库合并时,可以将多个物理instance合并为一个逻辑instance,提供客户端访问。 场景:分库业务。 比如产品数据拆分了4个库,每个库会有一个instance,如果不用group,... -
Azure ML 机器学习: Compute Instance, Computer Cluster, Inference Cluster的创建以及获取
2022-04-03 17:28:08解释如何在 Azure ML Python SDK 以及 Azure Portal 上创建与获取Compute Instance, Computer Cluster, Inference Cluster。 -
canal第三篇:配置多个instance
2022-04-20 15:18:45基于前两篇文章中的docker-composer.yaml调整 canal-server 在canal-server/conf/canal.properties 加入如下信息 …… # 多个使用 逗号 分割 canal.destinations = example,example2 ...新建instance.properties. -
C++ instance单例模式
2020-10-08 17:15:161、test.h #pragma once #include <string>... static int create_instance(); static void destroy_instance(); static Student *get_instance() { return m_instance; } void sh -
class accuracy、 instance accuracy、overall accuracy和average accuracy的区别
2022-03-23 19:10:40class accuracy、 instance accuracy、overall accuracy、mean accuracy和average accuracy的区别 -
newInstance() 方法
2021-07-26 17:04:56通过 Class 类的 newInstance() 方法创建对象,该方法要求该 Class 对应类有无参构造方法。执行 newInstance()方法实际上就是使用对应类的无参构造方法来创建该类的实例,其代码的作用等价于Super sup = new Super()... -
Class类简介——详述创建对象的两种方式之newInstance()方法
2020-03-18 11:09:102、newInstance() Class还有一个有用的方法可以为类创建一个实例,这个方法叫做newInstance()。例如: x.getClass.newInstance(),创建了一个同x一样类型的新实例。newInstance()方法调用默认构造器(无参数构造器... -
dbeaver Can‘t create driver instance
2022-02-10 13:53:51使用dbeaver 创建新的连接,下载完mysql驱动后,连接报错: Can’t create driver instance Error creating driver ‘MySQL’ instance. Most likely required jar files are missing. You should configure jars in... -
Chromium插件(Plugin)实例(Instance)创建过程分析
2016-11-07 00:59:29Chromium在解析网页时,每遇到一个标签,就会创建一个Plugin Instance。一般来说,Plugin Instance是在Plugin进程中创建和运行的。一个Plugin Module对应一个Plugin进程,同时可以创建多个不同的Plugin Instance。... -
微服务feign.RetryableException: Load balancer does not contain an instance for the service解决方案
2022-04-07 12:26:43遇到的问题~feign.RetryableException: connect timed out executing POST http://xxx ........ Load balancer does not contain an instance for the service 依赖的版本~ <dependency> <groupId>org... -
单例模式instance
2019-02-11 12:15:07单例模式是设计模式中最简单的模式了,它的目的是为了保证一个流程中只有一个对象存在,相当于一个全局变量。 1 单例模式的实现 ... private static SingleInstance instance = null; private ... -
解决JSON parse error: Cannot deserialize instance of `java.lang.Integer` out of VALUE_TRUE token;...
2022-05-18 18:24:15JSON parse error: Cannot deserialize instance of `java.lang.Integer` out of VALUE_TRUE token; nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize ... -
keras 的InstanceNormalization的使用
2020-01-23 15:21:461.instanceNormalization在keras_contrib中,而keras_contrib不能以常规pip方式导入,而是 pip install git+https://www.github.com/keras-team/keras-contrib.git 但是这样还需要下载git工具,我先去官网下载,... -
Java中newInstance()和new()区别
2020-11-02 09:30:49newInstance创建类是这个类必须已经加载过且已经连接(Class.forName(“A”)这个过程),new创建类是则不需要这个类加载过 newInstance 是弱类型(GC是回收对象的限制条件很低,容易被回收)、低效率、只能调用无参... -
深度学习_深度学习基础知识_Instance Normalization详解
2020-11-27 23:23:56Instance Normalization和Batch Normalization一样,也是Normalization的一种方法,只是IN是作用于单张图片,但是BN作用于一个Batch。 BN对Batch中的每一张图片的同一个通道一起进行Normalization操作,而IN是指单张... -
有人在jdk源码里下毒【class.newInstance() bug复现】
2022-02-11 17:10:21弃用原因:以前的newInstance()有bug,异常抓不到,bug后面会演示; 替代方法:clazz.getDeclaredConstructor().newInstance(),通过把构造方法中的所有异常装进InvocationTargetException来避免异常逃逸; bug复现... -
Sping Cloud Gateway Unable to find instance for
2021-09-17 10:42:21在升级springcloud体系版本时候遇到org.springframework.cloud.gateway.support.NotFoundException: Unable to find instance forxxx 出现以上错误主要原因有几个: 1、spring.application.name中不要使用下划线... -
instance must be started before calling this method
2021-07-29 15:48:16java.lang.IllegalStateException: instance must be started before calling this method 分析下原因本地测试的时候引用了dubbo服务,注册中心用的zk,zk 客户端使用的是 Apache 的 Curator 具体问题栈如下 ... -
v$instance_recovery
2021-08-19 15:09:32v$instance_recovery select optimal_logfile_size from v$instance_recovery; OPTIMAL_LOGFILE_SIZE: -
Unable to find instance for XXXX
2021-08-24 14:15:04当你的控制台报了这样的错误 这就是请求的后端服务没启动,联系后端启动后端就行。 -
Class.newInstance()与new、Constructor.newInstance()的区别
2018-06-21 17:23:29在初始化一个类,生成一个实例的时候,newInstance() 和 new 有什么区别?用newInstance与用new是区别的,区别在于创建对象的方式不一样,前者是使用类加载机制,那么为什么会有两种创建对象方式?这个就要从可伸缩... -
JSON parse error: Cannot construct instance of
2022-01-05 17:09:30JSON parse error: Cannot construct instance of `com.request.ApplyRequest$Detail` (although at least one Creator exists): can only instantiate non-static inner class by using default, no-argument ... -
MySQL 安装时 server instance configuration wizard 无响应 卡死 解决办法
2022-03-17 23:22:43MySQL 安装时 server instance configuration wizard 无响应 卡死 解决办法 Win11 Win10 出现情况: MySQL安装后 配置实例阶段 运行到最后一步执行 卡死 未响应 系统环境:win11、win10 MySQL版本:MySQL 5.5、... -
“terminate called after throwing an instance of ‘std::out_of_range‘
2022-04-30 13:51:10“terminate called after throwing an instance of ‘std::out_of_range’” 2.“Abort message: 'terminating with uncaught exception of type std::out_of_range” 这样的错误,极有可能是访问越界的问题。 导致...