move datafile online

简介: oracle 在线move 数据文件。

建立测试数据文件,在线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

相关文章
|
7月前
|
数据库 OceanBase
min restore scn of backup set file is greater than restore scn. can't use to restor
min restore scn of backup set file is greater than restore scn. can't use to restor
54 1
|
数据库
ORA-01113: file 1 needs media recovery ORA-01110: data file 1:
把下面两个隐含参数加入到pfile中
253 0
|
SQL Oracle 关系型数据库
Online Data Files move
online data files move,move online,
1702 0
|
Oracle 关系型数据库 数据库
[20170616]recover copy of datafile 6.txt
[20170616]no copy of datafile 6 found to recover.txt --//最近几天一直被这个问题纠缠,我虽然不知道问题在哪来,还是找到简单的解决方法,做1个记录: --//链接:http://www.
1153 0
|
SQL Oracle 关系型数据库
[20160720]rman set newname for datafile
[20160720]rman set newname for datafile本质.txt --前几天在恢复历史数据库,因为生产系统数据库是asm,恢复必须要转成文件类型。
1529 0
|
Oracle 关系型数据库 数据库
ORA-01189的完整解决过程(File is from a different RESETLOGS than previous files)
昨天用户报告数据库不能启动了,询问用户,用户也不清楚原因。在解决过程中遇到了ORA-01189的问题,查遍了网上,包括metalink,也没有找到合适的解决方案,差点就放弃了......还好,根据ORACLE的错误解释,终于摸索出了下面的解决方法。
1438 0