Pfile和Spfile配置解釋(轉(zhuǎn)載)

摘抄自這里耗美,僅用來記錄,以便查閱咪惠。

Certain files in the database can completely change the way your Oracle 12c database behaves. They can influence everything from performance and tuning as well as troubleshooting. Maintaining and configuring these files are a major component of database administration.

PFILE AND SPFILES IN ORACLE 12C

These are the files that set up your database operating environment:

  • PFILE
  • SPFILES

Let’s go through many of the common parameters you find in these files. The parameter file is the first file read when you start your database; the parameters within it configure how your database operates.

First, take a look at an example of a PFILE and some of the commonly set parameters:

*.audit_file_dest='/u01/app/oracle/admin/dev12c/adump'
*.audit_trail='db'
*.compatible='12.0.0.0.0'
*.control_files='/u01/app/oracle/oradata/dev12c/control01.ctl',
         '/u02/app/oracle/oradata/dev12c/control02.ctl',
         '/u03/app/oracle/oradata/dev12c/control03.ctl'
*.db_block_size=8192
*.db_domain=’lfg.com’
*.db_name='dev12c'
*.db_recovery_file_dest='/u01/app/oracle/fast_recovery_area'
*.db_recovery_file_dest_size=4815m
*.diagnostic_dest='/u01/app/oracle'
*.memory_target=1280m
*.open_cursors=300
*.processes=300
*.undo_tablespace='UNDOTBS1'

The parameters have a * in front of them because you can use the parameter file to set parameters in more than one Oracle instance.

Follow these steps to see the parameters that are modified in an existing Oracle database:

  1. Log in to SQL*Plus as a SYSDBA.

  2. Type create pfile from spfile; (including the semicolon).

    The command dumps a text version of your SPFILE.

After you create your PFILE, you want to turn it into an SPFILE. Essentially, you do the reverse of what you did before:

  1. Log in to SQL*Plus as a SYSDBA.

  2. Type create spfile from pfile; (including the semicolon).

    You get a file called spfileORACLE_SID.ora in the same directory as your PFILE, where ORACLE_SID is your instance_name.

HOW TO SET PARAMETERS IN THE PFILES AND SPFILES IN ORACLE 12C

Whether you use PFILES or SPFILES determines how you set your parameters.

With a new database, you always start with a PFILE. If you end up wanting to use an SPFILE, you create it from the PFILE.

The first thing you need to do is find your PFILE. For whatever reason, despite all the other similarities, Linux/UNIX and Windows store it in different locations.

Find your PFILE on Windows, where ORACLE_SID is your instance name:

ORACLE_HOMEdatabaseinitORACLE_SID.ora

Find your PFILE on Linux/UNIX, where ORACLE_SID is your instance name:

ORACLE_HOME/dbs/initORACLE_SID.ora

These parameters are some of the most commonly customized. Most parameters suit most databases at their default value.

The * means to apply the parameter to all instances that read this file.

  • audit_file_dest: This parameter tells Oracle where to put auditing information on the file system. All connections to the database as SYSDBA are audited and put into this directory.
  • audit_trail: This tells Oracle where you want audit records written. Audit records are written to the database or the file system. They can be in text format or XML. Records written to the database are stored in the AUD$ system table. The valid values for this parameter follow:
    • db: Normal audit records written to the AUD$ table
    • os: Normal audit records written to the audit_file_dest directory
    • db_extended: Audit records written to the AUD$ table in extended format, including SQLTEXT and bind variable values
    • xml: XML-formatted normal audit records written to the database
    • xml, extended: Normal auditing and includes all columns of the audit trail, including SqlText and SqlBind values in XML format to the database
  • compatible: Set it to force the database to behave like a version earlier than Oracle 12c. In Oracle 12c, you can set it back as far as 10.0.0. However, it can be set back only before the database is created or before upgrading from an earlier version. After you migrate this parameter to 12.1.0 and open the database, you can no longer go back.
  • The parameter is useful for testing before an upgrade is complete. Most of the time you find it set on the latest version for your software. If you try using a feature from a database version later than what you’ve configured, it results in an Oracle error.
  • control_files: Just what is says. It tells the instance where to look for the control files during the startup phase. If the instance doesn’t find even one of them, you can’t mount your database.
  • db_name: The database name. Choose this name carefully. Although you can change it, doing so is a pain. The name can be up to eight alphanumeric characters. Avoid the urge to use special characters other than #, $, and _.
  • db_recovery_file_dest: This sets what’s known as the Fast Recovery Area. The area can hold files such as
    • Backups
    • Archive log files
    • Control files
    • Redo log files
  • db_recovery_file_dest_size: This determines how much space is dedicated to your Flash Recovery Area. If it fills up, you get an error message and the database could come to a halt — especially if you’re storing archive log files here. If archive log files can’t be written, redo log files can’t be overwritten. User sessions hang until the situation is resolved.
  • diagnostic_dest: This location is known as the Automatic Diagnostic Repository (ADR) home. It contains files that Oracle support may use to resolve issues with your database. This parameter was new in 11g. You can use a new tool called ADRCI to access the files in this directory. It contains
    • Trace files
    • Core files
    • Alert logs
    • Incident files
  • memory_target: This parameter sets the memory that the Oracle instance is allowed to use for all System Global Area (SGA) and program global area activities. It doesn’t include memory consumed by server and user processes.
  • open_cursors: Limits the number of open SQL cursors a session can have.
  • processes: Limits the number of OS users’ processes that can connect to the instance.
  • undo_tablespace: This parameter tells the instance to which tables it will write its transaction undo. It must be an undo type tablespace.
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個濱河市,隨后出現(xiàn)的幾起案子刊愚,更是在濱河造成了極大的恐慌,老刑警劉巖踩验,帶你破解...
    沈念sama閱讀 206,968評論 6 482
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件鸥诽,死亡現(xiàn)場離奇詭異,居然都是意外死亡晰甚,警方通過查閱死者的電腦和手機衙传,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 88,601評論 2 382
  • 文/潘曉璐 我一進店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來厕九,“玉大人蓖捶,你說我怎么就攤上這事”庠叮” “怎么了俊鱼?”我有些...
    開封第一講書人閱讀 153,220評論 0 344
  • 文/不壞的土叔 我叫張陵,是天一觀的道長畅买。 經(jīng)常有香客問我并闲,道長,這世上最難降的妖魔是什么谷羞? 我笑而不...
    開封第一講書人閱讀 55,416評論 1 279
  • 正文 為了忘掉前任帝火,我火速辦了婚禮溜徙,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘犀填。我一直安慰自己蠢壹,他們只是感情好,可當(dāng)我...
    茶點故事閱讀 64,425評論 5 374
  • 文/花漫 我一把揭開白布九巡。 她就那樣靜靜地躺著图贸,像睡著了一般。 火紅的嫁衣襯著肌膚如雪冕广。 梳的紋絲不亂的頭發(fā)上疏日,一...
    開封第一講書人閱讀 49,144評論 1 285
  • 那天,我揣著相機與錄音撒汉,去河邊找鬼沟优。 笑死,一個胖子當(dāng)著我的面吹牛神凑,可吹牛的內(nèi)容都是我干的净神。 我是一名探鬼主播,決...
    沈念sama閱讀 38,432評論 3 401
  • 文/蒼蘭香墨 我猛地睜開眼溉委,長吁一口氣:“原來是場噩夢啊……” “哼鹃唯!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起瓣喊,我...
    開封第一講書人閱讀 37,088評論 0 261
  • 序言:老撾萬榮一對情侶失蹤坡慌,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后藻三,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體洪橘,經(jīng)...
    沈念sama閱讀 43,586評論 1 300
  • 正文 獨居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 36,028評論 2 325
  • 正文 我和宋清朗相戀三年棵帽,在試婚紗的時候發(fā)現(xiàn)自己被綠了熄求。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點故事閱讀 38,137評論 1 334
  • 序言:一個原本活蹦亂跳的男人離奇死亡逗概,死狀恐怖弟晚,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情逾苫,我是刑警寧澤卿城,帶...
    沈念sama閱讀 33,783評論 4 324
  • 正文 年R本政府宣布,位于F島的核電站铅搓,受9級特大地震影響瑟押,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜星掰,卻給世界環(huán)境...
    茶點故事閱讀 39,343評論 3 307
  • 文/蒙蒙 一多望、第九天 我趴在偏房一處隱蔽的房頂上張望嫩舟。 院中可真熱鬧,春花似錦便斥、人聲如沸至壤。這莊子的主人今日做“春日...
    開封第一講書人閱讀 30,333評論 0 19
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至黎棠,卻和暖如春晋渺,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背脓斩。 一陣腳步聲響...
    開封第一講書人閱讀 31,559評論 1 262
  • 我被黑心中介騙來泰國打工木西, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留,地道東北人随静。 一個月前我還...
    沈念sama閱讀 45,595評論 2 355
  • 正文 我出身青樓八千,卻偏偏與公主長得像,于是被迫代替她去往敵國和親燎猛。 傳聞我的和親對象是個殘疾皇子恋捆,可洞房花燭夜當(dāng)晚...
    茶點故事閱讀 42,901評論 2 345

推薦閱讀更多精彩內(nèi)容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi閱讀 7,294評論 0 10
  • 2018-12-3 陰歷十月二十六 周一 雨綿綿 雨, 纏綿了兩天兩夜重绷, 如江南朦朧沸停, 更似春至三月 輕輕柔...
    99太陽風(fēng)閱讀 696評論 2 6
  • 一、js默認綁定 在全局聲明的對象或者函數(shù)都會被認為是window對象下的昭卓,這時候默認this是綁定到全局作用域下...
    野蠻生長_ed2e閱讀 566評論 0 0