1.通過(guò)運(yùn)行Oracle Database Configuration Assistant 創(chuàng)建、配置、或刪除數(shù)據(jù)庫(kù)(也可在命令行下輸入dbca);
2.用命令行的方式建立數(shù)據(jù)庫(kù)
3.通過(guò)運(yùn)行自定義的批處理腳本(或create_ORACLE_SID.bat(create_ORACLE_SID.sql))來(lái)創(chuàng)建、配置、或刪除數(shù)據(jù)庫(kù)。
CONNECT / AS SYSDBA
STARTUP PFILE= 'C:oracleadmininit_testorcl.ora' NOMOUNT;
CREATE DATABASE testOrcl DATAFILE '/u02/oracle/testOrcl/system01.dbf' SIZE 100M
LOGFILE GROUP1 ('/u01/oracle/testOrcl/redo1a.log',
'/u02/oracle/testOrcl/redo1b.log') SIZE 500K,
GROUP2 ('/u01/oracle/testOrcl/redo1a.log',
'/u02/oracle/testOrcl/redo1b.log') SIZE 500K
CHARACTER SET ZHS16CGB231280;
--將數(shù)據(jù)庫(kù)直接從未建置狀態(tài)轉(zhuǎn)換到打開狀態(tài)
ALTER DATABASE OPEN;
--刪除數(shù)據(jù)庫(kù)(Dropping a Database)
SPOOL C:DROP_DATABASE.BAT
SELECT 'DEL '||NAME 刪除數(shù)據(jù)庫(kù)相關(guān)數(shù)據(jù)文件 FROM V$DATAFILE;
SELECT 'DEL '||MEMBER 刪除數(shù)據(jù)重構(gòu)日志文件 FROM V$LOGFILE;
SPOOL OFF;