Wednesday, 13 August 2014

SILENT ORACLE INSTALLATION in RHEL

./runInstaller -record -destinationFile /tmp/11gR2.rsp

./runInstaller -silent -responseFile /tmp/11gR2.rsp
/u01/app/oracle/product/11.2.0/db_1

[oracle@silent-oracle database]$ set DISPLAY=192.16.61.100:0.0
[oracle@silent-oracle database]$ export DISPLAY=192.16.61.100:0.0
[oracle@silent-oracle database]$ echo $DISPLAY
192.16.61.100:0.0
xdpyinfo | grep 'dimensions:'

An unexpected error has been detected by HotSpot Virtual Machine:
#
#  SIGSEGV (0xb) at pc=0x0000003c8b214d70, pid=1964, tid=139905424221968
#
# Java VM: Java HotSpot(TM) 64-Bit Server VM (1.5.0_30-b03 mixed mode)
# Problematic frame:
# C  [ld-linux-x86-64.so.2+0x14d70]
#
# An error report file with more information is saved as hs_err_pid1964.log
#
# If you would like to submit a bug report, please visit:

ORACLE_HOSTNAME=silent-oracle; export ORACLE_HOSTNAME
ORACLE_BASE=/u01/app/oracle/; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1; export ORACLE_HOME
ORACLE_SID=bcbldb; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=$ORACLE_HOME/bin:/usr/sbin:$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

export JAVA_HOME=/tmp/jdk1.7.0_07
export PATH=$PATH:/tmp/jdk1.7.0_07/bin:

# User specific environment and startup programs

PATH=$PATH:$HOME/bin


#   http://java.sun.com/webapps/bugreport/crash.jsp
#


alternatives --config java
export LD_BIND_NOW=1


./runInstaller -silent -force \
FROM_LOCATION=/u01/SOFT/database/stage/products.xml \
oracle.install.option=INSTALL_DB_SWONLY \
UNIX_GROUP_NAME=oinstall \
INVENTORY_LOCATION=/u01/app/oracle/oraInventory \
ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1 \
ORACLE_HOME_NAME="OraDb11g_Home1" \
ORACLE_BASE=/u01/app/oracle \
oracle.install.db.InstallEdition=SE \
oracle.install.db.isCustomInstall=false \
oracle.install.db.DBA_GROUP=dba \
oracle.install.db.OPER_GROUP=dba \
DECLINE_SECURITY_UPDATES=true

1. ./u01/app/oracle/oraInventory/orainstRoot.sh
2. /u01/app/oracle/product/11.2.0/db_1/root.sh


[oracle@localhost database]$ exit
# As a root user, execute the following script(s):
[root@localhost ~]$ /home/oracle/oraInventory/orainstRoot.sh
[root@localhost ~]$ /u01/app/oracle/product/11.2/db_1/root.sh










/u01/bcbldb/oradata
/u01/bcbldb/redolog
ORACLE_SID=bcbldb
Step 1:Create Directory structure with Oracle ownership and permission as below:

[oracle@localhost ~]$ cd /u01

[oracle@localhost u01]$ mkdir bcbldb

