1. 程式人生 > >Linux系統啟動Oracle資料庫報錯問題集錦

Linux系統啟動Oracle資料庫報錯問題集錦

1、報錯:could not open parameter file '/data/oracle/product/11.2.0/db_1/dbs/initorcl.ora'

[[email protected] ~]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.1.0 Production on Mon Dec 17 17:19:08 2018

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

SQL> conn / as sysdba
Connected to an idle instance.
SQL> startup
ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/data/oracle/product/11.2.0/db_1/dbs/initorcl.ora'

報錯原因:/data/oracle/product/11.2.0/db_1/dbs/目錄下只有init.ora檔案

嘗試:將init.ora 檔案重新命名為initorcl.ora

2、報錯:the specified ADR Base directory does not exist

重新啟動資料庫,報如下錯誤:

SQL> startup
ORA-48108: invalid value given for the diagnostic_dest init.ora parameter
ORA-48140: the specified ADR Base directory does not exist [/data/oracle/product/11.2.0/db_1/dbs/<ORACLE_BASE>]
ORA-48187: specified directory does not exist
Linux-x86_64 Error: 2: No such file or directory
Additional information: 1

嘗試:修改initorcl.ora檔案,將diagnostic_dest='<ORACLE_BASE>'一行註釋

3、報錯:MEMORY_TARGET not supported on this system

重新啟動資料庫,報如下錯誤:

SQL> startup
ORA-00845: MEMORY_TARGET not supported on this system

此報錯出現原因:/dev/shm小於MEMORY_TARGET的大小,或者是/dev/shm根本就沒有掛載

解決方法:

檢視已掛載的檔案系統

[[email protected]

~]$ df -Th 
檔案系統      型別    容量  已用 可用 已用% 掛載點 
/dev/sda2    ext3    16G  11G  3.9G  74% / 
/dev/sda3    ext3    1.6G  37M  1.4G  3% /tmp
/dev/sda1    ext3    99M  12M  83M  13% /boot
tmpfs        tmpfs    252M    0  252M  0% /dev/shm

可以看到 /dev/shm容量為252M

嘗試增加/dev/shm的size,用root使用者登陸,在tmpfs一行後面增加,size=1G

[[email protected] ~]# vi /etc/fstab

/dev/mapper/VolGroup-root /                       ext4    defaults        1 1
UUID=48d61e51-4412-4e46-abb2-e549858de300 /boot                   ext4    defaults        1 2
UUID=b9205e04-060e-4555-8649-c8c5554ced12 swap                    swap    defaults        0 0
tmpfs                   /dev/shm                tmpfs   defaults,size=1G        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0

重新掛載/dev/shm:

[[email protected] ~]# umount /dev/shm
umount: /dev/shm: device is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))
[[email protected] ~]# fuser -km /dev/shm/
/dev/shm/:            1694m  1708m  1711m  1728m  1745m
[[email protected] ~]# umount /dev/shm/ 
[[email protected] ~]# mount /dev/shm/

4、報錯:Parameter db_recovery_file_dest destination string cannot be translated

重新用Oracle使用者登陸,重啟資料庫,新錯誤出現:

SQL> startup
ORA-01261: Parameter db_recovery_file_dest destination string cannot be translated
ORA-01262: Stat failed on a file destination directory
Linux-x86_64 Error: 2: No such file or directory

檢視Oracle的初始化檔案

[[email protected] ~]$ cat /data/oracle/product/11.2.0/db_1/dbs/initorcl.ora

audit_file_dest='<ORACLE_BASE>/admin/orcl/adump'
db_recovery_file_dest='<ORACLE_BASE>/flash_recovery_area'

發現在$ORACLE_BASE目錄下並沒有上面兩個資料夾,用oracle使用者建立資料夾,並將<ORACLE_BASE>改為絕對路徑,如下:

audit_file_dest='/data/oracle/admin/orcl/adump'
db_recovery_file_dest='/data/oracle/flash_recovery_area'

[[email protected] ~]# mkdir $ORACLE_BASE/admin
[[email protected] ~]# mkdir $ORACLE_BASE/admin/orcl
[[email protected] ~]# mkdir $ORACLE_BASE/admin/orcl/adump
[[email protected] ~]# mkdir $ORACLE_BASE/flash_recovery_area

成功啟動資料庫:

SQL> startup
ORACLE instance started.

Total System Global Area 1068937216 bytes
Fixed Size                  2220200 bytes
Variable Size             616566616 bytes
Database Buffers          444596224 bytes
Redo Buffers                5554176 bytes
ORA-00205: error in identifying control file, check alert log for more info