1、 系统
oracle 9.2.0.1 ,red hat 8.0。
历时大概2-3小时。
欢迎访问:www.huangpuzhuang.com
www.huangpuzhuang.com/bbs
2、 取得软件
不管你是偷是抢、还是down,取得Linux9i_Disk1.cpio.gz、Linux9i_Disk2.cpio.gz、Linux9i_Disk3.cpio.gz这三张盘。复制道硬盘,解压缩:
gunzip Linux9i_Disk1.cpio.gz
cpio -idmv < lnx_920_disk1.cpio
对三张盘都做如此操作,则硬盘形成Disk1、Disk2、Disk3三个目录。
还要设置信号量
[root@dbserver install]# cat /proc/sys/kernel/shmmax
33554432
[root@dbserver root]# echo `expr 1024 \* 1024 \* 512` > /proc/sys/kernel/shmmax
[root@dbserver root]# cat /proc/sys/kernel/shmmax
536870912
我的内存是1g
3、 添加用户
先建立相关目录:
mkdir /opt/oracle
mkdir /opt/oracle/product
mkdir /opt/oracle/product/9.2.0.1
groupadd dba
useradd -g dba oracle
passwd oracle
chown -R oracle.dba /opt/oracle
以oracle 设置环境变量:
以oracle登陆xwindowz,设置 Oracle 环境
以 Oracle 用户进入,编辑 $HOME/.bash_profile:
# Oracle Environment
export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=/opt/oracle/product/9.2.0.1
export ORACLE_SID=cihz
PATH= $PATH: $ORACLE_HOME/bin
4、 开始安装
进入Disk1,运行runInstaller,如果说找不到什么libstdc 什么的问题,应该安装
compat-libstdc++-7.3-2.96.110.i386.rpm
[root@dbserver oracle]# rpm -ivh compat-libstdc++-7.3-2.96.110.i386.rpm
warning: compat-libstdc++-7.3-2.96.110.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
Preparing... ########################################### [100%]
1:compat-libstdc++ ########################################### [100%]
过程中出现:
"Error in invoking target install of makefile /oracle/product/9.2.0/ctx/lib/ins_ctx.mk",
解决办法:
打开文件 $ORACLE_HOME/ctx/lib/env_ctx.mk,把" $(LDLIBFLAG)dl"加到INSO_LINK参数中:
INSO_LINK = -L $(CTXLIB) $(LDLIBFLAG)m $(LDLIBFLAG)dl $(LDLIBFLAG)sc_ca $(LDLIBFLAG)sc_fa
$(LDLIBFLAG)sc_ex $(LDLIBFLAG)sc_da $(LDLIBFLAG)sc_ut $(LDLIBFLAG)sc_ch $(LDLIBFLAG)sc_fi
$(LLIBCTXHX) $(LDLIBFLAG)c -Wl,-rpath, $(CTXHOME)lib $(CORELIBS) $(COMPEOBJS)
然后回到安装界面按重试retry,就可以继续安装。
5、 手工建库
先写个initcihz.ora ,放到dbs,如果你的sid是cihz的话
启动instance:
SQL> startup nomount
ORACLE instance started.
Total System Global Area 70062220 bytes
Fixed Size 450700 bytes
Variable Size 62914560 bytes
Database Buffers 6553600 bytes
Redo Buffers 143360 bytes
SQL>
SQL> CREATE DATABASE cihz
USER SYS IDENTIFIED BY cihz
USER SYSTEM IDENTIFIED BY cihz
LOGFILE GROUP 1 ('/opt/oracle/oradata/cihz/redo01a.log','/opt/oracle/oradata/cihz/redo01b.log') SIZE 5M,
GROUP 2 ('/opt/oracle/oradata/cihz/redo02a.log','/opt/oracle/oradata/cihz/redo02b.log') SIZE 5M,
GROUP 3 ('/opt/oracle/oradata/cihz/redo03a.log','/opt/oracle/oradata/cihz/redo03b.log') SIZE 5M
MAXLOGFILES 15
MAXLOGHISTORY 10
MAXDATAFILES 1024
MAXINSTANCES 255
CHARACTER SET ZHS16GBK
DATAFILE '/opt/oracle/oradata/cihz/system01.dbf' SIZE 500M
EXTENT MANAGEMENT LOCAL
DEFAULT TEMPORARY TABLESPACE temp
TEMPFILE '/opt/oracle/oradata/cihz/temp01.dbf'
SIZE 500M REUSE
UNDO TABLESPACE undotbs
DATAFILE '/opt/oracle/oradata/cihz/undo01.dbf'
SIZE 500M REUSE AUTOEXTEND ON NEXT 5120K MAXSIZE UNLIMITED;
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 CREATE DATABASE cihz
*
ERROR at line 1:
ORA-30014: operation only supported in Automatic Undo Management mode
出错了,在init里增加如下:
UNDO_MANAGEMENT=AUTO
UNDO_TABLESPACE=undotbs
SQL> shutdown
ORA-01507: database not mounted
ORACLE instance shut down.
SQL> startup nomount
ORACLE instance started.
Total System Global Area 70062220 bytes
Fixed Size 450700 bytes
Variable Size 62914560 bytes
Database Buffers 6553600 bytes
Redo Buffers 143360 bytes
SQL> CREATE DATABASE cihz
USER SYS IDENTIFIED BY cihz
USER SYSTEM IDENTIFIED BY cihz
LOGFILE GROUP 1 ('/opt/oracle/oradata/cihz/redo01a.log','/opt/oracle/oradata/cihz/redo01b.log') SIZE 5M,
GROUP 2 ('/opt/oracle/oradata/cihz/redo02a.log','/opt/oracle/oradata/cihz/redo02b.log') SIZE 5M,
GROUP 3 ('/opt/oracle/oradata/cihz/redo03a.log','/opt/oracle/oradata/cihz/redo03b.log') SIZE 5M
MAXLOGFILES 15
MAXLOGHISTORY 10
MAXDATAFILES 1024
MAXINSTANCES 255
CHARACTER SET ZHS16GBK
DATAFILE '/opt/oracle/oradata/cihz/system01.dbf' SIZE 500M
EXTENT MANAGEMENT LOCAL
DEFAULT TEMPORARY TABLESPACE temp
TEMPFILE '/opt/oracle/oradata/cihz/temp01.dbf'
SIZE 500M REUSE
UNDO TABLESPACE undotbs
DATAFILE '/opt/oracle/oradata/cihz/undo01.dbf'
SIZE 500M REUSE AUTOEXTEND ON NEXT 5120K MAXSIZE UNLIMITED;
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 CREATE DATABASE cihz
*
ERROR at line 1:
ORA-01213: MAXINSTANCES may not exceed 63
SQL>
*
ERROR at line 1:
ORA-01501: CREATE DATABASE failed
ORA-01222: MAXINSTANCES of 63 requires MAXLOGFILES be at least 126, not 15
按照错误提示修改过来就行了。
建立其他表空间:
CREATE TABLESPACE users LOGGING
DATAFILE '/opt/oracle/oradata/cihz/users01.dbf'
SIZE 100M
EXTENT MANAGEMENT LOCAL;
CREATE TABLESPACE tools LOGGING
DATAFILE '/opt/oracle/oradata/cihz/tools01.dbf'
SIZE 100M
EXTENT MANAGEMENT LOCAL;
接下来的数据字典:
@/opt/oracle/product/9.2.0.1/rdbms/admin/catalog.sql
@/opt/oracle/product/9.2.0.1/rdbms/admin/catproc.sql
6、 测试
CREATE TABLESPACE cihz
DATAFILE '/opt/oracle/oradata/cihz/cihz01.dbf'
SIZE 500M ;
create user cihz identified by cihz
default tablespace cihz
TEMPORARY TABLESPACE temp
SQL> conn cihz/cihz
ERROR:
ORA-01045: user CIHZ lacks CREATE SESSION privilege; logon denied
Warning: You are no longer connected to ORACLE.
SQL> conn system/cihz
Connected.
SQL> grant connect ,resource to cihz;
Grant succeeded.
SQL> conn cihz/cihz
Error accessing PRODUCT_USER_PROFILE
Warning: Product user profile information not loaded!
You may need to run PUPBLD.SQL as SYSTEM
Connected.
SQL>
SQL> conn system/cihz
Connected.
SQL> @/opt/oracle/product/9.2.0.1/sqlplus/admin/pupbld.sql
DROP SYNONYM PRODUCT_USER_PROFILE
Synonym created.
SQL> conn cihz/cihz
Connected.
SQL> create table test(
2 a number,
3 b varchar2(20),
4 c blob
5 );
Table created.
SQL> insert into test (a,b)values (2,'asf');
1 row created.
SQL>