Tải bản đầy đủ (.pdf) (10 trang)

Oracle Database Administration for Microsoft SQL Server DBAs part 8 pdf

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (285 KB, 10 trang )

to check that the oracle user has been added and to verify permissions.
You can edit the files with the vi editor or another text editor.
> cat /etc/security/limits.conf
#<domain> <type> <item> <value>
#
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
# End of file
> cat /etc/pam.d/login
#%PAM-1.0
auth [user_unknown=ignore success=ok ignore=ignore default=bad]
pam_security.so
auth include system-auth
account required pam_nologin.so
account include system-auth
password include system-auth
# pam_selinux.so close should be the first session rule
session required pam_selinux.so close
session include system-auth
session required pam_loginuid.so
session optional pam_console.so
# pam_selinux.so open should only be followed by sessions to be
executed in the user context
session required pam_selinux.so open
session optional pam_keyinit.so force revoke
session required /lib/security/pam-limits.so
session required pam_limits.so
Some system areas, such as those listed for the parameter and option
settings, can normally be viewed but not modified. Administrator permissions


(root access) might be needed to make changes to these files. If sharing the
server with another application, it’s important to make sure that changes to
these system areas are communicated, or discussed first. Even without write
permissions, having access to this information is helpful for doing a comparison
of what is needed and being able to communicate what configuration changes
are needed to the server administrator.
52
Oracle Database Administration for Microsoft SQL Server DBAs
Other Linux Considerations
Filling up some shared areas, such as /tmp, will cause issues with running or
installing Oracle software. You should be careful about placing files in these
areas and be sure to purge any old installation logs that are placed there.
Required Packages
The Oracle installation guide lists the required packages for the various Linux
flavors. Some of the packages will already exist on your system, since they are
included in the Linux installation. You should verify that they were installed
by using the command rpm –q package_name. You will need to install
any of the required packages that have not been installed by default.
As an example, for Red Hat or Oracle Enterprise Linux 5.2 and Oracle
Database 11
g
Release 2 (R2), the following required packages are included in
the Linux installation by default (verified by using rpm with the –q option):
binutils-2.17.50.0.6-6.el5 (x86_64)
compat-libstdc++-33-3.2.3-61 (x86_64)
compat-libstdc++33-3.2.3.61 (i386)
elfutils-libelf-9.125-3.el5 (x86_64)
glibc-2.5-24 (x86_64)
glibc-2.5-24 (i686)
glibc-common-2.5-24 (x86_64)

ksh-20060214-1.7 (x86_64)
libaio-0.3.106-3.2 (x86_64)
libaio-0.3.106-3.2 (i386)
libgcc-4.1.2-42.el5 (i386)
libgcc-4.1.2-42.el5 (x86_64)
libstdc++-4.1.2-42.el5 (x86_64)
libstdc++-4.1.2-42.el5 (i386)
make-3.81-3.el5 (x86_64)
If there are 32-bit and 64-bit versions listed, it doesn’t matter whether
you are running on a 32-bit or 64-bit version—both must be installed.
Continuing with the same example, the following required packages are
not installed by default and will need to be added:
elfutils-libelf-devel-0.125-3.el5.x86_64.rpm
elfutils-libelf-devel-static-0.125-3.el5.x86_64.rpm
elfutils-libelf-devel and elfutils-libelf-devel-static
static-0.125-3.el5.x86_64.rpm
glibc-headers-2.5-24.x86_64.rpm
kernel-headers-2.6.18-92.el5.x86_64.rpm
glibc-devel-2.5-24.x86_64.rpm
Chapter 3: Oracle Installation
53
glibc-devel-2.5-24.i386.rpm
gcc-4.1.2-42.el5.x86_64.rpm
libgomp-4.1.2-42.el5.x86_64.rpm
libstdc++-devel-4.1.2-42.el5.x86_64.rpm
gcc-c++-4.1.2-42.el5.x86_64.rpm
libaio-devel-0.3.106-3.2.x86_64.rpm
libaio-devel-0.3.106-3.2.i386.rpm
sysstat-7.0.2-1.el5.x86_64.rpm
unixODBC-2.2.11-7.1.x86_64.rpm

