温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

oracle表空间文件系统迁移到ASM

发布时间:2020-07-21 07:15:40 来源:网络 阅读:484 作者:yiliang515 栏目:关系型数据库

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;

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI