Oracle學(xué)習(xí)筆記(六)
2024-08-29 13:56:09
供稿:網(wǎng)友
一、oracle
oracle服務(wù)器有Oracle instace 和Oracle database
instance有memory structure 和 background process 組成。
memory structure包括shared pool、 SGA(System Global Area).
SGA包括:Database buffer cache 和 Redo log buffer cache.
show sga;
show parameter shared;
show parameter db_cache;
show parameter log;
alter system set shared_pool_size=65M;
Process 包括User process、Server process、Background process;
databasey有data file 和 log file 和 control file組成。
database邏輯結(jié)構(gòu):表空間(tablespaces)、段(segments)、分區(qū)(extents)、塊(blocks)
ODCA(Oracle Database Configuration Assistant)
:創(chuàng)建數(shù)據(jù)庫(kù)
:配置數(shù)據(jù)庫(kù)選項(xiàng)
:刪除數(shù)據(jù)庫(kù)
:管理數(shù)據(jù)庫(kù)模板
二、管理數(shù)據(jù)庫(kù)實(shí)例
1、創(chuàng)建和管理初始參數(shù)文件initialization parameter files
系統(tǒng)參數(shù)文件system parameter file——spfilesid,spfile
初始參數(shù)文件init parameter file——initsid.ora
放置位置在oracle安裝目錄下database文件下
參數(shù)分:顯示參數(shù)explicit、隱式參數(shù)implicit、動(dòng)態(tài)、靜態(tài)
2、configure omf
v$system_parameter動(dòng)態(tài)性能表
創(chuàng)建spfile
create spfile from pfile
create spfile='d:/spfile.ora' from pfile;
創(chuàng)建表空間
create tablespace test1 datafile='d:/12.dbf' size 3M;
3、開啟和關(guān)閉數(shù)據(jù)庫(kù)
開啟數(shù)據(jù)庫(kù)Starting Up a Database
shutdown、nomount、mount、open
nomount——startup instance
used to create db,create controlfile
mount——open controlfile
used to change log mode,rename file,db recovery...
startup [nomount|mount|open]
pfile=
restrict
recovery
force
修改數(shù)據(jù)庫(kù)指令( alter database command)
1、改變數(shù)據(jù)庫(kù)從nomount狀態(tài)為mount;
alter database db_01 mount;
2、打開一個(gè)只讀的數(shù)據(jù)庫(kù)
alter database db_01 open read only;
關(guān)閉數(shù)據(jù)庫(kù)Shutting Down the Database
shutdown mode:normal、transactional、immediate、abort
4、監(jiān)視和使用diagnostic files
alter log file——alertsid.log
background tace file、use trace files
三、創(chuàng)建一個(gè)Oracle數(shù)據(jù)庫(kù)
1、使用ODCA(oracle database configuration assistant)創(chuàng)建數(shù)據(jù)庫(kù)