当前位置: 首页 > news >正文

查看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.

相关文章:

查看Oracle是哪个Oracle_home 下启动的

[rootrac1 ~]# ps -ef|grep smon root 413 24903 0 22:30 pts/0 00:00:00 grep --colorauto 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 oracl…...

重温react-06(初识函数组件和快速生成格式的插件使用方式)

开始 函数组件必然成为未来发展的趋势(个人见解),总之努力的去学习,才能赚更多的钱.加油呀! 函数组件的格式 import React from reactexport default function LearnFunction01() {return (<div>LearnFunction01</div>) }以上是函数式组件的组基本的方式 快捷生…...

【高考志愿】仪器科学与技术

目录 一、专业介绍 1.1 专业概述 1.2 专业方向 1.3 主要课程 二、专业技能与素质培养 三、就业前景 四、个人发展规划建议 五、仪器科学与技术专业排名 六、总结 一、专业介绍 1.1 专业概述 仪器科学与技术专业是一门综合性极强的学科&#xff0c;它融合了测量、控制…...

Elasticsearch的Mapping

Elasticsearch的Mapping Mapping是什么 Mapping定义了ES的索引结构、字段类型、分词器等&#xff0c;是索引的一部分。类似于关系型数据库中“表结构”的概念&#xff0c;在 Mapping 里也包含了一些属性&#xff0c;比如字段名称、类型、字段使用的分词器、是否评分、是否创建…...

【vocabulary in use (elementary)】6 Health and Illness

very well / fine 很好 ill sick 生病 I feel terrible 感觉很差 headache 头疼 toothache 牙疼 dentist medicine 药 pills 片药 caps 胶囊 aspirin 阿司匹林 antibiotic 抗生素 vitamin 维生素 painkiller 止痛药 dentist 牙医 got a cold 感冒 for many years 很多年 all th…...

探囊取物之多形式注册页面(基于BootStrap4)

基于BootStrap4的注册页面&#xff0c;支持手机验证码注册、账号密码注册 低配置云服务器&#xff0c;首次加载速度较慢&#xff0c;请耐心等候&#xff1b;演练页面可点击查看源码 预览页面&#xff1a;http://www.daelui.com/#/tigerlair/saas/preview/ly4gax38ub9j 演练页…...

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

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

【RabbitMQ实战】Springboot 整合RabbitMQ组件,多种编码示例,带你实践 看完这一篇就够了

提示&#xff1a;文章写完后&#xff0c;目录可以自动生成&#xff0c;如何生成可参考右边的帮助文档 文章目录 前言一、对RabbitMQ管理界面深入了解1、在这个界面里面我们可以做些什么&#xff1f; 二、编码练习&#xff08;1&#xff09;使用direct exchange(直连型交换机)&a…...

【你也能从零基础学会网站开发】理解DBMS数据库管理系统架构,从用户到数据到底经历了什么

&#x1f680; 个人主页 极客小俊 ✍&#x1f3fb; 作者简介&#xff1a;程序猿、设计师、技术分享 &#x1f40b; 希望大家多多支持, 我们一起学习和进步&#xff01; &#x1f3c5; 欢迎评论 ❤️点赞&#x1f4ac;评论 &#x1f4c2;收藏 &#x1f4c2;加关注 其实前面我们也…...

Vue.js 中的API接口封装实战与详解

在开发Web应用的过程中&#xff0c;我们常常需要和服务器进行数据交互&#xff0c;这就涉及到了API接口的调用。在Vue.js项目中&#xff0c;为了提高代码复用性、可维护性和降低错误率&#xff0c;我们将API接口进行合理的封装显得尤为重要。本文将详细介绍如何在Vue.js项目中实…...

职场内卷、不稳定、没前景……怎么破?

经济下行期&#xff0c;大家普遍反映混职场艰难。 再深究下&#xff0c;发现造成职场艰难的原因主要有三个&#xff1a; 1.内卷&#xff1a;狼多肉少 2.不稳定&#xff1a;裁员总是不期而遇 3.没前景&#xff1a;明知过几年会被优化&#xff0c;但无法改变&#xff0c;死气沉沉…...

LeetCode 算法:将有序数组转换为二叉搜索树 c++

