一、 准备相关目录
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
mkdir -p $ORACLE_BASE/admin/wailon/{a,b,c,d,u}dump
mkdir -p /u01/app/oradata/wailon
二、 设置ORACLE用户环境变量.bash_profile
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
ORACLE_SID=wailon
export ORACLE_BASE ORACLE_HOME ORACLE_SID
PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
export PATH
$source .bash_profile
三、 创建密码文件
cd $ORACLE_HOME/dbs
orapwd file=orapwwailon password=oracle entries=10
四、 创建pfile参数文件
cat init.ora | grep -v ^# | grep -v ^$ >> initwailon.ora
vi initwailon.ora
---------------------------------------------------------------------------------------
compatible=10.2.0
db_name=wailon
sga_target=500m
audit_file_dest='/u01/app/oracle/admin/wailon/adump'
background_dump_dest='/u01/app/oracle/admin/wailon/bdump'
core_dump_dest='/u01/app/oracle/admin/wailon/cdump'
user_dump_dest='/u01/app/oracle/admin/wailon/udump'
control_files='/u01/app/oradata/wailon/control01.ctl', '/u01/app/oradata/wailon/control02.ctl'
db_recovery_file_dest='/u01/app/flash_recovery_area'
db_recovery_file_dest_size=2g
undo_tablespace=undotbs01
undo_management=auto
五、 启动数据库到NOMOUNT状态
sqlplus / as sysdba
startup nomount;
六、 创建数据库
create database wailon
user sys identified by oracle
user system identified by oracle
maxinstances 8
maxlogfiles 32
maxlogmembers 3
maxloghistory 1
maxdatafiles 100
datafile '/u01/app/oradata/wailon/system01.dbf' size 500m autoextend on
extent management local
sysaux datafile '/u01/app/oradata/wailon/sysaux01.dbf' size 500m
default tablespace user01 datafile '/u01/app/oradata/wailon/user01.dbf' size 100m
undo tablespace undotbs01 datafile '/u01/app/oradata/wailon/untotbs01.dbf' size 100m
default temporary tablespace temp01 tempfile '/u01/app/oradata/wailon/temp01.dbf' size 100m
logfile
group 1 '/u01/app/oradata/wailon/redo01.log' size 50m,
group 2 '/u01/app/oradata/wailon/redo02.log' size 50m,
group 3 '/u01/app/oradata/wailon/redo03.log' size 50m
character set zhs16gbk
national character set al16utf16;
七、 创建SPFILE
create spfile from pfile;
shutdown immediate;
startup;
八、 创建数据字典
sqlplus / as sysdba
SQL> @?/rdbms/admin/catalog.sql
SQL> @?/rdbms/admin/catproc.sql
--创建用户安全审核表
SQL> connect system/oracle
SQL> @?/sqlplus/admin/pupbld.sql
--创建SCOTT用户
SQL> @?/rdbms/admin/utlsampl
至此,一个库成功创建。手工建库有助进一步熟悉ORACLE体系结构。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/429786/viewspace-776339/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/429786/viewspace-776339/