標籤:問題:出現錯誤:無法對sys擁有的對象建立觸發器解決方案:問題排除:問題1、首先要知道出發是無法在sys使用者上建立的,首先要確定現在所登入的使用者為非sys的普通的使用者。問題2、使用者登入的身份為非管理員身份,需以normal身份登入。登入的兩種模式及命令:管理員身份:conn soctt/tiger as sysdbaNormal身份:conn soctt/tiger若處於管理員身份的普通使用者可直接切換到normal身份命令:conn
標籤:oracle 預存程序類型:1、in:輸入類型,即由應用程式將資料傳入oracle預存程序中;這種參數在預存程序中是唯讀參數,在預存程序中無法對該類型的參數進行修改;2、out:輸出參數,是在預存程序中對該值進行賦值,在程式中擷取值。3、in out:輸入輸出參數,兼具以上兩種特性,但可讀可寫。 驗證輸入參數:由於預設參數是輸入類型的,在中,對BAcount參數賦值,報錯。解決辦法:CREATE OR REPLACE PACKAGE body BAWQ_PROC_JGZX
標籤:內容主要來自看書學習的筆記,如下記錄了常見查詢執行計畫的方法。2.2 如何查看執行計畫1.explain plan2.dbms_xplan包3.autotrace4.10046事件5.10053事件6.awr/statspack報告(@?/rdbms/admin/awrsqrpt)7.指令碼(display_cursor_9i.sql)2.2.1 explain planexplain plan for sqlselect * from table(dbms_xplan.display);
標籤:建立一個表:cteate table 表名(列1 類型, 列2 類型);查看錶結構 desc表名添加一個欄位 alter table 表名 add(列類型);修改欄位類型 alter table 表名 modify(列類型);刪除一個欄位 alter table 表名 drop column列名;修改表的名字 rename student to stu刪除表 drop table 表名插入資料:1、 create table test( id
標籤:建立資料表空間等等select tablespace_name from dba_tablespaces;--dba許可權使用者查詢資料庫中的資料表空間 select * from all_tables where tablespace_name=‘tablespace_name‘;--查詢資料表空間中的表,注意大寫 select tablespace_name,table_name from user_tables where table_name=‘tb_Employee‘;--
標籤:轉載:http://www.cnblogs.com/baiyixianzi/archive/2012/08/30/plsql12.html一、文法 大致寫法:select * from some_table [where 條件1] connect by [條件2] start with [條件3]; 其中 connect by 與 start with 語句擺放的先後順序不影響查詢的結果,[where 條件1]可以不需要。 [where
標籤:oracle表如果含有clob欄位,則無法匯出用sql指令碼,尤其需要進行資料備份或者資料匯入匯出時候不方便。這個預存程序你只需傳入表名和需要返回的結果,就可以擷取可執行檔sql,直接在PL/SQL執行返回的結果,即可將資料匯出成sql,預存程序如下create or replace procedure generate_insert_sql(t_name in varchar2,execute_sql out varchar2) as CURSOR col_cur is
標籤:涉及到表的處理請參看原表結構與資料 Oracle建表插資料等等使用select into語句讀取tb_Employee的一行,使用異常處理處理no_data_found和two_many_rows的系統預定義異常set serveroutput on;declareemp tb_Employee%rowtype;beginselect * into emp from tb_Employee where ename =
標籤:1、DUAL表的用途Dual 是 Oracle中的一個實際存在的表,任何使用者均可讀取,常用在沒有目標表的Select語句塊中--查看當前串連使用者Connected to Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 Connected as SYSSQL> select user from
標籤:訂單表。與訂單資訊表(多個訂單資訊列有同一個訂單id)查出全部訂單以及其資訊並依照訂單分頁select * from(select a. * , (DENSE_RANK() OVER(ORDER BY id DESC)) AS numindex from(SELECT o. * , DENSE_RANK() OVER(ORDER BY o.id DESC) AS rn from order o) a where rn <= 10) where numindex >