Oracle 12c ORA-01516: nonexistent log file, data file, or temporary file "10"
admin
2023-05-06 19:41:58
0


执行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为自己数据库可用?带着疑问做测试。


SQL> show con_name


CON_NAME

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

CDB$ROOT


首先用alter pluggable database move命令来看看是否在CDB数据库中能否一定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中执行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


成功!

   总结:尽管oracle 12c日志文件共享,但是cdb和各个pdb只能在各自数据库使用自己的日志。


相关内容

热门资讯

“爱泼斯坦被软禁时,性侵了我” 据英国广播公司BBC报道,一名曾遭受杰弗里·爱泼斯坦性侵的幸存者讲述了这位已故性侵犯者,在因引诱未成...
凤凰女记者战地日记丨一边装行李... 今天早上起来一睁眼,就看看伊朗的局势。美伊昨晚在波斯湾又发生了零星冲突,凌晨12点伊朗说靠近格什姆岛...
菲军方称向参议院派兵负责安保执... 新华社马尼拉5月13日电(记者赵晨捷 李萌)菲律宾武装部队13日发表声明称,当天出现在参议院内的军方...
公众进入武汉大学已无需预约,带... 据“正在新闻”微信公众号、“中国网湖北”微信公众号消息,5月13日,多位市民发视频表示,社会公众进入...
以总理办公室:内塔尼亚胡在对伊... △内塔尼亚胡(资料图)当地时间5月13日晚,以色列总理办公室发表声明称,在“咆哮的狮子”军事行动期间...
伊朗外长:科威特“非法”攻击伊... △伊朗外长阿拉格齐(资料图)当地时间13日晚,伊朗外长阿拉格齐对外表示,科威特“非法”攻击了一艘伊朗...
欧盟召开紧急会议,协调应对汉坦... 当地时间13日,欧盟各成员国常驻欧盟代表在布鲁塞尔举行紧急会议,重点讨论在汉坦病毒疫情背景下加强跨境...
菲律宾总统称未下达逮捕德拉罗萨... 新华社马尼拉5月13日电(记者赵晨捷 李萌)据菲律宾媒体报道,菲总统马科斯13日称未下达逮捕参议员德...
时隔九年再度来京,特朗普有何诉... ◆5月12日,特朗普登上“空军一号”前对着镜头挥手告别。(图源:美联社)文/何平编辑/漆菲5月13日...
硬科技管控,中美关系的新压舱石 特朗普此次访华,英伟达CEO黄仁勋随行的消息提振美股市场,凸显芯片与人工智能已成为中美关系的核心议题...