原题链接&#x1f517;&#xff1a;将有序数组转换为二叉搜索树 难度&#xff1a;简单⭐️ 题目 给你一个整数数组 nums &#xff0c;其中元素已经按 升序 排列&#xff0c;请你将其转换为一棵 平衡 二叉搜索树。 示例 1&#xff1a; 输入&#xff1a;nums [-10,-3,0,5,9]…...

智慧公厕系统改变了人们对服务区公厕的看法

在过去&#xff0c;服务区公厕常常给人留下脏乱差的印象&#xff0c;成为人们在长途旅行途中不愿停留的地方。然而&#xff0c;随着智慧科技的不断发展和应用&#xff0c;智慧公厕系统的出现改变了人们对服务区公厕的看法&#xff0c;为公共卫生设施的提升注入了新的活力。 一、…...

终极指南:RNNS、Transformers 和 Diffusion 模型

一、说明 作为广泛使用这些工具和模型的人&#xff0c;我的目标是解开 RNN、Transformer 和 Diffusion 模型的复杂性和细微差别&#xff0c;为您提供详细的比较&#xff0c;为您的特定需求提供正确的选择。 无论您是在构建语言翻译系统、生成高保真图像&#xff0c;还是处理时间…...

WPF UI 3D 基本概念 点线三角面 相机对象 材质对象与贴图 3D地球 光源 变形处理 动作交互 辅助交互插件 系列三

WPF UI交互专题 平面图形 Path Drawing 绘图 渐变 Brush 矩阵 Transform 变形 阴影效果 模糊效果 自定义灰度去色效果 系列二-CSDN博客 1软件中的3D基本概念 WPF 中 3D 功能的设计初衷并非提供功能齐全的游戏开发平台。 WPF 中的 3D 图形内容封装在 Viewport3D 元素中&#x…...

分子AI预测赛Task2笔记

下面所述比较官方的内容都来自官方文档 ‍‌⁠‌‍​​​‌​​⁠​​​​​&#xfeff;​​​&#xfeff;‍‬​​‍⁠‍‍​​‬​&#xfeff;‌​​​‌‍‬​​​​​​‍‌Task2&#xff1a;赛题深入解析 - 飞书云文档 (feishu.cn) 赛题背景 强调了人工智能在科研领域&…...

剖析DeFi交易产品之UniswapV4:创建池子

本文首发于公众号&#xff1a;Keegan小钢 创建池子的底层函数是 PoolManager 合约的 initialize 函数&#xff0c;其代码实现并不复杂&#xff0c;如下所示&#xff1a; function initialize(PoolKey memory key, uint160 sqrtPriceX96, bytes calldata hookData)externalover…...

速盾:cdn内容分发服务有哪些优势?

CDN&#xff08;Content Delivery Network&#xff09;是指内容分发网络&#xff0c;是一种将网络内容分发到全球各个地点的技术和架构。在现代互联网架构中&#xff0c;CDN已经变得非常重要。CDN通过将内容分发到靠近用户的服务器上&#xff0c;提供高速、高效的服务。下面是C…...

如何利用React和Python构建强大的网络爬虫应用

如何利用React和Python构建强大的网络爬虫应用 引言&#xff1a; 网络爬虫是一种自动化程序&#xff0c;用于通过互联网抓取网页数据。随着互联网的不断发展和数据的爆炸式增长&#xff0c;网络爬虫越来越受欢迎。本文将介绍如何利用React和Python这两种流行的技术&#xff0c…...

炎黄数智人:招商局集团推出AI数字员工“招小影”

引言 在全球数字化浪潮的推动下&#xff0c;招商局集团开启了一项具有里程碑意义的项目。招商局集团将引入AI数字员工“招小影”&#xff0c;这一举措不仅彰显了招商局集团在智能化转型方面的坚定决心&#xff0c;也为企业管理模式的创新注入了新的活力。 “招小影”是一款集成…...

Phi-3-mini-4k-instruct-gguf多场景落地:跨境电商多语言商品描述批量生成

Phi-3-mini-4k-instruct-gguf多场景落地&#xff1a;跨境电商多语言商品描述批量生成 1. 跨境电商的痛点与解决方案 跨境电商卖家每天面临的最大挑战之一&#xff0c;就是为同一款商品准备不同语言版本的描述。传统做法要么需要雇佣多语种文案人员&#xff0c;要么使用机械的…...

