centos 安装oracle 11g r2(三)---表空间创建

参考文章:https://www.cnblogs.com/anzerong2012/p/7941179.html

 

创建表空间前要保证监听与数据库实例已经启动

1、启动监听

[oracle@localhost ~]$ lsnrctl start

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 01-DEC-2017 09:25:48

Copyright (c) 1991, 2009, Oracle. All rights reserved.

Starting /data/oracle/product/11.2.0/db_1/bin/tnslsnr: please wait...
......
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 01-DEC-2017 09:25:48
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /data/oracle/product/11.2.0/db_1/network/admin/listener.ora
Listener Log File
/data/oracle/diag/tnslsnr/localhost/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)))
The listener supports no services
The command completed successfully

2、进入数据库

[oracle@localhost ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Fri Dec 1 09:25:51 2017

Copyright (c) 1982, 2009, Oracle. All rights reserved.

Connected to an idle instance.

3、启动数据库

SQL> startup

ORACLE instance started.

Total System Global Area 1586708480 bytes
Fixed Size 2213736 bytes
Variable Size 922749080 bytes
Database Buffers 654311424 bytes
Redo Buffers 7434240 bytes
Database mounted.
Database opened.

4、创建名称为 xsj 的表空间

SQL> create tablespace xsj datafile '/data/oracle/oradata/BDCS/xsj.dbf' size 128M autoextend on next 256M maxsize 2048M extent management local;

Tablespace created.

备注:

create  tablespace 表空间名

datafile '物理文件名.dbf' 

size 50m  --初始大小 

autoextend on   --自动扩展

next 50m maxsize 20480m  --自动扩展每次增加50M,最大可到20480M

extent management local;

5、创建用户名/密码为 xsj/123456 的用户

SQL>  create user xsj identified by 123456 account unlock default tablespace xsj;

User created.

6、为用户配置权限

SQL> grant connect,resource to xsj;

Grant succeeded.

SQL>grant dba to xsj;

Grant succeeded.

7、退出

SQL> exit

8.远程连接数据库

sqlplus命令的用法

sqlplus user/pwd@//host:port/sid

#user:用户名

#pwd:密码

#host:数据库服务器IP

#port:端口

#sid:数据库标识符

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值