文档库 最新最全的文档下载
当前位置:文档库 › oracle安装

oracle安装

安装过程若是乱码则用export LANG=en

第一步:执行vi /etc/sysctl.conf,i键之后可以编辑,修改后esc退出编辑,运行sysctl -p使修改生效。
fs.file-max = 6815744
fs.aio-max-nr = 1048576
Kernel.shmall = 268435456
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576


第二步:为Oracle用户设置shell限制:在/etc/security/limits.conf文件的最后一行添加:
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536


第三步:在/etc/pam.d/login的最后一行加入:
session required /lib/security/pam_limits.so
session required pam_limits.so


第四步:我们开始创建ORACLE的用户群组并为用户oracle设置密码:

#groupadd oinstall
#groupadd dba
#useradd –g oinstall –G dba oracle
#passwd oracle
新的 密码:oracle 密码是不可见的,直接输入按enter结束
重新输入新的 密码:oracle

第五步:切换到Oracle用户
1、mkdir u01文件夹 存储Oracle应用软件
2、mkdir soft 文件夹 存储Oracle安装源文件

第六步:配置oracle的.bash_profile文件(环境变量):
切换到oracle用户
ORACLE_BASE=/home/oracle/u01
ORACLE_HOME=$ORACLE_BASE/oracle
PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_BASE ORACLE_HOME ORACLE_SID
执行source .bash_profile 使环境变量生效


第七步:切换到root用户
在root下执行xhost +
第八步:
切换到Oracle用户 执行./runinstaller


运行脚本

配置sid
ORACLE_SID=orcl






错误1:sqlplus libclntsh.so.11.1 Permission denied 解决方法

[root@localhost bin]# semanage fcontext -a -t textrel_shlib_t /home/oracle/u01/oracle/lib/libclntsh.so.11.1
[root@localhost bin]# restorecon -R -v /home/oracle/u01/oracle/lib/libclntsh.so.11.1

错误2: [INS-20802]OracleNetConfigurationAssistantfailed

解决方案:
需打名为p8670579_112010_LINUX.zip的补丁。
出现此错误时,先不要关闭安装程序:
进入该补丁所在目录(使用oracle用户)

$ unzip p8670579_112010_LINUX.zip
[oracle@ora11gR2 OPatch]$ cd /u01/oracle/8670579/
[oracle@ora11gR2 8670579]$ /u01/oracle/OPatch/opatch apply -invPtrLoc /u01/oracle/oraInst.loc

其中/u01/oracle可用$ORACLE_HOME代替.
补丁打好后,点击安装程序的retry,继续安装即可。


1.启动问题 ora-01078
解决方法: 将$ORACLE_BASE/admin/数据库名称/pfile目录下的init.ora.012009233838形式的文件copy 到$ORACLE_HOME/dbs目录下initoracle.ora即可。(注:initoracle.ora中的oracle为你的实例名 ORACLE_SID)
2.ORA-00845: MEMORY_TARGET not supported on this system
3.ORA-01507: database not mounted
ORA-01507: database not mounted (转)
热度 2已有 1183 次阅读2010-11-3 20:55 |个人分类:技术文章

| database, mounted, not
将今天搜索时看到两篇文章转载收藏一下:
ORA-01102: cannot mount database in EXCLUSIVE mode
一.今天在STARTUP一数据库时,发生如下错误:
SQL> conn /as sysdba
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 276824064 bytes
Fixed Size 778736 bytes
Variable Size 137371152 bytes
Database Buffers 138412032 bytes
Redo Buffers 262144 bytes
ORA-01102: cannot mount database in EXCLUSIVE mode
SQL> shutdown immediate
ORA-01507: database not mounted

ORACLE instance shut down.
GOOGLE一下,发现是lk文件造成的,该文件位于ORALCE_HOME下的dbs目录下,马上检查该文件:
[root@qa-oracle dbs]# fuser -u lkNDMSQA
lkNDMSQA: 6666(oracle) 6668(oracle) 6670(oracle) 6672(oracle) 6674(oracle) 6676(oracle) 6678(oracle) 6680(oracle) 6690(oracle) 6692(oracle) 6694(oracle) 6696(oracle) 6737(oracle) 6830(oracle)
果然该文件没释放,用fuser命令kill掉:
[root@qa-oracle dbs]# fuser -k lkNDMSQA
lkNDMSQA: 6666 6668 6670 6672 6674 6676 6678 6680 6690 6692 6694 6696 6737 6830
[root@qa-oracle dbs]# fuser -u lkNDMSQA
然后:
SQL> startup
ORACLE instance started.
Total System Global Area 276824064 bytes
Fixed Size 778736 bytes
Variable Size 137371152 bytes
Database Buffers 138412032 bytes
Redo Buffers 262144 bytes
Database mounted.
Database opened.
SQL>
数据库成功OPEN.
二.说明Oracle被异常关闭时,有资源没有被释放,一般有以下几种可能,
1、 Oracle的共享内存段或信号量没有被释放;
2、 Oracle的后台进程(如SMON、PMON、DBWn等)没有被关闭;
3、 用于锁内存的文件lk和sgadef.dbf文件没有被删除。
首先,虽然我们的系统是HA系统,但是备节点的实例始终处在关闭状态,这点通过在备节点上查数据库状态可以证实。
其次、是因系统掉电引起数据库宕机的,系统在接电后被重启,因此我们排除了第二种可能种的1、2点。最可疑的就是第3点了。
查$ORACLE_HOME/dbs目录:
$ cd $ORACLE_HOME/dbs
$ ls sgadef*
sgadef* not found
$ ls lk*
lkORA92
果然,lk文件没有被删除。将它删除掉
$ rm lk*
再启动数据库,成功。
三.有可能还会出现以下错误
ORA-00205: error in identifying control file, check alert log for more info
报此错误有一种情况是在环境变量里面没添加NLS_LANG,必须加上这一句。
export NLS_LANG=AMERICAN_CHINA.ZHS16GBK


ORA-01102: cannot mount database in EXCLUSIVE mode
今天在STARTUP一数据库时,发生如下错误:

SQL> conn /as sysdba
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 276824064 bytes
Fixed Size 778736 bytes
Variable Size 1373711

52 bytes
Database Buffers 138412032 bytes
Redo Buffers 262144 bytes
ORA-01102: cannot mount database in EXCLUSIVE mode
SQL> shutdown immediate
ORA-01507: database not mounted

ORACLE instance shut down.

GOOGLE一下,发现是lk文件造成的,该文件位于ORALCE_HOME下的dbs目录下,马上检查该文件:

[root@qa-oracle dbs]# fuser -u lkNDMSQA
lkNDMSQA: 6666(oracle) 6668(oracle) 6670(oracle) 6672(oracle) 6674(oracle) 6676(oracle) 6678(oracle) 6680(oracle) 6690(oracle) 6692(oracle) 6694(oracle) 6696(oracle) 6737(oracle) 6830(oracle)

果然该文件没释放,用fuser命令kill掉:
[root@qa-oracle dbs]# fuser -k lkNDMSQA
lkNDMSQA: 6666 6668 6670 6672 6674 6676 6678 6680 6690 6692 6694 6696 6737 6830
[root@qa-oracle dbs]# fuser -u lkNDMSQA

然后:

SQL> startup
ORACLE instance started.
Total System Global Area 276824064 bytes
Fixed Size 778736 bytes
Variable Size 137371152 bytes
Database Buffers 138412032 bytes
Redo Buffers 262144 bytes
Database mounted.
Database opened.
SQL>

数据库成功OPEN.




相关文档