標籤:為了方便起見,建立了以下簡單模型,和構造了部分測試資料: 在某個業務受理子系統BSS中,SQL 代碼--客戶資料表create table customers(customer_id number(8) not null, -- 客戶標示city_name varchar2(10) not null, -- 所在城市customer_type char(2) not null, -- 客戶類型...)create unique index PK_customers on
標籤:對於Oracle中沒有 if exists(...) 的文法,目前有許多種解決方案,這裡先分析常用的三種,推薦使用最後一種第一種是最常用的,判斷count(*)的值是否為零,如下declare v_cnt number;begin select count(*) into v_cnt from T_VIP where col=1; if v_cnt = 0 then dbms_output.put_line(‘無記錄‘
標籤: 當某個資料庫使用者在資料庫中插入、更新、刪除一個表的資料,或者增加一個表的主鍵時或者表的索引時,常常會出現ora-00054:resource busy and acquire with nowait specified這樣的錯誤。主要是因為有事務正在執行(或者事務已經被鎖),所有導致執行不成功。 1、用dba許可權的使用者查看資料庫都有哪些鎖select t2.username,t2.sid,t2.serial#,t2.logon_time from v$
標籤:本文介紹命令模式(管理員權限):1.以管理員權限開啟命令控制台,輸入下面命令:Sqlplus sys/管理員賬戶名稱(就是DBA賬戶) as sysdba;(記得分號哦,有時沒有的話會報錯)2.先刪除要建立的角色(無論該角色存在與否,都最好執行一下這個命令):drop user 使用者名稱 cascade;3.建立使用者,並設定密碼:create user 使用者名稱 identified by 密碼;4.給建立使用者指派角色:GRANT CREATE USER,DROP