程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 數據庫知識 >> Oracle數據庫 >> Oracle數據庫基礎 >> oracle 常用的一些命令或者sql 語句

oracle 常用的一些命令或者sql 語句

編輯:Oracle數據庫基礎

1. 創建一個用戶,並為該用戶分配Create權限,分配表空間:
create user scott identifIEd by tiger;
grant create session to scott;

grant create table to scott;

alter user scott default tablespace users;

alter user scott quota 512M on users;

2. 查找where條件指定的用戶為owner的所有表名稱:
select owner, table_name from dba_tables where owner='SCOTT';

3. 在某一指定的表上創建指定參數的索引。
create index ind_test on test(x) tablespace users storage
(initial 2K
next 2K
minextents 1
maxextents 100
pctincrease 0);

4. 查看指定用戶為owner的索引名稱:
select index_name, table_owner from dba_indexes where owner='SCOTT';

5. 查看指定表上的所有索引信息:
select index_owner, index_name, column_name from dba_ind_columns where table_name='SCOTT';

6. 創建序列:
create s
incremen
start wi
maxvalue
Cycle;

7. 使用序列:
insert into scott.test
values(staff_id.nextval,
'test');

8. 查看表空間信息:
select * from dba_tablespaces;

9. 查看當前在線用戶:
select username from v$session;

10. How can I compile and link my application?
Answer:
Compiling and linking are very platform specific. Your system-specific Oracle
documentation has instructions on how to link a Pro*C/C++ application. On UNIX
systems, there is a makefile called proc.mk in the demo directory. To link, say, the
demo program sample1.pc, you would enter the command line
make -f proc.mk sample1
If you need to use special precompiler options, you can run Pro*C/C++ separately,
then do the make. Or, you can create your own custom makefile. For example, if
your program contains embedded PL/SQL code, you can enter
proc cv_demo userid=scott/tiger sqlcheck=semantics
make -f proc.mk cv_demo
On VMS systems,

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved