SPFILE 和 PFLIE互相创建

SPFILE 和 PFLIE互相创建

1. 创建SPFILE

以下两种方式创建SPFILE,数据库必须不是以SPFILE方式启动的。否则会报以下错误

SQL> create spfile from pfile='/u01/app/oracle/product/12.2.0/db_1/dbs/init.ora';
create spfile from pfile='/u01/app/oracle/product/12.2.0/db_1/dbs/init.ora'
*
ERROR at line 1:
ORA-32002: cannot create SPFILE already being used by the instance


SQL>
SQL> create spfile from memory;
create spfile from memory
*
ERROR at line 1:
ORA-32002: cannot create SPFILE already being used by the instance


SQL>

1.1. 使用PFILE创建

SQL> create spfile from pfile='/u01/app/oracle/product/12.2.0/db_1/dbs/init.ora';

File created.

SQL>

注 :如果当前实例正在使用spfile,会创建失败

1.2 使用Memory创建

SQL> create spfile from memory;

File created.

SQL>

2. 创建PFILE

2.1. 使用SPFILE创建

SQL> create pfile='/u01/app/oracle/product/12.2.0/db_1/dbs/initorcl.ora' from spfile;

File created.

SQL>
posted @ 2022-11-16 19:14  何以卿卿  阅读(355)  评论(0编辑  收藏  举报