Sunday, August 11, 2013

Oracle Grid Infrastructure – Part 4

Dear Readers,

My name is Franz Devantier, creator of this blog.  I am an Oracle Certified Professional (OCP DBA 11g) Security DBA.  I will be sharing with you the basic duties of an Oracle DBA, and also some of the undocumented, and not so well known tasks. 

Contact me: devantierf@gmail.com

Oracle Grid Infrastructure – Part 4
Configuring Disks for Oracle Automatic Storage Management Using the Automatic Storage Management Library Driver (ASMLIB)
To do this we need to install and configure the ASMLIB software, Configure the Disk Devices to use ASMLIB, be able to administer the ASMLIB and disks.  Now that is quite a task list, so let’s give it a go.

Installing and Configuring the ASMLIB Software
Firstly you should determine the kernel version and architecture of the system you are on.
$ uname –rm

Secondly make sure that you have the required ASMLIB packages available.
oracleasm-support-<version>.<arch>.rpm
oracleasm-<kernel>-<version>.<arch>.rpm
oracleasmlib-<version>.<arch>.rpm
Make sure that you download the correct packages.
<version> should be the version of ASMLIB driver
<arch> should march your system architecture  verify against (uname -rm)
<kernel> is the version of the kernel that you are using

Thirdly you can install the packages:
$ rpm -Uvh oracleasm-support-<version>.<arch>.rpm \
oracleasm-<kernel>-<version>.<arch>.rpm \
oracleasmlib-<version>.<arch>.rpm

Fourthly you need to determine the UID of the Oracle software owner, as well as GID of the OSASM group.
$ id oracle

Fifthly, you must run the oracleasm initialization script
$ /etc/init.d/oracleasm configure

Next you will need to enter values for the prompts that the above script displays.
Prompt
Possible Response
Default UID to own the driver interface:
Specify the UID of the Oracle Grid Infrastructure owner user, which by default may be grid.
Default GID to own the driver interface:
Specify the GID of the OSASM group which by default may be asmadmin.
Start Oracle Automatic Storage Management Library driver on start (y/n):
Recommended to enter y to start the Oracle Automatic Storage Management library driver when the system starts.
Scan for Oracle ASM disks on boot (y/n):
Recommended to enter y to scan for the presence of any Oracle Automatic Storage Management disks when the system starts.


Configuring the Disk Devices to Use the Oracle ASMLIB Driver
If you are going to use IDE, SCSI, or RAID devices in your ASM disk group then you should:
=> if needed, install or configure the disk devices intended for the disk group and restart the system.
=> Identify the device name for the disks that you are going to use.
$ /sbin/fdisk –l
The device name will probably vary, depending on the type of disk.
Disk Type
Device Name Format
Description
IDE disk
/dev/hdyn
Here “y” identifies the IDE disk, and “n” is the partition number. The first disk on the IDE bus could be something like: /dev/hda
SCSI disk
/dev/sdxn
Here “y” identifies the SCSI disk, and “n” is the partition number. The first disk on the first SCSI bus: /dev/sda
RAID disk
/dev/rd/cxdypz/dev/ida/cxdypz
RAID devices can have different device names, depending on the RAID controller. Here “x” is a number that identifies the controller, “y” is a number that identifies the disk, and “z” is a number that identifies the partition. The second logical drive on the first controller: /dev/ida/c0d1   They are numbered from 0 of course.

=> Create a single whole-disk partition on each disk that you are going to use.
You can use fdisk for this task.

=> Mark the disk as an Oracle Automatic Storage Management disk with a disk-name of DISK1.
$ /etc/init.d/oracleasm createdisk DISK1 /dev/sdb1

If you are using a multipathing disk driver with ASM, then you must make sure that you specify the correct logical device name for the disk.  Although the disk names must start with an uppercase letter, they can also contain uppercase letters, numbers and the underscore character

Remember that if you are going to create a database during the installation of the Oracle software, using ASMLIB driver, then you must change the default disk discovery string to ORCL:*

