Sie sind auf Seite 1von 138

Part 0. Introduction to Oracle VirtualBox, Solaris 11.

1, DB 11gR2, MS Access
2010, LibreOffice Base, ODBC and JDBC

Last Updated on Sunday, 30 December 2012 01:01


Published on Saturday, 29 December 2012 18:11
Written by Pawel Wawrzyniak
Hits: 3905

I had some spare time during Christmas and New Year period and I decided to make a short exercise on: Oracle
Solaris 11.1 (x86) manual installation, Oracle Database 11gR2 manual installation and some experiments with
integration of LibreOffice Base (via JDBC driver) and MS Access 2013 on top of MS Windows 8 (for data
manipulation and database frontend application development). Why such a set of products? Well, Solaris is marketed
as the best Unix for Oracle technologies deployment. Moreover, I have experience with GNU/Linux and AIX5L when
it comes to Oracle DB. Why MS Access 2013 and MS Windows 8? I like MS Access for data manipulation, useful
frontends and database application prototyping since the MS Access 97, so I wondered what comes with the newest
version. Same about MS Windows 8 curiosity. I hope youll find the following material useful for your own purposes.
Lets see what software components are required to start this exercise.

The complete list of required software components covers:

Host side:
Virtualization platform: Oracle VirtualBox 4.2.6

Additional tool: Clone VDI 2.10 (was used to resize the virtual hard drive)

LibreOffice 3.6.4.3 (or newer)

Oracle DB 11gR2 JDBC Drivers (file: ojdbc6.jar)

Guest#1 side:

Operating system: Oracle Solaris 11.1 (x86/64-bit)

DB software: Oracle DB 11gR2

Guest#2 side:

Operating system: MS Windows 8 (RTM, 90-day evaluation version)

DB software: MS Access 2010 (60-day evaluation version)


Thats all. Now we can begin.

Part 1. Oracle VirtualBox 4.2.6 installation and virtual machine creation for Solaris
11.1 and Oracle DB 11gR2

Last Updated on Sunday, 30 December 2012 01:01


Published on Sunday, 30 December 2012 00:59
Written by Pawel Wawrzyniak
Hits: 3400

I doubt that most of us have tons of hardware, especially in the era of virtualization. Today our desktop computers
are strong enough to help us with home made experiments on software installation and configuration. Everything is
much more flexible when we deal with virtual machines, not to mention the fact, that we can heavily reduce the
amount of hardware which we were still using a few years ago. To start the experiment, we need to download and
install VirtualBox 4.2.6 (or higher).
This operation is so straightforward that we will skip the detailed description. I decided to install VirtualBox on my
host machine, which was a typical MS Windows 7 based office desktop. However, with multi-core CPU and enough
RAM.
When VirtualBox was installed, I created a virtual machine aimed for Solaris 11.1 (x86/64-bit) installation. The
specification is as presented on the following screenshots.

Please note, that the virtual hard drive size is 30 GB (dynamically allocated) and more than 25 GB is used (this is the
situation with installed and working Oracle database instance). Previously I allocated only 20 GB of space for virtual
hard drive and it was my fault it was too small and I could not continue with Oracle DB installation in easy manner.
Moreover, the virtual disk drive was fixed size type. Fortunately, nothing critical happened as this issue was a
pleasure to be solved with CloneVDI. This tool helped me a lot with virtual disk drive resize operation from 20 GB to
30 GB in my case.
Of course all the parameters of virtual machine can be much better everything is up to you and your host hardware
capabilities. Now, let's start with Solaris 11.1 (x86/64-bit) installation.

Part 2. Oracle Solaris 11.1 (x86/64-bit) installation with Text Install

Last Updated on Sunday, 30 December 2012 19:14


Published on Sunday, 30 December 2012 18:17
Written by Pawel Wawrzyniak
Hits: 5976

Firstly, we have to download Solaris 11.1 (x86/64-bit) from Oracle Technology Network (all required software
components are presented in part 0 of this series). There are several options available. From the most friendly Live
Media, where we can boot Solaris to the graphical desktop environment (Gnome), try it out on our target machine
and decide if we want to install the system with nice, modern graphical installer, through ready to be used virtual

machines (no fun in our case), to the option we will use in our scenario, so called: Text Install. In my opinion the most
classic way of Solaris installation and it will provide the best experience for us. Lets download this version now.
We assume that the target virtual machine has been already created in VirtualBox with minimal parameters
presented in part 1 article of this series. Then, we can start virtual machine and mount Solaris 11.1 (x86/64-bit) Text
Install CD-ROM image as our virtual CD-ROM in VirtualBox. Soon, the installation process will start. We will now
present screenshots taken from every screen of Solaris 11.1 text installer. All values were specific to my case and
should be modified to fulfill individual requirements.
I can only point out once again, that as I mentioned before in part 1 the virtual disk drive for Solaris 11.1
installation with Oracle DB 11gR2 on top of it should be at least 30 GB. Please note, that at the current stage, the
target virtual disk drive capacity was set by me to 20 GB (we will see this size on dedicated screenshot) of course,
it was even too much for Solaris 11.1, but during the installation of Oracle DB 11gR2 I had to use Clone VDI to
extend its capacity up to 30 GB. So, if someone want to skip the virtual hard drive expansion task with Clone VDI
tool, then its a very good idea to set the appropriate size during virtual machine creation (30 GB or more means no
issues).

