SELECT * FROM empLOYEE WHERE ROWNUM < n
ORDER BY empno;
102. 如何知道機器上的Oracle支持多少並發用戶數?
SQL>conn internal
SQL>show parameter processes
一般不可以﹐不建議這樣做的
select (select count(id) from aa)+(select count(id) from bb) 總數 from dual
select * from
(select t
where rank = N
select add_months(sysdate
It is
應該是tnsnames
建立一個臨時的redolog組
沒有限制
SELECT CEIL(N) FROM DUAL
SELECT FLOOR(N) FROM DUAL
SELECT LAST_DAY(SYSDATE) FROM DUAL
IMP SYSTEM/MANAGER FILE=AA
SQL>SELECT * FROM user_constraints WHERE CONSTRAINT_TYPE=
SQL>SELECT * FROM BSEMPMS_OLD INTERSECT SELECT * FROM BSEMPMS_NEW
SQL>SELECT * FROM BSEMPMS_OLD UNION SELECT * FROM BSEMPMS_NEW
SQL>SELECT * FROM BSEMPMS_OLD UNION ALL SELECT * FROM BSEMPMS_NEW
SQL>SELECT * FROM BSEMPMS_OLD MINUS SELECT * FROM BSEMPMS_NEW
建sequence seq_custid
create sequence seq_custid start
建表時
create table cust
{ cust_id smallint not null
insert 時
insert into table cust
values( seq_cust
日期的各部分的常用的的寫法
SELECT TO_CHAR(SYSDATE
SELECT TO_CHAR(SYSDATE
SELECT TO_CHAR(SYSDATE
SELECT TO_CHAR(SYSDATE
SELECT TO_CHAR(SYSDATE
SELECT TO_CHAR(SYSDATE
SELECT TRUNC(SYSDATE) FROM DUAL
SELECT TO_CHAR(SYSDATE
SELECT TO_CHAR(SYSDATE) FROM DUAL
SELECT TO_DATE(
SELECT TO_CHAR(SYSDATE
SELECT TO_CHAR(SYSDATE
SELECT TO_CHAR(SYSDATE
SELECT TO_CHAR(SYSDATE
虛擬字段
為表創建序列
CREATE SEQUENCE EMPSEQ
SELECT empseq
自動插入序列的數值
INSERT INTO emp
VALUES (empseq
按設定排序的行的序號
SELECT * FROM emp WHERE ROWNUM <
返回行的物理地址
SELECT ROWID
set serverout on
declare
N number
ret varchar
begin
ret
dbms_output
end
SELECT b
FROM v$session a
WHERE a
ORDER BY b
select /*+ ORDERED */ sql_text from v$sqltext a
where a
select sql_hash_value from v$session b
where b
order by piece asc
SELECT * FROM TABLE_NAME
WHERE ROWID!=(SELECT MAX(ROWID) FROM TABLE_NAME D
WHERE TABLE_NAME
DELETE FROM TABLE_NAME
WHERE ROWID!=(SELECT MAX(ROWID) FROM TABLE_NAME D
WHERE TABLE_NAME
SQL >SPOOL VIEW
SQL >SELECT
COMPILE
SQL >SPOOL OFF
然後執行VIEW
SQL >@VIEW
增加MINEXTENTS的值
向回滾段表空間添加文件或使已有的文件變大
下列存儲過程內容放在AA
create or replace procedure testCCB(i in number) as
begin
dbms_output
end
SQL>wrap iname=a
PL/SQL Wrapper
Copyright (c) Oracle Corporation
Processing AA
運行AA
SQL> @AA
select event
sum(decode(wait_Time
from v$session_Wait
group by event order by
select name
from v$rollstat C
where C
select B
from v$filestat A
where A
order by B
select substr(C
from v$datafile C
where C
select user_indexes
from user_ind_columns
where user_ind_columns
and user_ind_columns
order by user_indexes
From:http://tw.wingwit.com/Article/program/Oracle/201311/16604.html