oracle ORA-65169:尝试复制文件时遇到错误

tkclm6bt  于 2023-11-17  发布在  Oracle
关注(0)|答案(2)|浏览(180)

由于克隆PDB数据库,我试图在两个ora19数据库之间创建clone_link
两个DB都创建了用户,如:

CREATE USER c##remote_clone_user IDENTIFIED BY remote_clone_user CONTAINER=ALL;
GRANT CREATE SESSION, CREATE PLUGGABLE DATABASE TO c##remote_clone_user CONTAINER=ALL;

字符串
我想将PDB从DB2复制到DB1,所以我关闭了DB2上的所需PDB,并打开进行阅读:

alter pluggable database testpdb close;
alter pluggable database testpdb open read only;


已创建clone_link并尝试复制PDB(tns testpdb连接设置为DB2)

--db link to database we want to copy
create database link clone_link
    connect to C##remote_clone_user identified by remote_clone_user using 'testpdb';

-- clone from DB2 to DB1  
create pluggable database testpdb from testpdb@clone_link
    file_name_convert = ('/u01/app/oracle/oradata/', '/testpdb/');


但我得到错误:

Error starting at line : 14 in command -
create pluggable database testpdb from testpdb@clone_link
    file_name_convert = ('/u01/app/oracle/oradata/', '/testpdb/')
Error report -
ORA-65169: error encountered while attempting to copy file /u01/app/oracle/oradata/testpdb/testpdb_index.dbf 
ORA-19504: failed to create file "/testpdb/testpdb/testpdb_index.dbf"
ORA-27040: file create error, unable to create file
Linux-x86_64 Error: 13: Permission denied
Additional information: 3
65169. 00000 -  "error encountered while attempting to copy file %s "
*Cause:    An error was encountered while attempting to copy the file
           while creating a pluggable database.
*Action:   Check additional error messages for the cause of the failure to
           copy the file, and resolve the issue accordingly.


在警报日志中,我只看到:

Undo Create of Pluggable Database TESTPDB with pdb id - 7.
**************************************************************
ORA-65169 signalled during: create pluggable database testpdb from testpdb@clone_link
    file_name_convert = ('/u01/app/oracle/oradata/', '/testpdb/')...


我不确定需要设置什么权限

cgh8pdjw

cgh8pdjw1#

缓解此问题所需的步骤:这是一个权限问题,您需要/orlog/目录具有权限。按照以下步骤操作,或者更好的方法是,从以下过程创建脚本来解决此问题:

[oracle@oracle ~]$ ls -l  /u01/app/oracle/product/19.0.0/db_1/mydbfiles/ORCLDB/pdbseed

-rw-r-----. 1 oracle oinstall 104865792 Nov  3 07:29 undotbs01.dbf

字符串
所以我更新了文件的权限。它需要有组写权限:

[oracle@oracle ~]$ chmod -R 777 /u01/app/oracle/product/19.0.0/db_1/mydbfiles/ORCLDB/pdbseed

[oracle@oracle ~]$ ls -l
/u01/app/oracle/product/19.0.0/db_1/mydbfiles/ORCLDB/pdbseed

-rwxrwxrwx. 1 oracle oinstall 104865792 Nov  3 07:29 undotbs01.dbf


然后它会工作:

SQL> CREATE PLUGGABLE DATABASE pdb2 ADMIN USER admin2 IDENTIFIED BY Shane123 ROLES = (dba)
  2  FILE_NAME_CONVERT = ('/u01/app/oracle/product/19.0.0/db_1/mydbfiles/ORCLDB/pdbseed' , '/u01/app/oracle/product/19.0.0/db_1/mydbfiles/ORCLDB/pdb2');

Pluggable database created.


创建后,您可以将权限切换回之前。虽然这是一种解决方法,但如果您将其添加到脚本中,它就像魔术一样工作!

kadbb459

kadbb4592#

它在CDB为我工作

alter system set "_exadata_feature_on" =true scope=spfile;
shutdown immediate;
startup;

字符串

相关问题