search
HomeDatabaseMysql Tutorial使用v$session_longops来监控RMAN备份进度

这次备份的数据库是个大块头,数据文件达到10TB。 可是管理方只允许使用4个通道备份,直接扼杀了备份速度。通过glance命令查看cp

这次备份的数据库是个大块头,数据文件达到10TB。 可是管理方只允许使用4个通道备份,直接扼杀了备份速度。通过glance命令查看cpu,磁盘、内存的压力都不高,即使开8个通道或是16个通道也没问题。该主机是双节点RAC,每台主机配有32个cpu,并且是在周末业务较低的时候备份。

这4个通道的限制就如同一辆法拉利挂着一档行驶在高速公路上,这要多久才能跑完...

1,备份之前了解一下目标数据库的状态

看看dba_segments,实际数据块的总大小为5TB
SQL> select sum(bytes)/1024/1024/1024 GB from dba_segments;

        GB
----------
5287.02454

看看dba_data_files,数据文件总大小大约为10TB
SQL> select sum(bytes)/1024/1024/1024 GB from dba_data_files;

        GB
----------
9402.70592

临时备份路径为/orabak,磁盘空间大小为为9TB
bdf
/dev/vx/dsk/bakdg/bakvol
                  9961472000  634128 9883018840    0% /orabak


2,这是一个普通压缩方式的数据库全备脚本,包含控制文件、参数文件和归档日志文件。最突出的部分是这4通道,让人痛不欲生。
vi backup.cmd

rman target / run{
allocate channel c1 device type disk maxpiecesize = 20G;
allocate channel c2 device type disk maxpiecesize = 20G;
allocate channel c3 device type disk maxpiecesize = 20G;
allocate channel c4 device type disk maxpiecesize = 20G;
backup tag 'sh_db_full' as compressed backupset format '/orabak/sh_db_full_%U' database
include current controlfile;
sql 'alter system archive log current';
backup tag 'sh_arch' as compressed backupset archivelog all format '/orabak/sh_arch_%U';
release channel c1;
release channel c2;
release channel c3;
release channel c4;
}
EOF

3,在Oracle用户下授权备份脚本
chmod 755 backup.cmd

4,在后台执行备份脚本
nohup backup.cmd &

5,,通过nohup.out日志来监控rman备份输出

备份时间为2014/10/12日 16:45
tail -f nohup.out

6,通过glance命令来观察备份时的系统状态,发现CPU的使用率只有23%,磁盘压力只有15%,4个通道所占用的cpu分别为100%左右。其实我们的可以资源非常多,却不允许使用。

Glance 11.13.007                16:47:43 jccmsdb1      ia64                                                        Current Avg  High
------------------------------------------------------------------------------------------------------------------------------------
CPU  Util  SSN              NU UW W                                                                              | 23%  23%  33%
Disk Util  F            F                                                                                        | 15%  11%  30%
Mem  Util  S                SU                                              UF  F                                | 70%  70%  70%
Networkil  U                                    UR              R                                                | 54%  54%  54%
------------------------------------------------------------------------------------------------------------------------------------
                                                            PROCESS LIST                                                Users=    9
                        User      CPU %  Thrd  Disk        Memory    Block
Process Name        PID Name    (2400% max) Cnt IO rate    RSS      VSS  On
------------------------------------------------------------------------------------------------------------------------------------
oraclesgpmdb      12326 oracle        100    1  51.9  92.0mb    104mb  PRI
oraclesgpmdb      12280 oracle        100    1  54.2  92.0mb    104mb  PRI
oraclesgpmdb      12281 oracle      99.6    1  54.4  92.0mb    104mb  PRI
oraclesgpmdb      12304 oracle      99.4    1  57.6  92.0mb    104mb  PRI
ora_m000_sgp      28333 oracle      15.6    1    0.0    131mb    163mb  PRI
perl              18601 root          9.1    1    0.0    712kb    724kb  died
ora_dia0_sgp        6943 oracle        7.6    1    0.0    134mb    136mb SLEEP
java                9109 root          7.4    41    0.7    305mb    759mb SLEEP
df                18605 root          6.2    1    0.0    84kb    160kb  died
glance            19308 quest        6.0    1    0.0  20.1mb  23.9mb STRMS
ocssd.bin          16787 grid          5.1    19    2.8    138mb    138mb SLEEP
vxfsd                342 root          4.5  217  117.3  79.1mb  89.0mb SYSTM


7,通过v$session_longops视图查看rman备份的进度,这部分也是本片博客要阐述的重点。

SQL> /

Statement
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
MySQL: An Introduction to the World's Most Popular DatabaseMySQL: An Introduction to the World's Most Popular DatabaseApr 12, 2025 am 12:18 AM

