查看Oracle是哪个Oracle_home 下启动的

[root@rac1 ~]# ps -ef|grep smon
root       413 24903  0 22:30 pts/0    00:00:00 grep --color=auto smon
root     27165     1  0 22:11 ?        00:00:09 /u01/app/19.0.0/grid/bin/osysmond.bin
grid     27784     1  0 22:12 ?        00:00:00 asm_smon_+ASM1
oracle   29505     1  0 22:12 ?        00:00:00 ora_smon_cdb1
[root@rac1 ~]# gdb -q -x print_environment.gdb  a.out 29505 
a.out: No such file or directory.
Attaching to process 29505
Reading symbols from /u01/app/oracle/product/19.0.0/db_1/bin/oracle...(no debugging symbols found)...done.
Reading symbols from /u01/app/oracle/product/19.0.0/db_1/lib/libodm19.so...(no debugging symbols found)...done.
Loaded symbols for /u01/app/oracle/product/19.0.0/db_1/lib/libodm19.so
Reading symbols from /u01/app/oracle/product/19.0.0/db_1/lib/libofs.so...(no debugging symbols found)...done.
Loaded symbols for /u01/app/oracle/product/19.0.0/db_1/lib/libofs.so
Reading symbols from /u01/app/oracle/product/19.0.0/db_1/lib/libcell19.so...done.
Loaded symbols for /u01/app/oracle/product/19.0.0/db_1/lib/libcell19.so
Reading symbols from /u01/app/oracle/product/19.0.0/db_1/lib/libskgxp19.so...(no debugging symbols found)...done.
Loaded symbols for /u01/app/oracle/product/19.0.0/db_1/lib/libskgxp19.so
Reading symbols from /u01/app/oracle/product/19.0.0/db_1/lib/libskjcx19.so...(no debugging symbols found)...done.
Loaded symbols for /u01/app/oracle/product/19.0.0/db_1/lib/libskjcx19.so

-- Problem Statement:
On 10.2.0.1 in Production:
When attempting to connect AS SYSDBA to an open Oracle database,
the following message is received:

MESSAGE
-------------------
Connected to an idle instance.

However, the database was indeed up, running, and open.

CAUSE

The session's $ORACLE_HOME was not the same as that the instance was started with.

The Oracle instance was started with a trailing slash in $ORACLE_HOME: /opt/oracle/10gR2/

The session's $ORACLE_HOME was: /opt/oracle/10gR2 (without the trailing slash).

SOLUTION

From Note 373303.1, "How to Check the Environment Variables for an Oracle Process":


1. Determine the pid of the process at OS level, eg for the smon process:

ps -ef | grep smon

2. Get the environment of the process:

SOLARIS:
pargs -e <pid from above> | grep ORACLE

(See Note 373303.1 for syntax on other platforms.)

3. Modify ORACLE_HOME in the session environment to match this string.

Or, restart the instance using the ORACLE_HOME that matches that of the session environment.

There are cases when a database was started from an environment that did not have all the variables set correctly and this can cause troubles afterwards. Typical examples are :

- starting a database from an environment where ORACLE_HOME has a path with a final forward slash ( "/u01/oracle/12.1.0.1/db_1/" rather than "/u01/oracle/12.1.0.1/db_1")

- starting the database from an environment that points with the TNS_ADMIN parameter to the wrong sqlnet configuration files

- starting the database with the incorrect value for LD_LIBRARY_PATH  (LIBPATH for AIX or SHLIB_PATH for HP)

- starting the database from an environment that does not have the ORACLE_UQNAME variable set, although this is used to derive the path to a TDE( or SSL ) wallet.

This note presents the methods to be used to find out the values of the environment variables used by the database processes.

SOLUTION

1. Determine the pid of the process at OS level, eg for the smon process:
ps -ef | grep smon

2. Get the environment of the process:

SOLARIS:
pargs -e <pid from above> | grep ORACLE

LINUX:
cat /proc/<pid from above>/environ

AIX:
ps eauwww <pid from above>

HP-UX:
On this Unix flavor there is no command to grasp the process environment directly. This can only be extracted using a debugger from the _environ structure. This procedure can be used on the other Unix flavors, as follows:
gdb smon <pid from above>
This attaches gdb to the pid mentioned above. The smon name is just an indication that the process we attach to is smon, but the only parameter that matters is the pid.
After attaching to the process, the following command extracts the information from the _environ list:
p ((char**)_environ)[0]@30
which would list the first 30 environment variables. If more are defined, just increase the parameter after @.
As well, the list can be extracted one item from the list at a time, using an iterator like:
p ((char**)_environ)[i]
which would extract element #i+1.

Alternatively you can do this :

1) Create the following script called print_environment.gdb:

set $v = (char**)environ
while $v[0]
  print $v[0]
  set $v = $v+1
end
detach
quit

2) Get the PID of one background server process :

ps -ef | grep smon

3) Call print_environment.gdb to display the variable ( SHLIB_PATH in this case ) :

