作為數據庫管理員大部分時候要創建自己的數據庫實例
for rman或者更改db_block_size等
但手工建庫步驟復雜
令人生畏
所以找了個腳本供大家參考
腳本上有各個步驟地說明
比較好用!
手工創建數據庫的全部腳本及說明
系統環境
操作系統
Windows
Server
機器內存
M
數據庫
Oracle
i R
(
) for NT 企業版
安裝路徑
D:\ORACLE
建庫步驟
手工創建相關目錄
D:\Oracle\admin\test
D:\Oracle\admin\test\adhoc
D:\Oracle\admin\test\bdump
D:\Oracle\admin\test\cdump
D:\Oracle\admin\test\create
D:\Oracle\admin\test\exp
D:\Oracle\admin\test\pfile
D:\Oracle\admin\test\udump
D:\Oracle\oradata\test
D:\Oracle\oradata\test\archive
手工創建初始化啟動參數文件
D:\Oracle\admin\test\pfile\inittest
ora
內容
手工創建D:\Oracle\Ora
\DATABASE\inittest
ora文件
內容
IFILE=
D:\Oracle\admin\test\pfile\inittest
ora
使用orapwd
exe命令
創建D:\Oracle\Ora
\DATABASE\PWDtest
ora
命令
D:\Oracle\Ora
\bin\orapwd file=D:\Oracle\Ora
\DATABASE\PWDtest
ora password=ORACLE entries=
通過oradim
exe命令
在服務裡生成一個新的實例管理服務
啟動方式為手工
set ORACLE_SID=test
D:\Oracle\Ora
\bin\oradim
new
sid test
startmode manual
pfile
D:\Oracle\admin\test\pfile\inittest
ora
生成各種數據庫對象
D:\>svrmgrl
創建數據庫
connect INTERNAL/oracle
startup nomount pfile=
D:\Oracle\admin\test\pfile\inittest
ora
CREATE DATABASE test
LOGFILE
D:\Oracle\oradata\test\redo
log
SIZE
K
D:\Oracle\oradata\test\redo
log
SIZE
K
D:\Oracle\oradata\test\redo
log
SIZE
K
MAXLOGFILES
MAXLOGMEMBERS
MAXLOGHISTORY
DATAFILE
D:\Oracle\oradata\test\system
dbf
SIZE
M REUSE AUTOEXTEND ON NEXT
K
MAXDATAFILES
MAXINSTANCES
CHARACTER SET ZHS
GBK
NATIONAL CHARACTER SET ZHS
GBK;
控制文件
日志文件在上面語句執行時生成
connect INTERNAL/oracle
修改系統表空間
ALTER TABLESPACE SYSTEM DEFAULT STORAGE ( INITIAL
K NEXT
K MINEXTENTS
MAXEXTENTS UNLIMITED PCTINCREASE
);
ALTER TABLESPACE SYSTEM MINIMUM EXTENT
K;
創建回滾表空間
CREATE TABLESPACE RBS DATAFILE
D:\Oracle\oradata\test\rbs
dbf
SIZE
M REUSE
AUTOEXTEND ON NEXT
K
MINIMUM EXTENT
K
DEFAULT STORAGE ( INITIAL
K NEXT
K MINEXTENTS
MAXEXTENTS
);
創建用戶表空間
CREATE TABLESPACE USERS DATAFILE
D:\Oracle\oradata\test\users
dbf
SIZE
M REUSE
AUTOEXTEND ON NEXT
K
MINIMUM EXTENT
K
DEFAULT STORAGE ( INITIAL
K NEXT
K MINEXTENTS
MAXEXTENTS
PCTINCREASE
);
創建臨時表空間
CREATE TABLESPACE TEMP DATAFILE
D:\Oracle\oradata\test\temp
dbf
SIZE
M REUSE
AUTOEXTEND ON NEXT
K
MINIMUM EXTENT
K
DEFAULT STORAGE ( INITIAL
K NEXT
K MINEXTENTS
MAXEXTENTS UNLIMITED PCTINCREASE
) TEMPORARY;
創建工具表空間
CREATE TABLESPACE TOOLS DATAFILE
D:\Oracle\oradata\test\tools
dbf
SIZE
M REUSE
AUTOEXTEND ON NEXT
K
MINIMUM EXTENT
K
DEFAULT STORAGE ( INITIAL
K NEXT
K MINEXTENTS
MAXEXTENTS
PCTINCREASE
);
創建索引表空間
CREATE TABLESPACE INDX DATAFILE
D:\Oracle\oradata\test\indx
dbf
SIZE
M REUSE
AUTOEXTEND ON NEXT
K
MINIMUM EXTENT
K
DEFAULT STORAGE ( INITIAL
K NEXT
K MINEXTENTS
MAXEXTENTS
PCTINCREASE
);
創建回滾段
CREATE PUBLIC ROLLBACK SEGMENT RBS
TABLESPACE RBS STORAGE ( OPTIMAL
K );
CREATE PUBLIC ROLLBACK SEGMENT RBS
TABLESPACE RBS STORAGE ( OPTIMAL
K );
CREATE PUBLIC ROLLBACK SEGMENT RBS
TABLESPACE RBS STORAGE ( OPTIMAL
K );
CREATE PUBLIC ROLLBACK SEGMENT RBS
TABLESPACE RBS STORAGE ( OPTIMAL
K );
CREATE PUBLIC ROLLBACK SEGMENT RBS
TABLESPACE RBS STORAGE ( OPTIMAL
K );
CREATE PUBLIC ROLLBACK SEGMENT RBS
TABLESPACE RBS STORAGE ( OPTIMAL
K );
CREATE PUBLIC ROLLBACK SEGMENT RBS
TABLESPACE RBS STORAGE ( OPTIMAL
K );
CREATE PUBLIC ROLLBACK SEGMENT RBS
TABLESPACE RBS STORAGE ( OPTIMAL
K );
CREATE PUBLIC ROLLBACK SEGMENT RBS
TABLESPACE RBS STORAGE ( OPTIMAL
K );
CREATE PUBLIC ROLLBACK SEGMENT RBS
TABLESPACE RBS STORAGE ( OPTIMAL
K );
CREATE PUBLIC ROLLBACK SEGMENT RBS
TABLESPACE RBS STORAGE ( OPTIMAL
K );
CREATE PUBLIC ROLLBACK SEGMENT RBS
TABLESPACE RBS STORAGE ( OPTIMAL
K );
CREATE PUBLIC ROLLBACK SEGMENT RBS
TABLESPACE RBS STORAGE ( OPTIMAL
K );
CREATE PUBLIC ROLLBACK SEGMENT RBS
TABLESPACE RBS STORAGE ( OPTIMAL
K );
CREATE PUBLIC ROLLBACK SEGMENT RBS
TABLESPACE RBS STORAGE ( OPTIMAL
K );
CREATE PUBLIC ROLLBACK SEGMENT RBS
TABLESPACE RBS STORAGE ( OPTIMAL
K );
CREATE PUBLIC ROLLBACK SEGMENT RBS
TABLESPACE RBS STORAGE ( OPTIMAL
K );
CREATE PUBLIC ROLLBACK SEGMENT RBS
TABLESPACE RBS STORAGE ( OPTIMAL
K );
CREATE PUBLIC ROLLBACK SEGMENT RBS
TABLESPACE RBS STORAGE ( OPTIMAL
K );
CREATE PUBLIC ROLLBACK SEGMENT RBS
TABLESPACE RBS STORAGE ( OPTIMAL
K );
CREATE PUBLIC ROLLBACK SEGMENT RBS
TABLESPACE RBS STORAGE ( OPTIMAL
K );
CREATE PUBLIC ROLLBACK SEGMENT RBS
TABLESPACE RBS STORAGE ( OPTIMAL
K );
CREATE PUBLIC ROLLBACK SEGMENT RBS
TABLESPACE RBS STORAGE ( OPTIMAL
K );
CREATE PUBLIC ROLLBACK SEGMENT RBS
TABLESPACE RBS STORAGE ( OPTIMAL
K );
CREATE PUBLIC ROLLBACK SEGMENT RBS
TABLESPACE RBS STORAGE ( OPTIMAL
K );
使回滾段在線
ALTER ROLLBACK SEGMENT
RBS
ONLINE;
ALTER ROLLBACK SEGMENT
RBS
ONLINE;
ALTER ROLLBACK SEGMENT
RBS
ONLINE;
ALTER ROLLBACK SEGMENT
RBS
ONLINE;
ALTER ROLLBACK SEGMENT
RBS
ONLINE;
ALTER ROLLBACK SEGMENT
RBS
ONLINE;
ALTER ROLLBACK SEGMENT
RBS
ONLINE;
ALTER ROLLBACK SEGMENT
RBS
ONLINE;
ALTER ROLLBACK SEGMENT
RBS
ONLINE;
ALTER ROLLBACK SEGMENT
RBS
ONLINE;
ALTER ROLLBACK SEGMENT
RBS
ONLINE;
ALTER ROLLBACK SEGMENT
RBS
ONLINE;
ALTER ROLLBACK SEGMENT
RBS
ONLINE;
ALTER ROLLBACK SEGMENT
RBS
ONLINE;
ALTER ROLLBACK SEGMENT
RBS
ONLINE;
ALTER ROLLBACK SEGMENT
RBS
ONLINE;
ALTER ROLLBACK SEGMENT
RBS
ON
From:http://tw.wingwit.com/Article/program/Oracle/201311/17193.html