unixODBC-2.2.11-7.1.i386.rpm
unixODBC-devel-2.2.11-7.1.x86_64.rpm
unixODBC-devel-2.2.11-7.1.i386.rpm
The first three packages listed need to be installed together:
> rpm -ivh elfutils-libelf-devel-0.125-3.el5.x86_64.rpm elfutils-libelf-devel
To install the unixODBC-devel-2 packages, enter the following at the
Linux prompt:
>rpm –ivh unixODBC-devel-2*rpm
Once again, use rpm with the -q option to verify that a package is
installed:
>rpm –q unixODBC-devel-2.2.11
The installation guide provided by Oracle will have the most up-to-date
information for your versions of Oracle and Linux, and point out any
dependencies with certain packages and if there are any issues.
Kernel Parameters
You may need to adjust the kernel parameters if your Oracle system will
have high memory needs. Recall from Chapter 2 the example of the error
message that appears when the operating system doesn’t have enough
memory to mount the /dev/shm file system. Kernel parameters are in the
/etc/sysctl.conf file, which can be edited to make the necessary modifications.
kernel.shmall = physical RAM size / pagesize
kernel.shmmax=½ofphysical RAM, but < 4GB
kernel.shmmni =4096
54
Oracle Database Administration for Microsoft SQL Server DBAs
kernel.sem = 250 32000 100 128
fs.file-max = 512 x processes
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144

net.core.mem_max = 4194304
net.core.wmem_default = 262144
net.core_wmem_max = 1048576
After this file is edited, you must activate the changes by running the
following at the command prompt as root:
sysctl –p
Use the following command to view the current settings for a kernel
parameter:
> /sbin/sysctl -a | grep <param-name>
This was a quick overview of the setup for the Linux operating system.
The Oracle installation guide will have the details for your specific
environment.
Storage Requirements
Now we need to look at where the database is going to live. There are many
storage options available with hardware, configurations, and file systems,
and with new hardware developments, even more options may be coming
soon. However, we do want to eventually get to actually installing Oracle,
so this will not be an all-inclusive discussion about storage, but enough to
cover the basics.
If you don’t have enough memory in which to store the database—
whether it’s SQL Server or Oracle—fast read access is great. For backing up
data and applications that are heavy on the transactions, fast writing to the
disk is another bonus. In designing the storage layout, striping and mirroring
play a definite part. The databases need to be highly available, and the users
will always be happier with faster access, so building in fault-tolerant systems
Chapter 3: Oracle Installation
55
at the storage level is a necessity. Making it fast is even better. Chapter 10
will cover some I/O tuning and possible issues. Here, we’ll first examine
what disk storage is needed, and then look at Oracle Automatic Storage

Management (ASM), which can simplify your work by handling much of
the storage for you. We’ll also review the types of Oracle files.
Disk Storage
You will need storage for datafiles and log files, as well as disk space for
installing the software, but what other disk storage is required? You will
need space for server logs and backups, and possibly a scratch area for
exports and working with files.
Although you could use certain storage solutions, such as striping, to make
your database system work with just two disk drives or one file system, such a
setup isn’t ideal. With Linux, it’s possible to just have one mount point and
place everything there under different directories. To set up storage for a
particular system properly, the DBA needs to understand the different pieces:
files, I/O events, and backups. You need to know which are typical events for
databases and which are not, and which databases are heavy on read and
writes of disk, and how each of these can affect the disk storage needed.
Under Windows, you would at least hope for two additional drives
besides the C: drive. For example, you might set up disk storage on
Windows as follows:

D:\oracle Base directory for software and server logs

D:\oradata For datafiles and one control file

E:\orabackup For backups

E:\oraarch For archive logs

E:\oraexp For data dump files and exports

E:\oradata Another location for control files

Control files contain information about the datafiles that can be used
for recovery, as discussed in the “Oracle Files” section a little later in the
chapter. You should place the control files in different directories and have
multiple copies available in case they are needed.
56
Oracle Database Administration for Microsoft SQL Server DBAs
Under Linux, you might set up your disk storage as follows (/u0
n
is a
typical naming convention):

