oracle安装简洁步骤

update:2014-09-09

创建表空间,用户,授权.

SQL>
select * from dba_data_files;
create tablespace shequ datafile '/u01/oracle/oradata/shequ/shequ01.dbf' size 4096m autoextend on;
create user shequ identified by shequ;
alter user shequ default tablespace shequ;
grant connect,resource,dba to shequ;
$ sqlplus shequ/shequ@shequ

==================================

1,选择自定义模式

选择安装类型的时候,注意有产品语言选项

2,选择仅安装软件,然后再netca,dbca来配置监听并建库。

dbca的时候,选择custom database;

到了数据文件存放设置步骤时,最好自定义路径

到了flash recovery area 时候,可以反选

并建议启用归档,勾选enable archiving 并手动指定归档日志存放的绝对路径,比如:/u01/arch(设置一个路径即可)

到了数据库组件选择部分,仅选择最下方 企业管理资料库即可

***重要是设置初始化参数部分***

占物理内存的百分比

块大小

并发连接数

字符编码,使用unicode(AL32UTF8),或者指定ZHS16GBK(不推荐这种方式),根据具体业务库情况具体确定,而且要注意和环境变量的配置保持一致;地区字符设置,默认语言可以不用修改

这里注意配置oracle用户.bash_profile中的export NLS_LANG=时候要写正确:

export NLS_LANG=AMERICAN_AMERICA.AL32UTF8

连接模式:专用,共享(推荐专用)

到了storage步骤,需要调整系统辅助,系统,临时,undo表空间的文件大小 

最后,建议勾选“生成手工建库”脚本

3,切记,切记配置/etc/hosts

如果报错:

An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : 11 occurred at PC=0xB7597503
Function=index+0x63
Library=/lib/libc.so.6

Current Java thread:
at oracle.net.common.NetGetEnv.getDNSDomain(Native Method)
at oracle.net.ca.ConfigureProfile.setDefaultProfileParams(Unknown Source)
at oracle.net.ca.InitialSetup.setupConfigObjects(Unknown Source)
at oracle.net.ca.InitialSetup.<init>(Unknown Source)
at oracle.net.ca.NetCA.main(Unknown Source)
那么就:
#vi /etc/sysconfig/network
#ifconfig eth0
#vi /etc/hosts

-----------------------

一,下载安装介质(略)

二,安装系统(略),注意分区、自定义组件包、修改/etc/hosts、/etc/sysconfig/network、系统时间等基本细节。

三,安装依赖包:

#yum -y install yum-utils.noarch

查看依赖包是否有安装:

#rpm -q compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel glibc glibc-devel glibc-common gcc gcc-c++ kernel-headers libgcc libaio libaio-devel libstdc++ libstdc++-devel unixODBC unixODBC-devel sysstat binutils make

单纯下载依赖包:

#yumdownloader compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel glibc glibc-devel glibc-common gcc gcc-c++ kernel-headers libgcc libaio libaio-devel libstdc++ libstdc++-devel unixODBC unixODBC-devel sysstat binutils make

yum方式安装依赖包:

#yum -y install compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel glibc glibc-devel glibc-common gcc gcc-c++ kernel-headers libgcc libaio libaio-devel libstdc++ libstdc++-devel unixODBC unixODBC-devel sysstat binutils make 

四,创建组及用户并设置密码:

# mkdir -p /u01/oracle && groupadd oinstall && groupadd dba && groupadd oper && useradd -g oinstall -G dba oracle && passwd oracle

五,移动安装目录,修改所属,修改目录权限:

# cp -Rv database/ /u01

# chown -R oracle:oinstall /u01/ && chmod -R 775 /u01/

 

六,修改参数文件3种,并配置环境变量2处:

A.

#vi /etc/sysctl.conf  具体值可根据oracle安装向导检测结果返回来修正

kernel.shmall = 268435456

kernel.shmmax = 2147483648

kernel.shmmni = 4096

kernel.sem = 250 32000 100 128

fs.file-max = 65536

net.ipv4.ip_local_port_range = 1024 65000

net.core.rmem_default = 4194304

net.core.rmem_max = 4194304

net.core.wmem_default = 262144

net.core.wmem_max = 262144

#sysctl -p 使生效

B.

#vi /etc/security/limits.conf

oracle soft nproc 2047

oracle hard nproc 16384

oracle soft nofile 1024

oracle hard nofile 65536

 

C.

#vi /etc/pam.d/login

#session required /lib/security/pam_limits.so

session required /lib64/security/pam_limits.so(64位系统使用这个路径)

session required pam_limits.so

(1)

#vi /etc/profile,可选,修改内容同下

(2)

