环境:Red Hat Enterprise Linux Server release 6.51、设置环境变量
export ORACLE_SID=hxd2、创建数据库密码文件
orapwd file=$ORACLE_HOME/dbs/orapwdhxd password=oracle entries=103、编辑pfile文件
cd $ORACLE_HOME
cp init.ora inithxd.ora4、创建目录
使用Oracle用户
mkdir -p /u01/app/oracle/admin/orcl/adump
mkdir -p /u01/app/oracle/flash_recovery_area
mkdir -p /u01/app/oracle/oradata/hxd/hxd/
mkdir -p /u01/app/oracle/flash_recovery_area/hxd/5、修改inithxd.ora文件
cd $ORACLE_HOME/dbs
cp init.ora inithxd.ora
vi inithxd.ora
db_name='hxd'
memory_target=1G
processes = 300
audit_file_dest='/u01/app/oracle/admin/orcl/adump'
audit_trail ='db'
db_block_size=8192
db_domain=''
db_recovery_file_dest='/u01/app/oracle/flash_recovery_area'
db_recovery_file_dest_size=2G
diagnostic_dest='/u01/app/oracle'
dispatchers='(PROTOCOL=TCP) (SERVICE=ORCLXDB)'
open_cursors=1000
remote_login_passwordfile='EXCLUSIVE'
undo_tablespace='UNDOTBS1'
# You may want to ensure that control files are created on separate physical
# devices
control_files = (/u01/app/oacle/oradata/hxd/hxd/crontrol1.ctl,/u01/app/oracle/flash_recovery_area/hxd/control2.ctl,/u01/app/oacle/oradata/hxd/hxd/crontrol3.ctl)
compatible ='11.2.0'mount -o remount /dev/shm
6、加载inithxd.ora文件
sqlplus / as sysdba
startup nomount7、创建spfile文件
create spfile from pfile;8、创建数据库脚本
CREATE DATABASE HXD
USER SYS IDENTIFIED BY oracle
USER SYSTEM IDENTIFIED BY oracle
LOGFILE GROUP 1 ('/u01/app/oracle/oradata/hxd/hxd/redo01.log') SIZE 100M,
GROUP 2 ('/u01/app/oracle/oradata/hxd/hxd/redo02.log') SIZE 100M,
GROUP 3 ('/u01/app/oracle/oradata/hxd/hxd/redo03.log') SIZE 100M
MAXLOGFILES 5
MAXLOGMEMBERS 5
MAXLOGHISTORY 1
MAXDATAFILES 100
CHARACTER SET ZHS16GBK
NATIONAL CHARACTER SET AL16UTF16
EXTENT MANAGEMENT LOCAL
DATAFILE '/u01/app/oracle/oradata/hxd/hxd/system01.dbf' SIZE 325M REUSE
SYSAUX DATAFILE '/u01/app/oracle/oradata/hxd/hxd/sysaux01.dbf' SIZE 325M REUSE
DEFAULT TABLESPACE users
DATAFILE '/u01/app/oracle/oradata/hxd/hxd/users01.dbf'
SIZE 500M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED
DEFAULT TEMPORARY TABLESPACE tempts1
TEMPFILE '/u01/app/oracle/oradata/hxd/hxd/temp01.dbf'
SIZE 20M REUSE
UNDO TABLESPACE UNDOTBS1
DATAFILE '/u01/app/oracle/oradata/hxd/hxd/undotbs01.dbf'
SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;9、运行脚本创建数据字典视图
使用sys用户运行
@?/rdbms/admin/catalog.sql
@?/rdbms/admin/catproc.sql
@?/rdbms/admin/utlrp.sql10、运行脚本创建数据字典视图
使用system用户执行
@?/sqlplus/admin/pupbld.sql结束
catalog.sql脚本创建数据字典表,动态性能视图,和这些视图的同义词,并将这些同义词赋予PUBILC访问。catproc.sql 运行PL/SQL所必需的所有脚本
utlrp.sql 编译无效对象
pupbld.sql 让SQL*PLUS能够禁用一些用户命令。仅仅是限制使用sqlplu客户端工具有关功能。
Oracle 11g 手工创建数据库
最新推荐文章于 2023-03-27 15:55:22 发布