MDA/MDD/TDD/DDD/DDDDDDD
          posts - 536, comments - 111, trackbacks - 0, articles - 0
            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

          oracle的參數以及pfile和spfile

          Posted on 2009-07-31 00:19 leekiang 閱讀(706) 評論(0)  編輯  收藏 所屬分類: oracle
          對這些東西都沒什么整體概念,以下是東抄西抄的。

          1,Select isspecified,count(*) from v$spparameter group by isspecified;
          ?如果isspecified里有true,表明用spfile進行了指定配置
          ?如果全為false,則表明用pfile啟動

          2,spfile是二進制的

          3,http://snakeskin.javaeye.com/blog/155136
          db_buffer_size=db_block_buffers*db_block_size, db_block_size為數據庫默認值, 不要修改
          pfile不要有SGA_TARGET這個參數, 也不要有db_cache_size這個參數, SGA_MAX_SIZE也不需要

          1)創建pfile
          SQL>create pfile from spfile
          這樣就在d:/oracle/product/10.1.0/db_1/database目錄下面多1個文件INITorcl.ORA
          或者copy d:/oracle/product/10.1.0/admin/orcl/pfile/init.ora.XXXXXXXX到上述目錄, 名字改成INITorcl.ORA
          init.ora.XXXX也是個pfile文件, 不妨試著用這個文件啟動你的數據庫
          SQL>startup pfile='d:/oracle/product/10.1.0/admin/orcl/pfile/init.ora.XXXXXXXX'
          特別是你改動參數導致數據庫無法啟動的情況下, 用這個文件恢復你的spfile將非常有用
          SQL>create spfile from pfile='d:/oracle/product/10.1.0/admin/orcl/pfile/init.ora.XXXXXXXX'

          2)修改pfile的內容
          修改后主要內容為
          sga_target=1700000000(1.7G左右)
          lock_sga=true
          pre_aggregate_tagert=250000000(250M左右)
          workarea_size_policy=auto
          pre_page_sga=true
          sga_max_size=1720000000(1.72G左右)

          3)根據pfile啟動數據庫
          SQL>startup pfile='d:/oracle/product/10.1.0/db_1/database/INITorcl.ORA'
          如果不能啟動, 可能是某些參數的原因, 那么就修改INIToracl.ORA的配置文件, 直到能正常啟動為止.

          4,http://www.orafaq.com/node/5

          What is the difference between a PFILE and SPFILE:

          A PFILE is a static, client-side text file that must be updated with a standard text editor like "notepad" or "vi". This file normally reside on the server, however, you need a local copy if you want to start Oracle from a remote machine. DBA's commonly refer to this file as the INIT.ORA file.

          An SPFILE (Server Parameter File), on the other hand, is a persistent server-side binary file that can only be modified with the "ALTER SYSTEM SET" command. This means you no longer need a local copy of the pfile to start the database from a remote machine. Editing an SPFILE will corrupt it, and you will not be able to start your database anymore.

          5,怎樣查看一個參數修改是否需要重啟數據庫

          select name,value ,ISSYS_MODIFIABLE from v$parameter
          如果ISSYS_MODIFIABLE 返回的是false,說明該參數無法用alter system語句動態修改,需要重啟數據庫


          6,用命令修改參數

          alter system set java_pool_size=2 scope=spfile ;

          scope=spfile 的修改是需要重啟數據庫
          scope=both 實時生效和寫入spfile,不需要重啟數據庫
          scope=memory 實時生效,但不寫spfile,這樣如果重啟數據庫,則恢復原來的參數值

          每個參數能修改的scope是不一樣的,可以查詢v$parameter了解參數能被修改的類型

          見http://bbs.chinaunix.net/archiver/?tid-974075.html

          10,

          http://www.cnblogs.com/jacktu/archive/2008/02/27/1083232.html

          http://topic.csdn.net/u/20090227/16/fb3d88ed-f2ca-44ed-8097-dc363054515c.html


          主站蜘蛛池模板: 娱乐| 渭源县| 搜索| 婺源县| 新沂市| 乌拉特前旗| 朝阳县| 油尖旺区| 长乐市| 聂荣县| 延川县| 子长县| 凉山| 阿拉尔市| 墨玉县| 仁寿县| 无棣县| 醴陵市| 四平市| 海兴县| 广安市| 宁安市| 花莲市| 南溪县| 绥滨县| 江门市| 武宁县| 尼玛县| 池州市| 德阳市| 鄂温| 长子县| 北流市| 青冈县| 保康县| 大冶市| 韶关市| 惠东县| 九龙县| 南阳市| 伊川县|