Archive

Archive for the ‘oracle-install’ Category

How to install oracle TimesTen 11g on RedHat Enterprise Linux

November 5, 2011 Leave a comment

In this article we will learn how to install oracle TimesTen in memory-database on Redhat Enterprise Linux:

dbst8001:/etc>cat redhat-release
Red Hat Enterprise Linux Server release 5.5 (Tikanga)
dbst8001:/etc>id
uid=1000(oracle) gid=1000(oinstall) groups=1000(oinstall),1001(dba)
Create a directory /etc/TimesTen.
mkdir -p /etc/TimesTen
chown -R oracle:dba /etc/TimesTen
dbst8001:/u01/soft>ls -tlr
total 297408
drwxrwxrwx 5 root   root          4096 Feb  2  2011 linux8664
-rw-r--r-- 1 oracle oinstall 304236457 Nov  5 10:15 timesten112180.linux8664.tar.gz
run setup.sh to start installation.
dbst8001:/u01/soft/linux8664>./setup.sh

NOTE: Each TimesTen installation is identified by a unique instance name.
      The instance name must be a non-null alphanumeric string, not longer
      than 255 characters.

Please choose an instance name for this installation? [ tt1121 ]
Instance name will be 'tt1121'.
Is this correct? [ yes ] yes

Of the three components:

  [1] Client/Server and Data Manager
  [2] Data Manager Only
  [3] Client Only

Which would you like to install? [ 1 ] 1

Of the following options :

  [1] /home/oracle
  [2] /u01/soft
  [3] Specify a location
  [q] Quit the installation

Where would you like to install the tt1121 instance of TimesTen? [ 1 ] /u01/app
The directory /u01/app does not exist.
Do you want to create it? [ yes ] yes
Where would you like to create the daemon home directory? [ /u01/app/TimesTen/tt1121/info ]

The daemon logs will be located in /u01/app/TimesTen/tt1121/info
Would you like to specify a different location for the daemon logs? [ no ]
Installing into /u01/app/TimesTen/tt1121 ...
Uncompressing ...

NOTE: If you are configuring TimesTen for use with Oracle Clusterware, the
      daemon port number must be the same across all TimesTen installations
      managed within the same Oracle Clusterware cluster.

NOTE: All installations that replicate to each other must use the same daemon
      port number that is set at installation time. The daemon port number can
      be verified by running 'ttVersion'.

The default port number is 53388.

Do you want to use the default port number for the TimesTen daemon? [ yes ] yes
The daemon will run on the default port number (53388).

NOTE: For security, we recommend that you restrict access to the
      TimesTen installation to members of a single OS group. Only members of
      that OS group will be allowed to perform direct mode connections to
      TimesTen, and only members of that OS group will be allowed to perform
      operations that access TimesTen data stores, TimesTen files and shared
      memory. The OS group defaults to the primary group of the instance
      administrator. You can default to this group, choose another OS group
      or you can make this instance world-accessible. If you choose to make
      this instance world-accessible, all database files and shared memory
      are readable and writable by all users.

Restrict access to the the TimesTen installation to the group 'oinstall'? [ yes ]

NOTE: Enabling PL/SQL will increase the size of some TimesTen libraries.

Would you like to enable PL/SQL for this instance? [ yes ]

In order to use the 'In-Memory Database Cache' feature in any databases
created within this installation, you must set a value for the TNS_ADMIN
environment variable. It can be left blank, and a value can be supplied later
using <install_dir>/bin/ttModInstall.

Please enter a value for TNS_ADMIN (s=skip)? [  ] s


NOTE: It appears that you are running version 4.1 of the g++
      compiler. TimesTen ships with multiple sets of client libraries and server
      binaries : one built for compatibility with g++ 3.4.6 and one with
      g++ 4.1.0. The installer has created links to the 4.1.0 library in the
      <install_dir>/lib directory and to the 4.1.0 server binary in the
      <install_dir>/bin directory. If you want to use a different compiler,
      please modify the links to point to the desired library and server binary.

