建立测试数据文件,在线move到asm磁盘组:
/tmp/t1.dbf,/tmp/t2.dbf移动到+DATA磁盘组。
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL> show pdbs;
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDB01 READ WRITE NO
4 PDB03 MOUNTED
5 PDB02 MOUNTED
6 PDB04 MOUNTED
SQL> alter session set container=pdb01;
Session altered.
SQL> create tablespace t1 datafile '/tmp/t1.dbf' size 100M;
Tablespace created.
SQL> alter database move datafile '/tmp/t1.dbf' to '+DATA';
Database altered.
SQL> alter tablespace t1 add datafile '/tmp/t2.dbf' size 100m;
Tablespace altered.
SQL> alter database move datafile '/tmp/t2.dbf' to '+DATA';
Database altered.
查看数据文件目录:
ASM 自动制定数据文件位置到相应的目录。
List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1 910 SYSTEM YES +DATA/PCDB/DATAFILE/system.266.1036560211
3 570 SYSAUX NO +DATA/PCDB/DATAFILE/sysaux.261.1036560245
4 335 UNDOTBS1 YES +DATA/PCDB/DATAFILE/undotbs1.265.1036560271
5 270 PDB$SEED:SYSTEM NO +DATA/PCDB/86B637B62FE07A65E053F706E80A27CA/DATAFILE/system.257.1036560595
6 330 PDB$SEED:SYSAUX NO +DATA/PCDB/86B637B62FE07A65E053F706E80A27CA/DATAFILE/sysaux.267.1036560595
7 5 USERS NO +DATA/PCDB/DATAFILE/users.264.1036560271
8 100 PDB$SEED:UNDOTBS1 NO +DATA/PCDB/86B637B62FE07A65E053F706E80A27CA/DATAFILE/undotbs1.268.1036560595
9 270 PDB01:SYSTEM YES +DATA/PCDB/A2452ADC6EE36F8DE053E600A8C09846/DATAFILE/system.272.1036615745
10 330 PDB01:SYSAUX NO +DATA/PCDB/A2452ADC6EE36F8DE053E600A8C09846/DATAFILE/sysaux.273.1036615745
11 100 PDB01:UNDOTBS1 YES +DATA/PCDB/A2452ADC6EE36F8DE053E600A8C09846/DATAFILE/undotbs1.271.1036615745
12 270 PDB02:SYSTEM NO +DATA/PCDB/A2452ADC6EE96F8DE053E600A8C09846/DATAFILE/system.276.1036616815
13 330 PDB02:SYSAUX NO +DATA/PCDB/A2452ADC6EE96F8DE053E600A8C09846/DATAFILE/sysaux.277.1036616815
14 100 PDB02:UNDOTBS1 NO +DATA/PCDB/A2452ADC6EE96F8DE053E600A8C09846/DATAFILE/undotbs1.275.1036616815
15 270 PDB03:SYSTEM NO +DATA02/PCDB/A2452ADC6EEB6F8DE053E600A8C09846/DATAFILE/system.257.1036617221
16 330 PDB03:SYSAUX NO +DATA02/PCDB/A2452ADC6EEB6F8DE053E600A8C09846/DATAFILE/sysaux.258.1036617221
17 100 PDB03:UNDOTBS1 NO +DATA02/PCDB/A2452ADC6EEB6F8DE053E600A8C09846/DATAFILE/undotbs1.256.1036617221
18 270 PDB04:SYSTEM NO +DATA02/PCDB/A2452ADC6EEE6F8DE053E600A8C09846/DATAFILE/system.261.1036617469
19 330 PDB04:SYSAUX NO +DATA02/PCDB/A2452ADC6EEE6F8DE053E600A8C09846/DATAFILE/sysaux.262.1036617469
20 100 PDB04:UNDOTBS1 NO +DATA02/PCDB/A2452ADC6EEE6F8DE053E600A8C09846/DATAFILE/undotbs1.260.1036617469
21 100 PDB01:T1 NO +DATA/PCDB/A2452ADC6EE36F8DE053E600A8C09846/DATAFILE/t1.279.1036622681
22 100 PDB01:T1 NO +DATA/PCDB/A2452ADC6EE36F8DE053E600A8C09846/DATAFILE/t1.280.1036623223
List of Temporary Files
=======================
File Size(MB) Tablespace Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1 128 TEMP 32767 +DATA/PCDB/TEMPFILE/temp.258.1036560363
2 36 PDB$SEED:TEMP 32767 +DATA/PCDB/A2385627B2ED789AE053E600A8C098C9/TEMPFILE/temp.269.1036560637
3 36 PDB01:TEMP 32767 +DATA/PCDB/A2452ADC6EE36F8DE053E600A8C09846/TEMPFILE/temp.274.1036615767
4 36 PDB02:TEMP 32767 +DATA/PCDB/A2452ADC6EE96F8DE053E600A8C09846/TEMPFILE/temp.278.1036616839
5 36 PDB03:TEMP 32767 +DATA02/PCDB/A2452ADC6EEB6F8DE053E600A8C09846/TEMPFILE/temp.259.1036617245
6 36 PDB04:TEMP 32767 +DATA02/PCDB/A2452ADC6EEE6F8DE053E600A8C09846/TEMPFILE/temp.263.1036617495