Oracle基礎結構認知—初識oracle【轉】

來源:互聯網
上載者:User

標籤:name   ssi   arc   使用者   系統檔案   dash   round   會話   pst   

Oracle伺服器(oracle server)由執行個體和資料庫組成。其中,執行個體就是所謂的關係型資料庫管理系統(Relational Database Management System,RDBMS),用來提供相關的資料庫管理功能;而資料庫則由Oracle資料庫檔案組成,用來儲存資料。執行個體可以進一步細分為系統全域地區(System Global Area,SGA)和後台進程(Background Processes)。資料庫也可以再細分為資料檔案(data files)、控制檔案(control files)和聯機重做記錄檔(Online Redo Log file)。其中,執行個體的SGA是使用作業系統的記憶體空間,後台進程需要使用CPU與記憶體資源,組成的資料庫檔案則存放在硬碟中。在一個多使用者的訪問資料環境中可靠的管理大量的資料並允許多使用者對相同資料的訪問,所有這一切都必須完成的同時還要提供高效能。一個Oracle伺服器還必須防止未經授權的訪問,並提供故障恢複的有效解決。

Oracle資料庫(Oracle database)Oracle資料庫由作業系統檔案,也稱為資料庫檔案,提供實際的實體儲存體資料庫資訊。資料庫檔案用於確保資料是一致的,可以恢複在出現故障的執行個體。

Oracle執行個體(oracle instance)由後台進程和記憶體結構(SGA)組成,用於和作業系統進行聯絡的標識,也就是說資料庫和作業系統之間的互動使用的是資料庫執行個體.資料庫名和執行個體名可以相同也可以不同。在一般情況下,執行個體名和資料庫名是一對一的關係,但如果在oracle並行伺服器架構(即oracle即時應用叢集)中,資料庫名和執行個體名是一對多的關係。資料庫執行個體名與ORACLE_SID兩者都表示oracle執行個體,但是有區別的。instance_name是oracle資料庫參數。而ORACLE_SID是作業系統的環境變數。ORACLD_SID用於與作業系統互動,也就是說,從作業系統的角度訪問執行個體名,必須通過ORACLE_SID.

***操作資料庫***

1. 串連到資料庫:sqlplus “/as sysdba”

oracle查看資料庫執行個體

2. 停止資料庫:shutdown immediate

3. 啟動資料庫執行個體(instance):startup nomount

4. 啟動資料庫(database),這時讀取了control file檔案:alter database mount;

5. 開啟資料庫服務,其實完成了資料檔案及記錄檔的校正:alter database open;

6. 直接載入啟動:startup

oracle啟動掛載資料庫

***system global area***

Instance——memory structure (shared pool [library cache,data dictionary cache],Database buffer cache,redo log buffer cache)

Background process(pmon,smon,dbwr,lgwr,ckpt,others)

Database——data file

Log file

Control file

Dictionary cache=row cache

*一個資料庫可以有多個執行個體,一個執行個體只能操作一個資料庫。

*查看後台進程

Set wrap off

Set linesize 200;

Col name for a30

Select * from v$bgprocess;

Select * from v$bgprocess wehre paddr <>’00’;

*parameter process:pmon,smon,lgwr,dbwn,ckpt,reco

*optional process:不做闡述

*查看記錄檔

1.查看控制檔案:select * from v$controlfile;

2.查看資料檔案:select * from v$datafile;

3.查看記錄檔:select * from v$logfile;

*查看共用池: show parameter shared

*查看資料緩衝:show parameter db_cache

*查看日誌緩衝:show parameter log

*查看SGA大小:show parmeter sga

*調整db_cache: alter system set db_cache_size=64m;

*修改會話語言提示:alter session set nls_language=American;

*查看db相關參數:show parameter db

查看oracle資料庫參數

*關於db_cache修改開啟相關參數:alter system set db_cache_advice=on;

*查看large_pool_cache大小:show parameter large

*修改large_pool大小:alter system large_pool_size=20m;

*查看oracle歸檔模式:archive log list

*查看oracle歸檔日誌參數:show parameter log_archive_dest

*查看oracle歸檔日誌所在路徑:show parameter db_recovery_file_dest

*查看oracle資料庫具有管理員權限的:select * from v$pwfile_users;

*建立備份pfile檔案:create spfile=’/databack/files/spfile.ora’ from pfile;

*建立備份spfile檔案:create pfile=’/dadaback/files/init.ora’ from spfile;

*查看資料庫檔案類型的數量:show parameter db_create

 

轉自

https://www.toutiao.com/i6498649602999190030/

 

Oracle基礎結構認知—初識oracle【轉】

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.