Installing server components ...
What is the TCP/IP port number that you want the TimesTen Server to listen on? [ 53389 ]
Do you want to install QuickStart and the TimesTen Documentation? [ no ]
Would you like to install the documentation (without QuickStart)? [ yes ]
Where would you like to create the doc directory (s=skip)? [ /u01/app/TimesTen/tt1121/doc ]
The TimesTen documentation has been installed in /u01/app/TimesTen/tt1121/doc.
Installing client components ...

Would you like to use TimesTen Replication with Oracle Clusterware? [ no ]

NOTE: The TimesTen daemon startup/shutdown scripts have not been installed.

Run the 'setuproot' script :
        cd /u01/app/TimesTen/tt1121/bin
        ./setuproot -install
This will move the TimesTen startup script into its appropriate location.

The startup script is currently located here :
  '/u01/app/TimesTen/tt1121/startup/tt_tt1121'.

The 11.2.1.8 Release Notes are located here :
  '/u01/app/TimesTen/tt1121/README.html'

Starting the daemon ...
TimesTen Daemon startup OK.
End of TimesTen installation.

Now run the ttenv script.
dbst8001:/u01/app/TimesTen/tt1121/bin>ls ttenv*
ttenv.csh  ttenv.sh
dbst8001:/u01/app/TimesTen/tt1121/bin>. ttenv.sh

LD_LIBRARY_PATH set to /u01/app/TimesTen/tt1121/lib:/u01/app/TimesTen/tt1121/ttoracle_home/instantclient_11_1

ANT_HOME set to /u01/app/TimesTen/tt1121/3rdparty/ant

PATH set to /u01/app/TimesTen/tt1121/bin:/u01/app/TimesTen/tt1121/quickstart/sample_code/oci:/u01/app/TimesTen/tt1121/quickstart/sample_code/odbc:/u01/app/TimesTen/tt1121/quickstart/sample_code/odbc/xla:/u01/app/TimesTen/tt1121/quickstart/sample_code/jdbc:/u01/app/TimesTen/tt1121/quickstart/sample_code/odbc_drivermgr:/u01/app/TimesTen/tt1121/quickstart/sample_code/proc:/u01/app/TimesTen/tt1121/quickstart/sample_code/ttclasses:/u01/app/TimesTen/tt1121/quickstart/sample_code/ttclasses/xla:/u01/app/TimesTen/tt1121/ttoracle_home/instantclient_11_1:/u01/app/TimesTen/tt1121/ttoracle_home/instantclient_11_1/sdk:/u01/app/TimesTen/tt1121/3rdparty/ant/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/oracle/bin:/u01/app/oracle/product/11.2.0.2/db_1/bin

CLASSPATH set to /u01/app/TimesTen/tt1121/lib/ttjdbc5.jar:/u01/app/TimesTen/tt1121/lib/orai18n.jar:/u01/app/TimesTen/tt1121/lib/timestenjmsxla.jar:/u01/app/TimesTen/tt1121/3rdparty/jms1.1/lib/jms.jar:.

dbst8001:/u01/app/TimesTen/tt1121/bin>ttversion
TimesTen Release 11.2.1.8.0 (64 bit Linux/x86_64) (tt1121:53388) 2011-02-02T02:20:46Z
  Instance admin: oracle
  Instance home directory: /u01/app/TimesTen/tt1121
  Group owner: oinstall
  Daemon home directory: /u01/app/TimesTen/tt1121/info
  PL/SQL enabled.
dbst8001:/u01/app/TimesTen/tt1121/bin>ttstatus
TimesTen status report as of Sat Nov  5 10:47:08 2011

Daemon pid 5391 port 53388 instance tt1121
TimesTen server pid 5405 started on port 53389
------------------------------------------------------------------------
Accessible by group oinstall
End of report
Advertisements
Categories: oracle-install

Raw Device Setup on linux– oracle 10gr2 and 11gr1 for ocr and voting disks