After installation is completed, we can reboot (F8 on Installation Complete screen) and we will see GNU GRUB... We
can boot from our hard disk and login to Oracle Solaris 11.1 for the first time (remember to have installation CD-ROM
unmounted).

That's all for now. We finished the very basic installation. Now we will install Gnome - yes, we need graphical desktop
environment to install Oracle Database 11gR2 in a friendly manner, 100% locally.

Part 3. Installing Gnome for Oracle Solaris 11.1 (x86/64-bit)

Last Updated on Sunday, 30 December 2012 19:42


Published on Sunday, 30 December 2012 19:39
Written by Pawel Wawrzyniak
Hits: 7634

Now, as we have basic Oracle Solaris 11.1 installed on our virtual machine, we will need to have a graphical desktop
environment installed, too. It's required by the Oracle Universal Installer (OUI) application we will use to install Oracle
Database 11gR2.
We don't want to complicate the things too much at this time, therefore we will launch OUI locally. In typical scenario
one can want to run X server on his local desktop computer, export appropriate display settings from the target
server (on which, usually, an administrator is logging in via SSH2 remotely) and perform the installation via OUI,
including database creation via DBCA (Database Creation Assistant). We will simplify the whole process all in all
we are working with virtual machine and we can launch graphical session there. Although, we have to install Gnome
first. Let's do it.

Login using your user account and then switch to root role (you can skip "uname -a" command, of course):

Then type the following command:


# pkg install slim_install
You'll see the installation process, as shown on the following screenshots:

Wait until the end and execute:


# startx
You'll see the well-known Gnome desktop:

Now, let's reboot our system (System > Shut down... > Restart) after a short while we should be able to see
GDM (Gnome Display Manager) login:

That's all. We can now begin prerequisites configuration for Oracle Database 11gR2 installation.

Part 4A. Clone VDI helps with Oracle VirtualBox virtual disks resize operations

Last Updated on Sunday, 30 December 2012 21:32


Published on Sunday, 30 December 2012 20:29
Written by Pawel Wawrzyniak
Hits: 3332

I created a 20 GB virtual disk drive for Solaris 11.1 and Oracle DB 11gR2. This was really too small and the most
comfortable thing I could do was to use Clone VDI 2.10. This is small, simple and very useful piece of software
really recommended for all Oracle VirtualBox users. Not only we can clone our virtual hard disks, manage their
UUIDs, perform compacting, but also easily resize disks.
To solve my problem I made a backup of my virtual hard drive file (sic!), started Clone VDI, selected my source
virtual hard drive (Solaris11_1_test.vdi) which was 20 GB fixed size, I changed the name of my destination virtual
hard drive file (in this case: Clone of Solaris11_1_test_X.vdi to be honest, not a nice name, but everyone can
decide on his own, which is recommended). I also selected the options to: "Keep old UUID" and "Increase virtual
drive size to 30.00 GB". With such configuration I expected to have a drop-in replacement of my 20 GB source virtual
hard drive. I waited for a couple of minutes

And it was done. So, I replaced my old, 20 GB file with the new, 30 GB one. With some reference to the Solaris
11.1 administrators guide I was able to easily allocate a new space for my root storage pool with ZFS commands
(refer to the "Solaris Internals" for more information).

Part 4. Oracle Database 11gR2 prerequisites. Before actual installation on Solaris


11.1

Last Updated on Sunday, 24 February 2013 21:55


Published on Sunday, 30 December 2012 22:33
Written by Pawel Wawrzyniak
Hits: 21411

We have configured our fresh Oracle Solaris 11.1 (x86/64-bit) installation. Now we can start preparations for Oracle
Database 11gR2 binaries installation. Let's check all the prerequisites as presented in the official documentation
and then run the installation process with Oracle Universal Installer (OUI).
The most important documents for us are:

Oracle Database Installation Guide 11g Release 2 (11.2) for Oracle Solaris

Oracle Database Quick Installation Guide 11g Release 2 (11.2) for Oracle Solaris on x86-64 (64-Bit)
First of all, let's check the RAM requirements. According to documentation, a minimum is 1 GB and recommended
amount of RAM is 2 GB or more. We set 2 GB for our virtual machine, so it's good, but anyway use root role:
root@turingsman:~# prtconf | grep "Memory size"
Memory size: 2000 Megabytes
root@turingsman:~#
2000 Megabytes OK.
Now, let's check the swap space. The rule is that for RAM size between 1 GB and 2 GB, the swap size should be
equal to 1.5 times the size of RAM. If there is more than 2 GB RAM and less than 16 GB, then the swap size should
be equal to the RAM size. If there is more than 16 GB of RAM, our swap size shouldn't be bigger than 16 GB.

Execute the following command:


root@turingsman:~# swap -lh
swapfile dev swaplo blocks free
/dev/zvol/dsk/rpool/swap 274,2 4K 2.0G 2.0G
2 GB is enough. If you have less than 2 GB, please refer to the ZFS documentation and expand swap to required
size the process ofadjusting size of swap on an active system is very well documented in "Solaris Internals".
Now, for the sake of curiosity (and integrity of this tutorial), let's check for the system architecture:
root@turingsman:~# isainfo -kv
64-bit amd64 kernel modules
root@turingsman:~#
Good! Of course, this is supported architecture.
We will need at least 1 GB in the /tmp directory. Therefore, let's check it:
root@turingsman:~# df -h /tmp
Filesystem Size Used Available Capacity Mounted on
swap 2.5G 128M 2.4G 6% /tmp
OK. We've enough space. Otherwise, it should be expanded refer to "Solaris Internals".
Our Oracle Database 11gR2 runtime files (binaries) will require about 5 GB, so it's important to select a proper
volume with enough free space. If you created at least 30 GB hard drive for your virtual machine in VirtualBox, as it
was recommended several times before it's Ok. Otherwise, please refer to part 4A of this series.

Now, there is the most important information in official Oracle Database 11gR2 installation guide: no special kernel
parameters, packages, or patches are required at the time of this release for Oracle Solaris 11.
Seems that the whole Oracle Database 11gR2 installation process on Oracle Solaris 11.1 is much easier than when
compared to Oracle Solaris 10 or supported Linux distributions. I strongly recommend to follow the official
documentation. However, as I made some additional modifications using Oracle Solaris projects feature I'll present
them later in this article.
Alright. Enough about parameters, packages or patches (still, as I was experimenting with the whole thing, I made
some more/less rational decisions myself I'll present these modifications later).
We have to check what version of Solaris and what update level were using to be sure we're compliant with the
Oracle requirements:
root@turingsman:~# uname -a
SunOS turingsman 5.11 11.1 i86pc i386 i86pc
root@turingsman:~# uname -r
5.11
root@turingsman:~# cat /etc/release
Oracle Solaris 11.1 X86
Copyright (c) 1983, 2012, Oracle and/or its affiliates. All rights reserved.
Assembled 19 September 2012

Everything is OK.
We assume that there are no other Oracle products installed on this machine. This is the first installation, so we now
have to create some required groups and users:

# groupadd oinstall
# groupadd dba
# useradd -d /export/home/oracle -m -s /bin/bash -g oinstall -G dba oracle
This command creates the oracle user and specifies "oinstall" as the primary group and "dba" as the secondary
group.
Enter the following command to set the password of the oracle user:
root@turingsman:~# passwd -r files oracle
New Password: [type your favorite password]
Re-enter new Password: [re-type your favorite password]
passwd: password successfully changed for oracle
Check the shell limits:
root@turingsman:~# ulimit -t
unlimited
root@turingsman:~# ulimit -f
unlimited
root@turingsman:~# ulimit -d
unlimited
root@turingsman:~# ulimit -s
8192
root@turingsman:~# ulimit -n

1024
root@turingsman:~# ulimit -v
unlimited
root@turingsman:~#
Almost good. Oracle recommends the following minimum values for STACK (-s) = 32768 and NOFILES (-n) = 4096
limits. Tune them with the following commands:
root@turingsman:~# ulimit s 32768
root@turingsman:~# ulimit n 4096
You can check that limits were changed with the previous commands again (ulimit s, ulimit n).
To have these changes permanent, you should define the limits in /etc/system or use Oracle Solaris projects feature.
Now, I've unfortunately made some additional changes with the projects feature of Oracle Solaris. You can follow my
way to stay compliant with the record of this exercise. Perform the following commands:
root@turingsman:~# projadd -U oracle -K "project.max-shm-memory=(priv,6g,deny)"
user.oracle
root@turingsman:~# projmod -sK "project.max-sem-nsems=(priv,512,deny)" user.oracle
root@turingsman:~# projmod -sK "project.max-sem-ids=(priv,128,deny)" user.oracle
root@turingsman:~# projmod -sK "project.max-shm-ids=(priv,128,deny)" user.oracle
root@turingsman:~# projmod -sK "project.max-shm-memory=(priv,6g,deny)" user.oracle
And:

root@turingsman:~# ndd -set /dev/tcp tcp_smallest_anon_port 9000


root@turingsman:~# ndd -set /dev/tcp tcp_largest_anon_port 65500
/ root@turingsman:~# ndd -set /dev/udp udp_smallest_anon_port 9000
root@turingsman:~# ndd -set /dev/udp udp_largest_anon_port 65500
root@turingsman:~# projmod -sK "process.max-file-descriptor=(priv,65536,deny)"
user.oracle
Put in /etc/inittab the following lines for the TCP and UDP parameters to be sure that changes will be persistent
among reboots:
tm::sysinit:/usr/sbin/ndd -set /dev/tcp tcp_smallest_anon_port 9000 > /dev/console
tm::sysinit:/usr/sbin/ndd -set /dev/tcp tcp_largest_anon_port 65500 > /dev/console
tm::sysinit:/usr/sbin/ndd -set /dev/udp udp_smallest_anon_port 9000 > /dev/console
tm::sysinit:/usr/sbin/ndd -set /dev/udp udp_largest_anon_port 65500 > /dev/console
Now, we have to create required directories:
root@turingsman:~# mkdir -p /u01/app/oracle
root@turingsman:~# mkdir -p /u02/oradata
Assign the required owners:
# chown -R oracle:oinstall /u01
# chown -R oracle:oinstall /u02

And change permissions:


# chmod -R 775 /u01
# chmod -R 775 /u02
Now, customize bash profile with the following variables (use vi editor to create ".bash_profile" file for oracle user):
[]
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
ORACLE_SID=TURINGSMAN
LD_LIBRARY_PATH=$ORACLE_HOME/lib
PATH=$PATH:/usr/local/bin:$ORACLE_HOME/bin
export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH PATH
[]
Please note, we assume that Bash (Bourne-again shell) will be used by oracle user. So, log to the oracle account
now:
# su oracle
And run vi editor with the ".bash_profile" file for edition:
-bash-4.1$ vi .bash_profile

Now, put all the lines presented above into the file in vi editor and save file (hit "Esc" key, then hit "w" and "q" keys to
perform write and quit operation). However, at this stage this can be tricky as all the paths presented in the
".bash_profile" file are to be created by Oracle Universal Installer (OUI). These paths don't exist at this stage of
installation. Please only note, that if we change the paths in OUI we have to edit ".bash_profile" too. Also, our Oracle
Database 11gR2 installation should be planned, so we can assume that the following paths pattern will be copied in
OUI (this is our plan).

Now, we can copy the installation packages and unzip them for oracle user. So, login as oracle (if not logged in
already) and create a directory for installation packages. This can be anywhere we just have to remember that we
will require a few GBs of space for zipped installation packages and unzipped content. For example, this can be done
the following way:

root@turingsman:~# su - oracle
Oracle Corporation SunOS 5.11 11.1 September 2012
-bash-4.1$ pwd
/export/home/oracle
-bash-4.1$ mkdir orainstall
-bash-4.1$ cd orainstall
So, copy the installation packages to "orainstall" directory:
-bash-4.1$ cp /mnt/* orainstall/
Check we have both installation packages:
-bash-4.1$ ls
solaris.x64_11gR2_database_1of2.zip solaris.x64_11gR2_database_2of2.zip
We can now unzip both of them here:
-bash-4.1$ unzip /mnt/solaris.x64_11gR2_database_1of2.zip d
/export/home/oracle/orainst

-bash-4.1$ unzip /mnt/solaris.x64_11gR2_database_2of2.zip d


/export/home/oracle/orainst
After a while, we should have a "database" directory available. Let's check it:

-bash-4.1$ pwd
/export/home/oracle/orainstall
-bash-4.1$ ls -la
total 9
drwxr-xr-x 3 oracle oinstall 3 Dec 26 01:07 .
drwxr-xr-x 3 oracle oinstall 10 Dec 26 01:07 ..
drwxr-xr-x 8 oracle oinstall 10 Nov 24 2009 database
-bash-4.1$
Before I ran Oracle Universal Installer (OUI) from database directory for good, I did some additional changes in the
operating system. I installed JDK7 (with Add More Software tool available directly from the Gnome desktop). Also, I
installed SUNWmfrun package to avoid possible error about Motif libraries. You can do the same to stay compliant
with our exercise.

Also, some experts say that this is not required to export DISPLAY variable when OUI is executed locally. Well,
seems this statement is not true. I had to export DISPLAY variable to avoid OUI errors during initial prerequisites
check. This can be done with the following command from oracle user (Bash):
-bash-4.1$ DISPLAY=turingsman:0.0; export DISPLAY

Change "turingsman" with the name of your server, of course.


Now, we can run the famous Oracle Universal Installer remember to be logged in on oracle user account. Let's
check we have all we need in the database directory:
-bash-4.1$ cd database/
-bash-4.1$ ls -la
total 52
drwxr-xr-x 8 oracle oinstall 10 Nov 24 2009 .
drwxr-xr-x 3 oracle oinstall 3 Dec 26 01:07 ..
drwxr-xr-x 12 oracle oinstall 15 Nov 18 2009 doc
drwxr-xr-x 4 oracle oinstall 14 Nov 24 2009 install
drwxr-xr-x 2 oracle oinstall 5 Nov 24 2009 response
drwxr-xr-x 2 oracle oinstall 2 Nov 24 2009 rpm
-rwxr-xr-x 1 oracle oinstall 6513 Nov 24 2009 runInstaller
drwxr-xr-x 2 oracle oinstall 3 Nov 24 2009 sshsetup
drwxr-xr-x 14 oracle oinstall 30 Nov 24 2009 stage
-rw-r--r-- 1 oracle oinstall 5400 Nov 17 2009 welcome.html
Be sure to run the OUI from oracle user session in Gnome:
-bash-4.1$ ./runInstaller

That's all for now. We will continue with the Oracle Universal Installer in the part 5 of this series.

Part 5. Oracle Database 11gR2 installation with Oracle Universal Installer on


Solaris 11.1

Last Updated on Monday, 31 December 2012 21:28


Published on Monday, 31 December 2012 21:00
Written by Pawel Wawrzyniak
Hits: 5432

We will now install Oracle Database 11gR2 with Oracle Universal Installer, which we have successfully run in the end
of part 4 of this series. After Oracle Database 11gR2 binaries installation we will create and configure a database
instance with the dedicated tool Oracle Database Configuration Assistant (DBCA). Although, usually DBCA is run
in the last stage of OUI installation process, this is not a rule. If the Oracle database environment is configured
properly, we can run DBCA at any given moment to handle database instances in our system. Also, we can run
DBCA separately, if OUI reported some non-critical errors which prevented successful database creation as in our
case here.
Firstly, if OUI started successfully (passed all initial checks in the console mode), but then there was an error
message:
[INS-13001] Environment does not meet minimum requirements
This can mean two things. In fact, our system does not meet minimum requirements and we have to take care of this
issue. Maybe, it is enough to check the whole configuration and prerequisites fulfillment once again? Kernel

parameters? Patches? Is our operating system really supported by this version of Oracle Database 10gR2 (which
version, exactly)? It's possible that we forgot about something important which can still be more or less easily
handled.
However, things can be more enigmatic if we are sure that all the requirements are met or even exceeded. In such
case, the best option is to look for help on free OTN forums or paid My Oracle Support (MOS, previously known as
Metalink). There is a chance to get some help from Oracle experts available on the OTN forums but please note,
that due to the license requirements, it is prohibited to publish the information available via My Oracle Support on-line
service. All in all it's commercial, requires an user account to be created and assigned to the company's CSI number
(valid support contract is necessary).
Finally, to better understand what is going on we can generate the report in response file, by executing the following
command:
./runInstaller executePrereqs silent responseFile <responsefile>.rsp
Also, in some specific cases, when we are not installing a production environment, we can make a decision to go on
with the OUI, even if there was an error reported. Everything depends on type of error. Once again we can do a
little bit more in test environments, but in production environments such approach is not acceptable. We can even
skip the prerequisites checks and invoke OUI with the following command:
./runInstaller ignoreSysPrereqs
Although, prerequisites checking is our friend in most cases.
Once we ran OUI, we will see the following sequence of screens each one for each step of OUI.

The first step in OUI is to configure security updates. As we install in the test environment, we can skip this option.

Then, in the second step, we have to decide what we plan to do with the help of OUI. In our case we have to select:
"Create and configure a database" (this means that after OUI, there will be DBCA launched).

In the third step, let's select "Desktop class" database. This will make our live simpler and is more adequate to the
purpose of our exercise. We're only exploring the basics of standalone Oracle database installation, we don't think
about RAC (Realtime Application Cluster) or grid technologies.

Then, in step four, we have to provide all the required data very carefully. Please note, that if we change paths, we
will have to take care about ".bash_profile" file we created previously (see part 4 of this series). Therefore, let's copy
all the values from the screenshot presented below.

In step five we have to provide additional information path to Oracle Inventory (a place where installation files will
be copied) and oraInventory group name (a group which owns oraInventory directory). Sixth step is Prerequisite
Checks if skipped during launch of OUI, then it will not be performed.

Step seven provides the summary of all options we selected until now. We should refer to them and double-check
before going to the next step. Please note, that source location here is different than presented in part 4 of this
series. However, this is not an important difference everything depends on the fact where we unzipped our Oracle
Database 11gR2 installation disks and from which location we started OUI. So, this can be also different in your
specific case.

Step eight actual installation.

We can see that near the end of OUI installation process, DBCA tool is going to be started (database instance
creation).

Unfortunately, in our case DBCA failed to start. The reported reason is lack of seed database instance schema file
Seed_Database.dbf. This is not critical however, should be examined separately, if we cannot provide the required
file on-demand (in fact this error was generated due improper file copying operation between directories we will
cover this issue in more details later).

So, let's continue (OK > Skip). As we can see, Oracle DBCA step was ignored. That's OK. Now, OUI will ask us to
execute two scripts from the presented location. Please note, we have to use root role to execute these scripts under
Solaris 11.1. Also, it's worth to remember that this is the only moment in which Oracle requires us to work with root
role privileges during the whole OUI installation process.

Then, 100% of OUI installation process is completed (please note although, DBCA was skipped).

The last step ninth "The installation of Oracle Database was successful". However, the fun is yet to begin.

We will now continue with the DBCA Database Configuration Assistant in the next, sixth, part of this series. We
have to create general purpose database instance for the next planned exercises.

Part 6. Oracle Database 11gR2. Creating database with Database Configuration


Assistant

Last Updated on Saturday, 26 January 2013 17:44


Published on Tuesday, 01 January 2013 22:10
Written by Pawel Wawrzyniak
Hits: 6160

We will now run DBCA Database Configuration Assistant for our freshly installed Oracle 11gR2. This tool will help
us to create a database for our further explorations. Therefore, we will not go into the details of DBCA too much. Our
plan is to create the general purpose database. Also, we have to run this tool separately, because we skipped DBCA
step during Oracle Universal Installer installation process (see part 5). This was due to the lack of
"Seed_Database.dbf" which in fact can be found on the Oracle Database 11gR2 installation disks and was lost
during copying operation (on OTN forum some people claim that "Seed_Database.dbf" file can be lost during
unzipping operation unfortunately, no other details are provided). So, let's start.
First of all, we have to be sure, that our environment is properly configured especially, when it comes to the paths
etc. Check with the "env" command:

$ env
HZ=
SHELL=/bin/bash
TERM=xterm
LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.0/dbhome_1/lib
ORACLE_SID=TURINGSMAN
ORACLE_BASE=/u01/app/oracle
MAIL=/var/mail/oracle
PATH=/usr/bin::/usr/local/bin:/u01/app/oracle/product/11.2.0/dbhome_1/bin
PWD=/export/home/oracle
LANG=en_US.UTF-8
SHLVL=1
HOME=/export/home/oracle
LOGNAME=oracle
ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
_=/usr/bin/env
Export DISPLAY variable:
$ export DISPLAY=turingsman:0.0
Then we can execute DBCA with the following command of course, as an oracle user:
$ dbca

On the Welcome screen we click "Next".

DBCA consists of 12 steps. In the first step we have to select: "Create a Database" option (other options are
unavailable, except "Manage Templates", because there is no database yet in our system).

Then we have to select type of our database in the second step: "General Purpose or Transaction Processing".

Please click "Show Details" button to see what database components are required for such type of database.

Step 3. We have to provide Global Database Name and SID (System Identifier) of our database.

Step 4. Leave the default values for "Enterprise Manager settings" and "Automatic Maintenance Tasks".

Step 5. However, this is not recommended especially in production environment (in fact, not allowed for security
reasons!) we can make things easier and set the same passwords for all administrative accounts (SYS, SYSTEM,
DBSNMP, SYSMAN). All in all, we're working in test environment and this is only a kind of reconnaissance. Also,
please note, that all passwords can be changed in the future. For now, we can go with less secure option let's set
the same password for all mentioned accounts.

Step 6. As it was mentioned before we've skipped DBCA step during OUI installation process because
"Seed_Database.dbf" file (database template file) was not found. This issue was reported several times by some

people here and there, including OTN forum. There were many suggestions on what to do, including manual
database creation (in my opinion a good challenge for experienced DBAs) or downloading Oracle Database 11gR2
installation disks once again from OTN. Well, maybe re-downloading is a good idea, if we're sure that our installation
disks became corrupted. The question is then how it was possible to install Oracle database from such installation
media to this moment? In my case, the most reasonable explanation is that after several copying operations
between volumes (including the issue with required disk resize operation etc.) I somehow lost this file. Therefore,
I decided to look into the Oracle installation disk for "Seed_Database.dbf". I found this file under the following
location (check inside disk 2):
D:\Pawel\OraSol\solaris.x64_11gR2_database_2of2.zip\database\stage\Components\oracle.r
dbms.install.seeddb\11.2.0.1.0\1\DataFiles\Expanded\filegroup1

So, I copied this file to the previously mounted /mnt/sf_OraSol directory on my Solaris virtual machine and told DBCA
(via "Browse" button) where it is. This was a good idea. No additional software downloading from DBCA, no hand
made database creation etc.

Step 7. Remember to select a proper database files location in our case: /u01/oradata.

Step 8. We can leave default values for our purposes.

Step 9. Yes, we should add sample schemas this will be very usable in our future exercises (especially, famous
Human Resources schema).

Step 10. Default values only remember to set Unicode for national characters encoding.

Step 11. Database Storage. Default values we will not change anything or add any file. Please only refer to the files
locations to be sure, that everything will be installed in the desired place (control files, data files and redo logs).

Step 12. Select "Crate Database" and click "Finish". "Confirmation" window will be opened just refer to all
presented database details to once again confirm all our decisions and click "OK". The database creation process
will be launched.

And then it's done.

We have now created our first database, which includes exemplary schemas. In the next part we will verify that all
basic configuration files are defined correctly and we can easily operate our database with provided tools.

Part 7. Checkpoint for Oracle Database 11gR2 installation. Configuration files,


basic tools and common issues

Last Updated on Monday, 11 March 2013 21:26


Published on Monday, 11 March 2013 20:10
Written by Pawel Wawrzyniak
Hits: 5826

We had a short break after part 6 of this series. Believe it or not, there was a really important reason for me to stop
writing for a while although, this is quite a different story. Now, we're back to finish with our experiments with Oracle
Database 11gR2 on Solaris 11.1. What was really nice, during the last two months I received some emails and
comments with your suggestions and opinions on this series. Therefore, I would like to thank you all for positive
feedback and additional inspiration. Now, we can come back to work.
I hope our virtual machines are ready to be run again. Before we begin with additional experiments, it's good to know
which Oracle Database 11gR2 configuration files should be double-checked. Usually, if something is wrong with
these files, the overall Oracle database installation is not working properly or for example a listener or database
instance cannot be started. Also, we will present some basic administration tools for Oracle.
First of all, let's check listener.ora file. Please login to the oracle user account and execute the following command:
oracle@turingsman:~$ vi
/u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora

You should see something similar to this:


LISTENER=
(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=tcp)(HOST=turingsman)(PORT=1521))
(ADDRESS=(PROTOCOL=ipc)(KEY=extproc))))
SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=
(GLOBAL_DBNAME=TURINGSMAN)
(ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME=TURINGSMAN))
)
Now exit vi editor and execute the following command to check how tnsnames.ora file is composed:
oracle@turingsman:~$ vi
/u01/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora
In my case it looks like that:

# tnsnames.ora Network Configuration File:


/u01/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

TURINGSMAN =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = turingsman)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = TURINGSMAN)
)
)

LISTENER_TURINGSMAN =
(ADDRESS = (PROTOCOL = TCP)(HOST = turingsman)(PORT = 1521))
Also, always remember about .bash_profile file:
oracle@turingsman:~$ vi .bash_profile

In my case it looks like this:


ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
ORACLE_SID=TURINGSMAN
LD_LIBRARY_PATH=$ORACLE_HOME/lib
PATH=$PATH:/usr/local/bin:$ORACLE_HOME/bin

export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH PATH


And here is the set of useful commands, that has to be available from the command line, once your Oracle Database
11gR2 is installed and your oracle user shell is properly configured (see .bash_profile file).

Tool

Syntax

lsnrc lsnrctl <command>


tl

Purspos
e
This tool
is aimed
to
manage
Oracle
Databas
e listener

Selected
command
s
Example
(<comma
nd>)
Status
lsnrctl
Start
reload
Reload
Stop
Version
services
Exit

sqlpl sqlplus
us
[[username[/password]
[@service_name] | / [as
{sysdba|sysoper}]] |
/nolog]

tnspi tnsping <service_name>


ng
<how_many_times>

process Quit
(in short Help
words:
without
working
listener it
won't be
possible
to
connect
to the
Oracle
database
instance)
This tool help
is
required
to
connect
with the
Oracle
database
from
comman
d line to
execute
SQL
statemen
ts
This tool
helps to

sqlplus
/nolog
help

tnsping
TURINGS

trcro Trcroute <service_name>


ute

check if
given
Oracle
Net
service is
available
for
connecti
ons. If
connecti
on
succeed
ed,
tnsping
tool will
show
estimate
d time
required
for data
transmis
sion
between
client
and
server
side.
This tool
helps to
discover
the trace
of

MAN 4

trcrout
e
TURINGS
MAN

connecti
on
between
client
and
server

Let's have a short trip through the tools presented above. Imagine we have just logged in to our database server and
we want to start all the Oracle Database 11gR2 components by hand. Be sure we are using oracle account for
example:
pwawrzyn@turingsman:~$ su - oracle
Password:
Oracle Corporation SunOS 5.11 11.1 September 2012
-bash-4.1$
Then, run sqlplus:
-bash-4.1$ sqlplus /nolog
When sqlplus is started, execute the commands presented below (your commands are marked bold):
SQL*Plus: Release 11.2.0.1.0 Production on Sun Mar 10 20:02:10 2013
Copyright (c) 1982, 2009, Oracle. All rights reserved.

SQL> conn sys as sysdba;


Enter password:
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 835104768 bytes
Fixed Size 2215624 bytes
Variable Size 562037048 bytes
Database Buffers 268435456 bytes
Redo Buffers 2416640 bytes
Database mounted.
Database opened.
SQL> select * from v$instance;
INSTANCE_NUMBER INSTANCE_NAME
--------------- ---------------HOST_NAME
---------------------------------------------------------------VERSION STARTUP_ STATUS PAR THREAD# ARCHIVE LOG_SWITCH_WAIT
----------------- -------- ------------ --- ---------- ------- --------------LOGINS SHU DATABASE_STATUS INSTANCE_ROLE ACTIVE_ST BLO
---------- --- ----------------- ------------------ --------- --1 TURINGSMAN
turingsman

11.2.0.1.0 13/03/10 OPEN NO 1 STOPPED


ALLOWED NO ACTIVE PRIMARY_INSTANCE NORMAL NO
SQL> quit
Disconnected from Oracle Database 11g Release 11.2.0.1.0 - 64bit Production
Then, we should start Oracle listener process (commands to be executed are marked bold):
-bash-4.1$ lsnrctl
LSNRCTL for Solaris: Version 11.2.0.1.0 - Production on 10-MAR-2013 20:22:02
Copyright (c) 1991, 2009, Oracle.

All rights reserved.

Welcome to LSNRCTL, type "help" for information.

LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=turingsman)(PORT=1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Solaris Error: 146: Connection refused
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=extproc)))
TNS-12541: TNS:no listener

TNS-12560: TNS:protocol adapter error


TNS-00511: No listener
Solaris Error: 2: No such file or directory
LSNRCTL> start
Starting /u01/app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr: please wait...

TNSLSNR for Solaris: Version 11.2.0.1.0 - Production


System parameter file is
/u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/turingsman/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=turingsman)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=extproc)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=turingsman)(PORT=1521)))
STATUS of the LISTENER
-----------------------Alias

LISTENER

Version

TNSLSNR for Solaris: Version 11.2.0.1.0 - Production

Start Date

10-MAR-2013 20:22:12

Uptime

0 days 0 hr. 0 min. 0 sec

Trace Level

off

Security

ON: Local OS Authentication

SNMP

OFF

Listener Parameter File


/u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File
/u01/app/oracle/diag/tnslsnr/turingsman/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=turingsman)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=extproc)))
Services Summary...
Service "TURINGSMAN" has 1 instance(s).
Instance "TURINGSMAN", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
LSNRCTL> reload
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=turingsman)(PORT=1521)))
The command completed successfully
LSNRCTL> quit

Now, let's try tnsping we're working on local machine, so it's not a best example, but anyway:
-bash-4.1$ tnsping TURINGSMAN 4
TNS Ping Utility for Solaris: Version 11.2.0.1.0 - Production on 10-MAR-2013 20:23:03
Copyright (c) 1997, 2009, Oracle. All rights reserved.
Used parameter files:
/u01/app/oracle/product/11.2.0/dbhome_1/network/admin/sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = turingsman)
(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = TURINGSMAN)))
OK (20 msec)
OK (0 msec)
OK (0 msec)
OK (0 msec)
And finally, trcroute with the same remark like for tnsping we're on local machine:
-bash-4.1$ trcroute TURINGSMAN
Trace Route Utility for Solaris: Version 11.2.0.1.0 - Production on 10-MAR-2013
20:24:42
Copyright (c) 1995, 2009, Oracle. All rights reserved.

Route of TrcRoute:
-----------------Node: Client Time and address of entry into node:
------------------------------------------------------------10-MAR-2013 20:24:42 ADDRESS= PROTOCOL=TCP HOST=turingsman PORT=1521
Node: Server Time and address of entry into node:
------------------------------------------------------------10-MAR-2013 20:24:42 ADDRESS= PROTOCOL=TCP HOST=turingsman PORT=1521
If everything works similar way in your case, we can progress to the part 8 of this series. Finally, to summarize our
checkpoint here, we should remember that if something is not working properly, the most common reasons are
hidden in:

Improperly owned directories of Oracle installation (refer to the previous parts to check the guidelines on
chown command). Remember we're working on oracle user account. Root role is used very rare, mostly for
operating system purposes and not the Oracle Database itself with significant exception during Oracle Universal
Installer part, when we have to execute root.sh script from root account.

Improperly assigned rights to the Oracle installation directories please not only check you've applied chown
command on all required directories, but also use took care to use chmod command (refer to the part 4).

Improperly defined or not set and exported Oracle Database environment variables refer to the .bash_profile
(this part) and double check you have all required variables and correctly defined paths. If yes, but you can't for
example invoke the tools presented in this part, maybe you should reload .bash_profile or which is quite common
remember to use BASH (maybe you're using oracle account with different shell, like CSH?).

Errors in the configuration files usually, for basic Oracle Database 11gR2 configuration, we should check the
files presented here (listener.ora, tnsnames.ora).

Das könnte Ihnen auch gefallen