创建Oracle数据库
2016-06-11 18:57
465 查看
[root@localhost ~]# su - oracle
[oracle@localhost ~]$ sqlplus /nolog
SQL> conn /as sysdba;
SQL> show user;
USER is "SYS"
SQL> select name from v$datafile;
//创建临时表空间
create temporary tablespace xsgj_temp
tempfile '/opt/oradata/WULIU/xsgj_temp.dbf'
size 32m
autoextend on
next 32m maxsize 2048m
extent management local;
//创建数据表空间
create tablespace xsgj_data
logging
datafile '/opt/oradata/WULIU/xsgj_data.dbf'
size 32m
autoextend on
next 32m maxsize 2048m
extent management local;
//创建用户并指定表空间 http://hovertree.com/menu/oracle/
create user xsgj identified by xsgjmm
default tablespace xsgj_data
temporary tablespace xsgj_temp;
//给用户授予权限
grant connect,resource to xsgj;
//授dba权限
grant dba to xsgj;
//授dblink权限
grant create public database link to xsgj;
//以后以该用户登录,创建的任何数据库对象都属于test_temp 和test_data表空间,这就不用在每创建一个对象给其指定表空间了。
附加:
表空间的位置可以用一下的查询语句来查询
select name from v$datafile;
推荐:http://www.cnblogs.com/roucheng/p/3504463.html
[oracle@localhost ~]$ sqlplus /nolog
SQL> conn /as sysdba;
SQL> show user;
USER is "SYS"
SQL> select name from v$datafile;
//创建临时表空间
create temporary tablespace xsgj_temp
tempfile '/opt/oradata/WULIU/xsgj_temp.dbf'
size 32m
autoextend on
next 32m maxsize 2048m
extent management local;
//创建数据表空间
create tablespace xsgj_data
logging
datafile '/opt/oradata/WULIU/xsgj_data.dbf'
size 32m
autoextend on
next 32m maxsize 2048m
extent management local;
//创建用户并指定表空间 http://hovertree.com/menu/oracle/
create user xsgj identified by xsgjmm
default tablespace xsgj_data
temporary tablespace xsgj_temp;
//给用户授予权限
grant connect,resource to xsgj;
//授dba权限
grant dba to xsgj;
//授dblink权限
grant create public database link to xsgj;
//以后以该用户登录,创建的任何数据库对象都属于test_temp 和test_data表空间,这就不用在每创建一个对象给其指定表空间了。
附加:
表空间的位置可以用一下的查询语句来查询
select name from v$datafile;
推荐:http://www.cnblogs.com/roucheng/p/3504463.html
相关文章推荐
- Linux6.5系统Oracle11g的安装
- Oracle数据库连接字符串(各种版本)
- Oracle学习 第3天之高级查询
- Oracle中执行存储过程call和exec区别
- Oracle 10g 10.2.0.4的group by BUG |ORA-00979 not a GROUP BY expression|
- oracle从子表取出前几行数据:
- 数据泵导出出现ORA-31617错误
- Java jdbc访问sqlserver,oracle数据库 DEMO
- Oracle数据库-数据文件重置大小
- openSUSE 安装oracle jdk
- oracle连接数据库
- Oracle基础
- ora-01033:oracle initialization or shutdown in progress 解决方法
- Oracle 创建数据库及导入数据
- 安装oracle客户端口
- 创建oracle数据库
- dmp文件导入oracle
- oracle 五种约束 常用单组分组函数
- Oracle学习 第1、2天之高级查询
- Google Java Oracle 三角恋的前世今生