August 6, 2011 Leave a comment

Raw Device Setup

This step is only necessary if you want ocr and voting disks on raw devices without using any cluster file system(OCFS2,GPS,NFS,..)

[root@oral7001 iscsi]# fdisk -l

Disk /dev/sda: 16.1 GB, 16106127360 bytes
255 heads, 63 sectors/track, 1958 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14        1958    15623212+  8e  Linux LVM

Disk /dev/sdb: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        2610    20964793+  83  Linux

Disk /dev/sdc: 1073 MB, 1073741824 bytes
34 heads, 61 sectors/track, 1011 cylinders
Units = cylinders of 2074 * 512 = 1061888 bytes

Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1        1011     1048376+  83  Linux

Disk /dev/sdd: 1073 MB, 1073741824 bytes
34 heads, 61 sectors/track, 1011 cylinders
Units = cylinders of 2074 * 512 = 1061888 bytes

Device Boot      Start         End      Blocks   Id  System
/dev/sdd1               1        1011     1048376+  83  Linux

Disk /dev/sde: 1073 MB, 1073741824 bytes
34 heads, 61 sectors/track, 1011 cylinders
Units = cylinders of 2074 * 512 = 1061888 bytes

Device Boot      Start         End      Blocks   Id  System
/dev/sde1               1        1011     1048376+  83  Linux

Edit the /etc/sysconfig/rawdevices file, adding the following lines.I am using iscsi disks and hence used udev rules for persistent naming conventions.

[root@oral7001 iscsi]# ls -tlr
total 0
drwxr-xr-x 2 root root 80 Aug  6 12:06 oral7001_crs1
drwxr-xr-x 2 root root 80 Aug  6 12:09 oral7001_crs2
drwxr-xr-x 2 root root 80 Aug  6 12:10 oral7001_crs3

[root@oral7001 sysconfig]# cat rawdevices
# raw device bindings
# format:  <rawdev> <major> <minor>
#          <rawdev> <blockdev>
# example: /dev/raw/raw1 /dev/sda1
#          /dev/raw/raw2 8 5
/dev/raw/raw1   /dev/iscsi/oral7001_crs1/part1
/dev/raw/raw2   /dev/iscsi/oral7001_crs2/part1
/dev/raw/raw3  /dev/iscsi/oral7001_crs3/part1

[root@oral7001 sysconfig]# chkconfig –list | grep raw
rawdevices      0:off   1:off   2:off   3:off   4:off   5:off   6:off
[root@oral7001 sysconfig]# chkconfig –levels 345 rawdevices on

Start the rawdevices service using the following command.

[root@oral7001 sysconfig]# service rawdevices restart
Assigning devices:
/dev/raw/raw1  –>   /dev/iscsi/oral7001_crs1/part1
/dev/raw/raw1:  bound to major 8, minor 49
/dev/raw/raw2  –>   /dev/iscsi/oral7001_crs2/part1
/dev/raw/raw2:  bound to major 8, minor 65
/dev/raw/raw3  –>   /dev/iscsi/oral7001_crs3/part1
/dev/raw/raw3:  bound to major 8, minor 33
done

[root@oral7001 tmp]# cat raw_set_permissions.sh
chown oracle:oinstall /dev/raw/raw1
chown oracle:oinstall /dev/raw/raw2
chown oracle:oinstall /dev/raw/raw3
chmod 600 /dev/raw/raw1
chmod 600 /dev/raw/raw2
chmod 600 /dev/raw/raw3

Note : Installing Oracle Clusterware files on raw or block devices is no longer supported.

Thanks

Categories: oracle-install

Removing a node from Oracle RAC 11gR2

August 5, 2011 Leave a comment

In this article we will see how to remove an unreachable or destroyed node from an existing 11gr2 cluster.

The example below is based on 11.2.0.2 Release.

I have 2 node oracle rac on esxi and i am powering off second node and you can see the following message in the first node log file.

cd /u01/app/root/product/11.2.0/grid/log/oral8001

[cssd(11407)]CRS-1601:CSSD Reconfiguration complete. Active nodes are oral8001 .
2011-08-05 10:54:11.301
[crsd(11662)]CRS-5504:Node down event reported for node ‘oral8002’.
2011-08-05 10:54:11.488
[crsd(11662)]CRS-2773:Server ‘oral8002’ has been removed from pool ‘Free’.

Assumption is node2 is completely dead and we are deleting it from the existing cluster.Now node2 is not reachable then use node1 to do the cleanup process.

$ ./olsnodes -s -t
oral8001        Active  Unpinned
oral8002        Inactive        Unpinned

[root@oral8001 bin]# ./crsctl delete node -n oral8002
CRS-4661: Node oral8002 successfully deleted.

$ pwd
/u01/app/root/product/11.2.0/grid/oui/bin

$ ls
addLangs.sh  attachHome.sh  filesList.bat         filesList.sh  resource      runInstaller     runSSHSetup.sh
addNode.sh   detachHome.sh  filesList.properties  lsnodes       runConfig.sh  runInstaller.sh

$ ./runInstaller -updateNodelist ORACLE_HOME=/u01/app/root/product/11.2.0/grid “CLUSTER_NODES={oral8001}” CRS=true
Starting Oracle Universal Installer…

Checking swap space: must be greater than 500 MB.   Actual 2391 MB    Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /u01/app/oraInventory
‘UpdateNodeList’ was successful.

$ ./olsnodes -s -n
oral8001        1       Active

if you have any database instances on this node use dbca and select instance management and delete the instance.

 

Thanks

Categories: oracle-install

How do I find the Cluster name(oracle 10g)

July 8, 2011 Leave a comment

oracle 10g you can find the cluster name using the following command:

CRS_HOME=/u01/app/root/product/10.2.0/crs

$CRS_HOME/bin/cemutlo -n

oral6001:/home/oracle=>$CRS_HOME/bin/cemutlo -n
crsoral6001

Categories: oracle-install

11gR2 database creation script(dbca.sh)

July 7, 2011 Leave a comment

I have created following script to automate database creation process on file system:Please modify the script to suit your env.

#!/bin/ksh
###########################################################
#Set password
##########################################################
setPasswd(){
## PASSWORDS ##
echo
echo “Please specify the passwords for the ”
echo “following database administrative ”
echo “accounts.”
echo

for dbuser in SYS SYSTEM
do
echo
if [ “${dbuser}” = “SYS” ] || [ “${dbuser}” = “SYSTEM” ]
then
display_user=”${dbuser} (Database Administrative Account)”
fi
echo -n “${display_user} Password:  ”
while [ 1 ]
do
/bin/stty -echo > /dev/null 2>&1
temp=`echo $IFS`
export IFS=”\n”
while [ 1 ]
do
read LINE

while [ -z “$LINE” ]
do
echo
echo -n “Password can not be null, please try again:  ”
read LINE
done

result=`expr index “$LINE” [\’\”]`
if [ $result != 0 ];
then
echo
echo -n “The password you entered contains invalid characters. Please try again:  ”
else
break
fi
done
echo
echo -n “Confirm ${dbuser} password:  ”
read LINE1
echo
if [ “$LINE” != “$LINE1” ];
then
echo
echo -n “Passwords do not match.  Please enter the password again:  ”
else
break
fi
done

if [ ${dbuser} = “SYS” ]
then
SYS_PWD=$LINE
elif [ ${dbuser} = “SYSTEM” ]
then
SYSTEM_PWD=$LINE
else
echo “Invalid database user: ${dbuser}”
exit 30
fi

/bin/stty echo > /dev/null 2>&1
export IFS=$temp
done
}
#################################################################
#Set ORacle SID
################################################################
setOraSid(){
echo
echo “Please enter the name for your Oracle Database. ”
echo “This name will be used as your ”
echo -n “ORACLE SID (System Identifier):  ”
read LINE
while [ -z “$LINE” ]
do
echo -n “ORACLE SID can not be null, please try again:  ”
read LINE
done

NDB_LENGTH=”`echo ${LINE} | wc -L`”

while [ ${NDB_LENGTH} -gt 8 ]
do
echo “The new database name: ${LINE} is too long.  The database name must be 8 bytes or less, please try again:  ”
read LINE
NDB_LENGTH=”`echo ${LINE} | wc -L`”
done
ORACLE_SID=$LINE
GLOBAL_NAME=$ORACLE_SID
export ORACLE_SID=$LINE
}
##################################################################
# main
##################################################################
Me=$(\basename $0)
mypath=$(\dirname $0)

