首页 > 技术文章 > oracle 的一点累积

unixshell 2013-08-22 09:45 原文

1.  oracle用户相关

    sqlplus sys/oracle as sysdba    -- sys登录

    create user xxx identified by password;   --建用户

    create user xxx identified by passwd default tablespace xxx; -- 建用户带上默认表空间

    GRANT CONNECT,RESOURCE,CREATE ANY TABLE,DROP ANY TABLE,CREATE SEQUENCE,DROP ANY SEQUENCE, CREATE DATABASE LINK, CREATE VIEW to xxx;  --赋予用户权限

    drop user xxx cascade;  -- 删除用户

 

2.  表空间相关

    create tablespace bmp_default_dat datafile ''/home/oracle/oradata/ora11g/xxxxdefaultdat.dbf'' size 100M autoextend on next 10M maxsize 500M;

    alter user 用户名 quota unlimited on 表空间名称;

 

3.  索引

    create index xxx on xxxtable(columnnamexxx);

    create index xxx on xxxtable(columnnamexxx) tablespace xxxx;

 

4. 序列

create sequence xxxxxname
minvalue 1
maxvalue 999999999
start with 1000
increment by 1
cache 20
order;

 

 

推荐阅读