/u01/oracle Base directory for software, server logs, and control files

/u02/oracle/SID For exports, archives, backups, and control files

/u03/oracle/SID For datafiles (numbers can continue to increase)
and control files
Alternatively, you could use another naming convention such as /ora0
n
,
and this type of setup:

/ora01/oracle Base directory for software

/ora01/SID For datafiles and control files

/ora02 and subdirectories For export, backups, control files, and
so on
These are just some examples, intended to demonstrate how you might
break up the software, datafiles, and backup files.

Storage Management with ASM
ASM makes managing datafiles simple. With Oracle Database 11
g
R2, ASM
can manage all of the files—database files, nonstructured binary files, and
external files including text files.
This means that all of the discussion in the previous section could
actually be ignored. ASM handles managing the disk, adding disk storage,
and tuning I/O performance with rebalancing while the storage is up and
available to the Oracle databases on that server. The discussion then just
comes down to how many disk groups you will create. ASM will take care
of mirroring and striping. Different levels of redundancy are available for the
disk groups: normal, high, and external. With external, ASM doesn’t provide
the redundancy, but it can take advantage of external hardware mirroring.
Chapter 3: Oracle Installation
57
With Oracle Database 10
g
and even 11
g
R2, the ASM installation was part
of the database software installation routine. Starting with Oracle Database 11
g
R2, ASM is a separate installation using the Grid Infrastructure. Use a different
home directory than the database home directory for the installation of ASM,
and perform the installation as another user, such as asmadm user. The home
directory for ASM contains other pieces, such as Clusterware, which are part
of the ASM installation.
If you are installing a version of Oracle earlier than 11
g

R2, start the
installation process of the database software. After you set the home to install
the software, an option will come up for choosing which type of install to
do, as shown in Figure 3-2.
58
Oracle Database Administration for Microsoft SQL Server DBAs
FIGURE 3-2.
Choose to install ASM in Oracle Database 11
g
R1 or earlier
versions
After you choose the ASM installation, the Database Configuration
Assistant will start to create the instance that is used by ASM. In Figure 3-3,
the password is set for the system user, and the parameters to discover the
disk groups can be set here as well.
Next, create the disk groups. You can also add disk groups later. You
should see a list of devices available for the disk groups; if not, the parameter
for disk discovery might not be set. Figure 3-4 shows how to set this discovery
path, and then select the disks to be part of the disk group. Here is where the
redundancy for the disk group is selected. This is just the setup of the ASM
instance. In Chapter 10, we will look at how this plays into a highly available
database environment.
Chapter 3: Oracle Installation
59
FIGURE 3-3.
ASM instance creation
If you are installing Oracle Database 11
g
R2, ASM is a Grid Infrastructure
installation. As shown in Figure 3-5, you can install Clusterware and the Grid

Infrastructure. With this installation, the creation of the ASM instance, disk
groups, and volumes is done by the ASM Configuration Assistant instead of
the Database Configuration Assistant.
You can also use the ASM command-line utilities ASMCMD and ACFSUTIL
to create and manage the disks. Here’s an example of creating a volume
group from the operating system command line:
ASMCMD > volcreate -d DISKGRPDATA -s 20G volume1
ASMCMD can help manage the instance, with startup and shutdown, disk
group, and disk failure management.
60
Oracle Database Administration for Microsoft SQL Server DBAs
FIGURE 3-4.
ASM disk groups
The setup of the ASM disks needs to be done before even installing ASM
instance. The disk groups can be created so that they are available for the
software install. If using the file manager for the regular files, such as create
scripts and parameter files, as well as the datafiles for the database, these
disks and storage areas will need to be available for installation.
We have just scratched the surface of ASM. It has many more features
and options, and is an important piece of a stable database environment.
Oracle Files
Various types of files are part of the Oracle system. Understanding what
these files contain will help you to plan for storage and disk space.
Chapter 3: Oracle Installation
61
FIGURE 3-5.
ASM installation on Oracle Database 11
g
R2

×