开始安装数据库:
1、确定sid
2、创建alertlog等目录
3、确定初始化文件
4、生成密码文件
5、生成spfile和改参数
5、根据在线文档,找出并修改create database语句
6、startup nomount后,开始create database
7、catalog和catproc
SID=orcl
数据库目标挂载点 /data/oracle
建立目录
mkdir -p /data/oracle/oradata/orcl/disk{1,2,3,4,5}
mkdir -p /data/oracle/admin/orcl/{b,c,u,a}dump
创建pfile
cd $ORACLE_HOME/dbs
cat init.ora |grep -v ^# |grep -v ^$>initorcl.ora
vi initorcl.ora
修改里面的db_name和controlfile
删除其他内存参数:db_block_buffers、shared_pool_size,log_buffer = 3276
增加sga_max_size和sga_target均为300M
####################################################################
db_name=orcl
db_files = 80 # SMALL
db_file_multiblock_read_count = 8 # SMALL
log_checkpoint_interval = 10000
processes = 50 # SMALL
parallel_max_servers = 5 # SMALL
db_files = 80 # SMALL
db_file_multiblock_read_count = 8 # SMALL
log_checkpoint_interval = 10000
processes = 50 # SMALL
parallel_max_servers = 5 # SMALL
max_dump_file_size = 10240 # limit trace file size to 5 Meg each
control_files = (
/data/oracle/oradata/orcl/disk1/oraclctl_01.ctl,
/data/oracle/oradata/orcl/disk2/oraclctl_02.ctl,
/data/oracle/oradata/orcl/disk3/oraclctl_03.ctl,
/data/oracle/oradata/orcl/disk4/oraclctl_04.ctl,
/data/oracle/oradata/orcl/disk5/oraclctl_05.ctl
)
sga_target=300m
undo_tablespace=orcltbs
undo_management=auto
background_dump_dest='/data/oracle/admin/orcl/bdump'
core_dump_dest='/data/oracle/admin/orcl/cdump'
user_dump_dest='/data/oracle/admin/orcl/udump'
audit_file_dest='/data/oracle/admin/orcl/adump'
######################################################################
启动数据库到nomount状态
SQL> startup nomount;
ORACLE instance started.
Total System Global Area 314572800 bytes
Fixed Size 2020416 bytes
Variable Size 96472000 bytes
Database Buffers 209715200 bytes
Redo Buffers 6365184 bytes
####################################################################
查看日志
tail -f /data/oracle/admin/orcl/bdump/alert_orcl.log
###################################################################
在dbs下生成密码文件
orapwd file=orapworcl password=oracle
###################################################################
建立spfile
SQL> create spfile from pfile;
File created.
SQL> shutdown immediate;
ORA-01507: database not mounted
ORACLE instance shut down.
SQL> startup nomount;
ORACLE instance started.
Total System Global Area 314572800 bytes
Fixed Size 2020416 bytes
Variable Size 96472000 bytes
Database Buffers 209715200 bytes
Redo Buffers 6365184 bytes
SQL> show parameter spfile;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string /u01/app/oracle/product/10.2.0
/db_1/dbs/spfileorcl.ora
##########################################################################
建立脚本
vim db.sql
CREATE DATABASE orcl
USER SYS IDENTIFIED BY oracle
USER SYSTEM IDENTIFIED BY oracle
LOGFILE
GROUP 1 ('/data/oracle/oradata/orcl/disk1/redo1_1.rdo','/data/oracle/oradata/orcl/disk2/redo1_2.rdo') size 50m,
GROUP 2 ('/data/oracle/oradata/orcl/disk2/redo2_1.rdo','/data/oracle/oradata/orcl/disk3/redo2_2.rdo') size 50m,
GROUP 3 ('/data/oracle/oradata/orcl/disk3/redo3_1.rdo','/data/oracle/oradata/orcl/disk4/redo3_2.rdo') size 50m,
GROUP 4 ('/data/oracle/oradata/orcl/disk4/redo4_1.rdo','/data/oracle/oradata/orcl/disk5/redo4_2.rdo') size 50m,
GROUP 5 ('/data/oracle/oradata/orcl/disk5/redo5_1.rdo','/data/oracle/oradata/orcl/disk1/redo5_2.rdo') size 50m
CHARACTER SET AL32UTF8
NATIONAL CHARACTER SET UTF8
DATAFILE '/data/oracle/oradata/orcl/disk1/system01.dbf' size 300m autoextend on next 30m maxsize unlimited extent management local
SYSAUX DATAFILE '/data/oracle/oradata/orcl/disk2/sysaux01.dbf' size 300m autoextend on next 30m maxsize unlimited
UNDO TABLESPACE orcltbs datafile '/data/oracle/oradata/orcl/disk3/orcltbs01.dbf' size 100m
DEFAULT TEMPORARY TABLESPACE tempts1 TEMPFILE '/data/oracle/oradata/orcl/disk4/tempts1.dbf' size 100m
DEFAULT TABLESPACE tbs01 datafile '/data/oracle/oradata/orcl/disk5/tbs01.dbf' size 100m;
#################################################################################################
SQL> @db.sql
###### 监控alter.orcl.log日志
SQL> @db.sql
Database created.
#################################################################################################
开始执行catalog和catproc
@?/rdbms/admin/catalog.sql
@?/rdbms/admin/catproc.sql
show user
用户必须是system用户
conn system/oracle
show user
@?/sqlplus/admin/pupbld