Oracle Error:0RA-00845
首先,备份正确的参数:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
[oracle@oel71 ~]$ sqlplus / as sysdba SQL*Plus: Release 12.1.0.1.0 Production on Fri Dec 18 11:42:40 2015 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to an idle instance. SQL> SQL> startup mount; ORACLE instance started. Total System Global Area 1536602112 bytes Fixed Size 2288680 bytes Variable Size 939525080 bytes Database Buffers 587202560 bytes Redo Buffers 7585792 bytes Database mounted. SQL> !ls -ltr $ORACLE_HOME/dbs total 24 -rw-r--r-- 1 oracle oinstall 2992 Feb 3 2012 init.ora -rw-r----- 1 oracle oinstall 24 Dec 4 23:02 lkORCL -rw-r----- 1 oracle oinstall 7680 Dec 4 23:07 orapworcl -rw-rw---- 1 oracle oinstall 1544 Dec 18 11:42 hc_orcl.dat -rw-r----- 1 oracle oinstall 3584 Dec 18 11:43 spfileorcl.ora SQL> SQL> show parameter pfile; NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ spfile string /u01/app/oracle/product/12/db_ 1/dbs/spfileorcl.ora SQL> SQL> create pfile from spfile; File created. SQL> !ls -ltr $ORACLE_HOME/dbs total 28 -rw-r--r-- 1 oracle oinstall 2992 Feb 3 2012 init.ora -rw-r----- 1 oracle oinstall 24 Dec 4 23:02 lkORCL -rw-r----- 1 oracle oinstall 7680 Dec 4 23:07 orapworcl -rw-rw---- 1 oracle oinstall 1544 Dec 18 11:42 hc_orcl.dat -rw-r----- 1 oracle oinstall 3584 Dec 18 11:43 spfileorcl.ora -rw-r--r-- 1 oracle oinstall 1021 Dec 18 11:43 initorcl.ora SQL> SQL> exit Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options [oracle@oel71 ~]$ [oracle@oel71 ~]$ cat $ORACLE_HOME/dbs/initorcl.ora orcl.__data_transfer_cache_size=0 orcl.__db_cache_size=536870912 orcl.__java_pool_size=16777216 orcl.__large_pool_size=150994944 orcl.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment orcl.__pga_aggregate_target=553648128 orcl.__sga_target=989855744 orcl.__shared_io_pool_size=50331648 orcl.__shared_pool_size=218103808 orcl.__streams_pool_size=0 *.audit_file_dest='/u01/app/oracle/admin/orcl/adump' *.audit_trail='db' *.compatible='12.1.0.0.0' *.control_files='/u01/app/oracle/oradata/ORCL/controlfile/o1_mf_c63bw39d_.ctl','/u01/app/oracle/fast_recovery_area/ORCL/controlfile/o1_mf_c63bw3g2_.ctl' *.db_block_size=8192 *.db_create_file_dest='/u01/app/oracle/oradata' *.db_domain='' *.db_name='orcl' *.db_recovery_file_dest='/u01/app/oracle/fast_recovery_area' *.db_recovery_file_dest_size=4800m *.diagnostic_dest='/u01/app/oracle' *.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)' *.memory_target=1472m *.open_cursors=300 *.processes=300 *.remote_login_passwordfile='EXCLUSIVE' *.undo_tablespace='UNDOTBS1' [oracle@oel71 ~]$ [oracle@oel71 ~]$ |
当前:/dev/shm
1 2 3 |
[oracle@oel71 ~]$ df -h | grep --color /dev/shm tmpfs 1.8G 934M 909M 51% /dev/shm [oracle@oel71 ~]$ |
当前数据库的参数状态:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
SQL> select status from v$instance; STATUS ------------ MOUNTED SQL> SQL> show parameter memory_max_target NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ memory_max_target big integer 1472M SQL> show parameter memory_target NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ memory_target big integer 1472M SQL> |
在这两个参数之间,它们的关系是:
memory_max_target >= memory_target;
模拟错误:
将memory_target与memory_max_target设为比/dev/shm更大的值。
1 2 3 4 5 |
SQL> alter system set memory_target=2000M scope=spfile; System altered. SQL> |
然后重启数据库:
1 2 3 4 5 6 7 8 9 10 |
SQL> shutdown immediate; ORA-01109: database not open Database dismounted. ORACLE instance shut down. SQL> SQL> startup mount; ORA-00845: MEMORY_TARGET not supported on this system SQL> |
你就可以看到:ORA-00845的这个报错了。
关于该报错的Alert日志是这样的:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
[root@oel71 ~]# tail -f /u01/app/oracle/diag/rdbms/orcl/orcl/trace/alert_orcl.log Instance shutdown complete Fri Dec 18 12:01:19 2015 WARNING: failed to retrieve DB spfile location (unable to communicate with CRSD/OHASD) Starting ORACLE instance (normal) Fri Dec 18 12:01:19 2015 CLI notifier numLatches:3 maxDescs:519 Fri Dec 18 12:01:19 2015 WARNING: You are trying to use the MEMORY_TARGET feature. This feature requires the /dev/shm file system to be mounted for at least 2097152000 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 1931280384 and used is 81920 bytes. Ensure that the mount point is /dev/shm for this directory. Fri Dec 18 12:01:19 2015 memory_target needs larger /dev/shm +++++++++++++++++++++++ Fri Dec 18 12:02:57 2015 WARNING: failed to retrieve DB spfile location (unable to communicate with CRSD/OHASD) Starting ORACLE instance (normal) Fri Dec 18 12:02:57 2015 CLI notifier numLatches:3 maxDescs:519 Fri Dec 18 12:02:57 2015 WARNING: You are trying to use the MEMORY_TARGET feature. This feature requires the /dev/shm file system to be mounted for at least 2097152000 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 1931280384 and used is 81920 bytes. Ensure that the mount point is /dev/shm for this directory. Fri Dec 18 12:02:57 2015 memory_target needs larger /dev/shm +++++++++++++++++++++++ |
解决:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
[oracle@oel71 ~]$ cd $ORACLE_HOME/dbs [oracle@oel71 dbs]$ ls -ltr total 28 -rw-r--r-- 1 oracle oinstall 2992 Feb 3 2012 init.ora -rw-r----- 1 oracle oinstall 24 Dec 4 23:02 lkORCL -rw-r----- 1 oracle oinstall 7680 Dec 4 23:07 orapworcl -rw-r--r-- 1 oracle oinstall 1021 Dec 18 11:43 initorcl.ora -rw-r----- 1 oracle oinstall 3584 Dec 18 11:58 spfileorcl.ora -rw-rw---- 1 oracle oinstall 1544 Dec 18 12:01 hc_orcl.dat [oracle@oel71 dbs]$ [oracle@oel71 dbs]$ sqlplus / as sysdba SQL*Plus: Release 12.1.0.1.0 Production on Fri Dec 18 12:05:47 2015 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to an idle instance. SQL> startup pfile=initorcl.ora mount; ORACLE instance started. Total System Global Area 1536602112 bytes Fixed Size 2288680 bytes Variable Size 939525080 bytes Database Buffers 587202560 bytes Redo Buffers 7585792 bytes Database mounted. SQL> SQL> !pwd /u01/app/oracle/product/12/db_1/dbs SQL> !mv spfileorcl.ora spfileorcl.ora_memory_target_error_20151218_1206 SQL> !ls -ltr total 28 -rw-r--r-- 1 oracle oinstall 2992 Feb 3 2012 init.ora -rw-r----- 1 oracle oinstall 24 Dec 4 23:02 lkORCL -rw-r----- 1 oracle oinstall 7680 Dec 4 23:07 orapworcl -rw-r--r-- 1 oracle oinstall 1021 Dec 18 11:43 initorcl.ora -rw-r----- 1 oracle oinstall 3584 Dec 18 11:58 spfileorcl.ora_memory_target_error_20151218_1206 -rw-rw---- 1 oracle oinstall 1544 Dec 18 12:06 hc_orcl.dat SQL> SQL> show parameter memory_target NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ memory_target big integer 1472M SQL> show parameter memory_max_target NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ memory_max_target big integer 1472M SQL> SQL> SQL> show parameter pfile NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ spfile string SQL> SQL> create spfile from pfile; File created. SQL> SQL> !ls -ltr total 32 -rw-r--r-- 1 oracle oinstall 2992 Feb 3 2012 init.ora -rw-r----- 1 oracle oinstall 24 Dec 4 23:02 lkORCL -rw-r----- 1 oracle oinstall 7680 Dec 4 23:07 orapworcl -rw-r--r-- 1 oracle oinstall 1021 Dec 18 11:43 initorcl.ora -rw-r----- 1 oracle oinstall 3584 Dec 18 11:58 spfileorcl.ora_memory_target_error_20151218_1206 -rw-rw---- 1 oracle oinstall 1544 Dec 18 12:06 hc_orcl.dat -rw-r----- 1 oracle oinstall 3584 Dec 18 12:07 spfileorcl.ora SQL> SQL> shutdown immediate; ORA-01109: database not open Database dismounted. ORACLE instance shut down. SQL> SQL> startup ORACLE instance started. Total System Global Area 1536602112 bytes Fixed Size 2288680 bytes Variable Size 939525080 bytes Database Buffers 587202560 bytes Redo Buffers 7585792 bytes Database mounted. Database opened. SQL> SQL> show parameter pfile NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ spfile string /u01/app/oracle/product/12/db_ 1/dbs/spfileorcl.ora SQL> SQL> show parameter memory_max_target NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ memory_max_target big integer 1472M SQL> show parameter memory_target NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ memory_target big integer 1472M SQL> SQL> exit Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options [oracle@oel71 dbs]$ |
————————————
Done。