1、安装虚拟机
2、安装linux
3、安装配置xmanager
vi /etc/gdm/custom.conf
[xdmcp]
Enable=1
vi /usr/share/gdm/defaults.conf
[Security]
AllowRemoteRoot=true
AllowRemoteAutoLogin=true
重启: reboot
删除行 dd
删除单个字符 x
编辑内容: i a
退出: esc :q (不保存退出) :wq(保存退出) :wq!(强制保存退出)
查询: esc ?查询内容 (n)
3、配置内核参数
vi /etc/sysctl.conf
vi /etc/security/limits.conf
vi /etc/pam.d/login
4、创建oracle组、用户
groupadd dba
groupadd oinstall
useradd -d /home/oracle -g oinstall -G dba oracle
passwd oracle
su - oracle
vi .bash_profile
---------------------------------------------------
export ORACLE_BASE=/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORACLE_SID=orcl
export PATH=$ORACLE_HOME/bin:$PATH
export DISPLAY=192.168.1.105:0.0
5、创建目录、授权
su - root
cd /
mkdir oracle
mkdir setup
chown -R oracle.oinstall /oracle
chown -R oracle.oinstall /setup
chmod -R 775 /oracle
6、上传oracle软件
service vsftpd start
7、解压
su - oracle
cd /setup
unzip -x 10201_database_linux32
8、重启系统
su - root
reboot
9、安装oracle软件
su - oracle
cd /setup/database
./runInstaller -ignoreSyspreReqs
10、创建卷组
fdisk -l
pvcreate /dev/sdb
pvcreate /dev/sdc
pvcreate /dev/sdd
vgcreate vol1 /dev/sdb /dev/sdc
vgcreate vol2 /dev/sdd
lvcreate -l 510 -n oradata vol1
lvcreate -l 255 -n oraredo vol2
mkdir /oracle/oradata
mkdir /oracle/oraredo
mkfs.ext3 /dev/vol1/oradata
mkfs.ext3 /dev/vol2/oraredo
mount /dev/vol1/oradata /oracle/oradata
mount /dev/vol2/oraredo /oracle/oraredo
vi /etc/fstab
/dev/vol1/oradata /oracle/oradata ext3 defaults 0 0
/dev/vol2/oraredo /oracle/oraredo ext3 defaults 0 0
chown -R oracle.oinstall /oracle/oradata
chown -R oracle.oinstall /oracle/oraredo
chmod -R 775 /oracle/oradata
chmod -R 775 /oracle/oraredo
reboot
11、创建数据库
12、调整目录
/oracle/oradata
/oracle/oraredo
[root@yjs ~]# mkdir /oracle/oraredo/orcl
[root@yjs ~]# chown -R oracle.oinstall /oracle/oraredo
[root@yjs ~]# chmod -R 775 /oracle/oraredo
redo: /oracle/oradata ->/oracle/oraredo
shutdown immediate
cp /oracle/oradata/orcl/redo* /oracle/oraredo/orcl/
startup mount
alter database rename file '/oracle/oradata/orcl/redo01.log' to '/oracle/oraredo/orcl/redo01.log';
alter database rename file '/oracle/oradata/orcl/redo02.log' to '/oracle/oraredo/orcl/redo02.log';
alter database rename file '/oracle/oradata/orcl/redo03.log' to '/oracle/oraredo/orcl/redo03.log';
select * from v$logfile
alter database open;
控制文件: /oracle/oradata(3个) -> /oracle/oradata /oracle/oraredo
1)修改参数
startup nomount
SQL> alter system set control_files='/oracle/oradata/orcl/control01.ctl', '/oracle/oraredo/orcl/control02.ctl' scope=spfile;
2)拷贝文件
shutdown immediate
quit
cp /oracle/oradata/orcl/control01.ctl /oracle/oraredo/orcl/control02.ctl
sqlplus / as sysdba
startup
alter system set xxx=xxx scope=both|memory|spfile
both: 既改内存的参数值同时也改参数文件的值
memory: 只改内存,参数文件没改,下次重启不再生效
spfile: 只改参数文件,当前内存不改,只有重启之后生效
13、配置网络
配监听器 netmgr
在xp系统配置服务命名,用plsqldeveloper访问数据库
14、oracle随系统自动启动
# 0 - halt (Do NOT set initdefault to this)
# 1 - Single user mode
# 2 - Multiuser, without NFS (The same as 3, if you do not have networking)
# 3 - Full multiuser mode
# 4 - unused
# 5 - X11
# 6 - reboot (Do NOT set initdefault to this)
编辑文件
vi /etc/rc.d/init.d/ora
case "$1" in
start)
su - oracle -c "dbstart" >> /var/startoracle.log
;;
stop)
su - oracle -c "dbshut" >> /var/stoporacle.log
;;
esac
链接
cd /etc/rc.d/rc5.d
ln ../init.d/ora S99ora
ln ../init.d/ora K01ora
编辑oratab
vi /etc/oratab
orcl:/oracle/product/10.2.0/db_1:Y
reboot
exit 0
http://tahiti.oracle.com/