oracle运维管理经验,Oracle数据库运维经验(一)

oracle运维管理经验,Oracle数据库运维经验(一)示例 createtables G Oracle xedatas boyuyun dbf size512Mauto create

#示例

create tablespace boyuyun datafile ‘G:\Oracle\xedatas\boyuyun.dbf’ size 512M

autoextend on next 32M maxsize unlimited logging

extent management local autoallocate

segment space management auto;

create user byytest identified by byytest default tablespace boyuyun temporary tablespace temp;

grant dba,connect,resource to byytest;

#SQLPlus登录

sqlplus system/@XE as sysdba

#dmp文件导入

imp byytest/byytest@XE file=I:\boyuyun_\boyuyun_.dmp full=y

#删除表空间

drop tablespace DANZHOU including contents and datafiles;

开启Oracle服务

Win+R输入cmd打开命令提示符窗口

登录

sqlplus /nolog

connect /as sysdba;

#创建表空间

create tablespace tablespace_name logging datafile ‘G:\Oracle\xedatas\boyuyun.dbf’ size 64m;

#创建用户(指定默认表空间,所以要先创建表空间)

create user test1 identified by test1 default tablespace test1 temporary tablespace temp;

#授予相应权限

grant dba,connect,resource to test1;

#FAQ

如果表空间大小不足,可以设置让表空间超载时自动增长:

alter database datafile ‘D:\test1.dbf’ autoextend on next 100m;

上条语句使得表空间将满时会自动增加100m大小空间,还有另外一种增加方法:

alter database datafile ‘D:\test1.dbf’ autoextend on next 100m maxsize 500m;

这条语句意味着表空间每次可以增加100M,但累计增加到500M后将不再增加。

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/225450.html原文链接:https://javaforall.net

(0)
上一篇 2026年3月17日 上午9:18
下一篇 2026年3月17日 上午9:18


相关推荐

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号