SQL>create table int_test
(a int
partition by range(a)
(partition p
partition p
partition p
partition p
Table created
然後我們檢查所有對象
SQL> select object_name
AUDIT_TEST TABLE VALID
INT_TEST TABLE PARTITION VALID
INT_TEST TABLE PARTITION VALID
INT_TEST TABLE PARTITION VALID
INT_TEST TABLE PARTITION VALID
INT_TEST TABLE VALID
PK_TEST_ID INDEX VALID
TEST TABLE VALID
TR_TEST TRIGGER VALID
SQL> execute
DBMS_REDEFINITION
begin SYS
ORA
ORA
ORA
ORA
這裡存儲過程返回一個錯誤
* CREATE ANY TABLE
* ALTER ANY TABLE
* DROP ANY TABLE
* LOCK ANY TABLE
* SELECT ANY TABLE
我們可以臨時授予DBA權限給用戶
SQL> CONNECT SYSTEM/CHEN
Connected to Oracle
Connected as SYSTEM
SQL> execute SYS
PL/SQL procedure successfully completed
這裡可以看到
SQL> select sql_text from v$sqlarea where sql_text like
SQL_TEXT
SELECT CURRENT$
select * from
ALTER TRIGGER MYTEST
SELECT /*+ NO_MERGE NO_MERGE(LL$) ROWID(MAS$) ORDERED USE_NL(MAS$) NO_INDEX(MAS
DELETE FROM
truncate table
delete from
INSERT INTO
select sql_text from v$sqlarea where sql_text like
UPDATE
SELECT
begin dbms_redefinition
select count(*) from snap$ where (vname
comment on table
begin DBMS_REDEFINITION
comment on table
INSERT INTO
INSERT /*+ APPEND */ INTO
update
SELECT DISTINCT LOG$
以上的語句我不再解釋
我們再檢查所有對象
SQL> select object_name
TEST TABLE VALID
AUDIT_TEST TABLE VALID
TR_TEST TRIGGER VALID
PK_TEST_ID INDEX VALID
INT_TEST TABLE VALID
INT_TEST TABLE PARTITION VALID
INT_TEST TABLE PARTITION VALID
INT_TEST TABLE PARTITION VALID
INT_TEST TABLE PARTITION VALID
MLOG$_TEST TABLE VALID
RUPD$_TEST TABLE VALID
發現比以前多了兩個表對象
這個就是該過程在執行後會產生兩個表
一個是永久表MLOG$_EMP
另一個就是臨時表RUPD$_EMP
我們檢查一下所有的表數據
SQL> select count(*) from test;
SQL> select count(*) from MLOG$_test;
SQL> select count(*) from rupd$_test;
SQL> select count(*) from int_test;
可以看到
SQL> select c from audit_test;
這裡可以看到
這裡給大家介紹兩個表的來源
SQL> select master
TEST MLOG$_TEST
SQL> select mview_name
INT_TEST INT_TEST PREBUILT
From:http://tw.wingwit.com/Article/program/Oracle/201311/17663.html