RUID=`/usr/bin/id|awk -F\( ‘{print $2}’|awk -F\) ‘{print $1}’`
if [ ${RUID} != “oracle” ];then
echo “You must be logged in as oracle to  dbca.sh. ”
echo “Log in as oracle and restart dbca.sh execution.”
exit 1
fi

if [[ -z $ORACLE_HOME || -z $ORACLE_BASE ]];then
echo
echo “either ORACLE_HOME or ORACLE_BASE are not set ,Please set both the variables and restart the script again”
exit 30
fi

setOraSid
setPasswd

export ORACLE_BASE=$ORACLE_BASE
export ORACLE_HOME=$ORACLE_HOME
export SID=$ORACLE_SID
DBCA_TEMPLATE_DIR=${ORACLE_HOME}/assistants/dbca/templates
DBCA_TEMPLATE_NAME=${DBCA_TEMPLATE_DIR}/General_Purpose.dbc
ORACLE_OWNER=oracle
DBCA=${ORACLE_HOME}/bin/dbca
SQLPLUS=${ORACLE_HOME}/bin/sqlplus
DB_FILE_DIR=/u01/app/oradata
RECO_AREA=/u01/app/flash_recovery_area

#mkdir $ORACLE_BASE/admin/${ORACLE_SID}
#mkdir $ORACLE_BASE/admin/${ORACLE_SID}/dbs
#mkdir $ORACLE_BASE/admin/${ORACLE_SID}/adump

${DBCA} -silent -createDatabase -templateName ${DBCA_TEMPLATE_NAME} -gdbName ${GLOBAL_NAME} -sid ${SID} -sysPassword ${SYS_PWD} -systemPassword ${SYSTEM_PWD} -emConfiguration NONE -storageType FS -datafileJarLocation ${DBCA_TEMPLATE_DIR} -sampleSchema false -datafileDestination ${DB_FILE_DIR} -recoveryAreaDestination ${RECO_AREA}
RV=$?
if [ $RV -ne 0 ]
then
echo
echo “There was a problem creating your database.  Please review the log file shown above.”
else
echo
echo “The database was created successfully.”
fi

Usage :./dbca.sh

either ORACLE_HOME or ORACLE_BASE are not set ,Please set both the variables and restart the script again

exprot ORACLE_HOME=<your oracle home>

export ORACLE_BASE=<oracle base>

./dbca.sh

Please enter the name for your Oracle Database.
This name will be used as your
ORACLE SID (System Identifier):  dgprm1

Please specify the passwords for the
following database administrative
accounts.

SYS (Database Administrative Account) Password:
Confirm SYS password:

SYSTEM (Database Administrative Account) Password:
Confirm SYSTEM password:

Sample log:

