oracle rat database replay
rat的兩個主要元件database replay和sql performance analyzer(SPA),其中database reply可capture生產庫的工作負載,並replay到測試庫上,以主動發現升級問題.
database replay可以用於測試資料庫升級,作業系統升級,儲存系統升級,資料庫配置更改.
database replay基本步驟是工作負載capture,工作負載processing,工作負載replay,對比產生報告.
以下是一個簡單的測試:
db1:ct6604
db2:ct6604sb
1.透過rman,datapump,snapshot standby,logical standby來實現測試庫與與生產庫在資料capture前一致.
2.建立工作負載目錄
--ct6604
create directory cap_dump as '/home/oracle/oracap';
3.設定capture過濾
--ct6604
begin
dbms_workload_capture.ADD_FILTER(fname=>'filter01',fattribute=>'user',
fvalue=>'scott');
end;
4.開始capture,檢視capture狀態
--ct6604
--在開始capture時,已經在執行的事務可能capture不到.
begin
dbms_workload_capture.START_CAPTURE('cap01','CAP_DUMP',duration=>10);
end;
select * from dba_workload_captures;
得到capture_id為14
5.完成並結束capture
--ct6604
begin
dbms_workload_capture.FINISH_CAPTURE;
end;
6.匯出生產庫一個AWR報告
--ct6604
begin
dbms_workload_capture.export_awr(14);
end;
7.傳送capture檔案到測試庫
--ct6604
[oracle@ct6604 oracap]$ pwd
/home/oracle/oracap
[oracle@ct6604 oracap]$ scp -r * 192.108.56.120:~/oracap/
8.建立工作負載目錄
--ct6604sb
create directory cap_dump as '/home/oracle/oracap';
9.處理capture到的負載資料
--ct6604sb
begin
dbms_workload_replay.PROCESS_CAPTURE('CAP_DUMP');
end;
10.初始化replay資料
--ct6604sb
begin
dbms_workload_replay.INITIALIZE_REPLAY('rep01','CAP_DUMP');
end;
11.重對映外部連線
--ct6604sb
select * from dba_workload_connection_map;
begin dbms_workload_replay.REMAP_CONNECTION(1,'(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.108.56.121)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ct6604sb)))');
end;
12.準備replay工作負載
--ct6604sb
begin
dbms_workload_replay.PREPARE_REPLAY(synchronization => true,connect_time_scale => 100,think_time_scale => 100,think_time_auto_correct => false);
end;
13.確定replay工作負載所需的主機和客戶機數,啟動replay客戶機
--ct6604sb
wrc system/system mode=calibrate replaydir=/home/oracle/oracap
wrc system/system replaydir=/home/oracle/oracap
14.replay工作負載
--ct6604sb
begin
dbms_workload_replay.START_REPLAY;
end;
--可使用dbms_workload_replay.cancel_REPLAY取消replay操作
15.匯入capture和replay時的awr
--ct6604sb
select * from dba_workload_captures;得到capture_id為1
select * from dba_workload_replays;得到replay_id為1
select dbms_workload_capture.IMPORT_AWR(1,'SYSTEM') from dual;
select dbms_workload_replay.IMPORT_AWR(1,'SYSTEM') from dual;
16.檢視capture和replay時的報告
--ct6604sb
select dbms_workload_capture.REPORT(1,'TEXT') from dual;
select dbms_workload_replay.REPORT(1,'TEXT') from dual;
database replay可以用於測試資料庫升級,作業系統升級,儲存系統升級,資料庫配置更改.
database replay基本步驟是工作負載capture,工作負載processing,工作負載replay,對比產生報告.
以下是一個簡單的測試:
db1:ct6604
db2:ct6604sb
1.透過rman,datapump,snapshot standby,logical standby來實現測試庫與與生產庫在資料capture前一致.
2.建立工作負載目錄
--ct6604
create directory cap_dump as '/home/oracle/oracap';
3.設定capture過濾
--ct6604
begin
dbms_workload_capture.ADD_FILTER(fname=>'filter01',fattribute=>'user',
fvalue=>'scott');
end;
4.開始capture,檢視capture狀態
--ct6604
--在開始capture時,已經在執行的事務可能capture不到.
begin
dbms_workload_capture.START_CAPTURE('cap01','CAP_DUMP',duration=>10);
end;
select * from dba_workload_captures;
得到capture_id為14
5.完成並結束capture
--ct6604
begin
dbms_workload_capture.FINISH_CAPTURE;
end;
6.匯出生產庫一個AWR報告
--ct6604
begin
dbms_workload_capture.export_awr(14);
end;
7.傳送capture檔案到測試庫
--ct6604
[oracle@ct6604 oracap]$ pwd
/home/oracle/oracap
[oracle@ct6604 oracap]$ scp -r * 192.108.56.120:~/oracap/
8.建立工作負載目錄
--ct6604sb
create directory cap_dump as '/home/oracle/oracap';
9.處理capture到的負載資料
--ct6604sb
begin
dbms_workload_replay.PROCESS_CAPTURE('CAP_DUMP');
end;
10.初始化replay資料
--ct6604sb
begin
dbms_workload_replay.INITIALIZE_REPLAY('rep01','CAP_DUMP');
end;
11.重對映外部連線
--ct6604sb
select * from dba_workload_connection_map;
begin dbms_workload_replay.REMAP_CONNECTION(1,'(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.108.56.121)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ct6604sb)))');
end;
12.準備replay工作負載
--ct6604sb
begin
dbms_workload_replay.PREPARE_REPLAY(synchronization => true,connect_time_scale => 100,think_time_scale => 100,think_time_auto_correct => false);
end;
13.確定replay工作負載所需的主機和客戶機數,啟動replay客戶機
--ct6604sb
wrc system/system mode=calibrate replaydir=/home/oracle/oracap
wrc system/system replaydir=/home/oracle/oracap
14.replay工作負載
--ct6604sb
begin
dbms_workload_replay.START_REPLAY;
end;
--可使用dbms_workload_replay.cancel_REPLAY取消replay操作
15.匯入capture和replay時的awr
--ct6604sb
select * from dba_workload_captures;得到capture_id為1
select * from dba_workload_replays;得到replay_id為1
select dbms_workload_capture.IMPORT_AWR(1,'SYSTEM') from dual;
select dbms_workload_replay.IMPORT_AWR(1,'SYSTEM') from dual;
16.檢視capture和replay時的報告
--ct6604sb
select dbms_workload_capture.REPORT(1,'TEXT') from dual;
select dbms_workload_replay.REPORT(1,'TEXT') from dual;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28539951/viewspace-1811440/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle Database ReplayOracleDatabase
- Oracle 11g Database Replay 實驗OracleDatabase
- oracle rat spaOracle
- Oracle 資料庫重放(Database Replay)功能演示Oracle資料庫Database
- database replay基礎學習Database
- 資料庫負荷重放(Database replay)資料庫Database
- 11g Database Replay使用詳解Database
- 執行database replay進行升級測試Database
- Oracle RAT介紹及最佳實踐Oracle
- Oracle replayc測試Oracle
- Database Capture and Replay: Common Errors and Reasons (文件 ID 463263.1)DatabaseAPTError
- DATABASE REPLAY加壓播放引數之SCALE_UP_MULTIPLIERDatabase
- Real Application Test(RAT)APP
- RAT手冊總結
- Use Database Replay Feature to Help With Upgrade From 10.2.0.4 to 11g_748895.1Database
- TcpreplayTCP
- RAT(Oracle Real Application Testing)時ORA 600報錯處理OracleAPP
- Oracle Database Cloud - Database as a Service Quick StartOracleDatabaseCloudUI
- Types of Oracle Database Users : Database Users (6)OracleDatabase
- Oracle clone databaseOracleDatabase
- ORACLE database vaultOracleDatabase
- Oracle Database HistoryOracleDatabase
- alter database in OracleDatabaseOracle
- Oracle Database ScriptOracleDatabase
- Oracle Database ServiceOracleDatabase
- 【RAT】Oracle Real Application Testing(真用應用測試)介紹OracleAPP
- Oracle Physical Database LimitsOracleDatabaseMIT
- Oracle sharding databaseOracleDatabase
- Oracle Database Resource ManagerOracleDatabase
- Oracle Database Scheduler整理OracleDatabase
- oracle full database backupOracleDatabase
- Oracle Active database duplicationOracleDatabase
- Oracle Database Memory StructuresOracleDatabaseStruct
- Oracle database buffer cacheOracleDatabase
- Oracle Database In-MemoryOracleDatabase
- Oracle database instanceOracleDatabase
- Oracle Database Internals FAQOracleDatabase
- HP ORACLE DATABASE MACHINEOracleDatabaseMac