This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[oracle@orcl12c ~]$ sqlplus / as sysdba | |
SQL*Plus: Release 12.1.0.1.0 Production on Fri Oct 25 16:03:02 2013 | |
Copyright (c) 1982, 2013, Oracle. All rights reserved. | |
Connected to: | |
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production | |
With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics | |
and Real Application Testing options | |
SYS@ORCL12C1> show con_name | |
CON_NAME | |
------------------------------ | |
CDB$ROOT | |
SYS@ORCL12C1> select d.file#, d.name as file_name, c.name as con_name | |
from v$datafile d, v$containers c where d.con_id = c.con_id order by 2; | |
FILE# FILE_NAME CON_NAME | |
---------- -------------------------------------------------------------------------------- ---------- | |
3 +DATA/ORCL12C1/DATAFILE/sysaux.257.829484337 CDB$ROOT | |
1 +DATA/ORCL12C1/DATAFILE/system.258.829484423 CDB$ROOT | |
4 +DATA/ORCL12C1/DATAFILE/undotbs1.260.829484499 CDB$ROOT | |
6 +DATA/ORCL12C1/DATAFILE/users.259.829484497 CDB$ROOT | |
7 +DATA/ORCL12C1/DD7C48AA5A4404A2E04325AAE80A403C/DATAFILE/sysaux.270.829484593 PDB$SEED | |
5 +DATA/ORCL12C1/DD7C48AA5A4404A2E04325AAE80A403C/DATAFILE/system.271.829484593 PDB$SEED | |
12 +DATA/ORCL12C1/E958346A045F61C6E04380424364CF28/DATAFILE/sysaux.276.829486259 PDB1 | |
11 +DATA/ORCL12C1/E958346A045F61C6E04380424364CF28/DATAFILE/system.278.829486259 PDB1 | |
13 +DATA/ORCL12C1/E958346A045F61C6E04380424364CF28/DATAFILE/users.280.829753193 PDB1 | |
9 rows selected. | |
SYS@ORCL12C1> ALTER DATABASE MOVE DATAFILE '+DATA/ORCL12C1/E958346A045F61C6E04380424364CF28/DATAFILE/users.280.829753193' to '+DATA/ORCL12C1/TEST/users.dbf'; | |
ALTER DATABASE MOVE DATAFILE '+DATA/ORCL12C1/E958346A045F61C6E04380424364CF28/DATAFILE/users.280.829753193' to '+DATA/ORCL12C1/TEST/users.dbf' | |
* | |
ERROR at line 1: | |
ORA-01516: nonexistent log file, data file, or temporary file "13" |
As you can see, you need to be in the right container to make it work.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SYS@ORCL12C1> alter session set container = PDB1; | |
Session altered. | |
SYS@ORCL12C1> show con_name | |
CON_NAME | |
------------------------------ | |
PDB1 | |
SYS@ORCL12C1> ALTER DATABASE MOVE DATAFILE '+DATA/ORCL12C1/E958346A045F61C6E04380424364CF28/DATAFILE/users.280.829753193' to '+DATA/ORCL12C1/TEST/users.dbf' | |
Database altered. | |
SYS@ORCL12C1> select d.file#, d.name as file_name, c.name as con_name | |
from v$datafile d, v$containers c where d.con_id = c.con_id order by 2; | |
FILE# FILE_NAME CON_NAME | |
---------- -------------------------------------------------------------------------------- ---------- | |
12 +DATA/ORCL12C1/E958346A045F61C6E04380424364CF28/DATAFILE/sysaux.276.829486259 PDB1 | |
11 +DATA/ORCL12C1/E958346A045F61C6E04380424364CF28/DATAFILE/system.278.829486259 PDB1 | |
13 +DATA/ORCL12C1/TEST/users.dbf PDB1 |
No comments:
Post a Comment