講義軟件課件dba_第1頁
講義軟件課件dba_第2頁
講義軟件課件dba_第3頁
講義軟件課件dba_第4頁
講義軟件課件dba_第5頁
已閱讀5頁,還剩30頁未讀 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領

文檔簡介

1、Managing an Oracle InstanceObjectivesAfter completing this lesson, you should be able to do the following:Create and manage initialization parameter filesConfigure OMFStart up and shut down an instanceMonitor and use diagnostic filesOracle InstanceSGARedo logbufferData buffercacheShared poolData dic

2、t.cacheLibrarycacheDBW0SMONPMONCKPTLGWROthersspfiledb01.oraInitialization Parameter FilesSQL CONNECT / AS SYSDBASQL STARTUP Initialization Parameter FilesEntries are specific to the instance being accessedThere are two kinds of parameters:Explicit: Having an entry in the fileImplicit: No entry withi

3、n the file, but assuming the Oracle default valuesMultiple files can be used for a single database to optimize performance in different situations.Changes to entries in the file take effect based on the type of initialization parameter file used;Static parameter file, PFILE Persistent parameter file

4、, SPFILEPFILEinitSID.oraThe PFILE is a text file that can be modified with an operating system editor.Modifications to the file are made manually.Changes to the file take effect on the next startup.Its default location is $ORACLE_HOME/dbs.PFILE Example# Initialization Parameter File: initdb01.oradb_

5、name = db01instance_name = db01control_files = ( /u03/oradata/db01/control01db01.ctl, /u03/oradata/db01/control02db01.ctl)db_block_size = 4096db_block_buffers = 500shared_pool_size = 31457280 # 30M Shared Pooldb_files = 1024max_dump_file_size = 10240background_dump_dest = /u05/oracle9i/admin/db01/bd

6、umpuser_dump_dest = /u05/oracle9i/admin/db01/udumpcore_dump_dest = /u05/oracle9i/admin/db01/cdumpundo_management = autoundo_tablespace = undtbs. . .SPFILEspfileSID.oraBinary file with the ability to make changes persistent across shutdown and startupMaintained by the Oracle serverRecords parameter v

7、alue changes made with the ALTER SYSTEM commandCan specify whether the change being made is temporary or persistentValues can be deleted or reset to allow an instance to revert to the default valueALTER SYSTEM SET undo_tablespace = UNDO2;Creating an SPFILESPFILE can be created from an initSID.ora fi

8、le using the CREATE SPFILE command, which can be executed before or after instance startup:CREATE SPFILE FROM PFILE;SPFILE Example*.background_dump_dest=$ORACLE_HOME/admin/db01/bdump* patible=9.0.0*.control_files=/u03/oradata/db01/ctrl01db01.ctl,/u03/oradata/db01/ctrl02db01.ctl*.core_dump_dest=$ORAC

9、LE_HOME/admin/db01/cdump*.db_block_buffers=500*.db_block_size=4096*.db_files=40*.db_name=db01*.instance_name=db01*.remote_login_passwordfile=exclusive*.shared_pool_size=31457280 # 30M Shared Pool*.undo_management=AUTOdb01.undo_tablespace=UNDOTBS01db02.undo_tablespace=UNDOTBS02. . .Oracle Managed Fil

10、esOracle Managed Files (OMF) simplify fileadministrationOMF are created and deleted by the Oracle server as directed by SQL commandsOMF are established by setting two parameters:DB_CREATE_FILE_DEST: Set to give the default location for data filesDB_CREATE_ONLINE_LOG_DEST_N: Set to give the default l

11、ocations for online redo logs and control files, up to a maximum of 5 locationsOracle Managed File ExampleTo create a database where data files, control files, and online redo log files are created in separate directories:Set the initialization parameters:Issue the CREATE DATABASE SQL statement.DB_C

12、REATE_FILE_DEST = /u01/oradata/DB_CREATE_ONLINE_LOG_DEST_1 = /u02/oradata/DB_CREATE_ONLINE_LOG_DEST_2 = /u03/oradata/Starting Up a DatabaseNOMOUNTOPENMOUNTNOMOUNTSHUTDOWNInstance startedSTARTUPSHUTDOWNStarting Up a DatabaseMOUNTOPENMOUNTNOMOUNTSHUTDOWNControl file opened for this instanceInstance st

13、artedSTARTUPSHUTDOWNStarting Up a DatabaseOPENOPENMOUNTNOMOUNTSHUTDOWNAll files opened as described by the control file for this instanceControl file opened for this instanceInstance startedSTARTUPSHUTDOWNSTARTUP CommandSTARTUPStart up the instance and open the database:STARTUP PFILE=$ORACLE_HOME/db

14、s/initdb01.oraThe ALTER DATABASE CommandChange the state of the database from NOMOUNT to MOUNT:ALTER DATABASE db01 MOUNT;Open the database as a read-only database:ALTER DATABASE db01 OPEN READ ONLY;Opening a Database in Restricted ModeUse the STARTUP command to restrict access to a database:Use the

15、ALTER SYSTEM command to place an instance in restricted mode:STARTUP RESTRICTALTER SYSTEM ENABLE RESTRICTED SESSION;Opening a Database in Read-Only ModeA databases can be opened as a read-only database.A read-only database can be used to:Execute queriesExecute disk sorts using locally managed tables

16、pacesTake data files offline and online, not tablespacesPerform recovery of offline data files and tablespacesShutting Down the DatabaseShutdown Mode:NORMALTRANSACTIONALIMMEDIATEABORTAxxxxTxxooIxxxoShutdown ModeAllow new connectionsWait until current sessions end Wait until current transactions endF

17、orce a checkpoint and close filesNxoooYESNOxoShutdown OptionsDuring aShutdown Normal,Shutdown TransactionalorShutdown ImmediateConsistent Database(clean database)On the way down:Database buffer cache written to the data files mitted changes rolled backResources released.On the way up:No instance rec

18、overyShutdown OptionsDuring aShutdown AbortorInstance FailureorStartup ForceInconsistent Database(dirty database)On the way down:Modified buffers are not written to the data files mitted changes are not rolled backOn the way up:Redo logs used to reapply changesUndo segments used to roll back mitted

19、changesResources releasedManaging an Instance by Monitoring Diagnostic FilesDiagnostic files contain information about significant events encountered while the instance is operational. Used to resolve problems or to better manage the database on a day-to-day basis.Several types of diagnostic files e

20、xist:alertSID.log fileBackground trace filesUser trace filesAlert Log FileThe alertSID.log file records the commands and Results of major events while the database is operational.It is used for day-to-day operational information or diagnosing database errors.Each entry has a time stamp associated wi

21、th it.The DBA manages the alertSID.log file.Its location is defined by BACKGROUND_DUMP_DEST.Background Trace FilesBackground trace files support information errors detected by any background process.They are used to diagnose and troubleshoot errors.They are created when a background process encounte

22、rs an errorsTheir location is defined by BACKGROUND_DUMP_DESTUser Trace FileA user trace file is produced by the user processconnected to the Oracle server through the server process.A user trace file contains statistics for traced SQL statements or user error messages. It is created when a user encounters user session error

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論