Showing posts with label Oracle 10g. Show all posts
Showing posts with label Oracle 10g. Show all posts
Author: SAZILI MUHAMMAD at | 0 comments | Read more
Brief Tutorial Oracle 10g Administration in Solaris 10
Everytime I shutdown my Solaris 10, sometimes I forget how to start and stop database Oracle 10g. So, I write down this article to remind me again if I forget to start/stop my database. You have to refer to this article Install Oracle 10g in Solaris 10 x86 as a reference for some configurations.

START AND STOP DATABASE ORACLE 10g

1. Login as database owner user. In this case, the user is oracle.
bash-3.00# su - oracle
Sun Microsystems Inc.   SunOS 5.10      Generic January 2005

2. Set ORACLE_HOME and ORACLE_SID.
bash-3.00$ export ORACLE_HOME=/export/home/oracle/product/10.2.0/db_1
bash-3.00$ export ORACLE_SID=ORASOL

3. Goto the Oracle instance folder.
bash-3.00$ cd /export/home/oracle/product/10.2.0/db_1/bin/

4. Execute SQL*Plus.
bash-3.00$ ./sqlplus /nolog

SQL*Plus: Release 10.2.0.2.0 - Production on Tue May 5 12:41:03 2009

Copyright (c) 1982, 2005, Oracle. All Rights Reserved.

SQL>

5. Connect database as sysdba account.
SQL> connect / as sysdba
Connected to an idle instance.

6. Start database.
SQL> startup
ORACLE instance started.

Total System Global Area 289406976 bytes
Fixed Size 1279820 bytes
Variable Size 92276916 bytes
Database Buffers 192937984 bytes
Redo Buffers 2912256 bytes
Database mounted.
Database opened.

7. Verify database by executing simple SQL script.
SQL> SELECT * FROM tab;

8. Stop database.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

9. Exit SQL*Plus.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
bash-3.00$

START AND STOP LISTENER ORACLE 10g

We will use lsnrctl command to start/stop listener. Basically lsnrctl (Listener Control) is an SQL*Net utility used for controlling database listeners. A listener is required for allowing remote (not local) clients to connect to the Oracle database via the network. This utility cannot create or configure listeners, but provides commands to control listener functions such as starting and stopping listeners, reporting the status of listeners, changing parameter listener settings, etc.

1. Under root login, make sure that you have configure your host. Please check it using this command.
bash-3.00# cat /etc/hosts
#
# Internet host table
#
::1             localhost
127.0.0.1       localhost
192.168.56.132  solaris10.server.com    solaris10       unknown # Added by DHCP

2. Login as database owner user. In this case, the user is oracle.
bash-3.00# su - oracle
Sun Microsystems Inc.   SunOS 5.10      Generic January 2005

3. Goto the Oracle instance folder.
bash-3.00$ cd /export/home/oracle/product/10.2.0/db_1/bin/

4. Start listener.
bash-3.00$ ./lsnrctl start

5. Stop listener.
bash-3.00$ ./lsnrctl stop



Author: SAZILI MUHAMMAD at | 1 comments | Read more
Install Oracle 10g in Solaris 10 x86 (Part 4)
This part is very straightforward. We just need to do post-installation and verification. All of this just to make sure that our installation is running completely and perfectly.
This tutorial actually very basic installation and only install in one host. For better performance, normally Oracle is installed in the distributed environment. You can refer to official Oracle documentation for advanced installation.

POST-INSTALLATION

Edit the Database Startup Script parameter in /var/opt/oracle/oratab file to "Y"
ORASOL:/export/home/oracle/product/10.2.0/db_1:Y

VERIFICATION

1. Access Oracle Enterprise Manager URL: http://solaris10.server.com:1158/em

Login as: SYSTEM
Password: oracle
Connect As: Normal

Then click I agree

You should see the Oracle Enterprise Manager as in this picture.

2. Access iSQL*Plus URL: http://solaris10.server.com:5560/isqlplus

Username: SYSTEM
Password: oracle
Connect Identifier: (leave it blank)

Then click Login

