#1. 创建实例(linux下实例不需要服务所以不用创建,oradim–new –sid lmqq)
#2.复制pfile
cp /oracle/database/11g/dbs/init.ora /oracle/database/11g/dbs/initlmqq.ora
#3.创建需要的诊断目录,这些目录都是ORACLE进程遇到错误或用户手动TRACE时需要的。
mkdir -p $ORACLE_BASE/admin/lmqq/adump
mkdir -p $ORACLE_BASE/admin/lmqq/bdump
mkdir -p $ORACLE_BASE/admin/lmqq/cdump
mkdir -p $ORACLE_BASE/admin/lmqq/udump
mkdir -p $ORACLE_BASE/admin/lmqq/pfile
mkdir -p $ORACLE_BASE/oradata/lmqq #数据文件目录,确保pfile和createdatabase.sql里所涉及目录都创建好
#4.修改pfile里的实例名 确保local_listener为空
#5.启动实例
Sql>startup nomount pfile=/oracle/database/11g/dbs/initlmqq.ora
#6.创建spfile
Sql>create spfile from pfile;
#7.确认启动的实例名
Sql>show parameter instance_name;
#8.执行创建数据库脚本
create database lmqq
datafile '/oracle/database/oradata/lmqq/system.dbf' size 300m
sysaux datafile '/oracle/database/oradata/lmqq/sysaux.dbf' size 300M
undo tablespace UNDOTBS1datafile '/oracle/database/oradata/lmqq/undotbs.dbf' size 100M
default temporary tablespace temptempfile '/oracle/database/oradata/lmqq/temp.dbf' size 50m
character set ZHS16GBKnational character set ZHS16GBK
logfile
group 1 ('/oracle/database/log1/lmqq/redo01.log') size 10M,
group 2 ('/oracle/database/log1/lmqq/redo02.log') size 10M,
group 3 ('/oracle/database/log1/lmqq/redo03.log') size 10M
#10.数据库创建完成后创建数据字典等脚本
Sql>@?/rdbms/admin/catalog.sql
Sql>@?/rdbms/admin/catproc.sql
Sql>@?/rdbms/admin/catexp.sql
Sql>@?/sqlplus/admin/pupbld.sql
#11.密码文件
Orapwd file=’/oracle/database/11g/dbs/orapwdlmqq’
#12.配置em
Emca –config dbcontrol db –repos create