Database not start due to memory_target is higher than machine memory
When i try to startup i found this error:
[oracle@wcp12cr2 ~]$ sqlplus "/ as sysdba" SQL*Plus: Release 12.1.0.1.0 Production on Tue Sep 19 23:31:42 2017 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to an idle instance. SQL> startup; ORA-00845: MEMORY_TARGET not supported on this system
this is due to memory target parameter is higher than memory machine, so to startup this database we are going to initiate it with a new init.ora, because direct modifications with any text editor in spfileorcl.ora is not possible (file will become corrupt)
[oracle@wcp12cr2 dbs]$ cd $ORACLE_HOME/dbs [oracle@wcp12cr2 dbs]$ ls -ltr total 32 -rw-r--r--. 1 oracle oinstall 2992 Feb 3 2012 init.ora -rw-r-----. 1 oracle oinstall 24 Nov 11 2015 lkORCL -rw-r-----. 1 oracle oinstall 7680 Nov 11 2015 orapworcl -rw-rw----. 1 oracle oinstall 1544 Sep 19 23:41 hc_orcl.dat -rw-r-----. 1 oracle oinstall 2560 Sep 19 23:42 spfileorcl.ora [oracle@wcp12cr2 dbs]$ cat spfileorcl.ora C"▒▒Vt5CC"Vxorcl.__data_transfer_cache_size=0 orcl.__db_cache_size=2147483648 orcl.__java_pool_size=16777216 orcl.__large_pool_size=33554432 orcl.__oracle_base='/oracle/db'#ORACLE_BASE set from environment orcl.__pga_aggregate_target=1979711488 orcl.__sga_target=2952790016 orcl.__shared_io_pool_size=150994944 orcl.__shared_pool_size=570425344 orcl.__streams_pool_size=0 *.audit_file_dest='/oracle/db/admin/orcl/adump' *.audit_trail='db' *.compatible='12.1.0.0.0' *.control_files='/oracle/db/oradataCC"F/orcl/control01.ctl','/oracle/db/fast_recovery_area/orcl/control02.ctl' *.db_block_size=8192 *.db_domain='' *.db_name='orcl' *.db_recovery_file_dest='/oracle/db/fast_recovery_area' *.db_recovery_file_dest_size=4800m *.diagnostic_dest='/oracle/db' *.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)' *.memory_target=4703m *.open_cursors=300 *.processes=300 *.remote_login_passwordfile='EXCLUSIVE' *.undo_tablespace='UNDOTBS1'
if we look for memory_target parameter in the above spfileorcl.ora we can see it is set to 4703m, which is greater than 4000m that my virtual machine has. I´m going to create a initorcl.ora file setting this parameter to 1024m as you can see below:
[oracle@wcp12cr2 dbs]$ cat initorcl.ora *.audit_file_dest='/oracle/db/admin/orcl/adump' *.audit_trail='db' *.compatible='12.1.0.0.0' *.control_files='/oracle/db/oradata/orcl/control01.ctl','/oracle/db/fast_recovery_area/orcl/control02.ctl' *.db_block_size=8192 *.db_domain='' *.db_name='orcl' *.db_recovery_file_dest='/oracle/db/fast_recovery_area' *.db_recovery_file_dest_size=4800m *.diagnostic_dest='/oracle/db' *.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)' *.memory_target=1024m *.open_cursors=300 *.processes=300 *.remote_login_passwordfile='EXCLUSIVE' *.undo_tablespace='UNDOTBS1'
So, now i can backup existing spfileorcl.ora to spfileorcl.ora.bck and delete spfileorcl.ora in order database do not detect that file:
[oracle@wcp12cr2 dbs]$ cp spfileorcl.ora spfileorcl.ora.bck [oracle@wcp12cr2 dbs]$ rm spfileorcl.oraAt this point, we are ready to startup database with startup pfile=/oracle/db/ohome/dbs/initorcl.ora:
[oracle@wcp12cr2 dbs]$ sqlplus " / as sysdba " SQL*Plus: Release 12.1.0.1.0 Production on Tue Sep 19 23:36:46 2017 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options SQL> startup pfile=/oracle/db/ohome/dbs/initorcl.ora ORACLE instance started. Total System Global Area 1068937216 bytes Fixed Size 2296576 bytes Variable Size 713032960 bytes Database Buffers 348127232 bytes Redo Buffers 5480448 bytes Database mounted. Database opened.
And as we can see, we are using a pfile parameter:
SQL> show parameter spfile NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ spfile string SQL> shutdown immediate;Now, we can create a new spfile with right parameters:
SQL> create spfile from pfile; File created.
And now, we can see that a new spfileorcl.ora is generated:
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@wcp12cr2 dbs]$ 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 Nov 11 2015 lkORCL -rw-r-----. 1 oracle oinstall 7680 Nov 11 2015 orapworcl -rw-r--r--. 1 oracle oinstall 550 Sep 19 23:36 initorcl.ora -rw-rw----. 1 oracle oinstall 1544 Sep 19 23:41 hc_orcl.dat -rw-r-----. 1 oracle oinstall 2560 Sep 20 00:00 spfileorcl.ora
So the last step is to restart database in order to start use spfileorcl.ora parameter file
SQL> shutdown immediate; Database closed. Database dismounted. ORACLE instance shut down. SQL> startup; ORACLE instance started. Total System Global Area 1068937216 bytes Fixed Size 2296576 bytes Variable Size 713032960 bytes Database Buffers 348127232 bytes Redo Buffers 5480448 bytes Database mounted. Database opened. SQL> show parameter pfile; NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ spfile string /oracle/db/ohome/dbs/spfileorc l.ora
Such a great blog.Thanks for sharing.........
ReplyDeleteCyber Security Course in Pune
Cyber Security Course in Gurgaon
Cyber Security Course in Hyderabad
Cyber Security Course in Bangalore