2009-01-13 110 views
2

誰能告訴我,爲什麼會出現以下行爲(甲骨文10.2)公共同義詞變得無效:在Oracle中,爲什麼當一個表分區被丟棄

SQL> create table part_test (
     i int primary key, 
     d date 
) 
partition by range (d) (partition part_test_1 values less than (to_date(' 2 3 4 5 1980-01-01', 'yyyy-mm-dd'))); 

create public synonym part_test for part_test; 

select object_name, object_type, status from all_objects where object_name = 'PART_TEST'; 

alter table part_test add partition part_test_2 values less than (to_date('1981-01-01', 'yyyy-mm-dd')); 

select object_name, object_type, status from all_objects where object_name = 'PART_TEST'; 

alter table part_test drop partition part_test_1; 

select object_name, object_type, status from all_objects where object_name = 'PART_TEST'; 

drop public synonym part_test; 
drop table part_test; 

Table created. 

SQL> SQL> 
Synonym created. 

SQL> SQL> 
OBJECT_NAME     OBJECT_TYPE   STATUS 
------------------------------ ------------------- ------- 
PART_TEST      TABLE    VALID 
PART_TEST      TABLE PARTITION  VALID 
PART_TEST      SYNONYM    VALID 

SQL> SQL> 
Table altered. 

SQL> SQL> 
OBJECT_NAME     OBJECT_TYPE   STATUS 
------------------------------ ------------------- ------- 
PART_TEST      TABLE    VALID 
PART_TEST      TABLE PARTITION  VALID 
PART_TEST      TABLE PARTITION  VALID 
PART_TEST      SYNONYM    VALID 

SQL> SQL> 
Table altered. 

SQL> SQL> 
OBJECT_NAME     OBJECT_TYPE   STATUS 
------------------------------ ------------------- ------- 
PART_TEST      TABLE    VALID 
PART_TEST      TABLE PARTITION  VALID 
PART_TEST      SYNONYM    INVALID 

SQL> SQL> 
Synonym dropped. 

SQL> 
Table dropped. 

SQL> 

同義詞分區被刪除後變得無效,我無法解決原因。

感謝您的任何想法。

回答

5

我已經與Oracle 10.2測試它和同義詞變得其實是無效而當其他用戶通過做從part_test

SELECT COUNT(*)使用同義詞;

Oracle自動編譯同義詞,並且同義詞變得有效。

這與包裝,程序和功能相同。當您執行它們並且它們無效時,Oracle會嘗試自動編譯它們。

2

它不在11.1.0.6中 它可能是一個已修復的錯誤。它可能是必要的東西(例如,基於同義詞重新驗證視圖...),但是已經使用了改進的技術。

+0

我本來希望接受這個答案,但我只能接受一個,所以我會選擇與我的Oracle版本相關的。 Ta Gary。 – 2009-09-16 23:00:18

相關問題