alter database move datafile /u01/app/oracle/oradata/cdb/pdb/pdb_users01.dbf to /u01/app/pdb_user01.d..."/>
溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

Oracle 12c ORA-01516: nonexistent log file, data file, or temporary file "10"

發(fā)布時間:2020-07-02 13:29:10 來源:網(wǎng)絡(luò) 閱讀:7623 作者:DoveLauren 欄目:關(guān)系型數(shù)據(jù)庫


執(zhí)行alter database move操作報錯ORA-01516:

SQL> alter database move datafile '/u01/app/oracle/oradata/cdb/pdb/pdb_users01.dbf' to '/u01/app/pdb_user01.dbf';

alter database move datafile '/u01/app/oracle/oradata/cdb/pdb/pdb_users01.dbf' to '/u01/app/pdb_user01.dbf'

*

ERROR at line 1:

ORA-01516: nonexistent log file, data file, or temporary file "10"



[oracle@ora12c ~]$ oerr ora 1516

01516, 00000, "nonexistent log file, data file, or temporary file \"%s\""

// *Cause:  An attempt was made to use ALTER DATABASE to rename

//          a log file, data file, or temporary file; or to change attributes

//          of a data file or temporary file (for example, resize, autoextend,

//          online or offline); or to re-create or move a data file.

//          The attempt failed because the specified file

//          is not known to the database's control file

//          or is not of a type supported by the request.

// *Action: Specify the name or number of an existing file

//          of the correct type, as appropriate.

//          Check the relevant V$ table for a list of possible files.


查看file 10是否存在:


[oracle@ora12c backup]$ du -sh /u01/app/oracle/oradata/cdb/pdb/pdb_users01.dbf

5.1M/u01/app/oracle/oradata/cdb/pdb/pdb_users01.dbf


文件10存在。

這個時候想到log file、temporary file難道只能在con_name為自己數(shù)據(jù)庫可用?帶著疑問做測試。


SQL> show con_name


CON_NAME

------------------------------

CDB$ROOT


首先用alter pluggable database move命令來看看是否在CDB數(shù)據(jù)庫中能否一定PDB文件。

SQL> alter pluggable database move datafile '/u01/app/oracle/oradata/cdb/pdb/pdb_users01.dbf' to  '/u01/app/pdb_user01.dbf' ;


alter pluggable database move datafile '/u01/app/oracle/oradata/cdb/pdb/pdb_users01.dbf' to  '/u01/app/pdb_user01.dbf' ;


                                                                                          *

ERROR at line 1:

ORA-01916: keyword ONLINE, OFFLINE, RESIZE, AUTOEXTEND or END/DROP expected



顯然,在CDB中不支持alter pluggable database move命令




接下來在pdb中執(zhí)行alter pluggable database move操作

SQL> show pdbs        


    CON_ID CON_NAME  OPEN MODE  RESTRICTED

---------- ------------------------------ ---------- ----------

2 PDB$SEED  READ ONLY  NO

3 PDB  READ WRITE NO

SQL> alter session set container=pdb;


Session altered.


SQL> alter database move datafile '/u01/app/oracle/oradata/cdb/pdb/pdb_users01.dbf' to '/u01/app/pdb_user01.dbf';


Database altered.



SQL> select name,status from v$datafile where file#=10;


NAME                                                                             STATUS

-------------------------------------------------------------------------------- -------

/u01/app/pdb_user01.dbf                                                          ONLINE


成功!

   總結(jié):盡管oracle 12c日志文件共享,但是cdb和各個pdb只能在各自數(shù)據(jù)庫使用自己的日志。


向AI問一下細節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI