Oracle 的参数文件pfile与spfile

Oracle pfile与spfile文件参数 一、pfile与spfile Oracle中的参数文件是一个包含一系列参数以及参数对应值的操作系统文件。它们是在数据库实例启动时候加载的,决定了数据库的物理 结构、内存、数据库的限制及系统大量的默认值、数据库的各种物理属性、指定数据库控制文件名和路径等信息,是进行数据库设计和性能调优的重要文件。可以分为两种类型: pfile: 初始化参数文件(Initialization Parameters Files),Oracle 9i之前,ORACLE一直采用pfile方式存储初始化参数,pfile 默认的名称为“ 阅读详情

In Oracle Databases through 8i, parameters controling memory, processor usage, control file locations and other key parameters are kept in a pfile (short for parameter file).

The pfile is a static, plain text files which can be altered using a text editor, but it is only read at database startup. Any changes to the pfile will not be read until the database is restarted and any changes to a running database will not be written to the pfile.

Due to these limitations, in 9i Oracle introduced the spfile (server parameter file). The spfile cannot be edited by the DBA; instead it is updated by using ALTER SYSTEM commands from within Oracle. This allows parameter changes to be persistent across database restarts, but can leave you in a pinch if you need to change a parameter to get a database started but you need the database running to change the parameter.

A 9i (or later) database can have either a pfile or an spfile, or even both, but how can you tell which you have? If you have both, which one is being used? How do you go from one to the other? How do you get out of the chicken-and-the-egg quandary of a database that will not start up without you changing a parameter that’s in that file you can’t update unless the database is up?

Note: This information is based on an Oracle 9i installation on Solaris. Your mileage may vary. I have also chosen to ignore issues of RAC installation. In my example I have used ORADB as my SID.

Am I using a pfile or an spfile?

The first thing to check is if you have a pfile or spfile. They can be specified at startup or found in the default location. The default path for the pfile is $ORACLE_HOME/dbs/init$ORACLE_SID.ora and the default for the spfile is $ORACLE_HOME/dbs/spfile$ORACLE_SID.ora.

If both a pfile and an spfile exist in their default location and the database is started without a pfile='/path/to/init.ora' then the spfile will be used.

Assuming your database is running you can also check the spfile parameter. Either the command SHOW PARAMETER spfile or SELECT value FROM v$parameter WHERE name='spfile'; will return the path to the spfile if you are using one. If the value of spfile is blank you are not using an spfile.

The path to the spfile will often be represented in the database by ?/dbs/spfile@.ora. This may seem cryptic, but Oracle translates ? to $ORACLE_HOME and @ to $ORACLE_SID so this string translates to the default location of the spfile for this database.

How can I create an spfile from a pfile?

As long as your pfile is in the default locations and you want your spfile in the default location, you can easily create an spfile with the command CREATE SPFILE FROM PFILE;.

If you need to be more specific about the locations you can add paths to the create command like this:

CREATE SPFILE='/u01/app/oracle/product/9.2/dbs/spfileORADB.ora'
FROM PFILE=’/u01/app/oracle/product/9.2/dbs/initORADB.ora’;

These commands should work even when the database is not running! This is important when you want to change a database to use an spfile before you start it.

How can I create a pfile from an spfile?

The commands for creating a pfile are almost identical to those for creating a spfile except you reverse the order of spfile and pfile:

If your pfile is in the default location and you want your spfile created there as well run CREATE SPFILE FROM PFILE;.

If you have, or want them in custom locations specify the paths like this:

CREATE PFILE='/u01/app/oracle/product/9.2/dbs/initORADB.ora'
FROM SPFILE=’/u01/app/oracle/product/9.2/dbs/spfileORADB.ora’;

Again, this can be done without the database running. This is useful when the database fails to start due to a parameter set in the spfile. This is also a good step to integrate into your backup procedures.

How can I see what’s in my spfile

To view the settings in the spfile we have two options: First, we can use the command above to create a pfile from the spfile. This is simple, and fairly fast, but unnecessary if the database is running.

The better way, if the database is running, is to select the parameter you want to view from the oracle view v$spparameter with a command like this:

SELECT value FROM v$spparameter WHERE name='processes';

If you try to view the spfile with a text editor it may seem like it is plain text, but beware! The spfile will not behave correctly (if it works at all) if it has been edited by a text editor.

How can I update values in my spfile?

The values in spfile are updated with the ALTER SYSTEM command, but to update the spfile we add an additional parameter of SCOPE.

ALTER SYSTEM SET processes=50 SCOPE=spfile;

This command would update the parameter processes in the spfile. Since this parameter can only be set at startup, we say SCOPE=spfile and the change will be reflected when the database is restarted. Other options for SCOPE are memory which only changes the parameter until the database is restarted, and both which changes the instance immediately and will remain in effect after the database is restarted.

How can I update values in my spfile when my database won’t start?

So your database won’t startup because of a problem in your spfile. You can’t edit it with a text editor and you can’t use ALTER SYSTEM because your database is not running. It sounds like a problem, but really isn’t. Here’s what you do:

Connect up to your database as sysdba. You should get the message Connected to an idle instance

Run the command CREATE pfile FROM spfile; specifying the location as above if necessary. You should now have a fresh version of the spfile.

Edit the pfile to update the parameter you need to update.

Run the command CREATE spfile FROM pfile; to move the changes you have just made back into the spfile.

Startup the database normally. It should read the changed spfile and start up correctly. You can optionally delete the pfile if you are done.

 

GLDAS数据高效处理指南:基于Matlab的NC4转GeoTIFF实战解析 本文提供了一份基于Matlab的GLDAS数据处理实战指南,详细解析了如何将NetCDF4格式的GLDAS数据高效、准确地批量转换为GIS友好的GeoTIFF格式。文章核心内容包括数据理解、环境搭建、核心代码逐步拆解、效率提升技巧以及常见避坑方案,旨在帮助全球生态、水文与气候领域的研究者打通数据预处理的关键环节,提升科研工作效率。 阅读详情

相关推荐

Android应用之【巧妙隐藏桌面图标的进阶方案】

本文详细探讨了Android应用中隐藏桌面图标的进阶方案,解决了传统方法在Android 10及以上版本中出现的黑色图标残留问题。通过Intent-Filter配置和厂商适配技巧,实现子应用真正隐身,同时确保主应用正常启动。适用于企业工具套件、模块化系统等场景,提升用户体验和安全性。

weixin_28363123的博客 509

SPFILE 、PFILE 的全面解读

参数文件是实例启动首先要用到的文件,所以此类文件相当关键,本文就结合官方文档对参数文件进行一次全面的解读;

搞怪的索引 2412

【阿里云大模型高级工程师ACP习题集】2.5 优化RAG应用提升问答准确度(⭐️⭐️⭐️ 重点章节!!!)

【摘要】这是我精心整理出对应的习题集,里面足足有 30 道题目,从基础概念到深度拓展,全方位覆盖章节重点、难点。不管你是想检验自己的学习成果,还是想针对薄弱环节进行强化训练,它都能完美适配!

davidkorhenn的博客 1107

spfile rman时找不到,重建办法

---spfile 重启自动改变----

jnrjian的博客 1031

泛微ecology9二次开发-附件上传-安全实践

本文深入探讨了泛微ecology9二次开发中附件上传功能的安全实践。针对原生接口的安全机制,文章提出了同源部署与服务端代理转发两大核心策略,并提供了基于Vue3和Element Plus的完整前端实现代码,重点解决了会话验证、权限控制及文件关联等关键安全问题,确保二次开发应用能安全、稳定地与ecology9系统集成。

qsc9012345的博客 535

MobileNet V3 图像分类

MobileNet V3

Henry的博客 1768

oracle重建spfile,Oracle修改spfile的位置

虽然很多地方不建议这么做,可是有HA、oracle软件建在本地盘的情况下,如果spfile放在dbs下,会导致每次修改spfile都要去手动copy到备机上,这是很麻烦的一件事情,所以我把spflie放在随ha切换的存储磁盘上。1. 首先不能使用alter system set spfile的方式去指定:SQL> alter system set spfile = 'd:\spfilemao...

weixin_30363285的博客 978

uniapp(安卓苹果app端) - 微信小程序分享提示报错“由于不支持的分享类型无法分享到微信“,“由于应用和小程序未绑定在同意微信开放平台账号,无法分享到微信“解决办法,uniapp小程序分享失败

uni-app,安卓app,苹果app,手机app端,苹果ios,安卓Android,移动端app,分享,微信分享,微信朋友圈,微信好友,转发,vue2,vue3,App端调用手机的系统分享,微信小程序,分享功能,原生app分享小程序到微信,可分享到微信、朋友圈等,报错,uniapp分享报错由于不支持的分享类型无法分享到微信,未审核应用,uniApp安卓苹果app报错由于应用和小程序未绑定在同意微信开放平台账号,无法分享到微信,微信appid,已经配置了,还是报错,无法解决,一直提示,APP_ID错误,打包

✅ 精选推荐文章 5511

我的oracle 健康检查报告

最近一直想用sql来生成oracle的健康检查报告,这样看起来一目了然,经过网上搜资料加自己整理终于算是成型了,部分结果如下图所示, 具体参考附件,恳请广大网友看看是否还有需要添加的地方。DB_healthcheck_by_lhr_ORADG11G_20150826160539.zip ORADG11G 数据库巡检报告 Copyright (c) 2015-2100 (http...

小麦苗DBA宝典 4万+

YOLOv8 眼底病变检测(眼底照片)详细说明

本文介绍了基于YOLOv8的眼底病变自动检测系统。该系统可识别糖尿病视网膜病变、青光眼等5类常见眼底病变,包括微动脉瘤、出血点等特征。核心技术包含图像预处理、模型训练、病变检测与量化分析三个模块,采用1024×1024高分辨率输入,针对医学图像特点优化数据增强策略。系统支持批量处理、可视化标注和临床报告生成,提供病变数量、面积密度和严重程度评分等量化指标。特别强调医学合规性要求,需专业医生参与数据标注和模型验证,符合医疗器械认证标准。该系统可作为眼科医生的辅助诊断工具,提高眼底病变筛查效率。

u010117029的博客 133

CesiumForUnreal实现鹰眼地图(MiniMap)效果

CesiumForUnreal实现鹰眼地图(MiniMap)效果

专注GIS开发 3951

oracle 参数文件与参数,[转] Oracle 的参数文件pfile与spfile

转自:In Oracle Databases through 8i, parameters controling memory, processor usage, control file locations and other key parameters are kept in a pfile (short for parameter file).The pfile is a static, ...

weixin_26937243的博客 169

ssm框架搭建

这个是一个在idea上成功跑起来的ssm框架项目,保存在这里方便以后使用直接下载

oracle参数文件initorcl位置,详解oracle参数文件PFILE和SPFILE-pf文件

概述oracle中的参数文件是一个包含一系列参数以及参数对应的值的系统文件,它可以分为两种类型:pfile和spfile。他们是在数据库实例启动时加载的,决定了数据库的物理结构,内存,数据库的限制及系统大量的默认值,数据库的各种物理属性,指定数据控制文件名(当数据库实例由nomount启动到mount状态时,就会通过参数文件找到对应的控制文件,来装载对应的数据库)和路径等信息,是进行数据库设计和性...

weixin_30577815的博客 2266

VC中sqlite的使用

在VC中对sqlite的使用,实现数据库大批数据的快速插入,读取数据库中的数据在ListCtrl中显示

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

Oracle Database 12c 参数文件(Spfile 和 Pfile)

1. 前言 oracle 数据库的参数文件是在打开Oracle实例时创建的,我们可以动态或静态的更改这些参数文件的内容。oracle 在我们的数据库中有2个相同的参数文件,分别命名为SPFILE和 PFILE。 2. SPFILE(Server Parameter File)文件 SPFILE(Server Parameter File):是一个扩展名为 .ora 的二进制格式的物理文件,其中存储了打开Oracle 实例时所需要的参数。该文件通常位于 $ORACLE_HOME/dbs 目录下,采用 spf

daxues_的博客 2060

visio安装包

Microsoft Office Visio 是一款专业的制图软件。利用经过更新的形状、协作工具和数据链接图表,创建专业级图表以简化复杂的信息。

oracle的参数文件:pfile和spfile

oracle的参数文件:pfile和spfile

BLACKHEART的博客 5100

Oracle参数文件之pfile和spfile

一、pfile和spfile区别和联系二、辨别数据库使用spfile还是pfile三、判断数据库是通过spfile启动还是通过pfile启动:方法一: 第一个值为true代表为spfile启动,为false表示pfile启动;方法二:直接修改系统参数,如果提示无法修改spfile代表为pfile启动四、确定参数属性 视图 v$parameter 中 ISSYS_MODIFIABLE 列能够查看参数属性,ISSYS_MODIFIABLE ='IMMEDIATE’为动态参数、 ISSYS_

顺其自然~专栏 2224

oracle的参数文件 pfile和spfile

在oracle数据库中,参数文件包含了所有的数据库配置信息,它非常重要。如果要把oracle管理好,必须要做到对参数及参数文件的了如指掌。但是,oracle数据库中 据是庞大的,且正因为参数文件包含了数据库的所有配置信息,所以参数很多,有几百 个之多,一时是难以熟悉和掌握的,这需要在实践中的配置,了解和领会。有关各个参数的详细参考信息,请参阅oracle官方文档《Oracle9i Database

数据就是一切 4057

Oracle初始化参数文件spfile 和 pfile

实例启动时Oracle将读入初始化参数文件的每个参数项 ,参数文件有两种类型的参数1)显示:在该文件中有一个参数项。2)隐式:在该文件中没有参数项,但使用Oracle的默认值

天花板上的猫 1144

Oracle 参数文件(PFILE/SPFILE)的优先级与启动顺序,如何维护?

Oracle 参数文件(PFILE/SPFILE)的优先级与启动顺序,如何维护?

chenoracle的博客 1055

Oracle 初始化参数文件pfile和spfile

pfile和spfile差额 pfile :Oracle 9i之前。ORACLE使用我们一直PFILE存储的初始化参数,,能够在操作系统级别改动。当spfile文件改动出现错误导致oracle无法启动时,能够使用 pfile文件启动数据库 spfile:从Oracle 9i開始,Oracle引入了SPFILE文件,该文件为二进制格式,不能通过手工改动,仅仅能在sql下通过al...

aofan9566的博客 158

[oracle]初始化参数文件spfile、pfile及修改参数的两种方式

oracle数据库在启动过程中要读取初始化参数文件以确定一系列参数,例如数据库名pfile称、SGA大小、最大连接数等等,pfile就是这样的一个初始化参数文件,文本文件,可以直接打开编辑,数据库启动时到默认目录下查找此文件,或者在命令行指定pfile文件: SQL>startup  pfile='H:\oracle\product\10.2.0\db_1\database\INITorcl.O

joyeu的专栏 1万+

oracle创建参数文件,Oracle PFILE/SPFILE 初始化参数文件

Oracle PFILE/SPFILE 初始化参数文件初始化参数文件要启动一个例程,Oracle 服务器必须读取初始化参数文件。初始化参数文件文件中的条目专用于要启动的例程有两种类型的参数:–显式:文件中有一个条目–隐式:文件中没有条目,但假定取 Oracle缺省值可存在多个初始化参数文件对文件中条目的更改的生效时间,取决于使用的初始化参数文件类型–静态参数文件 PFILE–永久参数文件 SPFI...

weixin_33930436的博客 510

oracle p 存储,Oracle 初始化参数文件pfile和spfile

pfile和spfile的区别pfile :Oracle 9i之前,ORACLE一直采用PFILE方式存储初始化参数,该文件为文本文件,可以在操作系统级别修改。当spfile文件修改出现错误导致oracle无法启动时,可以使用 pfile文件启动数据库spfile:从Oracle 9i开始,Oracle引入了SPFILE文件,该文件为二进制格式,不能通过手工修改,只能在sql下通过alter sy...

weixin_29794879的博客 232

ORACLE初始化参数文件SPFILE、PFILE介绍

1.简介 在9i之前,参数文件只有一种,它是文本格式的,称为pfile,在9i及以后的版本中,新增了服务器参数文件,称为spfile,它是二进制格式的。这两种参数文件都是用来存储参 数配置以供oracle读取的,但也有不同点,注意以下几点: 1)pfile是文本文件,spfile是二进制文件; 2)对于参数的配置,pfile可以直接以文本编辑器打开手工配置,而spfile不行,必须在数据库启动后,...

卖掉裤子来上网 376

创建和管理Oracle初始化参数文件pfile、spfile

创建和管理Oracle初始化参数文件pfile、spfile 分类: Oracle—管理Oracle实例 2012-06-11 17:09 96人阅读 评论(0) 收藏 举报 知识点:      创建和管理初始化参数文件      启动和关闭例程      监视和使用诊断文件    参数文件      要启动一个Oracle例程,Oracle服务器必须读取初始化参数文

Rebulid Myself 8557
上一篇: ORA-1555: Snapshot too old的解决
下一篇: How to add one or more control files
dancle
博客等级 码龄23年 0粉丝 11原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值