[oracle@localhost u01]$ chmod -R 777 /u01/bcbldb/*

[oracle@localhost u01]$ chown -R oracle:oinstall /u01/bcbldb/*

[oracle@localhost bcbldb]$ mkdir adump diag flash_recovery_area

[oracle@localhost u01]$ chmod -R 777 /u01/bcbldb/*

[oracle@localhost u01]$ chown -R oracle:oinstall /u01/bcbldb/*


Step 2:Create Parameter file in $ORACLE_HOME/dbs location:

[oracle@localhost bcbldb]$ cd $ORACLE_HOME/dbs

[oracle@localhost dbs]$ vi init_bcbldb.ora

db_name='bcbldb'
memory_target=1G
processes = 1500
audit_file_dest='/u01/bcbldb/adump'
audit_trail ='db'
db_block_size=8192
db_domain=''
db_recovery_file_dest='/u01/bcbldb/flash_recovery_area'
db_recovery_file_dest_size=2G
diagnostic_dest='/u01/bcbldb/diag'
dispatchers='(PROTOCOL=TCP) (SERVICE=bcbldb)'
open_cursors=300
remote_login_passwordfile='EXCLUSIVE'
undo_tablespace='UNDOTBS1'
# You may want to ensure that control files are created on separate physical
# devices
control_files = (/u01/bcbldb/ora_control1.ctl,/u01/bcbldb/ora_control2.ctl)
compatible ='11.2.0'

/u01/bcbldb/oradata
/u01/bcbldb/redolog
ORACLE_SID=bcbldb
Step 3:Prepare Create Database script :

[oracle@localhost u01]$ cd /u01/bcbldb/

[oracle@localhost bcbldb]$ vi createdb_rashel.sql

CREATE DATABASE bcbldb
MAXLOGFILES 5
MAXLOGMEMBERS 5
MAXDATAFILES 100
MAXINSTANCES 1
LOGFILE
GROUP 1 '/u01/bcbldb/redolog/redo1.log' SIZE 10M,
GROUP 2 '/u01/bcbldb/redolog/redo2.log' SIZE 10M,
GROUP 3 '/u01/bcbldb/redolog/redo3.log' SIZE 10M
DATAFILE
'/u01/bcbldb/oradata/system.dbf' size 200M REUSE
sysaux datafile '/u01/bcbldb/oradata/sysaux.dbf' size 100m
undo tablespace UNDOTBS1
datafile '/u01/bcbldb/oradata/undo1.dbf' size 100m
DEFAULT TEMPORARY TABLESPACE temp1
TEMPFILE '/u01/bcbldb/oradata/temp01.dbf'
SIZE 100M REUSE
CHARACTER SET AL32UTF8
;
:wq

Step 4:Set the Oracle ENVIRONMENT and SID of Database in the Operating System:

[root@localhost bcbldb]# su - oracle

[oracle@localhost ~]$ vi .bash_profile

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export ORACLE_SID=orcl
export TNS_ADMIN=/u01/app/oracle/product/11.2.0/db_1/network/admin

:wq
[oracle@localhost ~]$ . .bash_profile
     This will set the Oracle Environment variables in Unix-based operating system.

[oracle@localhost ~]$export ORACLE_SID=bcbldb
     This will set the SID of the current Database in Unix-based operating system.


Step 5:Create the Password file.

[oracle@localhost ~]$orapwd file=$ORACLE_HOME/dbs/orapwbcbldb password=Oracle entries=10


Step 6:Create server parameter file.

[oracle@localhost dbs]$ sqlplus "/as sysdba"

SQL*Plus: Release 11.2.0.1.0 Production on Wed Mar 28 14:08:02 2012

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

Connected to an idle instance.

SQL>create spfile from pfile='$ORACLE_HOME/dbs/init.ora';


step 7:Start the Database in nomount State.
mount -t tmpfs shmfs -o size=2g /dev/shm
To make permanent changes to your file system update your fstab
# vi /etc/fstab
tmpfs  /dev/shm  tmpfs  defaults,size=3G  0 0

Update the new fstab file
# mount -a
SQL> startup nomount
ORA-00845: MEMORY_TARGET not supported on this system
SQL> startup nomount
ORACLE instance started.

Total System Global Area 1071333376 bytes
Fixed Size                  1341312 bytes
Variable Size             620759168 bytes
Database Buffers          444596224 bytes
Redo Buffers                4636672 bytes
SQL> select status from v$instance;

STATUS
------------
STARTED

Note:Common issue memory_target not supported,refer the below link for resolving:

http://rafioracledba.blogspot.in/2011/06/ora-00845-memorytarget-not-supported-on.html

Step 8:Execute Create Database script created in Step 3

SQL> @/u01/bcbldb/createdb_rashel.sql

Database created

Step 9:Execute the catalog.sql,catproc.sql and pupbld.sql scripts:
a)catalog.sql =>Creates dictionary tables and views
b)catproc.sql =>Creates PL/SQL procedures,functions and packages necessary.
c)pupbld.sql  =>Creates user profiles.


So our database is created. Now just run the catalog.sql,catproc.sql and pupbld.sql scripts.
WE will find catalog.sql and catproc.sql in $ORACLE_HOME/rdbms/admin path and pupbld.sql in $ORACLE_HOME/sqlplus/admin path.

SQL> @$ORACLE_HOME/rdbms/admin/catalog.sql
SQL> @$ORACLE_HOME/rdbms/admin/catproc.sql
conn system/manager

SQL>@$ORACLE_HOME/sqlplus/admin/pupbld.sql

SQL> alter user system identified by oracle;

User altered.

SQL> conn system/oracle
Enter password:
Connected.
SQL> @$ORACLE_HOME/sqlplus/admin/pupbld.sql
DROP SYNONYM PRODUCT_USER_PROFILE
             *
ERROR at line 1:
ORA-01434: private synonym to be dropped does not exist


  DATE_VALUE FROM PRODUCT_USER_PROFILE
                  *
ERROR at line 3:
ORA-00942: table or view does not exist


DROP TABLE PRODUCT_USER_PROFILE
           *
ERROR at line 1:
ORA-00942: table or view does not exist


ALTER TABLE SQLPLUS_PRODUCT_PROFILE ADD (LONG_VALUE LONG)
*
ERROR at line 1:
ORA-00942: table or view does not exist



Table created.

DROP TABLE PRODUCT_PROFILE
           *
ERROR at line 1:
ORA-00942: table or view does not exist


DROP VIEW PRODUCT_PRIVS
*
ERROR at line 1:
ORA-00942: table or view does not exist



View created.


Grant succeeded.

DROP PUBLIC SYNONYM PRODUCT_PROFILE
                    *
ERROR at line 1:
ORA-01432: public synonym to be dropped does not exist



Synonym created.

DROP SYNONYM PRODUCT_USER_PROFILE
             *
ERROR at line 1:
ORA-01434: private synonym to be dropped does not exist



Synonym created.

DROP PUBLIC SYNONYM PRODUCT_USER_PROFILE
                    *
ERROR at line 1:
ORA-01432: public synonym to be dropped does not exist

Synonym created.


Step 10:Verify the Dictionary views created.


SQL> select name from v$database;


Step 11:Change the Database mode from noarchive log to archive log mode
Changing to archive log mode:

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


SQL> archive log list
Database log mode              No Archive Mode
Automatic archival             Disabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     1
Current log sequence           3
SQL> shut immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.

Total System Global Area 1071333376 bytes
Fixed Size                  1341312 bytes
Variable Size             620759168 bytes
Database Buffers          444596224 bytes
Redo Buffers                4636672 bytes
Database mounted.
SQL> alter database archivelog;

Database altered.

SQL> select status from v$instance;

STATUS
------------
MOUNTED

SQL> alter database open;

Database altered.

SQL> select status from v$instance;

STATUS
------------
OPEN

SQL> archive log list
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     1
Next log sequence to archive   3
Current log sequence           3

# listener.ora Network Configuration File: vi /u01/oracle/app/product/11.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = silent-oracle)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )

ADR_BASE_LISTENER = /u01/oracle/app

# tnsnames.ora Network Configuration File: vi /u01/oracle/app/product/11.2.0/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

bcbldb =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = silent-oracle)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = bcbldb)
    )
  )

This completes the manual Database creation on Unix based Operating system....

Enjoy learning Oracle DBA....


Best regards,

RaShel :-)

No comments:

  Oracle 21c Cluster Setup & DB Creation on OEL-8.4 using Virtual-box       Moto: This document is created on traditional way to Insta...