Posted on 2009-05-29 16:46
风花雪月 阅读(212)
评论(0) 编辑 收藏 引用 所属分类:
oracle数据库
1.首先进入到dbs目录设置环境变量:$vi conish.env
ORACLE_BASE=/u01
ORACLE_HOME=$ORACLE_BASE/oracle
ORACLE_SID=yangyao
ORACLE_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
PATH=$ORACLE_HOME/bin:$PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
export ORACLE_BASE ORACLE_HOME ORACLE_SID ORACLE_NLS33 PATH LD_LIBRARY_PATH
2.创建初始化文件 $string spfiledenver.ora > spfileyangyao.ora
3.创建密码文件:$orapwd file=orapwyangyao password=5811419 entries=10
4.然后再/u01/oradata/下创建ORACLE_SID目录,$mkdir yangyao 例如/u01/oradata/yangyao
5.创建数据库创建脚本:$vi crdb01.sql
CREATE DATABASE "yangyao"
MAXDATAFILES 500
MAXINSTANCES 8
MAXLOGFILES 32
CHARACTER SET UTF8
NATIONAL CHARACTER SET AL16UTF16
ARCHIVELOG
DATAFILE
'/u01/oradata/yangyao/system01.dbf' SIZE 300M
EXTENT MANAGEMENT LOCAL
DEFAULT TEMPORARY TABLESPACE temp TEMPFILE '/u01/oradata/yangyao/tempts01.dbf' SIZE 10OM
EXTENT MANAGEMENT LOCAL
UNDO TABLESPACE "UNDOTBS1"
DATAFILE
'/u01/oradata/yangyao/undotbs01.dbf' SIZE 200M
LOGFILE
LOGFILE
GROUP 1 ('/u01/oradata/yangyao/redo01a.rdo',
'/u01/oradata/yangyao/redo01b.rdo') SIZE 100M,
GROUP 2 ('/u01/oradata/yangyao/redo02a.rdo',
'/u01/oradata/yangyao/redo02b.rdo') SIZE 100M,
GROUP 3 ('/u01/oradata/yangyao/redo03a.rdo',
'/u01/oradata/yangyao/redo03b.rdo') SIZE 100M;
6.在/u01/admin/下创建ORACLE_SID目录,例如/u01/admin/yangyao,然后在这个目录下创建五个目录分别为;
$mkdir bdump $mkdir cdump,$mkdir create,$mkdir pfile,$mkdir udump
/u01/admin/yangyao/bdump,/u01/admin/yangyao/cdump,/u01/admin/yangyao/create/,/u01/admin/yangyao/pfile,
/u01/admin/yangyao/udump
7.$sqlplus /nolog
8.>conn /as sysdba
9.>startup nomount
10.>@$ORACLE_HOME/dbs/crdbo1.sql;
11.创建用户表空间:>create tablespace mytbs datafile '/u01/oradata/yangyaomytbs01.dbf' size 100M extent management local;
12.创建数据字典:>spool log01.log
>@?/rdbms/admin/catalog.sql
>spool log02.log
>@?/rdbms/admin/catproc.sql
>spool log03.log
>@?/sqlplus/admin/pupbld.sql