案例說明: 有A,B兩台oracle資料庫,都為10g,現在有一個A資料庫中one表的幾條資料要插入到B資料庫中的one表?在網上查閱了一下,可以通過在A上建立dblink,當然在B機上建立也是一樣的。開啟sqlplus終端,或者任意的oracle用戶端環境,執行以下SQLcreate database link 連結名 connect to 使用者名稱 identified by 密碼 using '(DESCRIPTION = (ADDRESS_LIST = (ADDRESS
怎樣查看oracle當前的串連數呢?只需要用下面的SQL語句查詢一下就可以了。select * from v$session where username is not nullselect username,count(username) from v$session where username is not null group by username #查看不同使用者的串連數 select count(*) from v$session #串連數Select count(*) from
ProcedureCREATE OR REPLACE PROCEDURE ivan_sptest1 ( material_no IN sd_form_box.material_no%TYPE, pallet_id IN sd_form_box.pallet_id%TYPE, box_id IN sd_form_box.box_id%TYPE, v_ds1 OUT sys_refcursor,
//建立空間欄位索引 oracle spatial table//======================================drop index index_sp_v_gbjj;drop index index_sp_v_xzq;drop index index_sp_v_ytfq;drop index index_sp_v_dltb;drop index index_sp_v_nydfddj;create index index_sp_v_gbjj on
//建立空間欄位索引 oracle spatial table//======================================drop index index_sp_v_gbjj;drop index index_sp_v_xzq;drop index index_sp_v_ytfq;drop index index_sp_v_dltb;drop index index_sp_v_nydfddj;create index index_sp_v_gbjj on
比如現在有一人員表 (表名:peosons) 若想將姓名、社會安全號碼、住址這三個欄位完全相同的記錄查詢出來 select p1.* from persons p1,persons p2 where p1.id<>p2.id and p1.cardid = p2.cardid and p1.pname = p2.pname and p1.address =
今天在oracle的SQL plus 中執行了刪除和查詢操作,然後在PL/SQL中也執行查詢操作,語句一樣,結果卻不一樣,讓我大感鬱悶,後來才突然想到可能是兩邊資料不一致造成的,但是為什麼不一致呢,就是沒用commit,在網上查了一下,大概是這樣說的:DML語言,比如update,delete,insert等修改表中資料的需要commit;DDL語言,比如create,drop等改變表結構的,就不需要寫commit(因為內部隱藏了commit);DDL 資料定義語言 (Data
Oracle Database Development (6). A first exploration of OCI Vert MelonJun 25,20071.Preface Last time , i provided a full example of OCI , which contains the actual code of connection and SQL . Certainly it could not cover all of the knowledge , but
有時候會將一列和一系列值相比較。最簡單的辦法就是在 where 子句中使用子查詢。在where子句中可以使用兩種格式的子查詢。 第一種格式是使用IN操作符: ... where column in(select * from ... where ...); 第二種格式是使用EXIST操作符: ... where exists (select 'X' from ...where ...);