gdb -q -x print_environment.gdb  a.out <pid from above> | grep SHLIB_PATH


Windows:
To get the information on Windows, 2 things are needed:
1. check the registry for the ORACLE_* keys used to start the Oracle process. These keys are in:
HKEY_LOCAL_MACHINE/Software/Oracle/HOME<x>
(before 10g)
HKEY_LOCAL_MACHINE/SOFTWARE/ORACLE/KEY_<home name>
from 10g on.
2. check the environment variables that were used by the oracle process at startup.
For this, one would need the process explorer utility from sysinternals, which can be found at:
www.sysinternals.com
(http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx)
After starting the procexp utility, find the oracle process you want to check in the process list, right click on it, then select Properties. The Environment tab should indicate all the environment variables used when the process was started (even if dynamically in command line).
The utility also displays the key values from registry, but being so many it's difficult to look for them.


The most used application of this document is when dealing with the "Connected to an idle instance" scenario for a bequeath sysdba connection. This error indicates that ORACLE_SID and ORACLE_HOME in the current session do not match the same environment variables that were used when the database is started (ORACLE_SID and ORACLE_HOME are the strings used to uniquely identify the shared memory segment of the instance when a connection is done). Check the ORACLE_SID and ORACLE_HOME of the background process and compare them with the ones in the current session to find the mismatch.

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/765706.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

Shiro框架

入门概述 1 shiro是什么? Apache Shiro 是一个功能强大且易于使用的 Java 安全(权限)框架。Shiro 可以完成&#xff1a;认证、授权、加密、会话管理、与 Web 集成、缓存 等。借助 Shiro 您可以快速轻松地保护任何应用程序——从最小的移动应用程序到最大的 Web 和企业应用程…

Spring之spring的单例bean是线程安全的吗

Spring单例bean是线程安全的吗&#xff1f; 不是线程安全的。 1、Bean的作用域 Service Scope("singleton") public class UserServiceImpl implements UserService{ } singleton &#xff08;默认&#xff09;&#xff1a;bean在每个Spring IOC容器中只有一个实例…

【C++进阶学习】第五弹——二叉搜索树——二叉树进阶及set和map的铺垫

二叉树1&#xff1a;深入理解数据结构第一弹——二叉树&#xff08;1&#xff09;——堆-CSDN博客 二叉树2&#xff1a;深入理解数据结构第三弹——二叉树&#xff08;3&#xff09;——二叉树的基本结构与操作-CSDN博客 二叉树3&#xff1a;深入理解数据结构第三弹——二叉树…

BAS(入侵与攻击模拟)正在替代红队测试?

之前经常会被用户问到&#xff0c;漏扫、渗透和红队红的区别是啥&#xff1f; 传统的漏扫、渗透和红蓝对抗&#xff0c;可以看到工具化的漏洞不可靠&#xff0c;人工的成本就高。怎么找到一个漏洞可信度又高&#xff0c;成本又低的&#xff0c;就诞生了BAS。 抛开漏扫&#xf…

实体行业零基础做短视频矩阵,轻松实现海量曝光!

​在很多人的理解中&#xff0c;抖音是一个不错的盈利渠道&#xff0c;就像早些年的某宝、某多一样&#xff0c;我们现在在抖音看到的许多账号&#xff0c;大的IP&#xff0c;大多数都是品牌方、MCN机构&#xff0c;或者草根的网红等&#xff0c;但还是有不少实体老板没有入局&…

ShareSDK iOS端如何实现小红书分享

下载SDK 请登陆官网 &#xff0c;找到SDK下载&#xff0c;勾选需要的平台下载 导入SDK &#xff08;1&#xff09;离线导入将上述下载到的SDK&#xff0c;直接将整个SDK资源文件拖进项目里&#xff0c;如下图&#xff1a; 并且勾选以下3个选项 在点击Finish&#xff0c;…

Python - 递归函数(Recursive Function)的速度优化 (Python实现)

欢迎关注我的CSDN&#xff1a;https://spike.blog.csdn.net/ 本文地址&#xff1a;https://spike.blog.csdn.net/article/details/140137432 免责声明&#xff1a;本文来源于个人知识与开源资料&#xff0c;仅用于学术交流&#xff0c;不包含任何商业技术&#xff0c;欢迎相互学…

RTSP协议在视频监控系统中的典型应用、以及视频监控设备的rtsp地址格式介绍

目录 一、协议概述 1、定义 2、提交者 3、位置 二、主要特点 1、实时性 2、可扩展性 3、控制功能 4、回放支持 5、网络适应性 三、RTSP的工作原理 1、会话准备 2、会话建立 3、媒体流控制 4、会话终止 5、媒体数据传输 四、协议功能 1、双向性 2、带外协议 …

Studying-代码随想录训练营day26| 491.递增子序列、46.全排列、47.全排列 II、51.N皇后、37.解数独、回溯总结

