分享java带来的快乐

我喜欢java新东西

创建oracle 数据库表空间,角色,用户的sql语句

 

1.创建角色
CREATE ROLE "QIUDINGROLE" NOT IDENTIFIED;
GRANT "CONNECT" TO "QIUDINGROLE";
GRANT "DBA" TO "QIUDINGROLE";
GRANT "RESOURCE" TO "QIUDINGROLE";
2.创建表空间
CREATE SMALLFILE TABLESPACE "EXAM" DATAFILE 'D:\work\oracle\oradata\qiuding\EXAM' SIZE 100M AUTOEXTEND ON NEXT 1M MAXSIZE UNLIMITED LOGGING EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;
BEGIN DBMS_SERVER_ALERT.SET_THRESHOLD(9000,NULL,NULL,NULL,NULL,1,1,NULL,5,'EXAM'); END;
CREATE SMALLFILE TEMPORARY TABLESPACE "EXAM_TEMP" TEMPFILE 'D:\work\oracle\oradata\qiuding\EXAM_temp' SIZE 100M AUTOEXTEND ON NEXT 1M MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1M;
BEGIN DBMS_SERVER_ALERT.SET_THRESHOLD(9000,NULL,NULL,NULL,NULL,1,1,NULL,5,'EXAM_TEMP'); END;
 3.创建用户
create user EXAM                                                                        
  identified by "PASSWORD123"
  default tablespace "EXAM"
  temporary tablespace "EXAM_TEMP"
  profile DEFAULT
  ACCOUNT UNLOCK;
grant QIUDINGROLE to EXAM;
grant unlimited tablespace to EXAM;
4.创建备份目录并且付相应权限
create directory dump_dir as 'D:\work\oracle\backup';
grant read,write on directory dump_dir to EXAM;
 

 imp userid=exam/password123@qiuding fromuser=exam touser=exam file=D:\data\dbbak\oracle\20130311\exam\exam.dmp

posted on 2007-02-10 19:22 强强 阅读(13781) 评论(2)  编辑  收藏 所属分类: Oracle数据库

评论

# re: 创建oracle 数据库表空间,角色,用户的sql语句[未登录] 2007-06-20 11:01 TY

请问在使用
BEGIN DBMS_SERVER_ALERT.SET_THRESHOLD(9000,NULL,NULL,NULL,NULL,1,1,NULL,5,'HRCRM_DB'); END;
的时候,不报错误吗?

说的是CREATE中不能使用BEGIN   回复  更多评论   

# re: 创建oracle 数据库表空间,角色,用户的sql语句 2007-06-21 13:58 强强

@TY
报错时,就一条条命令执行,并且必须在oracle10g下
  回复  更多评论   


只有注册用户登录后才能发表评论。


网站导航: