oracle在建立執行個體的時候,多數采用的是dbca的形式。。其實手動建庫可以提供更大的自由發揮的空間,根據情況進行定制
登入oracle使用者
指定sid(instance identifier)
確定必須的環境變量已經設定,大多數平台上 oracle_sid 和 oracle_home 必須設定
export oracle_sid=ocm
export oracle_home=/u01/app/oracle/product/11.2.0/dbhome_1
選擇 dba 的認證方式
密碼檔案: password file
作業系統認證
提前把init檔案中的檔案夾建好
連上執行個體(instance)
密碼檔案:
作業系統認證:
建立spfile
sql> create spfile from pfile;
啟動執行個體到nomount
sql> startup nomount;
oracle instance started.
total system global area 1068937216 bytes
fixed size 2235208 bytes
variable size 616563896 bytes
database buffers 444596224 bytes
redo buffers 5541888 bytes
執行建立資料庫的語句(提前建好檔案夾)
替換密碼sys_password
替換undo表空間的名稱
create database orcl
user sys identified by sys_password
user system identified by system_password
logfile group 1 ('/u01/app/oracle/oradata/orcl/redo01a.log','/u02/logs/orcl/redo01b.log') size 100m blocksize 512,
maxlogfiles 5
maxlogmembers 5
maxloghistory 1
maxdatafiles 100
character set al32utf8
national character set al16utf16
--或者national character set utf8
--選用national character set al32utf8會報錯
extent management local
datafile '/u01/app/oracle/oradata/orcl/system01.dbf' size 325m reuse
sysaux datafile '/u01/app/oracle/oradata/orcl/sysaux01.dbf' size 325m reuse
default tablespace users
default temporary tablespace tempts1
undo tablespace undotbs1
建立資料字典視圖
用 sysdba 權限執行
@?/rdbms/admin/catalog.sql
@?/rdbms/admin/catproc.sql
@?/rdbms/admin/utlrp.sql
用 system 使用者執行
@?/sqlplus/admin/pupbld.sql
至此資料庫安裝完畢
sql> select open_mode from v$database;
read write
1 row selected.
fixed size 2235208 bytes
variable size 620758200 bytes
database buffers 440401920 bytes
redo buffers 5541888 bytes
sql> alter database mount exclusive;
database altered.
sql> alter system enable restricted session;
system altered.
sql> drop database;
database dropped.
disconnected from oracle database 11g enterprise edition release 11.2.0.3.0 - 64bit production
with the partitioning, olap, data mining and real application testing options
輸入 dbca 進行安裝
打開閃回和歸檔。 閃回模式允許我們回到資料庫的更早的時刻。
檢查設定