Chinaunix首页 | 论坛 | 博客
  • 博客访问: 262316
  • 博文数量: 44
  • 博客积分: 1431
  • 博客等级: 上尉
  • 技术积分: 558
  • 用 户 组: 普通用户
  • 注册时间: 2010-12-24 12:53
文章分类
文章存档

2012年(1)

2011年(28)

2010年(15)

分类: Oracle

2010-12-24 13:47:00

How to deploy oracle 10 on Linux platform

Step 1 Some missed rpm packet which included pdksh,sysstat-5.0.5-1.i386.rpm,binutils, libXp-1.0.0-8.1.el5.i386.rpm, xloadimage-4.1-9.i386.rpm, xscreensaver-4.18-5.rhel4.2.i386.rpm are missed, so you should install the rpm packets firstly, pdksh,sysstat,binutils can be found in your Redhat install DVD.


Step 2 Configuring the Linux Kernel Parameters, vi /etc/sysctl.conf, then add the followed
scripts at the end of sysctl.conf
kernel.shmall = 2097152
kernel.shmmax = 536870912(the value should half of the physic memory)
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=262144
net.core.wmem_default=262144
net.core.rmem_max=262144
net.core.wmem_max=262144


save the sysctl.conf
then run command:sysctl -p for applying what you had changed.

Step 3  Setting Shell Limits for the oracle User(This is optional)
Oracle recommends setting limits on the number of processes and open files each Linux account may use. To make these changes, cut and paste the following commands as root: 
cat >> /etc/security/limits.conf <
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
EOF

cat >> /etc/pam.d/login <
session required /lib/security/pam_limits.so
EOF

#Run the following scripts

cat >> /etc/profile <
if [ \$USER = "oracle" ]; then 
 if [ \$SHELL = "/bin/ksh" ]; then
 ulimit -p 16384
 ulimit -n 65536
 else
 ulimit -u 16384 -n 65536
 fi
 umask 022
fi
EOF

cat >> /etc/csh.login <
if ( \$USER == "oracle" ) then
 limit maxproc 16384
 limit descriptors 65536
 umask 022
endif
EOF


Step 4 According to oracle ,oracle10g didn't support Red Hat Enterprise Linux Server release 5 (Tikanga), so you should modify /etc/redhat-release, just modify Red Hat Enterprise Linux Server release 5 (Tikanga)  as redhat-4
And after you had finished the setup , restore the value

Step 5 In the process of installing, oracle setup program will check your preconditions, and a static IP address is needed, else oracle setup program will throw a error message as followed:
Recommendation: Oracle supports installations on systems with DHCP-assigned public IP addresses.
And here is the way to fix it, just do the followed step:
Login the Linux system as root, then modify /etc/hosts, the contents of hosts will look like the followed:
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1              localhost.localdomain localhost
::1            localhost6.localdomain6 localhost6
59.53.50.67            ringlinux.com ringlinux

Just change 59.53.50.67 as your machine IP address, for example:192.168.1.52
Then you need save what you had modified, so run a command named hostname
$hostname 
Once you had run the command, you will get a printed message: Your host name(ringlinux.com), if you can see the message, it means you got it.

Step 6 Create the Oracle Groups and User Account
/usr/sbin/groupadd oinstall
/usr/sbin/groupadd dba
/usr/sbin/useradd -m -g oinstall -G dba oracle
id oracle

Then set password for oracle
Passwd oracle

Step 7 Create directories
Issue the following commands as root: 
mkdir -p /opt/oracle
chown -R oracle:oinstall /opt/oracle
chmod -R 775 /opt/oracle

Step 8 Use root edit /home/oracle/.bash_profile, add the followed scripts into it
# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_BASE=/opt/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1; export ORACLE_HOME
ORACLE_SID=orcl; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
if [ $USER = "oracle" ]; then
 if [ $SHELL = "/bin/ksh" ]; then
  ulimit -p 16384
   ulimit -n 65536
 else
  ulimit -u 16384 -n 65536
 fi
fi


Step 9 $ ./runInstaller
   1. Select Installation Method
          * Select Basic Installation
          * Oracle Home Location: /u01/app/oracle/product/10.2.0/db_1
          * Installation Type: Enterprise Edition (1.3GB)
          * UNIX DBA Group:  oinstall
          * Make sure Create Starter Database is checked
          * Global Database Name: demo1
          * Enter the Database Password and Confirm Password
          * Click on Next
   2. Specify Inventory Directory and Credentials
          * Inventory Directory: /u01/app/oracle/oraInventory
          * Operating System group name:  oinstall
          * Click on Next
   3. Product-specific Prerequisite Checks
          * If you've been following the steps in this guide, all the checks should pass without difficulty. If one or more checks fail, correct the problem before proceeding. 
          * Click on Next
   4. Summary
          * A summary of the products being installed is presented.
          * Click on Install.
   5. Configuration Assistants
          * The Oracle Net, Oracle Database, and iSQL*Plus configuration assistants will run automatically
   6. Execute Configuration Scripts
          * At the end of the installation, a pop up window will appear indicating scripts that need to be run as root.  Login as root and run the indicated scripts.
          * Click on OK when finished.
   7. End of Installation
          * Make note of the URLs presented in the summary, and click on Exit when ready.
   8. Congratulations! Your new Oracle Database 10g Release 2 database is up and ready for use.

Once the oracle setup process had ended, you will be noticed that the usage of visiting oracle as followed:
The following J2EE Applications have been deployed and are accessible at the URLs listed below.
iSQL*Plus URL:
iSQL*Plus DBA URL:
/dba
Enterprise Manager 10g Database Control URL:

Attention: In the installation process, do choose advanced option, and change the character as a type of chinese  character,otherwise, chinese character can not display normally.


Reboot the system and login as root, open a ,then su to oracle:
$source .bash_profile dbstart
$sqlplus "/as sysdba"
$startup
$exit(Once the database has been mounted)
$lsnrctl start 
$emctl start dbconsole
$dbstart
$isqlplusctl start

you can run command: sqlplus /nolog to login isql@plus
then run command: connect system as sysdba

$dbstop
$emctl stop dbconsole
$lsnrctl stop


Remove Oracle 10g from linux
1. rm -rf /opt/oracle
2. rm -rf /etc/oraInst.loc  /etc/oratab
3. rm -rf /usr/local/bin/coraenv /usr/local/bin/oraenv /usr/local/bin/dbhome
4. remove oracle user and group(If you want to redeploy oracle database server,just escape this row);In some situation, if you want to redeploy oracle in the same machine, and you log into X window as oracle user, you will find that you can't log in X window, and fix this promble is log in as root then delete groups: oinstall,dba and user oracle,and recreate them.

阅读(1955) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~