Oracle學(xué)習(xí)筆記(六)
更新時(shí)間:2011年12月28日 22:57:46 作者:
最近需要用的oracle,所以大家好好的學(xué)習(xí)下基礎(chǔ)并整理下資料,希望能幫助到需要的朋友。
一、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、開(kāi)啟和關(guān)閉數(shù)據(jù)庫(kù)
開(kāi)啟數(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、打開(kāi)一個(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ù)
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、開(kāi)啟和關(guān)閉數(shù)據(jù)庫(kù)
開(kāi)啟數(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、打開(kāi)一個(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ù)
相關(guān)文章
oracle 11g導(dǎo)出數(shù)據(jù)時(shí)報(bào)ORA 1455錯(cuò)誤的處理方法
oracle 11g導(dǎo)出數(shù)據(jù)時(shí)報(bào)ORA 1455錯(cuò)誤,原因是由于導(dǎo)出的該用戶的表可能存在空數(shù)據(jù)表,下面是正確的導(dǎo)出步驟2014-08-08Oracle中pivot函數(shù)圖文實(shí)例詳解
pivot操作是一種數(shù)據(jù)處理方法,可以將一個(gè)表中的行數(shù)據(jù)轉(zhuǎn)換為列數(shù)據(jù),這種轉(zhuǎn)換對(duì)于表格數(shù)據(jù)的分析和展示非常有用,下面這篇文章主要給大家介紹了關(guān)于Oracle中pivot函數(shù)的相關(guān)資料,需要的朋友可以參考下2023-05-05Oracle數(shù)據(jù)庫(kù)按時(shí)間進(jìn)行分組統(tǒng)計(jì)數(shù)據(jù)的方法
這篇文章主要介紹了Oracle數(shù)據(jù)庫(kù)按時(shí)間進(jìn)行分組統(tǒng)計(jì)數(shù)據(jù)的方法,同時(shí)附帶了一個(gè)在不同時(shí)間段內(nèi)的統(tǒng)計(jì)實(shí)現(xiàn),需要的朋友可以參考下2015-11-11Oracle計(jì)算時(shí)間差為毫秒的實(shí)現(xiàn)代碼
這里我是用分隔字符串單獨(dú)計(jì)算毫秒部分,如果有更好的辦法,請(qǐng)大家分享一下,下面是查詢時(shí)間差為毫秒的模板,需要的朋友可以參考下2017-03-03Oracle單實(shí)例升級(jí)補(bǔ)丁全過(guò)程記錄
這篇文章主要介紹了Oracle單實(shí)例升級(jí)補(bǔ)丁,oracle19.3升級(jí)補(bǔ)丁到19.18,本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2023-08-08Oracle配置dblink訪問(wèn)PostgreSQL的操作方法
本文給大家介紹下Oracle配置dblink訪問(wèn)PostgreSQL的操作方法,通過(guò)dblink訪問(wèn)PostgreSQL的詳細(xì)過(guò)程,對(duì)Oracle?dblink訪問(wèn)PostgreSQL相關(guān)知識(shí)感興趣的朋友一起看看吧2022-03-03