如何通过加载系统参数故意导致 Oracle VM 崩溃

如何通过加载系统参数故意导致 Oracle VM 崩溃

我在用Oracle 虚拟机. 我想要表演压力测试在系统参数上,如 CPU、RAM 等。有人能帮我看看我该怎么做吗?用高负载加载参数比如使用所有虚拟核心、RAM 不足等等。

答案1

我使用以下rb.sql脚本。

-- The Following script shows the time it takes to insert 1 million rows in a database.
-- I used it to determine that:
-- 
-- 1) Optimized Databases perform in relation to the hardware they run on,
--    and all the databases on 1 platform run within 10% of each other.
-- 2) When Rollback, Temp or Redo logs share the same underlying disks as 
--    the "alan" table, the insert takes up to twice as long.
-- 3) When the rollback segments, Temp segments or redo log buffers are > 20 meg as
--    opposed to less than 1 meg, the inserts run 2 to 5 times faster.
--    By making the log_buffer and Rollback extents sizes close to 32k, 
--    the inserts run up to 9 times slower.
set feedback off
set termout off
drop table alan;
set termout on
create table alan (name varchar2(30)) storage (initial 32k next 1m) logging noparallel storage(buffer_pool default); 
insert into alan values ('alan');
insert into alan values ('alan1');
insert into alan select * from alan;
insert into alan select * from alan;
insert into alan select * from alan;
insert into alan select * from alan;
insert into alan select * from alan;
insert into alan select * from alan;
insert into alan select * from alan;
insert into alan select * from alan;
insert into alan select * from alan;
insert into alan select * from alan;
insert into alan select * from alan;
insert into alan select * from alan;
insert into alan select * from alan;
insert into alan select * from alan;
insert into alan select * from alan;
insert into alan select * from alan;
insert into alan select * from alan;
insert into alan select * from alan;
insert into alan select * from alan;
set timing on
insert /*+ PPEND */ into alan logging select * from alan         /* This line shows the elapsed time. */
;
set timing off
-- select max(sequence#) from v$loghist;
set feedback on
set termout off
--drop table alan;
set termout on

我使用 rb16.sql 来调用它:

@rb
@rb
@rb
@rb
@rb
@rb
@rb
@rb
@rb
@rb
@rb
@rb
@rb
@rb
@rb
@rb

然后我用call_rb16.sql调用rb16.sql:

@rb16
@rb16
@rb16
@rb16
@rb16
@rb16
@rb16
@rb16
@rb16
@rb16
@rb16
@rb16
@rb16
@rb16
@rb16
@rb16

由于 rb.sql 脚本插入到 alan 表中,因此您可以创建多个 oracle 用户并从多个登录中插入。rb.sql 脚本可识别瓶颈。

答案2

使用 Linux 真的很容易压力实用程序可选择性地加载部分或全部系统功能。可通过 YUM 下载...

将其视为stress负载生成器。强制系统崩溃则需要付出不同的努力。您可以使用它来查看负载下的运行情况,但我怀疑压力实用程序中的任何合理配置都会导致系统崩溃。

另请参阅:*nix 中的最大 CPU 负载

相关内容