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

來源:互聯網
上載者:User

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, there is a script called LNPROC that you use to link your
Pro*C/C++ applications.
 
 



相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.