ORA-32001: 已请求写入 SPFILE, 但是在启动时未指定 SPFILE - huak
SQL> alter system set log_archive_dest_1='location=/home/oracle/arch/' scope=spfile;
alter system set log_archive_dest_1='location=/home/oracle/arch/' scope=spfile*
ERROR at line 1:
ORA-32001: write to SPFILE requested but no SPFILE specified at startup
解决办法:
查看spfile
SQL> show parameter spfile;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string
spfie的路径是空的,然后创建spfile
SQL> create spfile from pfile;
File created.
SQL> show parameter spfile;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string
需要一致性关闭后,重启才能看到
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 608174080 bytes
Fixed Size 1220844 bytes
Variable Size 167776020 bytes
Database Buffers 436207616 bytes
Redo Buffers 2969600 bytes
Database mounted.
Database opened.
SQL> show parameter spfile;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string /u01/app/oracle/product/10.2.0
/db_1/dbs/spfileorcl.ora
看到spfile的路径已经有了,可以再去执行修改修改归档日志的路径
SQL> alter system set log_archive_dest_1='location=/home/oracle/arch/' scope=both;
System altered.
修改成功后查看归档日志的路径
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /home/oracle/arch/
Oldest online log sequence 2
Next log sequence to archive 4
Current log sequence 4
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 608174080 bytes
Fixed Size 1220844 bytes
Variable Size 167776020 bytes
Database Buffers 436207616 bytes
Redo Buffers 2969600 bytes
Database mounted.
Database opened.
重启实例后仍然可以看到修改过的归档日志路径,说明永久性修改成功。
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /home/oracle/arch/
Oldest online log sequence 2
Next log sequence to archive 4
Current log sequence 4