v$database:資料庫的資訊,如資料庫名,建立時間等。v$instance 執行個體資訊,如執行個體名,啟動時間。v$parameter 參數資訊,select * from v$parameter where name like '%name' ----> show parameter name(sqlplus中執行)v$process
Oracle的索引是以平衡樹的方式組織儲存的:儲存的是索引列的值,以及該行的rowid的一部分(檔案號,塊號,行號)下面我們通過例子來瞭解一下:1,create table test(id int,name varchar2(20))insert into test values(1,'A');insert into test values(2,'B');beginfor i in 3..2000 loopinsert into test values(i,'t'||i);end
過程如下:SQL> show user;USER is "SYS"SQL> create user test identified by test;User created.SQL> create table test.t(id int);create table test.t(id int)*ERROR at line 1:ORA-01950: no privileges on tablespace
在通過DML操作Oracle的視圖的時候,有一個很重要的條件是操作的base表必須是Key-Preserved Table.那麼,什麼是Key-Preserved Table呢.Oracle給出的定義是:A table is key preserved if every key of the table can also be a key of the result of the join.It is not necessary that the key or keys of a table
在應用中,很多時候會對錶的主鍵用一個自動增漲的數來付值,如Oracle的sequence,插入後又想得到的主鍵的值。下面介紹一下相關的方法。1,用Oracle 的returning 語句。PreparedStatement sta = conn.prepareStatement("INSERT INTO LOGGING VALUES (TESTSEQ.NEXTVAL,SYSDATE)returning id into ? "); sta.execute(); ResultSet
下面的指令碼在oracle中如何將一個使用者所擁有的所有對象,表,sequence,procedure。。。全部刪掉。 1,drop 對象的方式,注意要先將所有的外鍵約束刪掉。 DECLARETYPE cst_table_list IS TABLE OF VARCHAR2(40);TYPE cst_list IS TABLE OF VARCHAR2(40);TYPE name_list IS TABLE OF VARCHAR2(40);TYPE type_list IS TABLE OF
最近在項目中用到了JAVA用戶端傳遞對象數組到Oracle預存程序做大資料量插入,比如10萬層級.下面做一個插入10萬條記錄的樣本步驟,,為了容易理解,表的結果很簡單.1,假設表結構如下:CREATE TABLE UKBNOVCTCORDER(LosingLEName varchar2(200),LosingLECode varchar2(200))2,在資料庫建立一個type,對應JAVA端要傳入的對象結構:CREATE OR REPLACE TYPE
使用SYS使用者以SYSDBA身份登入系統 查看修改前sga_max_size,sga_target大小show parameter sga_max_size;show parameter sga_target; 修改參數alter system set sga_max_size=1600m scope=spfile;alter system set sga_target=1600m scope=spfile; 查看修改後sga_max_size,sga_target大小show