当前位置:网站首页>迁移服务器,重新配置数据库(数据库无监听,启动监听报TNS-12545、TNS-12560、TNS-00515错误)
迁移服务器,重新配置数据库(数据库无监听,启动监听报TNS-12545、TNS-12560、TNS-00515错误)
2022-07-26 04:57:00 【pizssn】
公司的测试服务器迁移,重新连接数据库报无监听。登录新数据库服务器去重启监听又报监听启动失败的三个错误
TNS-12545: Connect failed because target host or object does not exist
TNS-12560: TNS:protocol adapter error
TNS-00515: Connect failed because target host or object does not exist
这里贴一下原文作者大大的文章链接:linux 启动监听报错问题
因为迁移了服务器所以数据库肯定得重新配置一下。先查看一下新服务器的hostname。
[[email protected] ~]$ hostname
iZbp187xyakdytz90jknhfZ
接着去修改服务器的hosts文件(我们服务器的内容都是直接拷贝过去的,所以hosts文件里面还有部分内容是之前服务器的配置)。直接将新的服务器地址配置和hostname覆盖旧地址即可。
[[email protected] ~]$ vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
#旧地址配置
172.0.0.1 iZbfp187xyz9hZ4akdy90tn test
172.0.0.1 iZbfp187xyz9hZ4akdy90tn iZbfp187xyz9hZ4akdy90tn
#新地址配置
172.0.0.2 iZbp187xyakdytz90jknhfZ iZbp187xyakdytz90jknhfZ
这里还发生了一个小插曲,就是hosts文件是只读[readonly]文件,需要管理员角色修改一下文件编辑权限才能进行修改,不然修改了是一直不能保存的。这里我省懒,直接拿到我本地进行修改然后在进行上传覆盖即完成。
然后直接去数据库配置文件listener.ora和tnsnames.ora里面修改相应的内容。这两个配置文件直接用find命令在oracle目录下查找即可。
[[email protected] ~]$ find /home/app/oracle -name listener.ora
/home/app/oracle/product/11.2.0/dbhome_1/network/admin/samples/listener.ora
/home/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
直接进入到相应的目录下面,修改对应的listener.ora和tnsnames.ora,将对应的HOST改成我们对应的新服务器的hostname即可。
[[email protected] admin]$ vi listener.ora
# listener.ora Network Configuration File: /home/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = iZbfp187xyz9hZ4akdy90tn)(PORT = 1521))#旧hostname配置
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
ADR_BASE_LISTENER = /home/app/oracle
这时候重启一下数据库即可。注意:reboot只有在root角色下去使用才能进行重启,有的时候你不能重启可能是因为你进入了数据库角色oracle,然后此角色下进行重启,会报错。
[[email protected] /]$ reboot
最后就直接启动监听,重启数据库,数据库的重新配置就完成了。
边栏推荐
- The landing of tdengine in the GPS and AIS scheduling of Zhongtian steel
- Weights & biases (II)
- What points should be paid attention to in the selection of project management system?
- 2022 Henan Mengxin League game (3): Henan University L - synthetic game
- 1、 Basic introduction
- Two ways to create MySQL database
- Spark Structured Streaming HelloWorld
- New knowledge in big homework
- 数组排序2
- Whether the SQL that fails to execute MySQL is counted into the slow query?
猜你喜欢

User defined type details

Array sort 1

can 串口 can 232 can 485 串口转CANbus总线网关模块CAN232/485MB转换器CANCOM

The first open source MySQL native HTAP database in China will be released soon! Look at the three highlights first, limited to the surrounding areas, waiting for you~

UE4 two ways to obtain player control

Array sort 3

Customer service relationship management based on SQL net enterprise messenger enterprise communications

一个sql server查询截止某个日期最新的记录

Authentication Encyclopedia (cookies, sessions, tokens, JWT, single sign on), in-depth understanding and understanding of authentication

columns in GROUP BY clause; this is incompatible with sql_ mode=only_ full_ group_ By mysql8.0 solution
随机推荐
Soft exam review and plan
C language lseek() function: move the read and write location of the file
图像非局部均值滤波的原理
擅长C(暑假每日一题 6)
Why is mongodb fast
Google Emoji guessing game helps parents guide their children to surf the Internet safely
SQL encryption and decryption injection details
[learning notes] agc041
Ggjj, do you have a look at this problem? Does caching cause cross domain problems?
「游戏引擎 浅入浅出」4. 着色器
2022杭电多校第二场 A.Static Query on Tree(树剖)
UE4 controls the rotation of objects by pressing keys
The landing of tdengine in the GPS and AIS scheduling of Zhongtian steel
Leetcode - monotone stack and monotone queue
2022 Henan Mengxin League game (3): Henan University L - synthetic game
批量将PPM格式图片转化为JPG格式
Authentication Encyclopedia (cookies, sessions, tokens, JWT, single sign on), in-depth understanding and understanding of authentication
有ggjj看看这个问题没,是否缓存导致跨域问题?
SQL加解密注入详解
autocomplete禁止表单自动填充