Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Case Analysis of Oracle connection problem

2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

Today, the editor will share with you the relevant knowledge points about the case analysis of Oracle connection problems. The content is detailed and the logic is clear. I believe most people still know too much about this, so share this article for your reference. I hope you can get something after reading this article. Let's take a look at it.

We know that when Oracle starts, the fork process creates the relevant background process based on ORACLE_SID, while in Unix and Linux systems, ORACLE SID and ORACLE_HOME hash together and get a unique value as the key of SGA.

So I raise an interesting question: on the same server, there are more than 10g ORACLE_HOME 11g Oracle instances with the same name, but if you are under the same user (for example, the operating system user is oracle), is it possible to create two instances with the same name?

I think you have the answer in your head. Let me explain whether it is OK or not from another angle. Through an interesting DG configuration problem.

I threw the following error when building the library using RMAN's duplicate.

RMAN > duplicate target database for standby from active database nofilenamecheck

Starting Duplicate Db at 2017-08-03 10:40:42

RMAN-03002: failure of Duplicate Db command at 08/03/2017 10:40:42

RMAN-05501: aborting duplication of target database

RMAN-06403: could not obtain a fully authorized session

RMAN-04006: error from auxiliary database: ORA-01034: ORACLE not available

ORA-27101: shared memory realm does not exist

Linux-x86_64 Error: 2: No such file or directory

Look at the error is obvious, the standby library is started, the memory structure can not be found.

But in fact, there is no problem with viewing the database process.

I tried to connect according to the service name, and the following results surprised me.

Sqlplus sys@s2Queuedb as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Thu Aug 3 10:41:53 2017

Copyright (c) 1982, 2013, Oracle. All rights reserved.

Enter password:

Connected to an idle instance.

This is where the problem is, whether the instance name has a case to open it, I do not seem to have the impression. Then I just tried to start it under this window, but I didn't expect to get up a new example.

SQL > startup nomount

ORACLE instance started.

Total System Global Area 9620525056 bytes

Fixed Size 2261368 bytes

Variable Size 2248150664 bytes

Database Buffers 7348420608 bytes

Redo Buffers 21692416 bytes

You can see that there are two instances with the same name under the same user.

$ps-ef | grep smon | grep-v grep

Oracle 43259 10 10:39? 00:00:00 ora_smon_Queuedb

Oracle 43337 10 10:44? 00:00:00 ora_smon_Queuedb

When you get here, don't think it's bug, and don't think that the basics don't work. Let's sort out our ideas.

First of all, ORACLE_SID is unified, it is the same, and the difference is ORACLE_HOME. In this database environment, I only have one version of the database environment installed, so there is no more than one ORACLE_HOME, so this problem bothers me. Let's continue to look at ORACLE_HOME, where we can check the values of environment variables.

$cat / proc/43259/environ | xargs-0-N1 | grep ORACLE_HOME

ORACLE_HOME=/U01/app/oracle/product/11.2.0.4

Look at the value of the ORACLE_HOME variable of another instance.

$cat / proc/43337/environ | xargs-0-N1 | grep ORACLE_HOME

ORACLE_HOME=/home/U01/app/oracle/product/11.2.0.4

Here, it seems to have a vision, it turns out that ORACLE_HOME is different.

The problem here is still a little strange, because / home/U01 and / U01 point to the same directory. They mean the same thing.

Lrwxrwxrwx 1 root root 9 Aug 1 17:53 U01-> / home/U0

This question should be explained in this way. Let's continue to straighten out our thinking. When we use duplicate in RMAN, we use TNS connection, so the TNS connection points to another instance when connecting to the local instance (although this instance does not exist at first), then the local connection configuration is still in listener.ora.

Open the content of the static registration so that it is very clear.

SID_LIST_LISTENER =

(SID_LIST =

(SID_DESC =

(GLOBAL_DBNAME = Queuedb)

(ORACLE_HOME = / home/U01/app/oracle/product/11.2.0.4)

(SID_NAME = Queuedb)

)

)

So understanding this problem, we can think of a different way of thinking about what scenarios can carry forward this feature and play the role of divine assists in some specific scenes.

At least in the previous data migration, I used multiple versions of ORACLE_HOME to switch multiple instances of the same server, which can greatly improve the efficiency of data migration.

These are all the contents of the article "case Analysis of Oracle connection problems". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report