Administering the Oracle ASMLIB  Driver and Disks
You should use the oracleasm initialization script, to administer the ASMLIB driver and disks.
Option
Description
configure
You can reconfigure the Oracle ASM library driver, with this option.
$ /etc/init.d/oracleasm configure
Enable / disable
You can modify the behaviour of the ASMLIB driver when your system starts.  The “enable” option will cause the ASMLIB driver to load when the system starts.
$ /etc/init.d/oracleasm enable
Start / stop / restart
You can use these options to start or stop or restart ASMLIB driver without restarting the system.
$ /etc/init.d/oracleasm restart
createdisk
This option will mark a disk device for use with ASMLIB driver, and also give it a name.
$ /etc/init.d/oracleasm createdisk <DISKNAME> devicename
deletedisk
You must first drop the disk you want to process from the ASM disk group.
deletedisk will then unmark a named disk device:
$ /etc/init.d/oracleasm deletedisk <DISKNAME>
querydisk
In order to determine if a disk device or disk is being used by ASMLIB driver.
# /etc/init.d/oracleasm querydisk {<DISKNAME> | devicename}
listdisks
To list disk names of all the marked ASMLIB driver disks.
$ /etc/init.d/oracleasm listdisks
scandisks
This option will enable cluster nodes to identify which shared disks have been marked as ASMLIB driver disks on other nodes.
$ /etc/init.d/oracleasm scandisks

Franz Devantier,
Need a database health check?

Classifieds

Saturday, August 10, 2013

Oracle Grid Infrastructure – Part 3

Dear Readers,

My name is Franz Devantier, creator of this blog.  I am an Oracle Certified Professional (OCP DBA 11g) Security DBA.  I will be sharing with you the basic duties of an Oracle DBA, and also some of the undocumented, and not so well known tasks. 

For Companies:
Free Database health check, for your database installation.  One months free database support, for you, as a proof of concept.

For individuals:
Refer me to a company for a database support contract.
=> I will then give you 10% of the monthly contract value, for the duration of the contract.  Plus when the contract is extended or renewed you will still get 10% of the monthly contract value, until I no longer support the company, sometime in the future.
=> This 10% is my marketing budget, so if you refer me to a company I will give you my marketing budget.  Now that is probably the best deal you will ever get for a referral.

Oracle Grid Infrastructure – Part 3
General Steps for Configuring Oracle Automatic Storage Management
Step 1: Identifying Storage Requirements for Oracle Automatic Storage Management
You need to determine the number of devices and the amount of free disk space that you require, so that you can determine the storage requirements for you ASM instance.
=> You need to decide whether you are going to use the ASM instance for your database files, or for your recovery files, or for both.  You can for example store your database files in ASM, and your recovery files in file systems.  If you have for example enabled automated backups, then they can be configured for an available shared file system, or use ASM for recovery file storage.  At this stage it will be a good idea to document the reasons for the choices that you make.

If you are going to use ASM for your backup files, then during the Oracle database installation, you specify an Oracle ASM disk group for the fast recovery area.
 
When you create a database during the database installation you have two different options.
=> You can run Automatic Storage Management Configuration Assistant (ASMCA) in interactive mode to create and configure your disk groups.  When you run Database Configuration Assistant (DBCA), and you select the Advanced installation type, then you will be able to select the disk groups that you created using ASMCA earlier on.  This will allow you to select the disk groups that you created with ASMCA for the database files and the recovery files.  Ideally you should use separate disk groups for the database files and the recovery files.
=> You can run ASMCA in non-interactive mode, which will result in using the same ASM disk groups for both data files and recovery files.  During the database installation, you choose the Typicl installation type, and you will have to select the same disk group for both database files and recovery files.

=> The next thing to do is to choose the Oracle ASM redundancy level that you want to use for each Oracle ASM disk group, that you want to create.  This decision will affect the way that ASM mirrors the files in the disk group, and also determines the number of disks and the amount of disk space that you will require.
External Redundancy
This option does not allow ASM to mirror the contents of the disk group.  Oracle recommends that you only select this redundancy level when the disk group contains devices, such as RAID devices, that provide their own data protection.  You can also choose this redundancy level when the database does not require uninterrupted access to data.

