
2、以sysdba方式来打开sqlplus,命令如下: sqlplus / as sysdba
--查询临时表空间文件的绝对路径。如果需要的话,可以通过查询来写定绝对路径。一般用${ORACLE_HOME}就可以了
select name from v$tempfile
create temporary tablespace NOTIFYDB_TEMP tempfile '${ORACLE_HOME}\oradata\NOTIFYDB_TEMP.bdf' size 100m reuse autoextend on next 20m maxsize unlimited
4、创建表空间:
--查询用户表空间文件的绝对路径:
select name from v$datafile
create tablespace NOTIFYDB datafile '${ORACLE_HOME}\oradata\notifydb.dbf' size 100M reuse autoextend on next 40M maxsize unlimited default storage(initial 128k next 128k minextents 2 maxextents unlimited)
5、创建用户和密码,指定上边创建的临时表空间和表空间
create user hc_notify identified by hc_password default tablespace NOTIFYDB temporary tablespace NOTIFYDB_TEMP
6、赋予权限
grant dba to hc_notify
grant connect,resource to hc_notify
grant select any table to hc_notify
grant delete any table to hc_notify
grant update any table to hc_notify
grant insert any table to hc_notify
经过以上 *** 作,就可以使用hc_notify/hc_password登录指定的实例,创建我们自己的表了。
先su 到 oracle用户,SYS用户以DBA身份登陆//创建临时表空间
SQL>create temporary tablespace user_temp
datafile '/data1/oradata/user_temp.dbf'
size 5000M autoextend on
//创建数据表空间
SQL>create tablespace user_temp
datafile '/data1/oradata/user_temp.dbf'
size 500M autoextend on
(这些只是例子,具体数据文件的路径,大小,都要你自己改,这里的是不自动扩展,你如果想自动扩展,autoextend on next 50m maxsize 2048m,上网查一下就可以了)
//创建用户并指定表空间
SQL>create user username identified by password
default tablespace user_data
temporary tablespace user_temp
//给用户授予权限
SQL>grant connect,resource to username
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)