1,建立目录
在$ORACLE_BASE /admin/下
建立$ORACLE_SID
的目录,再创建子目录/adump(存储审计文件的目录) , /bdump (后台进程跟踪文件), /cdump (存储核心堆积文件), /udump(存储用户进程跟踪文件)
[root@oracle ~]# cd $ORACLE_BASE/admin/
[root@oracle admin]# pwd
/oracle/app/admin
[root@oracle admin]# mkdir -p /oracle/app/admin/prod/{a,b,c,u}dump
[root@oracle admin]# ls
orcl prod
[root@oracle admin]# cd prod
[root@oracle prod]# ls
adump bdump cdump udump
2,建立目录
在$ORACLE_BASE/oradata/
下建立$ORACLE_SID
的目录
mkdir -p /oracle/app/oradata/prod/disk{1,2,3,4,5}
3,设置oracle用户环境变量实例名为prod
export ORACLE_SID=prod
4,创建参数文件
cat $ORACLE_HOME/dbs/init.ora | grep -v ^$ | grep -v ^# > initprod.ora
vi initprod.ora
db_name='prod'
memory_target=512M
processes = 300
audit_file_dest='/oracle/app/admin/prod/adump'
audit_trail ='db'
db_block_size=8192
db_domain=''
db_recovery_file_dest='/oracle/app/fast_recovery_area'
db_recovery_file_dest_size=4182M
diagnostic_dest='/oracle/app/'
dispatchers='(PROTOCOL=TCP) (SERVICE=ORCLXDB)'
open_cursors=300
remote_login_passwordfile='EXCLUSIVE'
undo_tablespace='UNDOTBS1'
control_files = ('/oracle/app/oradata/prod/control01.ctl','/u01/app/oracle/oradata/prod/control02.ctl','/u01/app/oracle/oradata/prod/control03.ctl')
compatible ='11.2.0'//注意跟前面路径保持一致
5、创建密码文件
$ cd $ORACLE_HOME/dbs
$ orapwd file=orapwprod password=oracle
6、启动实例(NOMOUNTT 状态)
[oracle@oracle ~]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.4.0 Production on Fri Apr 15 11:49:45 2016
Copyright (c) 1982, 2013, Oracle. All rights reserved.
SQL> conn / as sysdba
Connected.
SQL> startup nomount
7,运行建库脚本
CREATE DATABASE prod
LOGFILE GROUP 1 ('/oracle/app/oradata/prod/redo01.log') SIZE 100M,
GROUP 2 ('/oracle/app/oradata/prod/redo02.log') SIZE 100M,
GROUP 3 ('/oracle/app/oradata/prod/redo03.log') SIZE 100M
MAXLOGFILES 50
MAXLOGMEMBERS 5
MAXLOGHISTORY 10
MAXDATAFILES 100
MAXINSTANCES 1
CHARACTER SET US7ASCII
NATIONAL CHARACTER SET AL16UTF16
DATAFILE '/oracle/app/oradata/prod/system01.dbf' SIZE 325M REUSE
EXTENT MANAGEMENT LOCAL
SYSAUX DATAFILE '/oracle/app/oradata/prod/sysaux01.dbf' SIZE 325M REUSE
DEFAULT TABLESPACE users
DATAFILE '/oracle/app/oradata/prod/users01.dbf' SIZE 100M REUSE
DEFAULT TEMPORARY TABLESPACE tempts
TEMPFILE '/oracle/app/oradata/prod/temp01.dbf'
SIZE 20M REUSE
UNDO TABLESPACE undotbs1
DATAFILE '/oracle/app/oradata/prod/undotbs01.dbf'
SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;
8,运行创建数据字典脚本
//创建数据字典视图
SQL> @?/rdbms/admin/catalog.sql
创建PL/SQL的软件包和过程
SQL> @?/rdbms/admin/catproc.sql
conn system/manager
@$ORACLE_HOME/sqlplus/admin/pupbld.sql