oracle安装完成以后,在sqlplus中使用startup出现的各种错误合计和解决方案。如果你碰到了,可以作为参考。
另外Oracle 11gR2 从头安装我写了另一篇文章 => Oracle安装
oracle排错
-
错误1:
SQL> startup ORA-48108: invalid value given for the diagnostic_dest init.ora parameter ORA-48140: the specified ADR Base directory does not exist [/u01/app/oracle/product/11.2.0/xe/dbs/<ORACLE_BASE>] ORA-48187: specified directory does not exist Linux-x86_64 Error: 2: No such file or directory Additional information: 1 // 解决方案 进入/u01/app/oracle/product/11.2.0/xe/dbs目录下,修改initXE.ora 删除 diagnostic_dest 这个变量
-
错误2:
SQL> startup ORA-00845: MEMORY_TARGET not supported on this system // 解决方案 // 查看日志发现 bash-4.4$ cat /u01/app/oracle/diag/rdbms/orcl/XE/trace/alert_XE.log Mon May 31 16:08:22 2021 Starting ORACLE instance (normal) WARNING: You are trying to use the MEMORY_TARGET feature. This feature requires the /dev/shm file system to be mounted for at least 1073741824 bytes. /dev/shm is either not mounted or is mounted with available space less than this size. Please fix this so that MEMORY_TARGET can work as expected. Current available is 957739008 bytes and used is 0 bytes. Ensure that the mount point is /dev/shm for this directory. memory_target needs larger /dev/shm // 报错信息表示我至少需要1073741824 bytes的 空间,你只有957739008 bytes // 使用df -h 查看发现我的 /dev/shm 确实只有914M,所以修改这个的大小使之满足条件。 bash-4.4$ df -h Filesystem Size Used Avail Use% Mounted on devtmpfs 899M 0 899M 0% /dev tmpfs 914M 0 914M 0% /dev/shm tmpfs 914M 480K 913M 1% /run tmpfs 914M 0 914M 0% /sys/fs/cgroup /dev/vda1 40G 6.5G 34G 17% / tmpfs 183M 0 183M 0% /run/user/0 tmpfs 183M 0 183M 0% /run/user/1001 // 使用root权限执行以下命令,因为1073741824 bytes = 1G,但是在运行过程中,/dev/shm 一点被用掉一点点,这个内存就会不够。所以这个值要设置大一点点。我这里设置了1500M mount -o size=1500M -o nr_inodes=1000000 -o noatime,nodiratime -o remount /dev/shm // 然后df -h 查看,修改成功 [root@iZuf61ii8wkx9sushpgjj8Z xe]# df -h Filesystem Size Used Avail Use% Mounted on devtmpfs 899M 0 899M 0% /dev tmpfs 1.5G 0 150M 0% /dev/shm tmpfs 914M 484K 913M 1% /run tmpfs 914M 0 914M 0% /sys/fs/cgroup /dev/vda1 40G 6.5G 34G 17% / tmpfs 183M 0 183M 0% /run/user/0 tmpfs 183M 0 183M 0% /run/user/1001
-
错误3
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 // 根据提示,表示 db_recovery_file_dest 这个参数错误 // 找到initXE.ora文件,发现它的目录是/u01/app/oracl/admin/flash_recovery_area // 该目录在我的机器上不存在,但是我有个fast_recovery_area 所以把initXE.ora修改为/u01/app/oracl/admin/fast_recovery_area
-
错误4
SQL> startup ORA-09925: Unable to create audit trail file Linux-x86_64 Error: 2: No such file or directory Additional information: 9925 // 和错误3是同一类型的错误,使用一样的修改方法 // 发现initXE.ora文件中,audit_file_dest的值为 /u01/app/oracl/admin/orcl/adump // 而该目录早我的电脑上不存在 但是我电脑上的adump在目录/u01/app/oracl/admin/orcl/XE/adump下 修改这个值