You should see the Oracle iSQL*Plus as in this picture. Here is the place you can simulate the SQL scripts.

3. Setup iSQL*Plus DBA.
a. Configure ORACLE_HOME and JAVA_HOME variable.
bash-3.00# export ORACLE_HOME=/export/home/oracle/product/10.2.0/db_1
bash-3.00# export JAVA_HOME=$ORACLE_HOME/jdk

b. Create user who have access to the iSQL*Plus DBA.
bash-3.00# cd $ORACLE_HOME/oc4j/j2ee/isqlplus/application-deployments/isqlplus

bash-3.00# $JAVA_HOME/bin/java -Djava.security.properties=$ORACLE_HOME/oc4j/j2ee/home/config/jazn.security.props -jar $ORACLE_HOME/oc4j/j2ee/home/jazn.jar -user "iSQL*Plus DBA/admin" -password welcome -adduser "iSQL*Plus DBA" oracledba oracle

c. Start the JAZN shell.
bash-3.00# $JAVA_HOME/bin/java -Djava.security.properties=$ORACLE_HOME/oc4j/j2ee/home/config/jazn.security.props -jar $ORACLE_HOME/oc4j/j2ee/home/jazn.jar -user "iSQL*Plus DBA/admin" -password welcome -shell

d. (Optional) List users who have been created and added to the iSQL*Plus DBA realm. We should have 2 users.
JAZN:> listusers "iSQL*Plus DBA"
admin
oracledba

e. Grant user to the webDba role.
JAZN:> grantrole webDba "iSQL*Plus DBA" oracledba

f. Exit the JAZN shell.
JAZN:> exit

4. Access iSQL*Plus DBA URL: http://solaris10.server.com:5560/isqlplus/dba

First, it will show the JAAS authentication window.

User Name: oracledba
Password: oracle

Click OK

5. In this iSQL*Plus DBA screen, put:

Username: SYSTEM
Password: oracle
Connect Identifier: (leave it blank)
Privilege: SYSDBA

Click Login

You should see the Oracle iSQL*Plus DBA as in this picture. If you notice, this application is different with just normal Oracle iSQL*Plus.



Author: SAZILI MUHAMMAD at | 0 comments | Read more
Install Oracle 10g in Solaris 10 x86 (Part 3)
After all the preparation tasks is done. Now we are ready to install Oracle 10g. We will install Oracle 10g using GUI, so that it will be easier to configure and install. This part is very straightforward, so you just follow the step-by-step based on the picture.

INSTALLATION

Before we do this steps, make sure that you login as a root, unless it mentions to login as other user.

1. Check the IP address:
bash-3.00# ifconfig -a
lo0: flags=2001000849 mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
e1000g0: flags=1004843 mtu 1500 index 2
inet 192.168.56.132 netmask ffffff00 broadcast 192.168.56.255
ether 0:c:29:72:90:cd

2. Enter the following command:
bash-3.00# xhost 192.168.56.132
192.168.56.132 being added to access control list

3. Login as oracle:
bash-3.00# su - oracle
Sun Microsystems Inc. SunOS 5.10 Generic January 2005

4. Enter the following command:
$ bash
bash-3.00$ DISPLAY=192.168.56.132:0.0; export DISPLAY

5. Run the Oracle installer:
bash-3.00$ cd /export/home/oracle_installer/database/
bash-3.00$ ./runInstaller
Starting Oracle Universal Installer...

Checking installer requirements...

Checking operating system version: must be 5.10. Actual 5.10
Passed

Checking Temp space: must be greater than 250 MB. Actual 2010 MB Passed
Checking swap space: must be greater than 500 MB. Actual 2341 MB Passed
Checking monitor: must be configured to display at least 256 colors.
Actual 16777216 Passed

All installer requirements met.

Preparing to launch Oracle Universal Installer
from /tmp/OraInstall2009-04-22_10-13-53PM. Please wait ...

6. Please wait for a while until it show the installer.

Choose Advanced Installation.

Click Next.

7. Click Next.

8. Choose Enterprise Edition (1.38GB).

Click Next.

