oracle+spfile+在哪,在Oracle关闭情况下如何修改spfile的参数

发现问题

我使用的Oracle11g,当我敲下如下一段命令后,就让我傻眼了。。

sql;">

alter system set sga_max_size=960M scope=spfile;

shutdown immediate

startup

此时的startup报错了,错误为:

startup

ORA-00844: Parameter not taking MEMORY_TARGET into account

ORA-00851: SGA_MAX_SIZE 985661440 cannot be set to more than MEMORY_TARGET 784334848.

原因分析

原来在Oracle11g中增加了memory_target参数,sga_max_size必须比memory_target参数小。那么问题来了,此时我已经关闭Oracle了,spfile文件是二进制文件,又不能手动修改,那么我该怎么办呢。。好捉急好捉急。。。

解决思路

通过pfile启动Oracle–>在Oracle中通过create pfile='' from spfile=''取出spfile的内容(pfile是可以手动修改的)–>修改新建的pfile–>以新的pfile启动Oracle–>在Oracle中通过create spfile='' from pfile=''获得修改后的spfile

实战

create pfile='/home/oracle/pfile.new' from spfile='/u01/app/oracle/product/11.2.0/db_1/dbs/spfilewingdb.ora';

File created.

sql> exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Partitioning,OLAP,Data Mining and Real Application Testing options

通过vi修改pfile.new文件中相应的参数(本文档中是memory_target参数),修改后保存

[oracle@wing ~]$ sqlplus / as sysdba

sql*Plus: Release 11.2.0.4.0 Production on Mon Feb 15 14:04:46 2016

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

Connected to an idle instance.

sql> startup pfile='/home/oracle/pfile.new'

ORACLE instance started.

Total System Global Area 810090496 bytes

Fixed Size 2257520 bytes

Variable Size 415239568 bytes

Database Buffers 390070272 bytes

Redo Buffers 2523136 bytes

Database mounted.

Database opened.

sql> create spfile='/u01/app/oracle/product/11.2.0/db_1/dbsspfilewingdb.ora' from pfile='/home/oracle/pfile.new';

File created.

sql> shutdown immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

sql> exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Partitioning,Data Mining and Real Application Testing options

[oracle@wing ~]$ sqlplus / as sysdba

sql*Plus: Release 11.2.0.4.0 Production on Mon Feb 15 14:08:40 2016

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

Connected to an idle instance.

sql>

sql> startup

ORACLE instance started.

Total System Global Area 810090496 bytes

Fixed Size 2257520 bytes

Variable Size 415239568 bytes

Database Buffers 390070272 bytes

Redo Buffers 2523136 bytes

Database mounted.

Database opened.

sql> show parameter memory

NAME TYPE

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

VALUE

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

hi_shared_memory_address integer

0

memory_max_target big integer

800M

memory_target big integer

800M

shared_memory_address integer

0

sql> show parameter sga

NAME TYPE

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

VALUE

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

lock_sga boolean

FALSE

pre_page_sga boolean

FALSE

sga_max_size big integer

776M

sga_target big integer

740M

# 至此Oracle使用新的spfile启动成功,参数也得到相应的修改

总结

以上就是关于如何在Oracle关闭的情况下修改spfile里面参数的全部内容了,希望本文的内容对大家的学习或者工作能带来一定的帮助,如果有疑问大家可以留言交流。

总结

如果觉得编程之家网站内容还不错,欢迎将编程之家网站推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值