第26天&#xff0c;回溯part04&#xff0c;昨天休息复习总结回溯内容&#xff0c;&#x1f4aa;(ง •_•)ง&#x1f4aa; 目录 491.递增子序列 46.全排列 47.全排列 II 51.N皇后 37.解数独 回溯总结 491.递增子序列 文档讲解&#xff1a;代码随想录递增子序列 视频讲…

d3dcompiler47dll丢失怎么解决,总结几种靠谱的方法

在日常生活和工作中&#xff0c;电脑已经成为我们不可或缺的工具。然而&#xff0c;在使用电脑的过程中&#xff0c;我们常常会遇到一些错误提示&#xff0c;其中之一就是“找不到d3dcompiler_47.dll”。这个问题可能会对电脑系统的正常运行造成一定的影响&#xff0c;因此我们…

多商户b2b2c商城系统怎么运营

B2B2C多用户商城系统支持多种运营模式&#xff0c;以满足不同类型和发展阶段的企业需求。以下是五大主要的运营模式&#xff1a; **1. 自营模式&#xff1a;**平台企业通过建立自营线上商城&#xff0c;整合自身多渠道业务。通过会员、商品、订单、财务和仓储等多用户商城管理系…

旧版st7789屏幕模块 没有CS引脚的天坑 已解决!!!

今天解决了天坑一个&#xff0c;大家可能有的人买的是st7789屏幕模块&#xff0c;240x240&#xff0c;1.3寸的 他标注的是老版&#xff0c;没有CS引脚&#xff0c;小崽子长这样&#xff1a; 这熊孩子用很多通用的驱动不吃&#xff0c;死活不显示&#xff0c;网上猛搜&#xff…

【简单讲解神经网络训练中batch的作用】

&#x1f3a5;博主&#xff1a;程序员不想YY啊 &#x1f4ab;CSDN优质创作者&#xff0c;CSDN实力新星&#xff0c;CSDN博客专家 &#x1f917;点赞&#x1f388;收藏⭐再看&#x1f4ab;养成习惯 ✨希望本文对您有所裨益&#xff0c;如有不足之处&#xff0c;欢迎在评论区提出…

pdf怎么拆分成一页一页?4种拆分方法分享

在日常的办公学习中&#xff0c;PDF文档因其跨平台、易阅读、不易篡改等特性&#xff0c;成为我们工作和学习中不可或缺的一部分。然而&#xff0c;当我们需要对PDF进行编辑、打印或分享时&#xff0c;有时需要将整个PDF文档拆分成一页一页的单独文件。那么&#xff0c;如何高效…

嵌入式学习——硬件(Linux系统在2440上的启动)——day57

1. Linux2.6系统在s3c2440上的启动过程分三个阶段 1.1 启动u-boot 1.2 启动Linux内核 1.3 挂载根文件系统 2. bootloader 2.1 定义 bootloader的本质是一个裸机程序&#xff0c;bootlood专门是为了能够正确地启动linux操作系 统&#xff0c;在系统初上电时需要对系统做一些…

TFD那智机器人仿真离线程序文本转换为现场机器人程序

TFD式样那智机器人离线程序通过Process Simulation、DELMIA等仿真软件为载体给机器人出离线&#xff0c;下载下来的文本程序&#xff0c;现场机器人一般是无法导入及识别出来的。那么就需要TFD on Desk TFD控制器来进行转换&#xff0c;才能导入现场机器人读取程序。 导入的文…

CAN通信波形【示波器抓取】

在测试bms系统过程中&#xff0c;在上位机发现无法读取CAN通信&#xff0c;尝试使用示波器抓取CAN通信波形&#xff0c;&#xff0c;去确定CAN通信是否正常。 做一想要从车上测出can总线上的数据还不太容易。 于是我首先使用示波器&#xff08;我使用的示波器型号是TDS 220&am…

NSSCTF-Web题目19(数据库注入、文件上传、php非法传参)

目录 [LitCTF 2023]这是什么&#xff1f;SQL &#xff01;注一下 &#xff01; 1、题目 2、知识点 3、思路 [SWPUCTF 2023 秋季新生赛]Pingpingping 4、题目 5、知识点 6、思路 [LitCTF 2023]这是什么&#xff1f;SQL &#xff01;注一下 &#xff01; 1、题目 2、知识…

全球首款商用,AI为视频自动配音配乐产品上线

近日&#xff0c;海外推出了一款名为Resona V2A的产品&#xff0c;这是全球首款商用视频转音频 (V2A) 技术产品。这项突破性技术利用AI&#xff0c;仅凭视频数据即可自动生成高质量、与上下文相关的音频&#xff0c;包括声音设计、音效、拟音和环境音&#xff0c;为电影制作人、…

【LeetCode】十、二分查找法:寻找峰值 + 二维矩阵的搜索

文章目录 1、二分查找法 Binary Search2、leetcode704&#xff1a;二分查找3、leetcode35&#xff1a;搜索插入位置4、leetcode162&#xff1a;寻找峰值5、leetcode74&#xff1a;搜索二维矩阵 1、二分查找法 Binary Search 找一个数&#xff0c;有序的情况下&#xff0c;直接…