删除系统默认表空间

oracle10g默认用户的default tablespace是users,所以不能删除,先将database级别的default tablespace改成其他的tablespace就可以删除了
思路; 新建一个表空间
然后指定其为默认永久表空间
然后删除原来的user表空间
[php]
SYS@ning>alter database default tablespace test;

Database altered.


SQL> alter tablespace users offline;

Tablespace altered.

SQL> drop tablespace users;
drop tablespace users
*
ERROR at line 1:
ORA-12919: Can not drop the default permanent tablespace


能告诉我怎么删除么?




总结

sqlplus '/as sysdba'
SQL>shutdown immediate
SQL>startup
#创建一个临时表空间temp02,用作临时替换
SQL>create temporary tablespace temp02 tempfile '/u2/oradb/oradata/topprod/temp02.dbf' size 10M autoextend on next 10M; 
#将系统临时表空间指向temp02
SQL>alter database default temporary tablespace temp02;
#删除原来的临时表空间temp
SQL>drop tablespace temp including contents and datafiles;
#创建新的临时表空间temp
SQL>create temporary tablespace temp tempfile '/u2/oradb/oradata/topprod/temp01.dbf' size 4096M autoextend on next 100M;
#将系统临时表空间指回temp
SQL>alter database default temporary tablespace temp;
#删除临时表空间temp02
SQL>drop tablespace temp02 including contents and datafiles;

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值