◆◆◆11G手动建库
◆设置环境变量
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/11.2.4/dbhome_1
export ORACLE_SID=kktest
◆建立需要的目录
mkdir -p $ORACLE_BASE/admin/$ORACLE_SID/adump
◆初始化文件配置:cat $ORACLE_HOME/dbs/initkktest.ora
db_name='kktest'
memory_target=1G
processes = 150
audit_file_dest='/u01/app/oracle/admin/kktest/adump'
audit_trail ='db'
db_block_size=8192
db_domain=''
db_recovery_file_dest='/u01/app/oracle/kktest/flash_recovery_area'
db_recovery_file_dest_size=500M
diagnostic_dest='/u01/app/oracle'
dispatchers='(PROTOCOL=TCP) (SERVICE=ORCLXDB)'
open_cursors=300
remote_login_passwordfile='EXCLUSIVE'
undo_tablespace='UNDOTBS1'
control_files = '/u01/app/oracle/kktest/ora_control1', '/u01/app/oracle/kktest/ora_control2'
compatible ='11.2.0'
◆建立密码文件
$ORACLE_HOME/bin/orapwd file=$ORACLE_HOME/dbs/orapwkktest password=oracle force=y
◆创建spfile,启动到nomount状态
sqlplus / as sysdba
SQL> create spfile from pfile;
SQL> startup nomount
◆准备sql脚本,创建数据库
CREATE DATABASE kktest
USER SYS IDENTIFIED BY oracle
USER SYSTEM IDENTIFIED BY oracle
LOGFILE GROUP 1 ('/u01/app/oracle/kktest/redo01a.log') SIZE 50M BLOCKSIZE 512,
GROUP 2 ('/u01/app/oracle/kktest/redo02a.log') SIZE 50M BLOCKSIZE 512,
GROUP 3 ('/u01/app/oracle/kktest/redo03a.log') SIZE 50M BLOCKSIZE 512
MAXLOGFILES 5
MAXLOGMEMBERS 5
MAXLOGHISTORY 1
MAXDATAFILES 2000
CHARACTER SET ZHS16GBK
NATIONAL CHARACTER SET AL16UTF16
EXTENT MANAGEMENT LOCAL
DATAFILE '/u01/app/oracle/kktest/system01.dbf' SIZE 325M REUSE
SYSAUX DATAFILE '/u01/app/oracle/kktest/sysaux01.dbf' SIZE 55M REUSE
DEFAULT TABLESPACE users
DATAFILE '/u01/app/oracle/kktest/users01.dbf'
SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED
DEFAULT TEMPORARY TABLESPACE tempts1
TEMPFILE '/u01/app/oracle/kktest/temp01.dbf'
SIZE 20M REUSE
UNDO TABLESPACE undotbs1
DATAFILE '/u01/app/oracle/kktest/undotbs01.dbf'
SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;
◆建立数据字典视图
SQL>
spool /u01/app/oracle/kktest/cat_kktest.log
@?/rdbms/admin/catalog.sql
@?/rdbms/admin/catproc.sql
@?/sqlplus/admin/pupbld.sql
spool off
执行完后检查log看看有什么错误。
◆最后修改为归档模式。