Oracle9i安装手记

发表于:2007-05-25来源:作者:点击数: 标签:服务器曙光oracle9i硬件手记
一、硬件 曙光 服务器 ,1G RAM /2 XERON CPU/2 SCSI HD 二、操作系统 RH7 .2 SERVER/2 G SWAP/用一块硬盘建立ORACLE分区其它用另一块 三、设置内核 echo 250 32000 100 128 > /proc/sys/kernel/sem echo 2147483648 > /proc/sys/kernel/shmmax echo 65536 >

  一、硬件
  曙光服务器,1G RAM /2 XERON CPU/2 SCSI HD
  
  二、操作系统
  RH7 .2 SERVER/2 G SWAP/用一块硬盘建立ORACLE分区其它用另一块
  
  三、设置内核
  echo 250 32000 100 128 > /proc/sys/kernel/sem
  echo 2147483648 > /proc/sys/kernel/shmmax
  echo 65536 > /proc/sys/fs/file-max
  ulimit -n 65536
  echo 1024 65000 > /proc/sys.net/ipv4/ip_local_port_change
  ulimit -u 16384
  
  四、安装JDK
  听说O920不需要安装JDK,不过还是安装的好。装在/usr/local/java
  
  五、建立组、用户、目录
  groupadd oinstall
  groupadd dba
  groupadd oper
  groupadd apache
  
  useradd -g oinstall -G dba oracle
  passwd oracle
  useradd -g oinstall -G apache apache
  passwd apache
  
  mkdir /oracle/oracle/product
  mkdir /oracle/oracle/product/9.2.0
  chown -R oracle.oinstall /oracle/oracle
  
  六、建立文件 .bash_profile放在oracle用户主目录下
  ORACLE_BASE=/oracle/oracle; export ORACLE_BASE
  ORACLE_HOME=$ORACLE_BASE/product/9.2.0; export ORACLE_HOME
  ORACLE_TERM=xterm; export ORACLE_TERM
  PATH=$PATH:$ORACLE_HOME/bin:/usr/local/java/bin; export PATH
  ORACLE_SID=ora9; export ORACLE_SID
  LD_LIBRARY_PATH=$ORACLE_HOME/lib; export LD_LIBRARY_PATH
  CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
  
  TMP=/temp; export TMP
  TMPDIR=$TMP; export TMPDIR
  
  七、准备oracle9i源盘
  gunzip lnx_920_disk1.cpio.gz
  gunzip lnx_920_disk2.cpio.gz
  gunzip lnx_920_disk3.cpio.gz
  
  cpio -idmv < lnx_920_disk1.cpio
  cpio -idmv < lnx_920_disk1.cpio
  cpio -idmv < lnx_920_disk1.cpio
  
  八、安装
  #export DISPLAY=”本机名:0.0”
  # /Disk1/runInstaller
  
  九、安装中的错误
  希望不要碰到错误,但是免不了。我碰到的是无法启动net configer assistant,database configer assitant.
  还用很多错误,如果是mk 的错误,请用ignore
  
  十、创建数据库
  dbca 不能启动,只能自己创建数据库
  1、 建立initsid.ora.
  在$ORACLE_HOME/dbs/下 #cp init.ora initor9.ora
  2、 用编辑器把initor9.ora中的数据库名改为实例名
  3、 sqlplus /nolog 启动sqlplus 下面是sqlplus 中的操作
  connect sys/change_on_install as sysdba;
  startup nomount;
  @createdatabase; --建立数据库
  @createtablespace; --建立表空间
  @createDL ;–-建立数据字典
  4、 createdatabase.sql
  CREATE DATABASE or9
  LOGFILE '$ORACLE_HOME/dbs/or9/oradata/redo01.log' SIZE 2048K,
  '$ORACLE_HOME/dbs/or9/oradata/redo02.log' SIZE 2048K,
  '$ORACLE_HOME/dbs/or9/oradata/redo03.log' SIZE 2048K
  MAXLOGFILES 32
  MAXLOGMEMBERS 2
  MAXLOGHISTORY 1
  DATAFILE '$ORACLE_HOME/dbs/or9/oradata/system01.dbf' SIZE 58M REUSE AUTOEXTEND ON NEXT 640K
  MAXDATAFILES 254
  MAXINSTANCES 1
  5、 createtablespace
  CREATE TABLESPACE RBS DATAFILE '$ORACLE_HOME/dbs/or9/oradata\rbs01.dbf' SIZE 256M REUSE
  AUTOEXTEND ON NEXT 5120K
  MINIMUM EXTENT 512K
  DEFAULT STORAGE ( INITIAL 512K NEXT 512K MINEXTENTS 8 MAXEXTENTS 4096)
  /
  CREATE TABLESPACE USERS DATAFILE '$ORACLE_HOME/dbs/or9/oradata\users01.dbf' SIZE 128M REUSE
  AUTOEXTEND ON NEXT 1280K
  MINIMUM EXTENT 128K
  DEFAULT STORAGE ( INITIAL 128K NEXT 128K MINEXTENTS 1 MAXEXTENTS 4096 PCTINCREASE 0)
  /
  CREATE TABLESPACE TEMP DATAFILE '$ORACLE_HOME/dbs/or9/oradata\temp01.dbf' SIZE 32M REUSE
  AUTOEXTEND ON NEXT 640K
  MINIMUM EXTENT 64K
  DEFAULT STORAGE ( INITIAL 64K NEXT 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED PCTINCREASE 0) TEMPORARY
  /
  CREATE TABLESPACE TOOLS DATAFILE '$ORACLE_HOME/dbs/or9/oradata\tools01.dbf' SIZE 64M REUSE
  AUTOEXTEND ON NEXT 320K
  MINIMUM EXTENT 32K
  DEFAULT STORAGE ( INITIAL 32K NEXT 32K MINEXTENTS 1 MAXEXTENTS 4096 PCTINCREASE 0)
  /
  CREATE TABLESPACE INDX DATAFILE '$ORACLE_HOME/dbs/or9/oradata\indx01.dbf' SIZE 32M REUSE
  AUTOEXTEND ON NEXT 1280K
  MINIMUM EXTENT 128K
  DEFAULT STORAGE ( INITIAL 128K NEXT 128K MINEXTENTS 1 MAXEXTENTS 4096 PCTINCREASE 0)
  /
  CREATE PUBLIC ROLLBACK SEGMENT RBS0 TABLESPACE RBS STORAGE ( OPTIMAL 4096K )
  /
  CREATE PUBLIC ROLLBACK SEGMENT RBS1 TABLESPACE RBS STORAGE ( OPTIMAL 4096K )
  /
  CREATE PUBLIC ROLLBACK SEGMENT RBS2 TABLESPACE RBS STORAGE ( OPTIMAL 4096K )
  /
  CREATE PUBLIC ROLLBACK SEGMENT RBS3 TABLESPACE RBS STORAGE ( OPTIMAL 4096K )
  /
  CREATE PUBLIC ROLLBACK SEGMENT RBS4 TABLESPACE RBS STORAGE ( OPTIMAL 4096K )
  /
  CREATE PUBLIC ROLLBACK SEGMENT RBS5 TABLESPACE RBS STORAGE ( OPTIMAL 4096K )
  /
  CREATE PUBLIC ROLLBACK SEGMENT RBS6 TABLESPACE RBS STORAGE ( OPTIMAL 4096K )
  /
  CREATE PUBLIC ROLLBACK SEGMENT RBS7 TABLESPACE RBS STORAGE ( OPTIMAL 4096K )
  /
  CREATE PUBLIC ROLLBACK SEGMENT RBS8 TABLESPACE RBS STORAGE ( OPTIMAL 4096K )
  /
  CREATE PUBLIC ROLLBACK SEGMENT RBS9 TABLESPACE RBS STORAGE ( OPTIMAL 4096K )
  /
  CREATE PUBLIC ROLLBACK SEGMENT RBS10 TABLESPACE RBS STORAGE ( OPTIMAL 4096K )
  /
  CREATE PUBLIC ROLLBACK SEGMENT RBS11 TABLESPACE RBS STORAGE ( OPTIMAL 4096K )
  /
  CREATE PUBLIC ROLLBACK SEGMENT RBS12 TABLESPACE RBS STORAGE ( OPTIMAL 4096K )
  /
  CREATE PUBLIC ROLLBACK SEGMENT RBS13 TABLESPACE RBS STORAGE ( OPTIMAL 4096K )
  /
  CREATE PUBLIC ROLLBACK SEGMENT RBS14 TABLESPACE RBS STORAGE ( OPTIMAL 4096K )
  /
  CREATE PUBLIC ROLLBACK SEGMENT RBS15 TABLESPACE RBS STORAGE ( OPTIMAL 4096K )
  /
  CREATE PUBLIC ROLLBACK SEGMENT RBS16 TABLESPACE RBS STORAGE ( OPTIMAL 4096K )
  /
  CREATE PUBLIC ROLLBACK SEGMENT RBS17 TABLESPACE RBS STORAGE ( OPTIMAL 4096K )
  /
  CREATE PUBLIC ROLLBACK SEGMENT RBS18 TABLESPACE RBS STORAGE ( OPTIMAL 4096K )
  /
  CREATE PUBLIC ROLLBACK SEGMENT RBS19 TABLESPACE RBS STORAGE ( OPTIMAL 4096K )
  /
  CREATE PUBLIC ROLLBACK SEGMENT RBS20 TABLESPACE RBS STORAGE ( OPTIMAL 4096K )
  /
  CREATE PUBLIC ROLLBACK SEGMENT RBS21 TABLESPACE RBS STORAGE ( OPTIMAL 4096K )
  /
  CREATE PUBLIC ROLLBACK SEGMENT RBS22 TABLESPACE RBS STORAGE ( OPTIMAL 4096K )
  /
  CREATE PUBLIC ROLLBACK SEGMENT RBS23 TABLESPACE RBS STORAGE ( OPTIMAL 4096K )
  /
  CREATE PUBLIC ROLLBACK SEGMENT RBS24 TABLESPACE RBS STORAGE ( OPTIMAL 4096K )
  /
  ALTER ROLLBACK SEGMENT "RBS0" ONLINE
  /
  ALTER ROLLBACK SEGMENT "RBS1" ONLINE
  /
  ALTER ROLLBACK SEGMENT "RBS2" ONLINE
  /
  ALTER ROLLBACK SEGMENT "RBS3" ONLINE
  /
  ALTER ROLLBACK SEGMENT "RBS4" ONLINE
  /
  ALTER ROLLBACK SEGMENT "RBS5" ONLINE
  /
  ALTER ROLLBACK SEGMENT "RBS6" ONLINE
  /
  ALTER ROLLBACK SEGMENT "RBS7" ONLINE
  /
  ALTER ROLLBACK SEGMENT "RBS8" ONLINE
  /
  ALTER ROLLBACK SEGMENT "RBS9" ONLINE
  /
  ALTER ROLLBACK SEGMENT "RBS10" ONLINE
  /
  ALTER ROLLBACK SEGMENT "RBS11" ONLINE
  /
  ALTER ROLLBACK SEGMENT "RBS12" ONLINE
  /
  ALTER ROLLBACK SEGMENT "RBS13" ONLINE
  /
  ALTER ROLLBACK SEGMENT "RBS14" ONLINE
  /
  ALTER ROLLBACK SEGMENT "RBS15" ONLINE
  /
  ALTER ROLLBACK SEGMENT "RBS16" ONLINE
  /
  ALTER ROLLBACK SEGMENT "RBS17" ONLINE
  /
  ALTER ROLLBACK SEGMENT "RBS18" ONLINE
  /
  ALTER ROLLBACK SEGMENT "RBS19" ONLINE
  /
  ALTER ROLLBACK SEGMENT "RBS20" ONLINE
  /
  ALTER ROLLBACK SEGMENT "RBS21" ONLINE
  /
  ALTER ROLLBACK SEGMENT "RBS22" ONLINE
  /
  ALTER ROLLBACK SEGMENT "RBS23" ONLINE
  /
  ALTER ROLLBACK SEGMENT "RBS24" ONLINE
  /
  alter user sys temporary tablespace TEMP
  /
  6、 createDL.sql
  @/oracle/oracle/product/9.2.0/rdbms/admin/catalog.sql
  /
  @/oracle/oracle/product/9.2.0/rdbms/admin/catexp7.sql
  /
  @/oracle/oracle/product/9.2.0/rdbms/admin/catproc.sql
  /
  @/oracle/oracle/product/9.2.0/rdbms/admin/caths.sql
  /
  connect internal/oracle
  /
  @/oracle/oracle/product/9.2.0/rdbms/admin/catrep.sql
  /
  connect system/manager
  /
  @/oracle/oracle/product/9.2.0/sqlplus/admin/pupbld.sql
  
  7、 其他
  connect internal/oracle
  /
  alter user sys temporary tablespace TEMP
  /
  alter user system default tablespace TOOLS
  /
  alter user system temporary tablespace TEMP
  /
  

原文转自:http://www.ltesting.net