欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

登录RMAN 报ORA-12162:TNS:net service name is incorrectly specif

程序员文章站 2024-02-18 19:52:52
...

登录RMAN 报ORA-12162:TNS:net service name is incorrectly specified错误

登录RMAN 报ORA-12162:TNS:net service name is incorrectly specified错误

[Oracle@localhost admin]$ date
Tue Apr 22 18:06:16 CST 2014
[oracle@localhost admin]$ rman target /
//出现诡异的ora-12162错误,第一反应是TNS,但第二反应告诉我,这是个简单的错误,,注意环境变量

Recovery Manager: Release 11.2.0.1.0 - Production on Tue Apr 22 18:08:11 2014

Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00554: initialization of internal recovery manager package failed
RMAN-04005: error from target database:
ORA-12162: TNS:net service name is incorrectly specified
[oracle@localhost admin]$ echo $ORACLE_HOME //查看ORACLE_HOME,设置正确
/u01/app/oracle/product/11.2.0/db_1
[oracle@localhost admin]$ echo $ORACLE_SID //查看ORACLE_SID,发现设置为空

[oracle@localhost ~]$ export ORACLE_SID=PROD //手工注入ORACLE_SID
[oracle@localhost ~]$ rman target / //启动RMAN,成功

Recovery Manager: Release 11.2.0.1.0 - Production on Tue Apr 22 18:13:40 2014

Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: PROD (DBID=239015079)

RMAN>

--------------------------------------推荐阅读 --------------------------------------

RMAN 配置归档日志删除策略

Oracle基础教程之通过RMAN复制数据库

RMAN备份策略制定参考内容

RMAN备份学习笔记

Oracle数据库备份加密 RMAN加密

--------------------------------------分割线 --------------------------------------