智能车调参手记:我用Kp=200, Ki=60, Kd=40让小车稳如老狗

智能车调参手记&#xff1a;我用Kp200, Ki60, Kd40让小车稳如老狗 凌晨三点的实验室里&#xff0c;咖啡杯已经见底&#xff0c;眼前的智能车在测试跑道上又一次冲出了弯道。这已经是本周第七次熬夜调试&#xff0c;上坡时的速度波动问题始终困扰着我们。就在准备放弃的时候&…...

从单片机思维到FPGA思维:我用Xilinx Ego1做循迹小车踩过的那些‘坑’

从单片机思维到FPGA思维&#xff1a;Xilinx Ego1循迹小车开发实战避坑指南 第一次用FPGA做循迹小车时&#xff0c;我盯着Vivado里密密麻麻的时序报告发呆了半小时——这和我熟悉的单片机开发完全是两个世界。作为有三年STM32开发经验的工程师&#xff0c;本以为凭借Verilog语法…...

基于博途1200PLC + HMI的交通灯控制系统仿真:打造灵活交通指挥中枢

基于博途1200PLCHMI交通灯/红绿灯控制系统仿真(时间可设置) 程序&#xff1a; 1、任务&#xff1a;PLC.人机界面控制交通灯 2、系统说明&#xff1a; 系统设有手动模式、自动模式、黄闪模式、红绿灯时间可设置、各灯可单独手动模式、故障模拟模式、数码管显示等模式运行 交通灯…...

Go语言中的Panic和Recover:错误处理的艺术

Go语言中的Panic和Recover&#xff1a;错误处理的艺术 1. Panic和Recover的基本概念 Panic和Recover是Go语言中用于处理异常情况的机制。Panic用于在程序遇到无法恢复的错误时终止程序&#xff0c;而Recover用于捕获Panic并恢复程序的正常执行。 Go语言的错误处理哲学是显式处理…...

Phi-3-mini-4k-instruct-gguf实操手册:中文短文本生成场景下的温度调优策略

Phi-3-mini-4k-instruct-gguf实操手册&#xff1a;中文短文本生成场景下的温度调优策略 1. 模型概述与使用场景 Phi-3-mini-4k-instruct-gguf 是微软推出的轻量级文本生成模型&#xff0c;特别适合处理中文短文本任务。这个经过优化的GGUF版本模型&#xff0c;在问答、文本改…...

Qwen3-TTS开源大模型实战:复古HUD界面下的AI语音创作工作流

Qwen3-TTS开源大模型实战&#xff1a;复古HUD界面下的AI语音创作工作流 1. 引言&#xff1a;当AI语音合成遇上复古游戏风 想象一下&#xff0c;你不再需要面对枯燥的音频参数调节界面&#xff0c;而是走进一个像素风的游戏世界。在这里&#xff0c;生成一段AI语音就像玩一款复…...

抖音批量下载工具:高效获取无水印视频与图文内容的全攻略

抖音批量下载工具&#xff1a;高效获取无水印视频与图文内容的全攻略 【免费下载链接】douyin-downloader A practical Douyin downloader for both single-item and profile batch downloads, with progress display, retries, SQLite deduplication, and browser fallback su…...

独立站页面结构优化的注意事项是什么_独立站 SEO 与品牌建设的关系是什么

独立站页面结构优化的注意事项是什么 在当今的数字化时代&#xff0c;独立站&#xff08;独立网站&#xff09;已经成为个人品牌和企业展示自我、推广产品和服务的重要平台。单凭一个美观的独立站&#xff0c;难以在竞争激烈的网络环境中脱颖而出。因此&#xff0c;独立站页面…...

SAP BAPI实战指南:核心模块高频接口速查与应用解析

1. SAP BAPI入门&#xff1a;为什么开发者需要这份速查手册 第一次接触SAP BAPI时&#xff0c;我盯着满屏的接口文档差点崩溃——光是FICO模块就有二十多个常用BAPI&#xff0c;每个接口的参数列表长得像毕业论文。后来在项目上踩过几次坑才明白&#xff0c;BAPI的难点不在于技…...