1.设定SID
ORACLE_SID=logdb
export ORACLE_SID
2. 设定其它环境变量
ORALCE_HOME,PATH等。
创建相关目录:
mkdir -p /u01/app/oracle/admin/logdb/adump
mkdir -p /u01/app/oracle/admin/logdb/bdump
mkdir -p /u01/app/oracle/admin/logdb/cdump
mkdir -p /u01/app/oracle/admin/logdb/udump
3.选择数据库管理员的授权方式
选择密码文件方式。
orapwd file=$ORACLE_HOME/dbs/orapwlogdb password=admin entries=5 force=y
file参数必须说明全路径。
Table 1-1 Required Password File Name and Location on UNIX, Linux, and Windows
Platform Required Name Required Location)
UNIX and Linux orapwORACLE_SID ORACLE_HOME/dbs
Windows PWDORACLE_SID.ora ORACLE_HOME\database
4.创建初始化参数文件
Platform Default Name Default Location
UNIX and Linux initORACLE_SID.ora ORACLE_HOME/dbs
For example, the initialization parameter
file for the mynewdb database is named:
initmynewdb.ora
Windows initORACLE_SID.ora ORACLE_HOME\database
# Change '' to point to the oracle base (the one you specify at
# install time)
db_name='logdb' #不要超过8个字符
memory_target=8G
processes = 500
audit_file_dest='/u01/app/oracle/admin/logdb/adump'
audit_trail ='db'
db_block_size=32768
db_domain=''
service_name='logdbsvc'
instance_name='logdb'
local_listener='logdb_listener' #在tnsname.ora中该定义连接串
#db_recovery_file_dest='/flash_recovery_area'
#db_recovery_file_dest_size=2G
diagnostic_dest='/u01/app/oracle'
dispatchers='(PROTOCOL=TCP) (SERVICE=ORCLXDB)'
open_cursors=300
remote_login_passwordfile='EXCLUSIVE'
undo_tablespace='UNDOTBS1'
# You may want to ensure that control files are created on separate physical
# devices
control_files = ('+CRS/logdb/controlfile/ora_control1','+CRS/logdb/controlfile/ora_control2')
compatible ='11.2.0'
log_archive_dest_1='LOCATION=+CRS'
background_dump_dest=/u01/app/oracle/admin/logdb/bdump
core_dump_dest=/u01/app/oracle/admin/logdb/cdump
user_dump_dest=/u01/app/oracle/admin/logdb/udump
5.连接到instance
$ sqlplus /nolog
SQL> CONNECT SYS AS SYSDBA
6.创建服务器参数文件(spfile)
CREATE SPFILE FROM PFILE;
7.启动instance
STARTUP NOMOUNT;
8.执行创建数据库命令
CREATE DATABASE logdb
USER SYS IDENTIFIED BY sys_password
USER SYSTEM IDENTIFIED BY system_password
LOGFILE GROUP 1 ('/u01/logs/my/redo01a.log','/u02/logs/my/redo01b.log') SIZE 100M BLOCKSIZE 512,
GROUP 2 ('/u01/logs/my/redo02a.log','/u02/logs/my/redo02b.log') SIZE 100M BLOCKSIZE 512,
GROUP 3 ('/u01/logs/my/redo03a.log','/u02/logs/my/redo03b.log') SIZE 100M BLOCKSIZE 512
MAXLOGFILES 5
MAXLOGMEMBERS 5
MAXLOGHISTORY 1
MAXDATAFILES 100
CHARACTER SET ZHS16GBK
NATIONAL CHARACTER SET AL16UTF16
EXTENT MANAGEMENT LOCAL
DATAFILE '+DATA2/logdb/system01.dbf' SIZE 325M REUSE
SYSAUX DATAFILE '+DATA/logdb/sysaux01.dbf' SIZE 325M REUSE
DEFAULT TABLESPACE users
DATAFILE '+DATA2/logdb/users01.dbf'
SIZE 500M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED
DEFAULT TEMPORARY TABLESPACE tempts1
TEMPFILE '+DATA2/logdb/temp01.dbf'
SIZE 20M REUSE
UNDO TABLESPACE undotbs
DATAFILE '+DATA2/logdb/undotbs01.dbf'
SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;
阅读(2133) | 评论(0) | 转发(0) |