Oracle 11g 新特性 -- 管理 SPFILE 說明

來源:互聯網
上載者:User

在Oracle 11g 以前,我們可以從spfile來建立pfile,或者利用pfile來建立spfile。 在Oracle 11g中,在管理spfile方面得到增強,可以從memory來建立pfile和spfile。 

文法如下:

CREATE PFILE [= 'pfile_name' ]

FROM { { SPFILE [= 'spfile_name'] } | MEMORY } ;

 

CREATE SPFILE [= 'spfile_name' ]

FROM { { PFILE [= 'pfile_name' ] } | MEMORY } ; 

樣本: 

[15:43 oracle@dave /u01/backup]$ora si

 

SQL*Plus: Release 11.2.0.3.0 Production onFri Oct 12 15:43:22 2012

 

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

 

 

Connected to:

Oracle Database 11g Enterprise EditionRelease 11.2.0.3.0 - 64bit Production

With the Partitioning, OLAP, Data Miningand Real Application Testing options

 

SQL> create pfile from memory;

 

File created.

 

SQL> create spfile from memory;

create spfile from memory

*

ERROR at line 1:

ORA-32002: cannot createSPFILE already being used by the instance

--對於open 狀態的執行個體,不能從memory建立spfile。

 

SQL> startup mount force;

ORACLE instance started.

 

Total System Global Area  730714112 bytes

Fixed Size                  2231952 bytes

Variable Size            285213040 bytes

Database Buffers          419430400 bytes

Redo Buffers              23838720 bytes

Database mounted.

SQL> select open_mode from v$database;

 

OPEN_MODE

--------------------

MOUNTED

 

SQL> create spfile from memory;

create spfile from memory

*

ERROR at line 1:

ORA-32002: cannot createSPFILE already being used by the instance

--mount 狀態也不可以使用

 

SQL> startup nomount force;

ORACLE instance started.

 

Total System Global Area  730714112 bytes

Fixed Size                  2231952 bytes

Variable Size            285213040 bytes

Database Buffers          419430400 bytes

Redo Buffers              23838720 bytes

SQL> create spfile from memory;

create spfile from memory

*

ERROR at line 1:

ORA-32002: cannot createSPFILE already being used by the instance

--nomount 狀態也不可以

 

SQL> shutdown abort;

ORACLE instance shut down.

SQL> create spfile from memory;

create spfile from memory

                  *

ERROR at line 1:

ORA-00922: missing or invalid option

--資料庫關閉後,文法不可以用。

 

 

我們用pfile啟動資料庫,在來建立spfile:

SQL> startuppfile='/u01/app/oracle/product/11.2.0/db_1/dbs/initdave.ora'

ORACLE instance started.

 

Total System Global Area  730714112 bytes

Fixed Size                  2231952 bytes

Variable Size            285213040 bytes

Database Buffers          419430400 bytes

Redo Buffers              23838720 bytes

Database mounted.

Database opened.

SQL> create spfile from memory;

 

File created.

--這次建立成功。

 

注意:

    (1)如果是RAC 環境,那麼產生的指令碼會包含所有節點的參數。

    (2)執行這個命令需要使用sysdba或sysoper角色來執行。

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.