OracleORA-02069注意事項(xiàng)
OracleORA-02069注意事項(xiàng)
Error: ORA-02069: global_names parameter must be set to TRUE for this operation
Cause: You tried to execute an operation that requires a remote mapping. This can not be done because the parameter called GLOBAL_NAMES is not set to TRUE.
Action: The options to resolve this Oracle error are:
Try setting the GLOBAL_NAMES parameter to TRUE with the following statement:
ALTER SESSION SET GLOBAL_NAMES = TRUE;
在一條語句中如果同時包括數(shù)據(jù)庫鏈和序列,就會出現(xiàn)潛在的問題,而Oracle的文檔在這里并沒有描述清楚。
下面通過一個例子對同時包括數(shù)據(jù)庫鏈和序列的幾種情況分別進(jìn)行說明。
首先,構(gòu)造一個測試的環(huán)境(兩個數(shù)據(jù)庫的GLOBAL_NAMES均為TRUE):
SQL> conn scott/tiger@yangtk
已連接。
SQL> create table test_on_yangtk (id number);
表已創(chuàng)建。
SQL> insert into test_on_yangtk values (1);
已創(chuàng)建 1 行。
SQL> commit;
提交完成。
SQL> create sequence seq_on_yangtk;
序列已創(chuàng)建。
SQL> conn yangtk/yangtk@test4
已連接。
SQL> create table test_on_test4 (id number);
表已創(chuàng)建。
SQL> insert into test_on_test4 values (1);
已創(chuàng)建 1 行。
SQL> commit;
提交完成。
SQL> create sequence seq_on_test4;
序列已創(chuàng)建。
SQL> create database link yangtk connect to scott identified by tiger using 'yangtk';
數(shù)據(jù)庫鏈接已創(chuàng)建。