oracle10g linux手工建库

su - oracle   -----切换到ORACLE用户下
1.设置环境变量

env | grep ORA  -----检测ORACLE用户环境。

[oracle@arc1 ~]$export ORACLE_BASE=/u01/app/oracle
[oracle@arc1 ~]$export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
[oracle@arc1 ~]$export ORACLE_SID=antu

2.创建必要相关目录:
[oracle@arc1 ~]$mkdir -p /u01/app/oracle/admin/antu/adump bdump cdump dpdump udump pfile
[oracle@arc1 ~]$mkdir -p /u01/app/oracle/oradata/antu


3.创建初始化参数文件-------技巧:可通过拷贝现在的初始化参数文件并将其做适当的修改就可。
[oracle@arc1 ~]$cd /u01/app/oracle/admin/orcl/pfile
[oracle@arc1 ~]$cp init.ora.102201114191 /u01/app/oracle/product/10.2.0/db_1/dbs/
[oracle@arc1 ~]$vi init.ora.102201114191
修改db_name的值为antu  修改background_dump_dest core_dump_dest  user_dump_dest的路径 修改control_file的路径
修改audit_file_dest的路径 
[oracle@arc1 ~]$cp init.ora.102201114191 initantu.ora


4 创建口令文件
[oracle@arc1 dbs]$ orapwd file=/u01/app/oracle/product/10.2.0/db_1/dbs/orapwantu password=antu entries=10


5.启动数据库到nomount状态
[oracle@arc1 ~]$sqlplus /nolog
SQL>conn sys/antu as sysdba
SQL>create spfile from pfile;
[oracle@arc1 ~]$startup nomount;

 

6.用脚本创建数据库文件
CREATE DATABASE antu
MAXINSTANCES 8
MAXLOGHISTORY 1
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
DATAFILE '/u01/app/oracle/oradata/antu/system01.dbf' SIZE 300M REUSE
SYSAUX DATAFILE '/u01/app/oracle/oradata/antu/sysaux01.dbf' SIZE 120M REUSE
DEFAULT TEMPORARY TABLESPACE TEMP TEMPFILE '/u01/app/oracle/oradata/antu/temp01.dbf' SIZE 20M REUSE
UNDO TABLESPACE "UNDOTBS1" DATAFILE '/u01/app/oracle/oradata/antu/undotbs01.dbf' SIZE 200M REUSE
CHARACTER SET ZHS16GBK
NATIONAL CHARACTER SET AL16UTF16
LOGFILE GROUP 1 ('/u01/app/oracle/oradata/antu/redo01.log') SIZE 51200K,
GROUP 2 ('/u01/app/oracle/oradata/antu/redo02.log') SIZE 51200K,
GROUP 3 ('/u01/app/oracle/oradata/antu/redo03.log') SIZE 51200K;

 

7.打开数据库
shutdown immediate;
startup nomount;
alter database mount;
alter database open;

8.执行脚本
@/u01/app/oracle/product/10.2.0/db_1/rdbms/admin/catalog.sql
@/u01/app/oracle/product/10.2.0/db_1/rdbms/admin/catproc.sql
@/u01/app/oracle/product/10.2.0/db_1/rdbms/admin/catblock.sql
@/u01/app/oracle/product/10.2.0/db_1/rdbms/admin/owminst.plb
@/u01/app/oracle/product/10.2.0/db_1/rdbms/admin/catclust.sql


9.建表空间,用户表。


 

你可能感兴趣的:(oracle,linux,职场,休闲,水滴石穿)