9. Click Next.

10. Just wait for a while, until all the Prerequisite Checks are succeeded.

Then click Next.

11. Click Next.

12. Click Next.

13. If you notice the SID, actually this value we have already set in /export/home/oracle/.profile file (See Part 2). We don't need to change anything.

Click Next.

14. Click Next.

15. Click Next.

16. Click Next.

17. Here, we just use the same password for all the user account. For example password: oracle

Click Next.

18. Click Install.

19. We just wait until the installation finished.

20. Again, we just wait until Database Configuration finished.

21. Click OK.

22. Don't click OK.

We have to run the scripts as instruction here.

Run orainstRoot.sh
bash-3.00# /export/home/oracle/oraInventory/orainstRoot.sh
Changing permissions of /export/home/oracle/oraInventory to 770.
Changing groupname of /export/home/oracle/oraInventory to oinstall.
The execution of the script is complete

Run root.sh
bash-3.00# /export/home/oracle/product/10.2.0/db_1/root.sh
Running Oracle 10g root.sh script...

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /export/home/oracle/product/10.2.0/db_1

Enter the full pathname of the local bin directory: [/usr/local/bin]:
Creating /usr/local/bin directory...
   Copying dbhome to /usr/local/bin ...
   Copying oraenv to /usr/local/bin ...
   Copying coraenv to /usr/local/bin ...


Creating /var/opt/oracle/oratab file...
Entries will be added to the /var/opt/oracle/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.

Then go back to the window and click OK.

23. CONGRATULATIONS...!! Oracle 10g has been installed successfully in Solaris 10 x86.

Click Exit.

Continue to PART 4...


Author: SAZILI MUHAMMAD at | 0 comments | Read more
Install Oracle 10g in Solaris 10 x86 (Part 2)
In this Part, we will do pre-installation step. I will show you the steps very clearly so that it will be easier to follow. Must be careful that all the instruction here is done using root user, unless it mention clearly to do the instruction under other user. This Part is very important as a prerequisite task before doing the real installation.

PRE-INSTALLATION STEPS

1. Check /etc/hosts file must be contain a fully qualified name for the server.
bash-3.00# vi /etc/hosts
#
# Internet host table
#
::1             localhost
127.0.0.1       localhost
192.168.56.132  solaris10.server.com     solaris10     unknown  # Added by DHCP
~
~
"/etc/hosts" 6 lines, 139 characters

2. Now we need 3 groups as an installation requirement: oinstall, dba, and oper.
Before we add these groups, we have to make sure that these groups don't exist.
bash-3.00# grep oinstall /etc/group
bash-3.00# grep dba /etc/group
bash-3.00# grep oper /etc/group

If this command doesn't return any value, it means these groups do not exist. Now we are ready to create these groups:
bash-3.00# /usr/sbin/groupadd oinstall
bash-3.00# /usr/sbin/groupadd dba
bash-3.00# /usr/sbin/groupadd oper

3. Now we need to create oracle user. First, we need to check whether oracle user does not exist.
bash-3.00# id -a oracle

If the user exist, it should return message like this:
uid=502(oracle) gid=502(oinstall) groups=502(oinstall),503(dba)

To create oracle user:
bash-3.00# useradd -g oinstall -G dba -d /export/home/oracle -m -s /bin/ksh oracle

Now, if we list file in /export/home/oracle folder, it will return like this:
bash-3.00# ls -la /export/home/oracle
total 12
drwxr-xr-x   2 oracle   oinstall     512 Apr 22 15:24 .
drwxr-xr-x   7 root     root         512 Apr 22 15:24 ..
-rw-r--r--   1 oracle   oinstall     144 Apr 22 15:24 .profile
-rw-r--r--   1 oracle   oinstall     136 Apr 22 15:24 local.cshrc
-rw-r--r--   1 oracle   oinstall     157 Apr 22 15:24 local.login
-rw-r--r--   1 oracle   oinstall     174 Apr 22 15:24 local.profile

4. Change the owner of the file.
bash-3.00# chown oracle:oinstall /export/home/oracle

