1、首先設定Oracle_SID=manual
2、建立密碼檔案
進入/u01/app/oracle/product/10.2.0/db_1/dbs目錄下,執行命令建立資料庫密碼檔案
[oracle@myorcl dbs]$ orapwd file=orapmanual password=oracle
3、建立所需的目錄結構
[oracle@myorcl dbs]$ cd /u01/app/oracle/admin/
[oracle@myorcl admin]$ mkdir manual
然後進入manual目錄建立一下檔案
[oracle@myorcl manual]$ ls
adumpbdumpcdumppfileudump
4、建立所需的參數檔案
[oracle@myorcl ~]$ cd /u01/app/oracle/admin/manual/pfile/
[oracle@myorcl pfile]$ vi init.ora
db_name=manual
db_domain=""
sga_target=285212672
pga_aggregate_target=94371840
db_block_size=8192
db_file_multiblock_read_count=16
open_cursors=300
processes=150
background_dump_dest=/u01/app/oracle/admin/manual/bdump
core_dump_dest=/u01/app/oracle/admin/manual/cdump
user_dump_dest=/u01/app/oracle/admin/manual/udump
audit_file_dest=/u01/app/oracle/admin/manual/adump
control_files=("/u01/app/oracle/oradata/manual/control01.ctl",/u01/app/oracle/oradata/manual/control02.ctl)
db_recovery_file_dest=/u01/app/oracle/flash_recovery_area/manual/
db_recovery_file_dest_size=2147483648
log_archive_format=%t_%s_%r.dbf
compatible=10.2.0.1.0
remote_login_passwordfile=EXCLUSIVE
undo_management=AUTO
undo_tablespace=UNDOTBS1
5、使用已建立的參數檔案啟動資料庫執行個體到nomount狀態
SQL>startup nomount pfile=/u01/app/oracle/admin/manual/pfile/init.ora
ORACLE instance started.
Total System Global Area285212672 bytes
Fixed Size1218992 bytes
Variable Size92276304 bytes
Database Buffers188743680 bytes
Redo Buffers2973696 bytes
6、然後執行SQL語句建立資料庫
SQL> create database manual
2datafile '/u01/app/oracle/oradata/manual/system01.dbf' size 300m reuse
3autoextend on next 10240K maxsize unlimited
4extent management local
5sysaux datafile '/u01/app/oracle/oradata/manual/sysaux01.dbf' size 120m reuse
6autoextend on next 1024k maxsize unlimited
7smallfile default temporary tablespace
8temp tempfile '/u01/app/oracle/oradata/manual/temp01.dbf' size 20m reuse
9autoextend on next 640k maxsize unlimited
smallfile undo tablespace "UNDOTBS1"datafile '/u01/app/oracle/oradata/manual/undotbs01.dbf' size 200m reuse autoextend on next 5120k maxsize unlimited
11character set ZHS16GBK
12NATIONAL CHARACTER SET AL16UTF16
13logfile group 1('/u01/app/oracle/oradata/manual/redo01.log') size 51200k,
14group 2('/u01/app/oracle/oradata/manual/redo02.log') size 51200k,
15group 3('/u01/app/oracle/oradata/manual/redo03.log') size 51200k
16user sys identified by oracle
17user system identified by oracle;
Database created.
7、建立使用者預設資料表空間users
SQL> create smallfile tablespace users logging datafile '/u01/app/oracle/oradata/manual/user01.dbf' size 5M reuse autoextend on next 1280K maxsize unlimited extent management local segment space management auto;
8、指定使用者預設資料表空間為users
SQL> alter database default tablespace users;
9、安裝資料字典
SQL> @/u01/app/oracle/product/10.2.0/db_1/rdbms/admin/catalog.sql
SQL> @/u01/app/oracle/product/10.2.0/db_1/rdbms/admin/catproc.sql
10、以system使用者建立PL/SQL資源集
SQL> connect system/oracle
Connected.
SQL> @/u01/app/oracle/product/10.2.0/db_1/sqlplus/admin/pupbld.sql
SQL> @/u01/app/oracle/product/10.2.0/db_1/sqlplus/admin/help/hlpbld.sql helpus.sql
一個簡化版的資料庫建立完成
SQL> select status from v$instance;
STATUS
------------------------------------
OPEN
[oracle@myorcl ~]$ lsnrctl status
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 05-JUL-2013 00:30:43
Copyright (c) 1991, 2005, Oracle.All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
------------------------
AliasLISTENER
VersionTNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date04-JUL-2013 19:58:59
Uptime0 days 4 hr. 31 min. 44 sec
Trace Leveloff
SecurityON: Local OS Authentication
SNMPOFF
Listener Parameter File/u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File/u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=myorcl.oracle.com)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "manual" has 1 instance(s).
Instance "manualorcl", status READY, has 1 handler(s) for this service...
Service "manual_XPT" has 1 instance(s).
Instance "manualorcl", status READY, has 1 handler(s) for this service...
Service "orcl" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclXDB" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orcl_XPT" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully