oracle create tablespace asm,oracle表空间文件系统迁移到ASM

1.配置测试环境

创建数据表空间

create tablespace test logging datafile '/home/oracle/test.dbf' size 10m autoextend on next 10m maxsize 2048m extent management local;

创建用户并指定表空间

create user test identified by 123456 default tablespace test;

给用户授予权限

grant connect,resource,dba to test;

创建表

sqlplus test/123456@orcl

CREATE TABLE test2(userId number(8), username varchar2(40), tep number (20)) PARTITION BY RANGE (userId)(PARTITION p1 VALUES LESS THAN (10000), PARTITION p2 VALUES LESS THAN (20000), PARTITION p3 VALUES LESS THAN (30000) );

查询当前用户下的表:

select tname from tab;

2.文件系统表空间迁移到ASM中去

rman target /

report schema; 查看表空间

sql 'alter tablespace test offline';离线表空间

backup as copy datafile 5 format '+DATA';Copy类型备份表空间

switch datafile 5 to copy;切换表空间文件到copy副本

sql 'alter tablespace test online';上线表空间

report schema;

sqlplus / as sysdba

select ts#,name from v$tablespace where name='TEST' union all select file#,name from v$datafile where ts#=6;

select * from v$dbfile;

sqlplus test/123456@orcl

select tname from tab;

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值