#vi /home/oracle/.bash_profile

export ORACLE_BASE=/u01/oracle

export ORACLE_HOME=/u01/oracle/version

export ORACLE_SID= testdb

export PATH=$PATH:$ORACLE_HOME/bin:$ORACLE_HOME

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib:/lib:$ORACLE_HOME

export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK

export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib:$ORACLE_HOME;

 

七,执行安装脚本

#cd /u01/database

# ./runInstaller

八,如果使用建库脚本来建库的话,要注意脚本路径对应,sql是否有在引用的路径下存在

      

[oracle@app1 scripts]$ vi sid.sh
[oracle@app1 scripts]$ ./sid.sh
You should Add this entry in the /etc/oratab: sid:/u01/oracle/10:Y

SQL*Plus: Release 10.2.0.1.0 - Production on Tue Feb 25 18:03:45 2014

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

specify a password for sys as parameter 1
Enter value for 1:

如果成功的话,可能是这种的结尾:

==============  End of creation  ==============

Connected.
SQL> spool /u01/oracle/admin/ebank/scripts/postDBCreation.log
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> connect "SYS"/"&&sysPassword" as SYSDBA
Connected to an idle instance.
SQL> startup mount pfile="/u01/oracle/admin/sid/scripts/init.ora";
ORACLE instance started.




Total System Global Area 1174405120 bytes
Fixed Size                  1219040 bytes
Variable Size             301991456 bytes
Database Buffers          855638016 bytes
Redo Buffers               15556608 bytes
Database mounted.
SQL> alter database archivelog;
SQL> alter database open;
SQL> connect "SYS"/"&&sysPassword" as SYSDBA
Connected.
SQL> set echo on
SQL> create spfile='/u01/oracle/10/dbs/SQL> connect "SYS"/"&&sysPassword" as SYSDBA
Connected to an idle instance.
SQL> startup ;
ORACLE instance started.

Total System Global Area 1174405120 bytes
Fixed Size                  1219040 bytes
Variable Size             301991456 bytes
Database Buffers          855638016 bytes
Redo Buffers               15556608 bytes
Database mounted.
Database opened.
spfileebank.ora' FROM pfile='/u01/oracle/admin/sid/scripts/init.ora';
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> connect "SYS"/"&&sysPassword" as SYSDBA
Connected to an idle instance.
SQL> startup ;
ORACLE instance started.

Total System Global Area 1174405120 bytes
Fixed Size                  1219040 bytes
Variable Size             301991456 bytes
Database Buffers          855638016 bytes
Redo Buffers               15556608 bytes
Database mounted.
Database opened.SQL> alter user SYSMAN identified by "&&sysmanPassword" account unlock;
old   1: alter user SYSMAN identified by "&&sysmanPassword" account unlock
new   1: alter user SYSMAN identified by "sid" account unlock
SQL> alter user DBSNMP identified by "&&dbsnmpPassword" account unlock;
old   1: alter user DBSNMP identified by "&&dbsnmpPassword" account unlock
new   1: alter user DBSNMP identified by "sid" account unlock
SQL> select 'utl_recomp_begin: ' || to_char(sysdate, 'HH:MI:SS') from dual;

'UTL_RECOMP_BEGIN:'||TO_CHAR(SYSDATE,'HH:MI:SS')
----------------------------------------------------
utl_recomp_begin: 06:22:15
SQL> execute utl_recomp.recomp_serial();

SQL> select 'utl_recomp_end: ' || to_char(sysdate, 'HH:MI:SS') from dual;

'UTL_RECOMP_END:'||TO_CHAR(SYSDATE,'HH:MI:SS')
------------------------------------------------
utl_recomp_end: 06:22:18
SQL> host /u01/oracle/10/bin/emca -config dbcontrol db -silent -DB_UNIQUE_NAME ebank -PORT 1521 -EM_HOME /u01/oracle/10 -LISTENER LISTENER -SERVICE_NAME ebank -SYS_PWD &&sysPassword -SID ebank -ORACLE_HOME /u01/oracle/10 -DBSNMP_PWD &&dbsnmpPassword -HOST ebank -LISTENER_OH /u01/oracle/10 -LOG_FILE /u01/oracle/admin/ebank/scripts/emConfig.log -SYSMAN_PWD &&sysmanPassword;

STARTED EMCA at Feb 25, 2014 6:22:19 PM
EM Configuration Assistant, Version 10.2.0.1.0 Production
Copyright (c) 2003, 2005, Oracle.  All rights reserved.

Feb 25, 2014 6:22:19 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/oracle/admin/ebank/scripts/emConfig.log.
Feb 25, 2014 6:22:26 PM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Feb 25, 2014 6:24:04 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully

