您好,登錄后才能下訂單哦!
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;
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。