ORA-01034: ORACLE not available ORA-27101: shared memory realm does not exist

记录一次问题:
数据库连接错误
ORA-01034: ORACLE not available ORA-27101: shared memory realm does not exist Linux-x86_64 Error: 2: No such file or directory Additional information: 4376 Additional information: -425214885 ORA-01034: ORACLE not available ORA-27101: shared memory realm

分析:
1、是不是内存设置的用问题。
2、监听设置问题

找问题
1、看出数据库状态,正常

SQL> select status from v$instance;

STATUS
------------
OPEN

2、查看alert_orcl.log日志
发现问题 :数据库的pmon进程不能把监听注册到实例

WARNING: Invalid value for listener related parameter MIXED LISTENER
2022-12-30T11:08:29.723018+08:00
ORA-00141: all addresses specified for parameter LOCAL_LISTENER are invalid
ORA-00132: syntax error or unresolved network name 'LISTENER_PROD'
Starting background process PMON

内存参数

Starting ORACLE instance (normal) (OS id: 38463)
2022-12-30T11:39:42.823699+08:00
****************************************************
 Sys-V shared memory will be used for creating SGA
 ****************************************************
2022-12-30T11:39:42.824557+08:00
**********************************************************************
2022-12-30T11:39:42.824631+08:00
Dump of system resources acquired for SHARED GLOBAL AREA (SGA)

2022-12-30T11:39:42.824778+08:00
 Per process system memlock (soft) limit = 32G
2022-12-30T11:39:42.824850+08:00
 Expected per process system memlock (soft) limit to lock
 instance MAX SHARED GLOBAL AREA (SGA) into memory: 9602M
2022-12-30T11:39:42.824979+08:00
 Available system pagesizes:
  4K, 2048K
2022-12-30T11:39:42.825102+08:00
 Supported system pagesize(s):
2022-12-30T11:39:42.825166+08:00
  PAGESIZE  AVAILABLE_PAGES  EXPECTED_PAGES  ALLOCATED_PAGES  ERROR(s)
2022-12-30T11:39:42.825240+08:00
        4K       Configured               7         2457607        NONE
2022-12-30T11:39:42.825387+08:00
     2048K                0            4801               0        NONE
2022-12-30T11:39:42.825457+08:00
RECOMMENDATION:
2022-12-30T11:39:42.825535+08:00
 1. For optimal performance, configure system with expected number
 of pages for every supported system pagesize prior to the next
 instance restart operation.
2022-12-30T11:39:42.829306+08:00
**********************************************************************

3、查看内存分配

SQL> show parameter sga

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
allow_group_access_to_sga            boolean     FALSE
lock_sga                             boolean     FALSE
pre_page_sga                         boolean     TRUE
sga_max_size                         big integer 9600M
sga_min_size                         big integer 0
sga_target                           big integer 9600M
unified_audit_sga_queue_size         integer     1048576

SQL> show parameter memory

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
hi_shared_memory_address             integer     0
inmemory_adg_enabled                 boolean     TRUE
inmemory_automatic_level             string      OFF
inmemory_clause_default              string
inmemory_expressions_usage           string      ENABLE
inmemory_force                       string      DEFAULT
inmemory_max_populate_servers        integer     0
inmemory_optimized_arithmetic        string      DISABLE
inmemory_prefer_xmem_memcompress     string
inmemory_prefer_xmem_priority        string
inmemory_query                       string      ENABLE


SQL> show parameter spfile

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      /u01/app/oracle/product/19.3.0
                                                 /dbhome_1/dbs/spfileorcl.ora

检查监听没有问题后,查看了下spfile,发现了问题
尝试解决
用pfile启动。重新注册下监听试试

SQL> shu immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup pfile=/u01/app/oracle/product/19.3.0/dbhome_1/dbs/initorcl.ora;
ORACLE instance started.

Total System Global Area 1.0066E+10 bytes
Fixed Size                 12445832 bytes
Variable Size            1577058304 bytes
Database Buffers         8455716864 bytes
Redo Buffers               21106688 bytes
Database mounted.
Database opened.
SQL> alter system register;

System altered.

数据库注册监听正常了

[oracle@zfb-jhdsj-hysjkserver1 admin]$ lsnrctl status

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 30-DEC-2022 11:40:41

Copyright (c) 1991, 2019, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.20.6.138)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date                30-DEC-2022 11:25:17
Uptime                    0 days 0 hr. 15 min. 24 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/19.3.0/dbhome_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/zfb-jhdsj-hysjkserver1/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.20.6.138)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "PROD" has 2 instance(s).
  Instance "ORCL", status UNKNOWN, has 1 handler(s) for this service...
  Instance "orcl", status READY, has 1 handler(s) for this service...
Service "PRODXDB" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully

重新创建spfile

SQL> create spfile from pfile;

File created.

重新起库,数据库连接正常
此次问题是参数文件的异常导致监听无法注册。

你可能感兴趣的:(ORA-问题处理,oracle,数据库,sql)