5. Set oracle password (example: oracle)
bash-3.00# passwd -r files oracle
New Password: oracle
Re-enter new Password: oracle
passwd: password successfully changed for oracle

6. Use vi to edit /export/home/oracle/.profile file.
bash-3.00# vi /export/home/oracle/.profile

7. Add these following lines inside /export/home/oracle/.profile file.
# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_BASE=/export/home/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1; export ORACLE_HOME
ORACLE_SID=ORASOL; export ORACLE_SID
PATH=$ORACLE_HOME/bin:$PATH; export PATH

8. Create /export/home/oracle/product/10.2.0/db_1 folder and change the owner for this folder
bash-3.00# mkdir -p /export/home/oracle/product/10.2.0/db_1
bash-3.00# chown -R oracle:oinstall /export/home/oracle

9. (Optional) Edit Solaris kernel parameter in the /etc/system file:
set semsys:seminfo_semmni=100
set semsys:seminfo_semmns=1024
set semsys:seminfo_semmsl=256
set semsys:seminfo_semvmx=32767
set shmsys:shminfo_shmmax=4294967295
set shmsys:shminfo_shmmni=100

10. In Solaris 10, that kernel configuration (No. 8) is obsolete. The other way, you can do these following command. This one is to create oracle project with project.max-shm-memory = 4GB.
bash-3.00# projadd -U oracle -K "project.max-shm-memory=(priv,4GB,deny)" oracle

11. Because of this setting will be lost after reboot, so we need to set permanently.
bash-3.00# projmod -s -K "project.max-shm-memory=(priv,4GB,deny)" oracle

12. Verify our project and kernel setting:
bash-3.00# cat /etc/project
system:0::::
user.root:1::::
noproject:2::::
default:3::::
group.staff:10::::
oracle:100::oracle::project.max-shm-memory=(priv,4294967296,deny)

13. Add this line in the /etc/user_attr file:
oracle::::project=oracle

Continue to PART 3...


Author: SAZILI MUHAMMAD at | 1 comments | Read more
Install Oracle 10g in Solaris 10 x86 (Part 1)
Currently, Oracle 10g is still one of the most database server used today. Many Oracle DBA certified has become very good pay in the IT industry. Normally in the real practise, Oracle database server is installed inside Solaris 10 for getting the most performance. In this article, I will explain how to install Oracle 10g in the Solaris 10 x86 (Intel processor). This installation is quiet complicated, so that you must follow step-by-step in this tutorial.

DOWNLOAD ORACLE 10g

To download Oracle 10g, we can go to this website: http://www.oracle.com/technology/software/products/database/oracle10g/htdocs/10202solx86soft.html

We need to login first before download or if you haven't registered yet, please register first.

Then we click this file 10202_database_solx86.zip for download.

Suppose we put this file in the /Desktop folder. After downloaded, we will unzip this file to the /export/home/oracle_installer folder:
bash-3.00# mkdir /export/home/oracle_installer
bash-3.00# unzip /Desktop/10202_database_solx86.zip -d /export/home/oracle_installer/

After the unzip finished, it should created database folder inside /export/home/oracle_installer/
bash-3.00# ls -la /export/home/oracle_installer/
total 6
drwxr-xr-x   3 root     root         512 Apr 21 21:15 .
drwxr-xr-x   6 root     root         512 Apr 21 21:14 ..
drwxrwxr-x   6 root     root         512 Jul 25  2006 database

First of all, before we do all these things, we have to login as root user.

CHECK REQUIREMENT AND INSTALL PREREQUISITE PACKAGES

1. Check minimal memory size should have at least 1 GB for better performance.
bash-3.00# /usr/sbin/prtconf | grep "Memory size"
Memory size: 1024 Megabytes

2. Check minimal swap file should have:
Swap file between 1024 MB and 2048 MB = 1.5 times the size of RAM
Swap file between 2049 MB and 8192 MB = Equal to the size of RAM
Swap file more than 8192 MB           = 0.75 times the size of RAM

bash-3.00# /usr/sbin/swap -s
total: 305348k bytes allocated + 61288k reserved = 366636k used, 2014240k available

3. Check minimal Disk Space in /tmp should have at least 400 MB
bash-3.00# df -h /tmp
Filesystem             size   used  avail capacity  Mounted on
swap                   1.9G    80K   1.9G     1%    /tmp

4. Check current operating system information should give 5.10 i86pc (Solaris 10 x86)
bash-3.00# uname -a
SunOS unknown 5.10 Generic_137138-09 i86pc i386 i86pc

5. Check free disk space available on the system recommended have at least 3.7 GB.
Filesystem             size   used  avail capacity  Mounted on
/dev/dsk/c0d0s0        7.7G   4.4G   3.2G    59%    /

6. Check the required packages are installed:
bash-3.00# pkginfo -i SUNWlibms SUNWtoo SUNWi1cs SUNWi15cs SUNWxwfnt SUNWxwplt SUNWmfrun SUNWxwplr SUNWxwdv SUNWgcc SUNWbtool SUNWi1of SUNWhea SUNWlibm SUNWsprot SUNWuiu8
system      SUNWbtool CCS tools bundled with SunOS
system      SUNWgcc   gcc - The GNU C compiler
system      SUNWhea   SunOS Header Files
system      SUNWi1of  ISO-8859-1 (Latin-1) Optional Fonts
system      SUNWlibm  Math & Microtasking Library Headers & Lint Files (Usr)
system      SUNWlibms Math & Microtasking Libraries (Usr)
system      SUNWmfrun Motif RunTime Kit
system      SUNWsprot Solaris Bundled tools
system      SUNWtoo   Programming Tools
system      SUNWuiu8  Iconv modules for UTF-8 Locale
system      SUNWxwdv  X Windows System Window Drivers
system      SUNWxwfnt X Window System platform required fonts
system      SUNWxwplr X Window System platform software configuration
system      SUNWxwplt X Window System platform software
ERROR: information for "SUNWi1cs" was not found
ERROR: information for "SUNWi15cs" was not found

Don't worry if you see the SUNWi1cs and SUNWi15cs packages was not found.
IT IS NORMAL. These packages are available in Solaris 10 installer.

7. Install SUNWi1cs and SUNWi15cs packages
bash-3.00# pkgadd -d /cdrom/sol_10_1008_x86/Solaris_10/Product SUNWi1cs SUNWi15cs

Processing package instance <SUNWi1cs> from </cdrom/sol_10_1008_x86/Solaris_10/Product>

X11 ISO8859-1 Codeset Support(i386) 2.0,REV=2004.10.17.15.04
Copyright 2004 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
Using </> as the package base directory.
## Processing package information.
## Processing system information.
   8 package pathnames are already properly installed.
## Verifying package dependencies.
## Verifying disk space requirements.
## Checking for conflicts with packages already installed.
## Checking for setuid/setgid programs.

This package contains scripts which will be executed with super-user
permission during the process of installing this package.

Do you want to continue with the installation of <SUNWi1cs> [y,n,?] y

Installing X11 ISO8859-1 Codeset Support as <SUNWi1cs>


## Installing part 1 of 1.
232 blocks

Installation of <SUNWi1cs> was successful.

Processing package instance <SUNWi15cs> from </cdrom/sol_10_1008_x86/Solaris_10/Product>

X11 ISO8859-15 Codeset Support(i386) 2.0,REV=2004.10.17.15.04
Copyright 2004 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
Using </> as the package base directory.
## Processing package information.
## Processing system information.
   6 package pathnames are already properly installed.
## Verifying package dependencies.
## Verifying disk space requirements.
## Checking for conflicts with packages already installed.
## Checking for setuid/setgid programs.

This package contains scripts which will be executed with super-user
permission during the process of installing this package.

Do you want to continue with the installation of <SUNWi15cs> [y,n,?] y

Installing X11 ISO8859-15 Codeset Support as <SUNWi15cs>

## Installing part 1 of 1.
1460 blocks

Installation of <SUNWi15cs> was successful.

Continue to PART 2...

« Previous

1234