Get the App
SLTechnology News&Howtos  ›  Database  › 

Set the database to automatic memory management

Shulou Source: shulou.com Published: 2022-06-01 08:25:27 10月04日 Update

Setting up automatic memory management of the database is mainly about setting two parameters:

Memory_max_target

Memory_target

If these two parameters are set to 0, the database memory is managed manually, otherwise it is managed automatically.

Shut down the database.

SQL > startup nomount

ORA-00838: Specified value of MEMORY_TARGET is too small, needs to be at least 6384M

-- the reason why I reported an error here is my previous alter system set MEMORY_TARGET='1536M' scope='spfile'.

Because the memory allocated to SGA by the system before is only so large, the parameters I set must not exceed SGA, which is the reason for the error in restarting the database after modifying the parameters.

SQL > create pfile ='/ home/oracle/initora11g.ora' from spfile

File created.

Create the pfile file, and then modify the pfile file to set the size of these two parameters to 7G.

[oracle@TestServer dbhome_1] $vi / home/oracle/initora11g.ora

Atsdb.__db_cache_size=16777216

Atsdb.__java_pool_size=16777216

Atsdb.__large_pool_size=16777216

Atsdb.__oracle_base='/opt/app/oracle'#ORACLE_BASE set from environment

Atsdb.__pga_aggregate_target=5083496448

Atsdb.__sga_target=1610612736

Atsdb.__shared_io_pool_size=0

Atsdb.__shared_pool_size=1526726656

Atsdb.__streams_pool_size=16777216

* .audit_file_dest='/opt/app/oracle/admin/atsdb/adump'

* .audit_trail='db'

* .compatible='11.2.0.0.0'

* .control_files='/opt/app/oracle/oradata/atsdb/control01.ctl','/opt/app/oracle/flash_recovery_area/atsdb/control02.ctl'

* .db_block_size=8192

* .db_domain=''

* .db_name='atsdb'

* .db_recovery_file_dest='/opt/app/oracle/flash_recovery_area'

* .db_recovery_file_dest_size=4070572032

* .diagnostic_dest='/opt/app/oracle'

* .dispatchers=' (PROTOCOL=TCP) (SERVICE=atsdbXDB)'

* .global_names=FALSE

* .memory_max_target=7610612736

* .memory_target=7610612736

* .open_cursors=300

* .pga_aggregate_target=5078253568

* .processes=3000

* .remote_login_passwordfile='EXCLUSIVE'

* .sessions=3555

* .sga_target=1610612736

* .undo_tablespace='UNDOTBS1'

Start the database from pfile after the modification is complete:

SQL > ='/ home/oracle startup pfile/initora11g.ora'

ORACLE instance started.

Total System Global Area 7616245760 bytes

Fixed Size 2214496 bytes

Variable Size 6979323296 bytes

Database Buffers 603979776 bytes

Redo Buffers 30728192 bytes

Database mounted.

Database opened.

You can see that the database has been restarted because the parameters that were just modified in pfile are now synchronized to spfile:

SQL > create spfile from pfile='/home/oracle/initora11g.ora'

File created.

SQL > show parameter memory

NAME TYPE

VALUE

-

Hi_shared_memory_address integer

0

Memory_max_target big integer

7296M

Memory_target big integer

7296M

Shared_memory_address integer

0

SQL >

It can also be seen here that the database is now automatically managed in memory.

Success.

Tags: Data database parameters memory management two files success that is the reason size manual is synchronized. Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Huawei Microsoft Shulou Information macOS