11GR2新特性測試-閃迴歸檔
閃回資料歸檔測試
(1)版本
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
(2)許可權
flashback archive administer privilege
create user test identified by test default tablespace users;
grant connect,resource to test;
grant flashback archive administer to test;
(3)建立閃迴歸檔
create flashback archive flash1
tablespace users
quota 10m
retention 1 year;
SQL> col owner_name for a10
SQL> col flashback_archive_name for a20
SQL> select owner_name,flashback_archive_name,FLASHBACK_ARCHIVE#,RETENTION_IN_DAYS,status from dba_flashback_archive;
OWNER_NAME FLASHBACK_ARCHIVE_NA FLASHBACK_ARCHIVE# RETENTION_IN_DAYS STATUS
---------- -------------------- ------------------ ----------------- -------
TEST FLASH1 1 365
SQL> col tablespace_name for a10
SQL> select flashback_archive_name,tablespace_name,quota_in_mb from dba_flashback_archive_ts
FLASHBACK_ARCHIVE_NA TABLESPACE QUOTA_IN_MB
-------------------- ---------- ----------------------------------------
FLASH1 USERS 10
(4)建立閃迴歸檔表
create table t(name varchar2(30),address varchar2(50))
flashback archive flash1;
SQL> col table_name for a10
SQL> col archive_table_name for a20
SQL> select * from dba_flashback_archive_tables
TABLE_NAME OWNER_NAME FLASHBACK_ARCHIVE_NA ARCHIVE_TABLE_NAME STATUS
---------- ---------- -------------------- -------------------- --------
T TEST FLASH1 SYS_FBA_HIST_74484 ENABLED
(5)查詢閃回記錄
SQL> select * from test.SYS_FBA_HIST_74484;
select * from test.SYS_FBA_HIST_74484
*
ERROR at line 1:
ORA-00942: table or view does not exist
SQL> insert into t values('a','b');
1 row created.
SQL> commit;
Commit complete.
SQL> insert into t values('a2','b');
1 row created.
SQL> insert into t values('a2','b2');
1 row created.
SQL> commit;
Commit complete.
SQL> delete from t where name='a';
1 row deleted.
SQL> commit;
Commit complete.
SQL> update t set address='c' where name='a';
0 rows updated.
SQL> update t set address='c' where name='a2';
2 rows updated.
SQL> commit;
Commit complete.
SQL> select * from test.SYS_FBA_HIST_74484;
no rows selected
SQL> desc test.SYS_FBA_HIST_74484;
Name Null? Type
----------------------------------------- -------- ----------------------------
RID VARCHAR2(4000)
STARTSCN NUMBER
ENDSCN NUMBER
XID RAW(8)
OPERATION VARCHAR2(1)
NAME VARCHAR2(30)
ADDRESS VARCHAR2(50)
SQL> select * from t as of timestamp(systimestamp-interval '10' minute);
NAME ADDRESS
--------------------------------------------------
a b
SQL> select * from t;
NAME ADDRESS
--------------------------------------------------
a2 c
c
SQL> set linesize 100
SQL> col rid for a20
SQL> col name for a10
SQL> col address for a10
SQL> select * from test.SYS_FBA_HIST_74484
RID STARTSCN ENDSCN XID O NAME ADDRESS
-------------------- ---------- ---------- ---------------- - ---------- ----------
AAASL0AAEAAAAMQAAB 1046635 1046839 0B0002000F000000 I a2 b
AAASL0AAEAAAAMQAAC 1046635 1046839 0B0002000F000000 I a2 b2
AAASL0AAEAAAAMQAAA 1046516 1046640 110020000E000000 I a b
問題:
只有插入記錄,沒有更新,刪除記錄?
(1)版本
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
(2)許可權
flashback archive administer privilege
create user test identified by test default tablespace users;
grant connect,resource to test;
grant flashback archive administer to test;
(3)建立閃迴歸檔
create flashback archive flash1
tablespace users
quota 10m
retention 1 year;
SQL> col owner_name for a10
SQL> col flashback_archive_name for a20
SQL> select owner_name,flashback_archive_name,FLASHBACK_ARCHIVE#,RETENTION_IN_DAYS,status from dba_flashback_archive;
OWNER_NAME FLASHBACK_ARCHIVE_NA FLASHBACK_ARCHIVE# RETENTION_IN_DAYS STATUS
---------- -------------------- ------------------ ----------------- -------
TEST FLASH1 1 365
SQL> col tablespace_name for a10
SQL> select flashback_archive_name,tablespace_name,quota_in_mb from dba_flashback_archive_ts
FLASHBACK_ARCHIVE_NA TABLESPACE QUOTA_IN_MB
-------------------- ---------- ----------------------------------------
FLASH1 USERS 10
(4)建立閃迴歸檔表
create table t(name varchar2(30),address varchar2(50))
flashback archive flash1;
SQL> col table_name for a10
SQL> col archive_table_name for a20
SQL> select * from dba_flashback_archive_tables
TABLE_NAME OWNER_NAME FLASHBACK_ARCHIVE_NA ARCHIVE_TABLE_NAME STATUS
---------- ---------- -------------------- -------------------- --------
T TEST FLASH1 SYS_FBA_HIST_74484 ENABLED
(5)查詢閃回記錄
SQL> select * from test.SYS_FBA_HIST_74484;
select * from test.SYS_FBA_HIST_74484
*
ERROR at line 1:
ORA-00942: table or view does not exist
SQL> insert into t values('a','b');
1 row created.
SQL> commit;
Commit complete.
SQL> insert into t values('a2','b');
1 row created.
SQL> insert into t values('a2','b2');
1 row created.
SQL> commit;
Commit complete.
SQL> delete from t where name='a';
1 row deleted.
SQL> commit;
Commit complete.
SQL> update t set address='c' where name='a';
0 rows updated.
SQL> update t set address='c' where name='a2';
2 rows updated.
SQL> commit;
Commit complete.
SQL> select * from test.SYS_FBA_HIST_74484;
no rows selected
SQL> desc test.SYS_FBA_HIST_74484;
Name Null? Type
----------------------------------------- -------- ----------------------------
RID VARCHAR2(4000)
STARTSCN NUMBER
ENDSCN NUMBER
XID RAW(8)
OPERATION VARCHAR2(1)
NAME VARCHAR2(30)
ADDRESS VARCHAR2(50)
SQL> select * from t as of timestamp(systimestamp-interval '10' minute);
NAME ADDRESS
--------------------------------------------------
a b
SQL> select * from t;
NAME ADDRESS
--------------------------------------------------
a2 c
c
SQL> set linesize 100
SQL> col rid for a20
SQL> col name for a10
SQL> col address for a10
SQL> select * from test.SYS_FBA_HIST_74484
RID STARTSCN ENDSCN XID O NAME ADDRESS
-------------------- ---------- ---------- ---------------- - ---------- ----------
AAASL0AAEAAAAMQAAB 1046635 1046839 0B0002000F000000 I a2 b
AAASL0AAEAAAAMQAAC 1046635 1046839 0B0002000F000000 I a2 b2
AAASL0AAEAAAAMQAAA 1046516 1046640 110020000E000000 I a b
問題:
只有插入記錄,沒有更新,刪除記錄?
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/18922393/viewspace-773507/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 閃迴歸檔的簡單測試
- 開閃回及閃迴歸檔
- Oracle 11g 閃迴歸檔Oracle
- Oracle Flashback Archive——Oracle閃迴歸檔(上)OracleHive
- Oracle Flashback Archive——Oracle閃迴歸檔(中)OracleHive
- Oracle Flashback Archive——Oracle閃迴歸檔(下)OracleHive
- 詳解迴歸測試
- 迴歸測試總結
- 11g新特性--Oracle 11g 閃回資料歸檔Oracle
- 【備份恢復】 閃回技術之閃迴歸檔
- Oracle 11g新特性--閃回資料歸檔(flashback data archive)[zt]OracleHive
- 軟體測試學習教程—迴歸測試
- 軟體迴歸測試常用方法有哪些?迴歸測試報告收費貴嗎?測試報告
- 迴歸測試的四個步驟
- 迴歸測試遇到的問題求助
- 測試DML 時產生歸檔日誌和閃回日誌的比
- 11GR2新特性(轉)
- oracle 11GR2 新特性Oracle
- 利用Junit4進行程式模組的測試,迴歸測試行程
- 我的測試之旅:(4)並行——自動化迴歸測試並行
- mysql8.0.11新特性測試MySql
- 物理DG刪除歸檔測試
- 使用java+TestNG進行介面迴歸測試Java
- RMAN備份與恢復(新舊控制檔案及歸檔日誌)測試
- Oracle閃回資料歸檔Oracle
- 【RAC】11gR2 新特性: Rebootless RestartbootREST
- RMAN備份與恢復(新舊控制檔案及歸檔日誌)測試(敘)
- 11gR2新特性---Gpnp守護程式
- 【11gR2新特性】extent延遲建立
- Oracle RAC 11gR2開啟歸檔Oracle
- Chrome 58測試版釋出,有哪些新特性?Chrome
- Oracle 12C 資料泵新特性測試Oracle
- 軟體測試中的Bug迴歸,到底有多重要?
- 實施軟體測試風險分析&迴歸用例刷選
- 迴歸測試中的專案質量管理應用(轉)
- 關於歸檔日誌的切換測試
- RAC下歸檔不放到共享盤的測試
- 【機器學習】線性迴歸預測機器學習