oracle 表空间创建 建立用户

1.假如如今已经建好名为'news'的数据库,此时在F:\oracle\product\10.1.0\oradata\目录下已经存在 news目录(注意:个人Oracle10g安装在F:\oracle下,若你的Oracle安装在别的目录,那么你新建的数据库目录就在* \product\10.1.0\oradata\目录下)。

    2.在建立用户以前,先要建立表空间:html

    其格式为:格式: create tablespace 表间名 datafile '数据文件名' size 表空间大小;java

    如:数据库

    SQL> create tablespace news_tablespace datafile 'D:\oracle\product\10.1.0\oradata\lms_card\lms_card.dbf' size 500M;oracle

    其中'news_tablespace'是你自定义的表空间名称,能够任意取名;'F:\oracle\product\10.1.0\oradata \news\news_data.dbf'是数据文件的存放位置,'news_data.dbf'文件名也是任意取;'size 500M'是指定该数据文件的大小,也就是表空间的大小。ide

    3.如今建好了名为'news_tablespace'的表空间,下面就能够建立用户了:spa

    其格式为:格式: create user 用户名 identified by 密码 default tablespace 表空间表;.net

    如:htm

    SQL> create user test identified by test default tablespace news_tablespace;blog

    默认表空间'default tablespace'使用上面建立的表空间。get

    4.接着受权给新建的用户:

    SQL> grant connect,resource to news; --表示把 connect,resource权限授予news用户

    SQL> grant dba to news; --表示把 dba权限授予给news用户

    受权成功。

    ok! 数据库用户建立完成,如今你就可使用该用户建立数据表了!

转载



asdtiang 2010-01-12 17:40 发表评论
相关文章
相关标签/搜索