Listen Software解決方案 "How To" 系列4:創(chuàng)建數(shù)據(jù)庫
2024-07-21 02:08:46
供稿:網(wǎng)友
listen software解決方案 “how to” 系列4:創(chuàng)建數(shù)據(jù)庫
計(jì)劃數(shù)據(jù)庫文件位置
三組重演日志文件,每組有兩個(gè)成員文件
創(chuàng)建數(shù)據(jù)文件的文件結(jié)構(gòu)
手工創(chuàng)建數(shù)據(jù)庫
1.設(shè)定唯一的實(shí)例名和數(shù)據(jù)庫字符集
2.設(shè)置操作系統(tǒng)變量
(unix)
oracle_home
oracle_sid
oracle_base
ora_nls33
path
(nt)
oradim80 -new -sid u16
-intpwd password -startmode auto
-pfile oracle_home/database/initu16.ora
you must decide the sid, password, and
create the parameter
file (initu16.ora)
set oracle_sid=u16
set local=2:u16
語句1:使u16成為當(dāng)前sid
語句2: 覆蓋local環(huán)境變量
3. 準(zhǔn)備參數(shù)文件
使用init.ora作為參數(shù)文件模板
db_name=數(shù)據(jù)庫標(biāo)識(shí)符(最多為8個(gè)字符)
control_files=三個(gè)控制文件的位置
db_block_size=數(shù)據(jù)庫塊的大小(數(shù)據(jù)庫創(chuàng)建后不能修改)
4. 創(chuàng)建密碼文件
5. 啟動(dòng)實(shí)例
startup nomount pfile=initu16.ora
6. 創(chuàng)建數(shù)據(jù)庫
從server manager上手工創(chuàng)建
create database "u16"
maxlogfiles 6
maxlogmembers 6
maxdatafiles 30
maxloghistory 100
archivelog
logfile
group 1
'e:/data/u16/group1/log1a.rdo' size 200k,
'e:/data/u16/group1/log1b.rdo' size 200k
group 2
'e:/data/u16/group2/log2a.rdo' size 200k,
'e:/data/u16/group2/log2b.rdo' size 200k
group 3
'e:/data/u16/group3/log3a.rdo' size 200k,
'e:/data/u16/group3/log3b.rdo' size 200k
datafile
'e:/data/u16/datafiles ystem01.dbf'
size 30m
character set we8iso8859p1;
查看數(shù)據(jù)庫狀態(tài)
select name,created,log_mode from v$database;
查看線程
select status, instance from v$thread;
查看數(shù)據(jù)文件
select name from v$datafile;
查看日志文件
select member from v$logfile;
查看控制文件
select name from v$controlfile;
檢驗(yàn)系統(tǒng)創(chuàng)建狀態(tài)
select file_name from dba_data_files
where tablespace_name='system';
查看數(shù)據(jù)庫用戶
select username, created from dba_users;
7.運(yùn)行腳本生成數(shù)據(jù)詞典,完成以前創(chuàng)建步驟
創(chuàng)建數(shù)據(jù)詞典
catalog.sql
生成pl/sql使用的對(duì)象
catproc.sql
8.維護(hù)重演日志文件
確定歸檔狀態(tài)
select log_mode from v$database;
確定自動(dòng)歸檔可用
select archiver from v$instance;
添加新的日志文件組
alter database add logfile
(
'c:/data/log3a.rdo',
'e:/data/log3b.rdo'
) size 200k;
查看日志文件信息
select * from v$log_file;