oracle11 ora 00922,Oracle 11g 新特性 -- 管理 SPFILE 说明

https://www.cndba.cn/Dave/article/1300

https://www.cndba.cn/Dave/article/1300

在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 sihttps://www.cndba.cn/Dave/article/1300

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 memoryhttps://www.cndba.cn/Dave/article/1300

*

ERROR at line 1:

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

--mount状态也不可以使用

SQL> startup nomount force;

ORACLE instance started.https://www.cndba.cn/Dave/article/1300

Total System Global Area  730714112 byteshttps://www.cndba.cn/Dave/article/1300

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

*

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

版权所有,文章允许转载,但必须以链接方式注明源地址,否则追究法律责任!

Skype:    tianlesoftware

QQ:       tianlesoftware@gmail.com

版权声明:本文为博主原创文章,未经博主允许不得转载。

oracle 11g

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值