时间:2021-07-01 10:21:17 帮助过:100人阅读
本文简单介绍通过Oracle数据库的create database命令创建一个符合OFA规范的Oracle数据库。
本文简单介绍通过Oracle数据库的create database命令创建一个符合OFA规范的Oracle数据库。
1 设置环境变量(vi .bash_profile或者是保存为一个可执行文件执行创建)
ORACLE_BASE=/u01/app
ORACLE_HOME=$ORACLE_HOME/oracle
ORACLE_SID=hsj
PATH=$ORACLE_HOME/bin:$PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
DISPLAY==192.168.138.1:0.0
export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH LD_LIBRARY_PATH DISPLAY
2 创建某些目录(存放日志目录,,存放数据文件目录,存放控制文件目录,归档目录)
mkdir -p /u01/app/flash_recovery_area/hsj
mkdir -p /u01/app/diag/rdbms/hsj #用来存放alert trace 跟踪日志
mkdir -p /u01/app/oradata/hsj/archive # 用来存放归档日志,上一级目录用来存放控制文件和数据文件、联机日志文件
mkdir -p /u01/app/admin/hsj/adump
mkdir -p /u01/app/admin/hsj/dpdump
mkdir -p /u01/app/admin/hsj/pfile
mkdir -p /u01/app/admin/hsj/scripts
3 创建参数文件 inithsj.ora,并且通过inithsj.ora 创建spfile,spfile文件必须存放$ORACLE_HOME/dbs/目录下面
mkdir
inithsj.ora 文件类容(某些参数需要根据实际环境进行修改)
v inithsj.ora
hsj.__db_cache_size=327155712
hsj.__java_pool_size=4194304
hsj.__large_pool_size=4194304
hsj.__oracle_base='/u01/app'#ORACLE_BASE set from environment
hsj.__pga_aggregate_target=331350016
hsj.__sga_target=490733568
hsj.__shared_io_pool_size=0
hsj.__shared_pool_size=146800640
hsj.__streams_pool_size=0
audit_file_dest='/u01/app/admin/hsj/adump'
audit_trail='db'
compatible='11.2.0.0.0'
control_files='/u01/app/oradata/hsj/control01.ctl','/u01/app/flash_recovery_area/hsj/control02.ctl'
db_block_size=8192
db_domain=''
db_name='hsj'
db_recovery_file_dest='/u01/app/flash_recovery_area'
db_recovery_file_dest_size=4039114752
diagnostic_dest='/u01/app'
dispatchers='(PROTOCOL=TCP) (SERVICE=hsjXDB)'
log_archive_format='%t_%s_%r.dbf'
memory_target=818937856
nls_language='AMERICAN'
open_cursors=300
remote_login_passwordfile='EXCLUSIVE'
undo_tablespace='UNDOTBS1'
sqlplus / as sysdba
create spfile from pfile #需要确保是在dbs目录下,否则需要指定具体的pfile文件路径和名称
4 启动数据库到nomount状态
Startup nomount;
5 创建数据库脚本 createdb.sql
spool createdb.log
create database hsj
user sys identified by root
user system identified by root
logfile group 1
('/u01/app/oradata/hsj/redo01.log') size 50M blocksize 512,
group 2
('/u01/app/oradata/hsj/redo02.log') size 50M blocksize 512,
group 3
('/u01/app/oradata/hsj/redo03.log') size 50M blocksize 512
maxlogfiles 30
maxlogmembers 5
maxloghistory 1
maxdatafiles 100
character set al32utf8
national character set al16utf16
extent management local
datafile '/u01/app/oradata/hsj/system01.dbf' size 300M reuse
sysaux datafile '/u01/app/oradata/hsj/sysaux01.dbf' size 300M reuse
default tablespace users
datafile '/u01/app/oradata/hsj/users01.dbf' size 300M reuse
autoextend on maxsize unlimited
default temporary tablespace tempts1
tempfile '/u01/app/oradata/hsj/temp01.dbf' size 20M reuse
undo tablespace UNDOTBS1
datafile '/u01/app/oradata/hsj/undotbs01.dbf'
size 200M reuse autoextend on maxsize unlimited;
spool off
6 进入到sqlplus执行创建数据库的脚本
@createdb.sql
7 如果有报错,请查看createdb.log alert日志 和trace日志
8 进入到 $ORACLE_HOME/rdbms/admin目录,执行创建数据字典的sql和创建系统包的sql
@catalog.sql
@catproc.sql
--------------------------------------分割线 --------------------------------------
Oracle 11g 在RedHat Linux 5.8_x64平台的安装手册
Linux-6-64下安装Oracle 12C笔记
在CentOS 6.4下安装Oracle 11gR2(x64)
Oracle 11gR2 在VMWare虚拟机中安装步骤
Debian 下 安装 Oracle 11g XE R2
本文永久更新链接地址: