Вы находитесь на странице: 1из 6

Oracle 10g R2 installtion on CentOS 5.

5/RHEL
The main required packages for installing oracle are (on 32 bit architecture): binutils.i386 compat-gcc-7.3-2.96.128.i386 compat-gcc-c++-7.3-2.96.128.i386 compat-libstdc++-7.3-2.96.128.i386 compat-libstdc++-devel-7.3-2.96.128.i386 cpp.i386 gcc.i386 gcc-c++.i386 glibc.i386 glibc-common.i386 glibc-devel.i386 glibc-headers.i386 glibc-kernheaders.i386 libstdc++.i386 libstdc++-devel.i386 libaio libai-devel.i386 pdksh.i386 setarch.i386 sysstat.i386

Pre installation Steps:


1. Edit /etc/hosts file # 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 192.168.0.1 masudserver.masud.com masudserver 2. Edit /etc/sysctl.conf kernel.shmall = 2097152 kernel.shmmax = 2147483648 kernel.shmmni = 4096 # semaphores: semmsl, semmns, semopm, semmni 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.rmem_max=262144 net.core.wmem_default=262144 net.core.wmem_max=262144

3. Run the following command to change the kernel parameters # /sbin/sysctl -p 4. Add the following security parameter in /etc/security/limits.conf oracle soft nproc 2047 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536 5. Edit /etc/pam.d/login and add following line session required pam_limits.so 6. SElinux and firewall should be turned off; check /etc/selinux/config file SELINUX=disabled 7. Creating following users and Groups # groupadd oinstall # groupadd dba # useradd -g oinstall -G dba oracle # passwd oracle 8. Oracle will be installed in the following Directories # mkdir -p /u01/app/oracle/product/10.2.0/db_1 # chown -R oracle:oinstall /u01 9. Take backup of the file /etc/redhat-release to /etc/redhat-release.original and edit /etc/redhat-release # cp /etc/redhat-release /etc/redhat-release.original # echo redhat-4 > /etc/redhat-release 10. Edit the /home/oracle/.bash_profile add the following lines # Oracle Settings TMP=/tmp; export TMP TMPDIR=$TMP; export TMPDIR ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1; export ORACLE_HOME ORACLE_SID=masud; 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 11. Copy the file 10201_database_linux32.zip into oracle user home directory, i.e, /home/oracle and unzip the file.

Installation Steps:
12. Now the time to start installation when you extract the file it will create a database directory. $ cd database $ ./runInstaller This will start Oracle Universal Installer 13 . In Oracle Universal Installer a. Select Advanced Installation b. Here Specify Inventory Directory and Credentials Values are : /u01/app/oracle/oraInventory and OS group name will be onistall c. Select Installation Type Enterprise Edition d. Specify Home Details Name: Oracle10gdb_1 Path: /u01/app/oracle/product/10.2.0/db_1 e. Product Specific Prerequisite checks This should come passed, otherwise select user verified f. Select Configuration Options Create Database g. Select Database configuration General Purpose

h. Specify Database configuration options Global Database Name: masud SID : masud i. Select Database management options Use database control for database management j. Specify Database Storage Option select File System location /u01/app/oracle/oradata k. Specify Backup and Recovery Options Do not enable l. Specify Database Schema Passwords Give a password which you must remember. m. Summery and install when the installation finishes it will show Database Configuration Assistant click ok Now it will give you two scripts which must be run as root # /u01/app/oracle/oraInventory/orainstRoot.sh # /u01/app/oracle/product/10.2.0/db_1/root.sh This is the end of installation part.

Post installation Steps


14. Just copy back # cp /etc/redhat-release.original /etc/redhat-release 15. Edit the file /etc/oratab, In last change N to Y masud:/u01/app/oracle/product/10.2.0/db_1:Y

How To Startup Oracle Database


1. Login to the system with oracle username
Typical oracle installation will have oracle as username and dba as group. On Linux, do su to oracle as shown below.
$ su - oracle

2. Connect to oracle sysdba


Make sure ORACLE_SID and ORACLE_HOME are set properly as shown below.

$ env | grep ORA ORACLE_SID=DEVDB ORACLE_HOME=/u01/app/oracle/product/10.2.0

You can connect using either / as sysdba or an oracle account that has DBA privilege.
$ sqlplus '/ as sysdba' SQL*Plus: Release 10.2.0.3.0 - Production on Sun Jan 18 11:11:28 2009 Copyright (c) 1982, 2006, Oracle. All Rights Reserved. Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production With the Partitioning and Data Mining options SQL>

3. Start Oracle Database


The default SPFILE (server parameter file) is located under $ORACLE_HOME/dbs. Oracle will use this SPFILE during startup, if you dont specify PFILE. Oracle will look for the parameter file in the following order under $ORACLE_HOME/dbs. If any one of them exist, it will use that particular parameter file. 1. spfile$ORACLE_SID.ora 2. spfile.ora 3. init$ORACLE_SID.ora Type startup at the SQL command prompt to startup the database as shown below.
SQL> startup ORACLE instance started. Total System Global Area Fixed Size Variable Size Database Buffers Redo Buffers Database mounted. Database opened. SQL> 812529152 2264280 960781800 54654432 3498640 bytes bytes bytes bytes bytes

If you want to startup Oracle with PFILE, pass it as a parameter as shown below.
SQL> STARTUP PFILE=/u01/app/oracle/product/10.2.0/dbs/init.ora

How To Shutdown Oracle Database


Following three methods are available to shutdown the oracle database: 1. Normal Shutdown

2. Shutdown Immediate 3. Shutdown Abort

1. Normal Shutdown
During normal shutdown, before the oracle database is shut down, oracle will wait for all active users to disconnect their sessions. As the parameter name (normal) suggest, use this option to shutdown the database under normal conditions.
SQL> shutdown Database closed. Database dismounted. ORACLE instance shut down. SQL>

2. Shutdown Immediate
During immediate shutdown, before the oracle database is shut down, oracle will rollback active transaction and disconnect all active users. Use this option when there is a problem with your database and you dont have enough time to request users to log-off.
SQL> shutdown immediate; Database closed. Database dismounted. ORACLE instance shut down. SQL>

3. Shutdown Abort
During shutdown abort, before the oracle database is shutdown, all user sessions will be terminated immediately. Uncomitted transactions will not be rolled back. Use this option only during emergency situations when the shutdown and shutdown immediate doesnt work.
$ sqlplus SQL*Plus: Copyright Connected '/ as sysdba' Release 10.2.0.3.0 - Production on Sun Jan 18 11:11:33 2009 (c) 1982, 2006, Oracle. All Rights Reserved. to an idle instance.

SQL> shutdown abort ORACLE instance shut down. SQL>

Вам также может понравиться