Normal Redundancy
Oracle ASSM uses two-way mirroring for data files and three way mirroring for control files.  This provides optimal performance and reliability in a normal redundancy disk group.  Also with Normal redundancy you can choose the mirroring characteristics for individual files in a disk group.  You can go with the two way mirroring or decide to use no mirroring.

A normal Redundancy disk group will require a minimum of two failure groups, or two disk devices, in order to enable the two way mirroring.  The effective disk space in a normal redundancy disk group is half the sum of the disk space of all its devices.
Oracle recommends Normal redundancy disk groups for most types of installations.

High Redundancy
The contents of the disk groups are three-way mirrored by default.  In order to create a disk group with high redundancy, you need to specify at least three failure groups, which are mapped to a minimum of three devices.
High-redundancy disk groups do provide a high level of data protection, which needs to be balanced against the cost of the additional storage devices needed.

=> You need to determine the total amount of disk space that you will require for the database files and the recovery files.  If there is an existing ASM instance, then you can use it.  It is [possible to add disks to an existing disk group during the database installation.  You can put the information in table format, to help you to come up with the final numbers.

Redundancy
Minimal Disks
Data files
Recovery files
Both file type
External
1
2 GB
6  GB
8  GB
Normal
2
4 GB
12 GB
16 GB
High
3
6 GB
18 GB
24 GB
  
You can see that in this theoretical scenario, the Normal redundancy seems to make the most sense.  Also you may decide to keep your recovery files in external redundancy disk groups, or in normal file systems.  For example if you had your data files in Normal redundancy 4GB, and your recovery files in External redundancy 6GB, then you have a total of 10GB.  If you had them all in Normal redundancy, then you would be looking at a total of 16 GB.

=> You can also optionally identify failure groups for the Oracle ASM disk group devices.  For example if you are using normal redundancy, and there are two disk devices in the disk group.  If both devices are connected to the same SCSI controller, then if the controller fails, then the disk group becomes unavailable.  So the SCSI controller becomes the single point of failure rather than the disk.  To avoid such a failure, you can have two SCSI controllers, and define the disks of a disk group to be physically connected to the two SCSI controllers.  Then if there is a SCSI controller failure, you have avoided a disk group failure, and your configuration is now able to tolerate the failure of one of the SCSI controllers.  

=> If you are sure that a suitable disk group is not available, then you can install or identify disk devices to add to a new disk group. 
. Make sure that the disk devices are owned by the user performing the Grid installation.
. All the devices in an Oracle ASM disk group must be the same size and have the same performance specifications.
. Do not specify multiple partitions on a single physical disk, as a disk group device.  Oracle ASM expects each disk group device to be on a separate physical disk.
. It is possible to specify a logical volume as a device in an Oracle ASM disk group.  Oracle recommends that you don’t do this, because it adds a layer of unnecessary complexity with Oracle ASM.
. Oracle recommends that if you do a logical volume manager, then you should use the logical volume manager to represent a single logical unit number(LUN) without striping or mirroring.  This will minimize the effect of the additional storage layer on the storage performance.


Step 2: Creating DAS or SAN Disk Partitions for Oracle Automatic Storage Management
You can use any physical disk for Oracle ASM, if it is partitioned.  A DAS or SAN disk must have a partition table in order to be used in Oracle ASM.  Oracle recommends creating just one partition on each disk.

Step 3: Configuring Disks for Oracle Automatic Storage Management
In order to simplify the configuration and management of the disk devices to use with Oracle ASM, Oracle provides an ASM Library Driver.  Once you have configured a disk to ASM, it is known as a candidate disk.
If you are going to use ASM for database storage, then Oracle recommends that you install the Automatic Storage Management Library (ASMLIB) driver, as well as the associated utilities.  ASMLIB and the associated utilities will then be used to configure the devices to be included in an ORACLE ASM disk group.  When you configure disks using the ASMLIB, then you should change the default discovery string to “ORCL:*” or empty “”.  When it is set like this, then the installer discovers these disks.

Franz Devantier,
Need a database health check?
devantierf@gmail.com

Classifieds

Friday, August 9, 2013

Oracle Grid Infrastructure – Part 2

Dear Readers,

My name is Franz Devantier, creator of this blog.  I am an Oracle Certified Professional (OCP DBA 11g) Security DBA.  I will be sharing with you the basic duties of an Oracle DBA, and also some of the undocumented, and not so well known tasks. 

For Companies:
Free Database health check, for your database installation.  One months free database support, for you, as a proof of concept.

For individuals:
Refer me to a company for a database support contract.
=> I will then give you 10% of the monthly contract value, for the duration of the contract.  Plus when the contract is extended or renewed you will still get 10% of the monthly contract value, until I no longer support the company, sometime in the future.
=> This 10% is my marketing budget, so if you refer me to a company I will give you my marketing budget.  Now that is probably the best deal you will ever get for a referral.

Oracle Grid Infrastructure – Part 2
Oracle ACFS and Oracle ADVM Support
Oracle Automatic Storage Management Cluster File System (ACFS), extends the ASM technology.  With ACFS all of your application data is supported in single instance as well as cluster configurations.  ACFS is layered on ASM through the Oracle Automatic Storage Management Dynamic Volume Manager (ADVM) interface.  ACFS and ADVM are supported on Oracle Linux 5 and red Hat Enterprise 5 for Linux x86 and Linux x86-64.

Oracle Release
Operating System
Kernel
11.2.x
Linux x86: Oracle Linux 5 and Red Hat Enterprise Linux 5
2.6.18 or later updates to 2.6.18
11.2.0.1
Linux x86-64: Oracle Linux 5 and Red Hat Enterprise Linux 5
2.6.18 or later updates to 2.6.18
11.2.0.2
Linux x86-64: Oracle Linux 5, Red Hat Enterprise Linux 5, SUSE Linux Enterprise Server 10 SP3 and later
2.6.18 or later updates to 2.6.18
11.2.0.3
Linux x86-64: Oracle Linux 5, Red Hat Enterprise Linux 5, SUSE Linux Enterprise Server 10 SP3 and later, SUSE Linux Enterprise Server 11 SP1
2.6.18 or later updates to 2.6.18
Oracle Unbreakable Enterprise Kernel 2.6.32-100.34.1 and later updates to 2.6.32-100
11.2.0.3
Linux x86-64: Oracle Linux 6 (with Oracle Unbreakable Enterprise Kernel)
Oracle Unbreakable Enterprise Kernel 2.6.32-100.34.1 and later updates to 2.6.32-100

Security Enhanced Linux (SELinux) is not supported on ACFS file systems.

Oracle recommends that you create Oracle data files in Oracle ASM disk groups.  Oracle does not support data files on ACFS file systems.  Of course ACFS is an available option when you have configured Oracle ASM.

Also Oracle Restart does not support ACFS resources on all platforms.  Oracle ACFS drivers must still be manually loaded and unloaded.  Once Oracle ASM is running, Oracle ACFS file systems must be manually mounted and unmounted.  Registered Oracle ACFS file systems are noted in the ACFS mount registry, and are mounted when ACFS starts up.  The Oracle ACFS database home file systems can be managed in the same way.

Managing Disk Groups for Older Database Versions
In Oracle 11.2, Oracle ASM is installed with Oracle Restart.  Prior to 11.2 Database Configuration Assistant (DBCA) was used to perform administrative tasks on Oracle ASM.

Migrating Existing Oracle Automatic Storage Management Instances
Firstly you must shut down all databases and applications using an existing Oracle ASM instance, before starting with the upgrade.  You can use Oracle Automatic Storage Management Configuration Assistant (ASMCA), to upgrade your existing ASM instance to a ASM 11.2 instance.  Using ASMCA you can configure disk groups, Oracle ASM volumes and Oracle ASM file systems.

If during the installation of your Grid Infrastructure and Oracle ASM, ASMCA detects that there is a prior version of ASM installed in another Oracle ASM home.  Then once you have finished installing the ASM 11.2 binaries, you can then use ASMCA to upgrade the existing Oracle ASM instance.

Oracle Automatic Storage Management Installation Considerations
Prior to Oracle 11.2, ASM was installed as part of the Oracle Database Installation.  With Oracle 11.2, Oracle ASM is installed as part of the Oracle Grid Infrastructure installation, which can be installed for a standalone server or for a cluster.

If you want to upgrade an existing ASM installation, then you first do the Oracle Grid Infrastructure Upgrade, and then the ASM upgrade.  If you decide to use ASM instead of file systems for your database installation, then you must first do an Oracle Grid Infrastructure installation, before you start your Oracle Database Installation.

When you install Oracle Grid Infrastructure for a Standalone Server Installation, Oracle Automatic Storage Management Configuration Assistant (ASMCA), is also installed.  To install, and configure ASM instances, you must run the ASMCA GUI utility.  You also use ASMCA to configure disk groups, volumes, as well as Oracle ACFS.  ASMCA can be used as a non-GUI utility, because it does have a command line interface.
=> You must prepare your disk partitions to be used for the Oracle ASM disk groups.
=> Make sure that there is at least one disk that is configured for an Oracle ASM disk group, before you begin the installation.
=> When you install ASM, ASMCA will create a separate server parameter file (SPFILE) and password file for the ASM instance.  When the ASM is installed, then the ASMSNMP schema and user are created.
=> The ASM instance manages the disk groups, and runs in the Oracle Grid Infrastructure home directory.

Preparing your ASM Installation
=> Firstly you need to define and identify the Storage Requirements for your ASM configuration.
=> Then you will need to create DAS or SAN disk partitions for ASM
=> Finally you will need to configure the disks for ASM

From the above you may or may not need more details on how to proceed.  One important point is to avoid using database identifiers that need to be quoted.  Because we are using a number of different tools with ASM, there may be a point, where the quoted object names may not be valid.  Fixing this problem up, could involve renaming the identifiers to non-quoted values.  So it is best to start off with non-quoted identifiers.

Franz Devantier,
Need a database health check?
devantierf@gmail.com

Classifieds

Thursday, August 8, 2013

Oracle Grid Infrastructure – Part 1

Dear Readers, My name is Franz Devantier, creator of this blog.  I am an Oracle Certified Professional (OCP DBA 11g) Security DBA.  I will be sharing with you the basic duties of an Oracle DBA, and also some of the undocumented, and not so well known tasks.  For Companies:Free Database health check, for your database installation.  One months free database support, for you, as a proof of concept. For individuals:Refer me to a company for a database support contract.=> I will then give you 10% of the monthly contract value, for the duration of the contract.  Plus when the contract is extended or renewed you will still get 10% of the monthly contract value, until I no longer support the company, sometime in the future.=> This 10% is my marketing budget, so if you refer me to a company I will give you my marketing budget.  Now that is probably the best deal you will ever get for a referral.Contact: devantierf@gmail.com Oracle Grid Infrastructure – Part 1Oracle Grid Infrastructure for a standalone server provides support for the Oracle database, including volume management, File system support, and automatic restart capabilities.  If you are going to use Oracle Automatic Storage Management (ASM) or Oracle Restart, then you must must install Oracle Grid Infrastructure, before you create the database. Oracle 11.2 Grid Infrastructure includes two infrastructure products into a single set of binaries, that is ASM and Oracle Restart.  ASM is Oracles Volume Manager as well as a file system that supports both single instance Oracle database’s, as well as Oracle Real Application Clusters (RAC).  ASM is Oracles recommended storage management solution, and is the superior alternative to conventional volume managers, file systems, and raw devices. Oracle Restart improves the availability of Your Oracle database 11.2 installation.=> In the case of a hardware or software failure, Oracle Restart will automatically start all of the Oracle components.  ASM, Oracle NET Listener, database services, and the Database instance.=> Oracle Restart will start the Oracle components in the proper order when the database host or server is restarted.   => Oracle Restart will run a periodic check to monitor the status of the Oracle components.  If a check fails for whatever reason, the the component is shut down and restarted. If you are going to use Oracle ASM 11.2 and or Oracle restart, then you must install Oracle Grid Infrastructure for a standalone server, before you install and create the database.  You can also manually register the database with Oracle Restart after you have created the database.  Remember that Oracle Restart is only used in single instance or non-clustered environments. Requirements for Oracle Grid Infrastructure InstallationYou will need to meet certain minimal requirements, before you can install Oracle Grid Infrastructure 11.2.  Memory, Disk space, and the configuration of the environment are important. Memory RequirementsThe memory requirements for Oracle 11.2 for a standalone server for Oracle Grid Infrastructure.=> minimal of 1.5 GB of RAM for the Oracle Grid Infrastructure.  Plus a minimal of 1 GB of RAM for the Oracle Database, if you install a database as well.  That comes to an abosolute minimal of 2.5GB. Oracle recommends that you should have at least 4GB of RAM available if you are going to install Oracle Grid Infrastructure and an Oracle Database.  Remember that if you install 4GB of RAM, a portion of that RAM will be reserved or used for management overhead, so to have a clear 4GB of RAM, you need a little bit more than 4GB of RAM.$ grep MemTotal /proc/meminfoMemTotal:        1020876 kB As you can see in this case, I need to install more memory, before I can continue with the installation.  You also need to take into account your settings for HugePages in Linux, when you determine how much RAM you need to install.  HugePages allocates non-swappable memory for large page tables, using memory mapped files.  The Memory allocated to HugePages is lost for other purposes, so you will need to deduct the amount of memory allocated to HugePages, in order to determine your available RAM.  This adjusted RAM is then used to calculate your optimal swap space. 
RAM
Swap Space
Between 1.5 GB and 2 GB
1.5 times the size of the RAM
Between 2 GB and 16 GB
Equal to the size of the RAM
More than 16 GB
16 GB
 Of course you must start off by checking what your configured swap space is:$ grep SwapTotal /proc/meminfoSwapTotal:       2064380 kB You will need to refer to the Operating System documentation for the details on configuring additional swap space. Tot display your RAM and SWAP space configuration you can type in “free”.$ free             total       used       free     shared    buffers     cachedMem:       1020876     646860     374016          0      31048     305976-/+ buffers/cache:     309836     711040Swap:      2064380          0    2064380 You will notice that the RAM and SWAP space do not seem to be optimally configured.  However because the relationship between RAM and SWAP keep changing under different load conditions, you will need to take a number of readings, before you have a fairly accurate reading.  If you really want to optimize your RAM/SWAP relationship, then you can contact your Operating System vendor for additional guidelines.  The guidelines given here are more general, so the guidelines from the OS vendor will be more optimal. Disk Space RequirementsYou will need at least 5.5 GB of disk space available, and at least 1GB of space in the “/tmp” directory.$ df -k /tmpFilesystem           1K-blocks      Used Available Use% Mounted on/dev/mapper/VolGroup-lv_root                      51606140   6023284  42961416  13% /So you can see that there is sufficient space available in the /tmp directory.If there was not enough space available, then you could delete unneeded files from the /tmp directory.When you set the Oracle User’s environment, remember to set the TMP and TMPDIR variables. If necessary you can extend the file system that contains the /tmp directory.  You may need to contact the system administrator for advice on extending the file system. Configuring the User’s EnvironmentYou need to set the environment for the Oracle Grid Infrastructure software owner user’s environment.  Make sure that the path is set to the Oracle Base directory.$ export ORACLE_BASE=/u01/app/oracleOracle Restart, and the Oracle Database will be sharing this same Oracle base directory. In the shell startup file, you must set the Oracle Grid Infrastructure software owner default file mode creation mask or the “umask” to 022.  This setting will ensure that the installation creates files with 755 permissions. You need to set ulimit for file descriptors and processes for the Oracle Grid Infrastructure software owner. Finally you will set the DISPLAY variable, so that you can use the OUI GUI for the installation.  If you are going to install the Oracle database in addition to Oracle Grid Infrastructure, then you will need to meet the pre-requisites for the installation of the database as well. Franz Devantier,Need a database health check?devantierf@gmail.com ClassifiedsYear of the Stem CellDevantier Hosting, from $2.75Host then Profit GVOGlobal Domains InternationalCash in on BannersHot Link CyclerA to Z AdBoardAd ViralizerTraffic Exchange ProfitsEasy DownlinesFast Cash and TrafficSimple SafelistsTraffic Wave - AutoresponderTraffic HooplaBusiness Related Social Media