MySQL is an open source relational database management system, mainly used to store and retrieve data quickly and reliably. Its working principle includes client requests, query resolution, execution of queries and return results. Examples of usage include creating tables, inserting and querying data, and advanced features such as JOIN operations. Common errors involve SQL syntax, data types, and permissions, and optimization suggestions include the use of indexes, optimized queries, and partitioning of tables.

The Importance of MySQL: Data Storage and ManagementThe Importance of MySQL: Data Storage and ManagementApr 12, 2025 am 12:18 AM

MySQL is an open source relational database management system suitable for data storage, management, query and security. 1. It supports a variety of operating systems and is widely used in Web applications and other fields. 2. Through the client-server architecture and different storage engines, MySQL processes data efficiently. 3. Basic usage includes creating databases and tables, inserting, querying and updating data. 4. Advanced usage involves complex queries and stored procedures. 5. Common errors can be debugged through the EXPLAIN statement. 6. Performance optimization includes the rational use of indexes and optimized query statements.

Why Use MySQL? Benefits and AdvantagesWhy Use MySQL? Benefits and AdvantagesApr 12, 2025 am 12:17 AM

MySQL is chosen for its performance, reliability, ease of use, and community support. 1.MySQL provides efficient data storage and retrieval functions, supporting multiple data types and advanced query operations. 2. Adopt client-server architecture and multiple storage engines to support transaction and query optimization. 3. Easy to use, supports a variety of operating systems and programming languages. 4. Have strong community support and provide rich resources and solutions.

Describe InnoDB locking mechanisms (shared locks, exclusive locks, intention locks, record locks, gap locks, next-key locks).Describe InnoDB locking mechanisms (shared locks, exclusive locks, intention locks, record locks, gap locks, next-key locks).Apr 12, 2025 am 12:16 AM

InnoDB's lock mechanisms include shared locks, exclusive locks, intention locks, record locks, gap locks and next key locks. 1. Shared lock allows transactions to read data without preventing other transactions from reading. 2. Exclusive lock prevents other transactions from reading and modifying data. 3. Intention lock optimizes lock efficiency. 4. Record lock lock index record. 5. Gap lock locks index recording gap. 6. The next key lock is a combination of record lock and gap lock to ensure data consistency.

What are common causes of poor MySQL query performance?What are common causes of poor MySQL query performance?Apr 12, 2025 am 12:11 AM

The main reasons for poor MySQL query performance include not using indexes, wrong execution plan selection by the query optimizer, unreasonable table design, excessive data volume and lock competition. 1. No index causes slow querying, and adding indexes can significantly improve performance. 2. Use the EXPLAIN command to analyze the query plan and find out the optimizer error. 3. Reconstructing the table structure and optimizing JOIN conditions can improve table design problems. 4. When the data volume is large, partitioning and table division strategies are adopted. 5. In a high concurrency environment, optimizing transactions and locking strategies can reduce lock competition.

When should you use a composite index versus multiple single-column indexes?When should you use a composite index versus multiple single-column indexes?Apr 11, 2025 am 12:06 AM

In database optimization, indexing strategies should be selected according to query requirements: 1. When the query involves multiple columns and the order of conditions is fixed, use composite indexes; 2. When the query involves multiple columns but the order of conditions is not fixed, use multiple single-column indexes. Composite indexes are suitable for optimizing multi-column queries, while single-column indexes are suitable for single-column queries.

How to identify and optimize slow queries in MySQL? (slow query log, performance_schema)How to identify and optimize slow queries in MySQL? (slow query log, performance_schema)Apr 10, 2025 am 09:36 AM

To optimize MySQL slow query, slowquerylog and performance_schema need to be used: 1. Enable slowquerylog and set thresholds to record slow query; 2. Use performance_schema to analyze query execution details, find out performance bottlenecks and optimize.

MySQL and SQL: Essential Skills for DevelopersMySQL and SQL: Essential Skills for DevelopersApr 10, 2025 am 09:30 AM

MySQL and SQL are essential skills for developers. 1.MySQL is an open source relational database management system, and SQL is the standard language used to manage and operate databases. 2.MySQL supports multiple storage engines through efficient data storage and retrieval functions, and SQL completes complex data operations through simple statements. 3. Examples of usage include basic queries and advanced queries, such as filtering and sorting by condition. 4. Common errors include syntax errors and performance issues, which can be optimized by checking SQL statements and using EXPLAIN commands. 5. Performance optimization techniques include using indexes, avoiding full table scanning, optimizing JOIN operations and improving code readability.

See all articles

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

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.