Home Database Mysql Tutorial 物理内存扩容,oracle 11g R1数据库相关参数修改

物理内存扩容,oracle 11g R1数据库相关参数修改

Jun 07, 2016 pm 05:36 PM

背景:对主备机的物理内存扩容一倍,内存扩容后,需要修改数据库相关的内存参数,包括数据库层面和操作系统层面。预计对备机扩容一倍内存操作完毕后,修改相关..

背景:
        对主备机的物理内存扩容一倍,内存扩容后,需要修改数据库相关的内存参数,包括数据库层面和操作系统层面。预计对备机扩容一倍内存操作完毕后,修改相关内存参数,将数据库启动到备机,运行2天,若没有问题,再对之前的主机物理内存扩容一倍,将数据库切换到备机。之所以这么做,是因为扩容操作,需要关闭操作系统,一晚上搞不定,所以分两次操作,同时也可以更好的确保,主备机在内存扩容和修改相关数据库参数后,都可以正常运行。

环境介绍:

双机 操作系统:solaris 10 数据库版本:oracle 11g R1 64bit 当前主机的hostname和IP: fly-db1 192.168.20.20 当前备机的hostname和IP: fly-db2 192.168.20.21 物理内存,扩容前94G,扩容后188G

      1、确认数据库的内存管理方式:手动管理

SQL> show parameter memory_target NAME TYPE VALUE ------------------------------------ ----------- ------- memory_target big integer 0 SQL> show parameter sga_target NAME TYPE VALUE ------------------------------------ ----------- ------- sga_target big integer 0

     2、查看当前spfile路径:采用共享存储

SQL>show parameter spfile       3、刚已确认数据库的参数文件采用共享存储,则数据库的所有文件(控制文件,在线日志,数据文件(数据表空间和临时表空间的数据文件),参数文件)均应该为裸设备,现需确认主备机数据库的这些文件确实为裸设备,以及权限均为:oracle:oinstall或者oracle:dba,以避免双机切换过程中,因为数据库的文件权限不正确或使用到文件系统的数据文件导致切换失败(之前遇到过这种情况,所以需要再次确认)bash-3.00$ hostname fly-db1 bash-3.00$ cat check_file.sql //在当前主机运行以下SQL,查询所有数据库文件,保存到文本oracle_131215.txt set heading off set echo off set newpage none set feedback off spool oracle_131215.txt select file_name from dba_data_files; select file_name from dba_temp_files; select member from v$logfile; select name from v$controlfile; select value from v$parameter where; spool off bash-3.00$ sqlplus /nolog SQL> conn /as sysdba Connected. SQL> @check_file.sql SQL> quit bash-3.00$ ls check_file.sql oracle_131215.txt bash-3.00$ for i in $(cat oracle_131215.txt);do ls -l $i;done //查看这些文件(有省略)是否为裸设备(即字符设备),权限是否正确 crw------- 1 oracle dba 342, 200 Dec 15 07:39 /dev/raw/raw1 crw------- 1 oracle dba 342, 201 Dec 15 02:57 /dev/raw/raw2 crw------- 1 oracle dba 342, 202 Dec 15 03:04 /dev/raw/raw3 crw------- 1 oracle dba 342, 254 Dec 15 01:22 /dev/raw/raw4 crw------- 1 oracle dba 342, 253 Dec 15 03:25 /dev/raw/raw5 bash-3.00$ for i in $(cat oracle_131215.txt);do ls -l $i | grep -v ^c;done //若文件个数太多,则刷选开头不是c打头的文件,若无输出,即均为裸设备 bash-3.00$ for i in $(cat oracle_131215.txt);do ls -l $i | grep root;done //刷选是否有root字眼的文件,文件创建时,默认为root:root bash-3.00$ scp oracle_131215.txt oracle@192.168.20.21:/home/oracle/ //在备机执行一样的操作 Password: oracle_131215.txt 100% |*********************************************************************************| 27216 00:00 bash-3.00$ ssh oracle@192.168.20.21 Password: Last login: Sun Dec 15 10:31:13 2013 from 192.168.20.20 ONLY Authorized users only! All accesses logged fly-db2% bash bash-3.00$ hostname fly-db2 bash-3.00$ for i in $(cat oracle_131215.txt);do ls -l $i;done crw------- 1 oracle dba 342, 200 Sep 15 2012 /dev/raw/raw1 crw------- 1 oracle dba 342, 201 Sep 15 2012 /dev/raw/raw2 crw------- 1 oracle dba 342, 202 Sep 15 2012 /dev/raw/raw3 crw------- 1 oracle dba 342, 254 Sep 15 2012 /dev/raw/raw4 crw------- 1 oracle dba 342, 253 Sep 15 2012 /dev/raw/raw5 bash-3.00$ for i in $(cat oracle_131215.txt);do ls -l $i | grep -v ^c;done bash-3.00$ for i in $(cat oracle_131215.txt);do ls -l $i | grep root;done

     4、确认需要修改的参数:

在主备机修改/etc/system文件中的以下参数为以下值,:(shmsys:shminfo_shmmax为共享内存段的最大值,一般为物理内存的一半,精确到字节) set shmsys:shminfo_shmmax=100931731456 将以下数据库参数修改为以下值: memory_max_target=110G //物理内存的60% sga_max_size=110G //物理内存的60% db_cache_size=55G //物理内存的30% shared_pool_size=10G //物理内存的5% pga_aggregate_target=18G //物理内存的10% db_files=2000 //数据库的数据文件个数限制修改为2000 processes=3000 //当前该值已经很大,不再修改

     具体的操作步骤如下:

     1、主备机的/etc/system文件必须一致,否则将备机的shmsys:shminfo_shmmax参数修改后,重启备机操作系统生效该参数时,将失败,/etc/system文件只有在操作系统引导时,才会被读取,理论上,在数据库运行时,是可以修改/etc/system文件的shmsys:shminfo_shmmax参数的

     2、修改主备机的/etc/system文件中的shmsys:shminfo_shmmax参数为物理内存(188G)的一半,精确到字节。
set shmsys:shminfo_shmmax=100931731456

    3、对比主备机的/etc/system文件是否一致,无任何输出,则一致

bash-3.00#hostname fly-db1 bash-3.00# diff /etc/system /home/oracle/system_flydb2_131215.bak

     4、重启备机操作系统,生效该参数的设置

bash-3.00# hostname fly-db1 bash-3.00# sync bash-3.00# sync bash-3.00# sync bash-3.00# shutdown -i6 -g0 -y
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

When might a full table scan be faster than using an index in MySQL? When might a full table scan be faster than using an index in MySQL? Apr 09, 2025 am 12:05 AM

Full table scanning may be faster in MySQL than using indexes. Specific cases include: 1) the data volume is small; 2) when the query returns a large amount of data; 3) when the index column is not highly selective; 4) when the complex query. By analyzing query plans, optimizing indexes, avoiding over-index and regularly maintaining tables, you can make the best choices in practical applications.

Can I install mysql on Windows 7 Can I install mysql on Windows 7 Apr 08, 2025 pm 03:21 PM

Yes, MySQL can be installed on Windows 7, and although Microsoft has stopped supporting Windows 7, MySQL is still compatible with it. However, the following points should be noted during the installation process: Download the MySQL installer for Windows. Select the appropriate version of MySQL (community or enterprise). Select the appropriate installation directory and character set during the installation process. Set the root user password and keep it properly. Connect to the database for testing. Note the compatibility and security issues on Windows 7, and it is recommended to upgrade to a supported operating system.

Explain InnoDB Full-Text Search capabilities. Explain InnoDB Full-Text Search capabilities. Apr 02, 2025 pm 06:09 PM

InnoDB's full-text search capabilities are very powerful, which can significantly improve database query efficiency and ability to process large amounts of text data. 1) InnoDB implements full-text search through inverted indexing, supporting basic and advanced search queries. 2) Use MATCH and AGAINST keywords to search, support Boolean mode and phrase search. 3) Optimization methods include using word segmentation technology, periodic rebuilding of indexes and adjusting cache size to improve performance and accuracy.

Difference between clustered index and non-clustered index (secondary index) in InnoDB. Difference between clustered index and non-clustered index (secondary index) in InnoDB. Apr 02, 2025 pm 06:25 PM

The difference between clustered index and non-clustered index is: 1. Clustered index stores data rows in the index structure, which is suitable for querying by primary key and range. 2. The non-clustered index stores index key values ​​and pointers to data rows, and is suitable for non-primary key column queries.

MySQL: Simple Concepts for Easy Learning MySQL: Simple Concepts for Easy Learning Apr 10, 2025 am 09:29 AM

MySQL is an open source relational database management system. 1) Create database and tables: Use the CREATEDATABASE and CREATETABLE commands. 2) Basic operations: INSERT, UPDATE, DELETE and SELECT. 3) Advanced operations: JOIN, subquery and transaction processing. 4) Debugging skills: Check syntax, data type and permissions. 5) Optimization suggestions: Use indexes, avoid SELECT* and use transactions.

The relationship between mysql user and database The relationship between mysql user and database Apr 08, 2025 pm 07:15 PM

In MySQL database, the relationship between the user and the database is defined by permissions and tables. The user has a username and password to access the database. Permissions are granted through the GRANT command, while the table is created by the CREATE TABLE command. To establish a relationship between a user and a database, you need to create a database, create a user, and then grant permissions.

Can mysql and mariadb coexist Can mysql and mariadb coexist Apr 08, 2025 pm 02:27 PM

MySQL and MariaDB can coexist, but need to be configured with caution. The key is to allocate different port numbers and data directories to each database, and adjust parameters such as memory allocation and cache size. Connection pooling, application configuration, and version differences also need to be considered and need to be carefully tested and planned to avoid pitfalls. Running two databases simultaneously can cause performance problems in situations where resources are limited.

Explain different types of MySQL indexes (B-Tree, Hash, Full-text, Spatial). Explain different types of MySQL indexes (B-Tree, Hash, Full-text, Spatial). Apr 02, 2025 pm 07:05 PM

MySQL supports four index types: B-Tree, Hash, Full-text, and Spatial. 1.B-Tree index is suitable for equal value search, range query and sorting. 2. Hash index is suitable for equal value searches, but does not support range query and sorting. 3. Full-text index is used for full-text search and is suitable for processing large amounts of text data. 4. Spatial index is used for geospatial data query and is suitable for GIS applications.

See all articles