【正文】
er [cascade]。 ? SQL*LOAD – 它提供了將 ascii格式的數(shù)據(jù)裝載入庫(kù)的工具。 – 熱備份 ? 數(shù)據(jù)庫(kù)啟動(dòng)并以歸檔方式 – online – offline – 冷備份 ? 數(shù)據(jù)庫(kù)關(guān)閉 – 歸檔方式 – 非歸檔方式 ? 邏輯備份 通過 Oracle的實(shí)用程序進(jìn)行的備份 – exp imp 物理備份 ? 確認(rèn)需要備份的文件的位置 – 數(shù)據(jù)文件 ? 以 Oracle用戶的身份進(jìn)入操作系統(tǒng) sqlplus sys/manager select name,status from v$datafile。 NAME TYPE VALUE log_archive_des string ?/dba/arch log_archive_format string %t_% svrmgr 物理備份 ? 確認(rèn)需要備份的文件的位置 – 參數(shù)文件 以 oracle用戶的身份進(jìn)入操作系統(tǒng),并且知道 oracle數(shù)據(jù)庫(kù)的 sid. 假設(shè) sid為 ora805 $cd $ORACLE_HOME/dbs $ls init*.ora (其中 是系統(tǒng)的參數(shù)文件 ) 或者通過下列的命令查詢 instance 的 sid: sqlplus sys/manager。修改參數(shù)文件: initsid.ora 增加下面兩行: log_archive_start=true log_archive_dest=$ORACLE_HOME/dbs/arch 重新啟動(dòng)數(shù)據(jù)庫(kù),這時(shí)數(shù)據(jù)庫(kù)將以 archive log 方式運(yùn)行 . $svrmgrl svrmgrconnect internal。 – 下線的 tablespace的備份 svrmgralter tablespace tablespace_name offline normal。 查詢數(shù)據(jù)庫(kù)的運(yùn)行模式: svrmgrconnect internal。 ? 需要拷貝的數(shù)據(jù)文件為: – 歸檔方式: ? 數(shù)據(jù)文件,控制文件,歸檔的日志文件,配置文件和參數(shù)文件 – 非歸檔方式: ? 數(shù)據(jù)文件,控制文件,聯(lián)機(jī)日志文件,配置文件和參數(shù)文件 邏輯備份 ? 通過 export和 import進(jìn)行的數(shù)據(jù)庫(kù)的備份為邏輯備份。 備份: 使用 exportimport實(shí)現(xiàn)增量數(shù)據(jù)備份和恢復(fù) 將最后一次的 dump文件 imp到 oracle數(shù)據(jù)庫(kù)中。數(shù)據(jù)庫(kù)的各種文件均會(huì)受到介質(zhì)故障的影響。 數(shù)據(jù)庫(kù)性能調(diào)整 utlbstat/utlestat ? 系統(tǒng)運(yùn)行性能分析報(bào)表 – Alter system set timed_statistics=true。需要從數(shù)據(jù)文件或控制文件,日志文件等的備份中進(jìn)行恢復(fù)。 imp sys/manager buffer=4096000 file= ignore=y full=y inctype=restore 恢復(fù) : Oracle 數(shù)據(jù)庫(kù)的備份與恢復(fù) ? 數(shù)據(jù)庫(kù)例程失敗的恢復(fù) – 在由于例程繼續(xù)工作受阻,象操作系統(tǒng)崩潰或電源中斷所導(dǎo)致的例程失敗。 進(jìn)行邏輯備份的舉例 現(xiàn)有一個(gè)數(shù)據(jù)庫(kù),它由 object1 object20, 20個(gè)數(shù)據(jù)對(duì)象組成。 ? 對(duì)于一個(gè) tablespace中所有的數(shù)據(jù)文件均需要進(jìn)行備份,否則整個(gè)tablespace 是無效的。 – 備份控制文件 trace svrmgrconnect internal。 svrmgralter database open。 –熱備份可以兩種: online與 offline的唯一區(qū)別是:數(shù)據(jù)庫(kù)的tablespace 是否在線。 connected svrmgrshow parameter control_file。 – file 定義 export 文件的名字 – buffer 決定在 export時(shí),用來存放卸載數(shù)據(jù)的緩沖區(qū)的大小。 ? 數(shù)據(jù)庫(kù)的實(shí)用程序 – Oracle Export – Oracle Import – Oracle Enterprise Manager 數(shù)據(jù)庫(kù)的實(shí)用程序 ? Export – 它是 Oracle數(shù)據(jù)庫(kù)的一個(gè)實(shí)用程序。 ALTER ROLLBACK SEGMENT rbs01 OFFLINE。 – CLASS COUNT TIME – – data block 0 0 – sort block 0 0 – save undo block 0 0 – segment header 0 0 – save undo header 0 0 – free list 0 0 – system undo header 0 0 – system undo block 0 0 – undo header 0 0 – undo block 0 0 回滾段的大小規(guī)劃 –使用同樣大小的子段 – INITIAL, NEXT應(yīng)用 2KB, 4KB。 允許數(shù)據(jù)文件自動(dòng)擴(kuò)展 ALTER TABLESPACE app_data ADD DATAFILE ?DISK6/?SIZE 200M AUTOEXTEND ON NEXT 10M MAXSIZE 500M。 either list them alphabetically or group them by functionality. Starting the Instance Usually you would start an instance without mounting a database only during database creation or the recreation of control files. Starting an instance includes the following tasks: ? Reading the parameter file init ? Allocating the SGA ? Starting the background processes ? Opening the ALERT file and the trace files The database must be named with the DB_NAME parameter either in the init file or in the STARTUP mand. Mounting the Database To perform specific maintenance operations, you start an instance and mount a database but do not open the database. For example, the database must be mounted but not open during the following tasks: ? Renaming data files ? Enabling and disabling redo log archiving options ? Performing full database recovery Mounting a database includes the following tasks: ? Associating a database with a previously started instance ? Locating and opening the control files specified in the parameter file ? Reading the control files to obtain the names and status of the data files and redo log files (However, no checks are performed to verify the existence of the data files and online redo log files at this time.) Opening the Database Normal database operation means that an instance is started and the database is mounted and open。 – for upfate select empno,sal,m from emp,dept where job=‘ CLERK’ and = and loc=‘ NEW YORK’ for update。 – PL*SQL ? 是 Oracle的一種過程化的SQL語(yǔ)言。 summary In this lesson, you should have learned how to: ? Explain database files: data files, control files, online redo logs ? Explain SGA memory structures: DB buffer cache, shared SQL pool, and redo log buffer ? Explain primary background processes: DBW0, LGWR, CKPT, PMON, SMON, and ARC0 ? Explain SQL processing steps: parse, execute, fetch 數(shù)據(jù)字典 數(shù)據(jù)字典 Data Dictionary ? 數(shù)據(jù)字典 – 數(shù)據(jù)字典是 Oracle數(shù)據(jù)庫(kù)的重要組成。 . 4 server記錄信息顯示事務(wù)已經(jīng)完成,鎖可以被釋放。 ) ? PGA(程序全局區(qū)) – 是內(nèi)存中的區(qū)域,包含單個(gè)進(jìn)程的數(shù)據(jù)和控制信息。 另外在 SGA中還有兩個(gè)可選的內(nèi)存結(jié)構(gòu): ? Java pool: 用來存儲(chǔ) Java代碼。Instance被看成使用各個(gè)操作系統(tǒng)的特定方法 instance 只能同時(shí)打開和使用一個(gè) database 。 ? 一個(gè) extent 由一系列連續(xù)的 Oracle blocks組成。例如 , 為表分配的所有存儲(chǔ)空間就是就是一個(gè) segment。 – 除了 SYSTEM tablespace 或 有活動(dòng)回滾段的 tablespace , tablespaces 可以被離線 (offline)。一個(gè)數(shù)據(jù)庫(kù)需要至少一個(gè)控制文件。數(shù)據(jù)包含在用戶定義的表中,而且數(shù)據(jù)文件還包含數(shù)據(jù)詞典 (data dictionary),數(shù)據(jù)修改以前的映象(beforeimages of modified Data)索引 (indexes)和其他類型的結(jié)構(gòu) (other types of structures)。孟憲順 202331 Genersoft Inc. Oracle DBA Oracle ocp course content Architecture and Administration Oracle結(jié)構(gòu)和維護(hù): 1. Oracle 特點(diǎn)、結(jié)構(gòu) 2. 創(chuàng)建數(shù)據(jù)庫(kù) 3. Oracle 數(shù)據(jù)庫(kù)的訪問 4. Managing an Oracle Instance 5. Maintaining the Control File 6. Maintaining Redo Log Files 7. Managing Tablespaces and Data Files 8. Managing Rollback Segments 9. Managing Users, privileges, roles 概述 ORACLE具有甲骨文之意,是全世界第二大軟件公司。一個(gè)數(shù)據(jù)庫(kù)中至少包含一個(gè)數(shù)據(jù)文件。 其它文件 ? 其他文件 – 參數(shù)文件 用來定義 Oracle實(shí)例的特性。 – Tablespaces 可以在讀 /寫之間切換。 ? 一個(gè) tablespace可能包含一個(gè)或多個(gè) Segment . ? segment不能跨越 tablespace 。 ? 一個(gè) extent 不能跨越 data file, 但必須存在 data file中。 System Global Area SGA是存儲(chǔ)數(shù)據(jù)庫(kù)進(jìn)程共享的數(shù)據(jù)庫(kù)信息的內(nèi)存區(qū)域。