Copying database files
DBCA_PROGRESS : 1%
DBCA_PROGRESS : 3%
DBCA_PROGRESS : 11%
DBCA_PROGRESS : 18%
DBCA_PROGRESS : 26%
DBCA_PROGRESS : 33%
DBCA_PROGRESS : 37%
Creating and starting Oracle instance
DBCA_PROGRESS : 40%
DBCA_PROGRESS : 45%
DBCA_PROGRESS : 50%
DBCA_PROGRESS : 55%
DBCA_PROGRESS : 56%
DBCA_PROGRESS : 60%
DBCA_PROGRESS : 62%
Completing Database Creation
DBCA_PROGRESS : 66%
DBCA_PROGRESS : 70%
DBCA_PROGRESS : 73%
DBCA_PROGRESS : 85%
DBCA_PROGRESS : 96%
DBCA_PROGRESS : 100%
Database creation complete. For details check the logfiles at:
/u01/app/oracle/cfgtoollogs/dbca/dgprm.
Database Information:
Global Database Name:dgprm
System Identifier(SID):dgprm

****script to create database on asm********

Categories: oracle-install

Steps to Configure oracle apex in 11g

June 5, 2011 Leave a comment

Here are the steps to configure oracle apex in 11gR2.

APEX application can access either the embedded PL/SQL gateway or Oracle HTTP server.By using the embedded PL/SQL gateway, it will run using the Oracle XML DB HTTP server

Step1)

To Configure the embedded PL/SQL gateway go to the $ORACLE_HOME/apex directory

*dbsl0001*<oracle:ora11gR2>:/u01/app/oracle/product/11.2.0.2/db_1/bin=>echo $ORACLE_HOME
/u01/app/oracle/product/11.2.0.2/db_1

now connect to the database using sqlplus from the database machine.

*dbsl0001*<oracle:ora11gr21>:/u01/app/oracle/product/11.2.0.2/db_1/bin=>./sqlplus / as sysdba

SQL*Plus: Release 11.2.0.2.0 Production on Sat Jun 4 21:24:53 2011

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

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 – 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options

SQL> @apxconf

PORT
———-
8080

Enter values below for the XDB HTTP listener port and the password for the Application Express ADMIN user.
Default values are in brackets [ ].
Press Enter to accept the default value.

Enter a password for the ADMIN user              []
Enter a port for the XDB HTTP listener [      8080]
…changing HTTP Port

PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed.

Session altered.

…changing password for ADMIN

PL/SQL procedure successfully completed.

Commit complete.

SQL> alter user anonymous account unlock;

User altered.

Enable Oracle XML DB HTTP server:

SQL> exec dbms_xdb.sethttpport(8080);

PL/SQL procedure successfully completed.

SQL> commit;

Commit complete.

now we can access oracle apex by using following link.

http://host:port/apex


workspace : internal

User : admin

password : you entered when you configured apex.

Categories: oracle-install

Steps to Configure database in archive log mode

June 3, 2011 Leave a comment

Please follow below steps to configure database in archive log mode.

Check if the database running archive log mode or not by using following query.

SQL> select NAME,LOG_MODE from v$database;

NAME      LOG_MODE
——— ————
RMANDV1   NOARCHIVELOG

There are two init.ora parameters we need to change before configuring database in archive log mode.

1)LOG_ARCHIVE_DEST —/u01/app/archive/rmandv1
2)LOG_ARCHIVE_FORMAT —‘rmandv1%t_%s_%r.arc’

alter system set LOG_ARCHIVE_DEST=’/u01/app/archive/rmandv1′ scope =both;

alter system set LOG_ARCHIVE_FORMAT=’rmandv1%t_%s_%r.arc’ scope =spfile;

Step1)Shutdown the database

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.

Step2)Start  up a new instance and mount, but do not open the database.

SQL> startup mount;
ORACLE instance started.

Total System Global Area  180355072 bytes
Fixed Size                  2094896 bytes
Variable Size              88082640 bytes
Database Buffers           83886080 bytes
Redo Buffers                6291456 bytes
Database mounted.

Step3)Put the database in archive log mode

SQL> alter database archivelog;

Database altered

Now open the database

SQL> alter database open;

Database altered.

check now if your database is in archive log mode.

SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /u01/app/archive/rmandv1
Oldest online log sequence     18
Next log sequence to archive   20
Current log sequence           20

Now database is configured in archive log mode.

Categories: oracle-install
%d bloggers like this: