病情依然在緩慢康復……Oracle基礎的東西,初始引數

louloueva發表於2009-01-02

本來這篇總結是該在2008年寫完的,沒想到最終拖到了2009……

初始引數,這麼基礎的東西怎麼到現在,還沒有詳細總結過?

因為……太麻煩,這些引數,在利用DBCA進行資料庫建立的時候,都有相應的初始值

而一直覺得,這種引數設定,用哪個,去查哪個,現瞭解也來得及

就像命令,搞IT到現在,接觸了成千上萬的命令

我平時不用的,不可能還時不時去溫習溫習

但自從開始面試Oracle職位之後,發現有時對方(多是人事)還就喜歡問些很基礎的東西

另外,雖然這種基礎知識,就算我總結過,真正用的時候,還是一樣得去查文件

可深入過,就會有印象,到時候再撿起來,就方便了

況且,我既然把目標定在Oracla ACE,先不說到底能不能達到

至少我不能因為太基礎,或是懶得弄,而暫時逃避

就像《喰霊~零》所體現的,面對這種事情,不硬著頭皮往上衝,就很難有所突破

[@more@]

嗯,閒言碎語不多講,開始深入總結

Oracle的初始引數是關於資料庫的一些執行方式或數值的設定

Oracle有兩種引數檔案

基本引數檔案,pfile

以未經加密的文字形式儲存,預設存放在/$ORACLE_HOME/dbs目錄下

檔名稱格式,init$ORACLE_SID.ora,比如test資料庫例項就是‘inittest.ora

或者$ORACLE_BASE/admin/例項名/pfile目錄下,檔名會是‘init.ora.隨機數’

利用文字編輯器來修改

伺服器引數檔案,spfile

以二進位制形式儲存的引數檔案

需要在資料庫執行期間利用命令修改(alter system)

通過在SqlPlus下的show parameter spfile命令,可以檢視當前應用的伺服器引數檔案路徑

預設,/$ORACLE_HOME/dbs,檔名為 spfile例項名.ora

或者和資料檔案存放在同目錄

Oracle9i之後,spfile在啟動時的優先順序別高於pfile,以下著重總結spfile

引數檔案的建立由使用者或DBCA來執行

如果是手工建立spfile,需要通過指定pfile來建立

CREATE SPFILE FROM PFILE='pfile路徑/init.ora';

還可以指定要建立的spfile絕對路徑和名稱

CREATE SPFILE='/u01/oracle/dbs/test_spfile.ora'

FROM PFILE='/u01/oracle/dbs/test_init.ora';

Oracle的初始引數分為靜態static和動態dynamic

在利用alter system修改引數的時候,可以指定修改的作用範圍,scope=範圍取值

(這個在以前的總結中用過both)

SPFILE,使用此範圍值,所修改的引數將在下次startup的時候生效

注:針對static引數的修改,只可指定此值

MEMORY,只可修改dynamic引數,立即生效,但並不儲存在spfile中,臨時性的修改

BOTHalter system的預設值,只可修改dynamic引數,立即生效,並永久有效

另外,在永alter system修改引數的時候,可以新增comment子句來編寫說明

還可用deferred子句,來使修改從下一次session連線開始有效

OCA.Oracle.10g.Administration.I.Study.Guide文件中

建議使用者儘量只修改Oracle推薦的30個基本引數

個人就簡單記錄一下這30個引數

Oracle 10g Basic Initialization Parameters

CLUSTER_DATABASE Tells the instance whether it is part of a clustered environment.

這個是表示例項是否屬於叢集環境的一部分

COMPATIBLE Specifies the release level and feature set that you want to be active in the instance.

例項想要實現哪個釋出版本的特性

CONTROL_FILES Designates the physical location of the database control files.

控制檔案路徑

DB_BLOCK_SIZE Specifies the default database block size.

預設資料庫塊大小,與系統塊大小相關,大一些的塊大小,有利於I/O效能的提升

DB_CREATE_FILE_DEST Specifies the directory location where database datafiles will be created if the Oracle Managed Files feature is used.

OMF特性下,資料庫資料檔案路徑

DB_CREATE_ONLINE_LOG_DEST_n Specifies the location(s) where the database redo log files will be created if the Oracle Managed Files feature is used.

OMF特性下,線上redo log路徑

DB_DOMAIN Specifies the logical location of the database on the network.

資料庫在網路中的域名

DB_NAME Specifies the name of the database that is mounted by the instance.

資料庫名

DB_RECOVERY_FILE_DEST Specifies the location where recovery files will be written if the Flash Recovery feature is used.

閃迴檔案路徑,可以是檔案系統,ASM,目錄,不支援裸裝置

DB_RECOVERY_FILE_DEST_SIZE Specifies the amount of disk space available for storing Flash Recovery files.

分配給閃迴檔案路徑的空間

DB_UNIQUE_NAME Specifies a globally unique name for the database within the enterprise.

全域性唯一資料庫名

INSTANCE_NUMBER Identifies the instance in a Real Application Clusters (RAC) environment.

RAC環境中的例項標號

JOB_QUEUE_PROCESSES Specifies the number of background processes to start for handling jobs submitted via Enterprise Manager or DBMS_JOBS.

可提交的任務佇列後臺程式數

LOG_ARCHIVE_DEST_n Specifies as many as nine locations where archived redo log files are to be written.

歸檔日誌目錄

LOG_ARCHIVE_DEST_STATE_n Indicates how the specified locations should be used for log archiving.

歸檔日誌目錄的可用狀態,enabledeferalternate

NLS_LANGUAGE Specifies the default language of the database.

資料庫預設語言

NLS_TERRITORY Specifies the default region or territory of the database.

資料庫區域

OPEN_CURSORS Sets the maximum number of cursors that an individual session can have open at one time.

單一會話中可以開啟的最大遊標數

PGA_AGGREGATE_TARGET Establishes the overall amount of memory that all PGA processes are allowed to consume.

PGA可調整記憶體的總量

PROCESSES Specifies the maximum number of operating system processes that can connect to the instance.

可連線例項的程式最大數,用來限制連線數。啟動不同資料庫特性時,它們所需的後臺程式數也不同

REMOTE_LISTENER Specifies a network name that points to the address or list of addresses of remote Oracle Net listeners.

指向遠端Oracle網路監聽器地址,用於RAC環境中

REMOTE_LOGIN_PASSWORDFILE Determines whether the instance uses a password file and what type.

遠端密碼登陸型別

ROLLBACK_SEGMENTS Specifies only if Automatic Undo Management is not being used.

當沒有使用自動undo管理時,指定回滾段

SESSIONS Determines the maximum number of sessions that can connect to the database.

可連線資料庫的最大會話數

SGA_TARGET Establishes the maximum size of the SGA, within which space is automatically allocated to each SGA component when automatic memory management is used.

SGA可調整最大記憶體數

SHARED_SERVERS Specifies the number of Shared Server processes to start when the instance is started.

例項的共享服務程式數

STAR_TRANSFORMATION_ENABLED Determines whether the optimizer will consider star transformations when queries are executed.

是否啟動查詢轉換

UNDO_MANAGEMENT Establishes whether system undo is automatically or manually managed.

undo表空間管理方式

UNDO_TABLESPACE Specifies which tablespace stores undo segments if the Automatic Undo Management option is used.

指定undo表空間

總結很簡短,很多不過是先有個概念瞭解一下

另外,Oracle® Database Administrator's Guide 10g Release 2 (10.2)B14231-02文件中

有些引數比上面說得詳細,有些則沒有解釋,可能需要查閱其它文件吧(比如關於RAC)

引數檔案是資料庫啟動時候必須的,而它也控制著資料庫啟動後所具有的一些特性

今後的試驗過程中,應該還有機會具體碰到某個引數的設定需要

到時候再詳細地有針對性地來深入總結

希望3號早上起來,病情能痊癒~^_^

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/556359/viewspace-1015607/,如需轉載,請註明出處,否則將追究法律責任。

相關文章