oracle手工代码建库
说明,此手工代码建库方法,适用于oracle 10g 单机环境。
oracle环境变量
more .bash_profile
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
ORACLE_SID=orcl
PATH=$ORACLE_HOME/bin:$PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib
export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH LD_LIBRARY_LIB
umask 022
1、建目录
mkdir -p /u01/app/oracle/admin/orcl/adump
mkdir -p /u01/app/oracle/admin/orcl/bdump
mkdir -p /u01/app/oracle/admin/orcl/cdump
mkdir -p /u01/app/oracle/admin/orcl/udump
mkdir -p /u01/oradata/orcl
2、创建密码文件
orapwd file=$ORACLE_HOME/dbs/orapworcl password=YOUR_PASSWORD
3、编辑参数文件
vi $ORACLE_HOME/dbs/initorcl.ora
*.control_files='/u01/oradata/orcl/control01.ctl','/u01/oradata/orcl/control02.ctl','/u01/oradata/orcl/control03.ctl'
*.db_name=orcl
*.db_block_size=8192
*.undo_management=auto
*.undo_tablespace=undotbs
*.sga_target=500M
export ORACLE_SID=orcl
sqlplus / as sysdba
create spfile from pfile;
4、启动实例,创建数据库
startup nomount;
create database orcl
user sys identified by oracle
user system identified by oracle
logfile group 1('/u01/oradata/orcl/redo01.log') size 50M,
group 2('/u01/oradata/orcl/redo02.log') size 50M,
group 3('/u01/oradata/orcl/redo03.log') size 50M
maxlogfiles 5
maxlogmembers 5
maxloghistory 1
maxdatafiles 500
maxinstances 1
character set AL32UTF8
national character set UTF8
datafile '/u01/oradata/orcl/system.dbf' size 500M
extent management local
sysaux datafile '/u01/oradata/orcl/sysaux01.dbf' size 500M
default tablespace users
datafile '/u01/oradata/orcl/users01.dbf' size 100M
default temporary tablespace temp
tempfile '/u01/oradata/orcl/temp01.dbf' size 50M
undo tablespace undotbs
datafile '/u01/oradata/orcl/undo01.dbf'size 50M;
5、执行脚本
--以sys执行脚本
@?/rdbms/admin/catalog.sql
@?/rdbms/admin/catblock.sql
@?/rdbms/admin/catproc.sql
@?/rdbms/admin/catoctk.sql
@?/rdbms/admin/owminst.plb
--以system执行脚本
conn system/YOUR_PASSWORD
@?/sqlplus/admin/pupbld.sql
conn system/YOUR_PASSWORD
@?/sqlplus/admin/help/hlpbld.sql helpus.sql
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/24626891/viewspace-2083037/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/24626891/viewspace-2083037/