1、oracle环境变量设置 .bash_profile
umask 022
export PATH
export ORACLE_BASE=/home/oracle/oracle10g
export ORACLE_SID=odd
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/jdk/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
export LC_CTYPE=en_US.UTF-8
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
2、创建pfile参数文件 initodd.ora
control_files=(/opt/oracle/oradata/odd/control01.ctl,/opt/oracle/oradata/odd/control02.ctl)
db_name=odd
db_block_size=8192
undo_management=AUTO
sga_target=200m
user_dump_dest=/opt/oracle/admin/udump
background_dump_dest=/opt/oracle/admin/bdump
undo_tablespace=undotbs
3、创建密码文件 orapwodd
orapwd file=orapwodd password=oracle
4、创建目录
mkdir -p /opt/oracle/oradata/odd/
mkdir -p /opt/oracle/admin/adump
mkdir -p /opt/oracle/admin/bdump
mkdir -p /opt/oracle/admin/cdump
mkdir -p /opt/oracle/admin/udump
5、将数据库启动到nomount状态,执行创建数据库脚本
sqlplus / as sysdba
startup nomount
CREATE DATABASE odd
USER SYS IDENTIFIED BY oracle
USER SYSTEM IDENTIFIED BY oracle
LOGFILE GROUP 1 ('/opt/oracle/oradata/odd/redo01.log') SIZE 50M,
GROUP 2 ('/opt/oracle/oradata/odd/redo02.log') SIZE 50M,
GROUP 3 ('/opt/oracle/oradata/odd/redo03.log') SIZE 50M
MAXLOGFILES 5
MAXLOGMEMBERS 5
MAXLOGHISTORY 1
MAXDATAFILES 100
MAXINSTANCES 1
CHARACTER SET UTF8
NATIONAL CHARACTER SET AL16UTF16
DATAFILE '/opt/oracle/oradata/odd/system01.dbf' SIZE 325M REUSE
EXTENT MANAGEMENT LOCAL
SYSAUX DATAFILE '/opt/oracle/oradata/odd/sysaux01.dbf' SIZE 325M REUSE
DEFAULT TEMPORARY TABLESPACE tempts1
TEMPFILE '/opt/oracle/oradata/odd/temp01.dbf'
SIZE 20M REUSE
UNDO TABLESPACE undotbs
DATAFILE '/opt/oracle/oradata/odd/undotbs01.dbf'
SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;
6、进入数据库执行脚本
@?/rdbms/admin/catalog.sql
@?/rdbms/admin/catproc.sql
7、验证
desc dba_tables
desc dbms_output
set serveroutput on
execute dbms_output.put_line('This is');
8、安装scott用户
@?/rdbms/admin/ultsampl.sql
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/20553601/viewspace-749149/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/20553601/viewspace-749149/