11G rac 由spfile创建数据库的pfile
报错如下
SQL> create pfile='/u01/inittips1.ora' from spfile;
create pfile='/u01/inittips1.ora' from spfile
*
ERROR at line 1:
ORA-07391: sftopn: fopen error, unable to open text file.
再次执行
SQL> create pfile='/u01/inittips1.ora' from spfile='+DATA/tips/spfiletips.ora';
create pfile='/u01/inittips1.ora' from spfile='+DATA/tips/spfiletips.ora'
*
ERROR at line 1:
ORA-07391: sftopn: fopen error, unable to open text file.
一样报同样的错误
于是查看/u01目录的权限得知,是权限导致的问题
[root@tip01 oracle]# ls -ld /u01/
drwxr-xr-x 3 root oinstall 4096 05-30 00:55 /u01/
[root@tip01 ~]# ls -ld /u01/app/oracle/
drwxrwxr-x 7 oracle oinstall 4096 06-25 00:30 /u01/app/oracle/
尝试在/u01/app/oracle/ 目录下创建pfile
均可以成功创建
SQL> create pfile='/u01/app/oracle/inittips1.ora' from spfile='+DATA/tips/spfiletips.ora';
File created.
SQL> create pfile='/u01/app/oracle/inittips1.ora' from spfile;
File created.
根据oracle官方文档,创建pfile应用以下语法
Backing Up the Server Parameter File
Oracle recommends that you regularly back up the server parameter file for recovery purposes.
Do this using Oracle Enterprise Manager
(as described in the Oracle Database 2 Day + Real Application Clusters Guide)
or use the CREATE PFILE statement. For example:
CREATE PFILE='?/dbs/initdbname.ora'
FROM SPFILE='/dev/vx/rdsk/oracle_dg/dbspfile'
RAC环境中的$ORACLE_HOME/dbs目录下的pfile中内容只有一行代码,
指定的是数据库spfile的位置
[root@tip01 ~]# su - oracle
[oracle@tip01 ~]$ cd $ORACLE_HOME/dbs
[oracle@tip01 dbs]$ more inittips1.ora
spfile=+DATA/TIPS/spfiletips.ora
[oracle@tip01 dbs]$
切记在RAC环境中使用SQL>create pfile from spfile 这样会使得pfile内容被替换,
数据库重启后不会用默认ASM磁盘组中的spfile
ORA-07391: sftopn: fopen error, unable to open text file
最新推荐文章于 2021-04-10 15:59:15 发布