Feb 25, 2014 6:24:04 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is http://app1:1158/em <<<<<<<<<<<
Enterprise Manager configuration completed successfully
FINISHED EMCA at Feb 25, 2014 6:24:04 PM

SQL> spool /u01/oracle/admin/sid/scripts/postDBCreation.log
SQL>

  

要注意,如果是删除之前安装介质后,重新安装时,可能会报错:

Oracle SID在本机上已经存在,请指定一个不同的SID

这时候,需要注释掉:

/etc/oratab: sid:/u01/oracle/10:Y

 

 

 

九,常见简单报错处理:

 

1.报错:checking operating system version: must be,版本不对;

# cat /etc/redhat-release

# vi ./database/install/oraparam.ini

[Certified Versions] Linux=redhat-3,SuSE-9,redhat-4,UnitedLinux-1.0,asianux-1,asianux-2,redhat-6.2

  

# cat /etc/redhat-release 
#CentOS release 6.5 (Final)
redhat-6

 

2.报错:libxp.so.6 cannot open shared object file  no such file or dir,缺包

#yum install libXp.so.6  libXp-devel  xorg-x11-deprecated-libs gcc-c++

 这里比较变态的是,作为64位系统,安装了64位的libXp,是不行的;因为oracle的这个安装向导一定要i386的包才行。  

 http://sysadmin.blog.51cto.com/83876/386571

http://www.puschitz.com/InstallingOracle10g.shtml

  • $ ./runInstaller ... Exception java.lang.UnsatisfiedLinkError: /tmp/OraInstall2005-06-15_07-36-25AM/jre/1.4.2/lib/i386/libawt.so: libXp.so.6: cannot open shared object file: No such file or directory occurred.. java.lang.UnsatisfiedLinkError: /tmp/OraInstall2005-06-15_07-36-25AM/jre/1.4.2/lib/i386/libawt.so: libXp.so.6: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1477) ...
      You may get this error message on RHEL3 x86_64, RHEL4 x86_64, and on other systems. Even though you most probably have 

/usr/X11R6/lib64/libXp.so.6

      installed on your system, this error messages is complaining that it can't find the 

libXp.so.6

       shared library for i386:
 /tmp/OraInstall2005-06-15_07-36-25AM/jre/1.4.2/lib/i386/libawt.so: libXp.so.6: cannot open shared object file: No such file or directory

 

  3,

ORA-12162: TNS:net service name is incorrectly specified

 

注意,配置oracle用户.bash_profile中export ORACLE_SID=sid时;要注意=号后面不要有空格

不能写成:

export ORACLE_SID=空格sid 

 

4,报swap空间不足够  

 

[root@product-kvm u01]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_productkvm-LogVol01 31G 4.5G 25G 16% /
tmpfs 7.8G 368K 7.8G 1% /dev/shm
/dev/sda1 194M 35M 150M 19% /boot
/dev/mapper/vg_productkvm-LogVol02 789G 19G 730G 3% /opt
[root@product-kvm u01]# cd /var/swqp
-bash: cd: /var/swqp: No such file or directory
[root@product-kvm u01]# cd /var/swap
-bash: cd: /var/swap: No such file or directory
[root@product-kvm u01]# mkdir /var/swap
[root@product-kvm u01]# chmod 700 /var/swap/
[root@product-kvm u01]# dd if=/dev/mapper/vg_productkvm-LogVol01 of=/var/swap/file.swp bs=1024 count=65536
65536+0 records in
65536+0 records out
67108864 bytes (67 MB) copied, 0.464329 s, 145 MB/s
[root@product-kvm u01]# mkswap /var/swap/file.swp
mkswap: /var/swap/file.swp: warning: don't erase bootbits sectors
on whole disk. Use -f to force.
Setting up swapspace version 1, size = 65532 KiB
no label, UUID=56a77a2c-deaa-4f5b-99ec-d8f1460e2b27
[root@product-kvm u01]# free -m
total used free shared buffers cached
Mem: 15900 15742 158 0 145 766
-/+ buffers/cache: 14830 1070
Swap: 4499 4499 0
[root@product-kvm u01]# swapon /var/swap/file.swp
[root@product-kvm u01]# free -m
total used free shared buffers cached
Mem: 15900 15546 353 0 145 765
-/+ buffers/cache: 14635 1264
Swap: 4563 4499 63
[root@product-kvm u01]#

5,安装 32位包:

# yum install -y  compat-libstdc++-33.i686 glibc.i686 glibc-devel.i686 libaio.i686 libgcc.i686 libstdc++.i686 unixODBC.i686 unixODBC-devel.i686 

 

 

 

 

你可能感兴趣的:(oracle)