当前位置:Gxlcms > mysql > Oracle11g新特性--管理SPFILE说明

Oracle11g新特性--管理SPFILE说明

时间:2021-07-01 10:21:17 帮助过:32人阅读

在Oracle 11g 以前,我们可以从spfile来创建pfile,或者利用pfile来创建spfile。 在Oracle 11g中,在管理spfile方面得到增强,可

在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角色来执行。

linux

人气教程排行