資料庫環境:Oracle 11G
功能spfile的改進
在11G中,Oracle為保護spfile也做了一些小小的改進,例如,在運行時,spfile無法中被刪除時,可以從memory中直接讀出所有參數的值類比spfile被刪除
[Oracle@rac2 dbs]$ rm spfileorcl.ora
嘗試修改參數,Oracle會報錯
SQL> alter system set sga_max_size=317M scope=spfile;
alter system set sga_max_size=317M scope=spfile
*
ERROR at line 1:
ORA-01565: error in identifying file '/opt/u01/app/Oracle/11G/dbs/spfile.ora'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3
使用以下命令建立一個新的spfile,但由於spfile正被Oracle使用,而運行時中Oracle並不即時
去監控spfile是否存在,因此需要為新的spfile指定一個新的名字。如spfile.ora
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> create spfile='/opt/u01/app/Oracle/11G/dbs/spfile.ora' from memory;
File created.
需要注意的是,這個命令讀出的是當前記憶體中的值,當然也可以使用這個方式來,備份當前的spfile.可以看出Oracle越來越方便。