1.确定数据库的名字
prod
[oracle@db253 dbs]$ export ORACLE_SID=prod
2.创建密码文件
[oracle@db253 dbs]$ orapwd file=orapwprod password=oracle
3.创建参数文件
[oracle@db253 dbs]$ vi initprod.ora
db_name=prod
memory_target=512000000
processes = 150
audit_file_dest='/u01/app/oracle/admin/prod/adump'
audit_trail ='db'
db_block_size=8192
db_domain=''
db_recovery_file_dest='/u01/app/oracle/fast_recovery_area'
db_recovery_file_dest_size=2G
diagnostic_dest='/u01/app/oracle'
open_cursors=300
remote_login_passwordfile='EXCLUSIVE'
undo_tablespace='UNDOTBS1'
undo_management=auto
control_files = '/u01/app/oracle/oradata/prod/control01.ctl'
compatible ='11.2.0'
注意:根据参数文件,创建所需要的路径
[oracle@db253 dbs]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Tue Jun 18 16:24:36 2013
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to an idle instance.
SYS@prod> create spfile from pfile;
File created.
SYS@prod> startup nomount;
ORACLE instance started.
Total System Global Area 514736128 bytes
Fixed Size 1345996 bytes
Variable Size 314574388 bytes
Database Buffers 192937984 bytes
Redo Buffers 5877760 bytes
4.create database
[oracle@db253 dbs]$ cat createdb.sql
CREATE DATABASE prod
USER SYS IDENTIFIED BY oracle
USER SYSTEM IDENTIFIED BY oracle
LOGFILE GROUP 1 ('/u01/app/oracle/oradata/prod/redo01.log') SIZE 100M BLOCKSIZE 512,
GROUP 2 ('/u01/app/oracle/oradata/prod/redo02.log') SIZE 100M BLOCKSIZE 512,
GROUP 3 ('/u01/app/oracle/oradata/prod/redo03.log') SIZE 100M BLOCKSIZE 512
MAXLOGFILES 5
MAXLOGMEMBERS 5
MAXLOGHISTORY 1
MAXDATAFILES 100
CHARACTER SET AL32UTF8
NATIONAL CHARACTER SET AL16UTF16
EXTENT MANAGEMENT LOCAL
DATAFILE '/u01/app/oracle/oradata/prod/system01.dbf' SIZE 325M REUSE
SYSAUX DATAFILE '/u01/app/oracle/oradata/prod/sysaux01.dbf' SIZE 325M REUSE
DEFAULT TABLESPACE users
DATAFILE '/u01/app/oracle/oradata/prod/users01.dbf'
SIZE 500M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED
DEFAULT TEMPORARY TABLESPACE tempts1
TEMPFILE '/u01/app/oracle/oradata/prod/temp01.dbf'
SIZE 20M REUSE
UNDO TABLESPACE undotbs1
DATAFILE '/u01/app/oracle/oradata/prod/undotbs01.dbf'
SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;
[oracle@db253 dbs]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Tue Jun 18 16:29:43 2013
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SYS@prod> @createdb.sql
Database created.
5.执行两个脚本
SYS>@?/rdbms/admin/catalog.sql
SYS>@?/rdbms/admin/catproc.sql
SYSTEM>@?/sqlplus/admin/pupbld.sql
***************************************************
[oracle@db253 homework]$ oerr ora 00845
00845, 00000, "MEMORY_TARGET not supported on this system"
// *Cause: The MEMORY_TARGET parameter was not supported on this operating system or /dev/shm was not sized correctly on Linux.
// *Action: Refer to documentation for a list of supported operating systems. Or, size /dev/shm to be at least the SGA_MAX_SIZE on each Oracle instance running on the system.
[oracle@db253 homework]$ df -h | grep shm
tmpfs 506M 264M 242M 53% /dev/shm
root#vi /etc/fstab
tmpfs /dev/shm tmpfs defaults,size=2048m 0 0
[root@db253 mnt]# mount -o remount /dev/shm
[root@db253 mnt]# df -h | grep shm
tmpfs 2.0G 264M 1.8G 13% /dev/shm