Posts Tagged ‘11g’

Oracle Silent Mode, Part 8: Add a Node to a 11.1 RAC Database

By Grégory Guillou August 27th, 2008 at 11:37 am
Posted in Oracle
Tags:

The process of adding a node to a 11.1 RAC is very similar to the 10.2 process described in Part 5 of this series. For this reason, this post will just focus on what has changed between the 2 versions. Here is the complete series up to now:

  1. Installation of 10.2 And 11.1 Databases
  2. Patches of 10.2 And 11.1 databases
  3. Cloning Software and databases
  4. Install a 10.2 RAC Database
  5. Add a Node to a 10.2 RAC database
  6. Remove a Node from a 10.2 RAC database
  7. Install a 11.1 RAC Database
  8. Add a Node to a 11.1 RAC database (This post!)
  9. Remove a Node from a 11.1 RAC database
  10. A ton of other stuff you should know

Before you start

Make sure you’ve kept a copy of the voting disk and that you have a backup of the OCR. Check that the locations for all the components to be installed, i.e.: Inventory, Clusterware, ASM, database software, OCR, Voting Disks, and data files, are writable. Confirm that all the prerequisites are met for the node and for the whole cluster with the node to be added.

Refer to the Oracle Clusterware Administration and Deployment Guide
11g Release 1 (11.1) - 4 Adding and Deleting Oracle Clusterware Homes

and the Oracle Real Application Clusters Administration and Deployment Guide
11g Release 1 (11.1) - 9 Adding and Deleting Oracle RAC from Nodes on Linux and UNIX Systems
for the complete reference of how to perform these steps.

(more…)

Oracle 11g — Audit Enabled by Default, But What About Purging?

By Alex Gorbachev July 3rd, 2008 at 1:48 pm
Posted in Group Blog Posts
Tags:

If you have created a new Oracle 11g database using DBCA and opted to use by default 11g’s enhanced security settings or, at least, the audit setting, then you risk the unlimited growth of the SYSAUS tablespace that hosts the audit trail table SYS.AUD$. I realized that while reviewing the slides of my presentation on 11g’s new features, a few of which covered security enhancements.

During my presentation at the TOUG meeting later that day, I mentioned that concern, and Mohamed El-Shafie from Oracle quickly noticed that there is no auto-purge. I promised to have another look at the maintenance tasks in 11g to confirm that, and indeed, the audit trail is not purged automatically when auditing is enabled by default.

Here is a quick remedy — scheduling an audit trail maintenance job.

First create a PL/SQL procedure that will accept a number of days to keep. It rounds down to the beginning of the day. I like to dump a few diagnostic messages to alert.log when my maintenance procedures are running, so I included that here as well. (There was a typo in purge data calculation — thanks to Nial for catching it.

create or replace procedure purge_audit_trail (days in number) as
  purge_date date;
begin
  purge_date := trunc(sysdate-days);
  dbms_system.ksdwrt(2,'AUDIT: Purging Audit Trail until ' ||
                        purge_date || ' started');
  delete from aud$ where ntimestamp# < purge_date;
  commit;
  dbms_system.ksdwrt(2,'AUDIT: Purging Audit Trail until ' ||
                        purge_date || ' has completed');
end;
/

Then let’s schedule a new maintenance job using Job Scheduler, which appeared first in 10g. Oracle 11g includes the default maintenance windows group, MAINTENANCE_WINDOW_GROUP, and we will use that to run the purge.

(more…)

Going to Toronto Oracle User Group Meeting (June 2008)

By Alex Gorbachev June 26th, 2008 at 8:21 am
Posted in Group Blog PostsNon-Tech ArticlesOracle
Tags:

Today I’m doing a presentation at the Toronto Oracle User Group meeting. It’ll be my first time there and I’m really looking forward to it.

My session is called Oracle 11g New Features Out of the Box. It went pretty well at Collaborate 08 and I think it will be the right audience at the TOUG meeting. I’m reviewing the slides at the moment — usual last minute tweaks but it’s time to leave to the airport — my flight is in 1.5 hour.

I have already checked-in on both the flight to Toronto and return. I didn’t know that you can check-in online on the return flight without completing one-way first. Well, I like technology advancing. :)

Oracle Silent Mode, Part 3: Cloning Software and Databases

By Grégory Guillou June 19th, 2008 at 2:19 pm
Posted in Oracle
Tags:

This post is the third of the series of ten posts that explore some of the Oracle Universal Installer (OUI), Network Assistant (NETCA), Database Creation Assistant (DBCA), Database Upgrade Assistant (DBUA) and other syntaxes you can use to script or speed up Oracle Installations. The complete series should look like this:

  1. Installation of 10.2 And 11.1 Databases
  2. Patches of 10.2 And 11.1 databases
  3. Cloning Software and databases (this post!)
  4. Installing a 10.2 RAC Database
  5. Add a Node to a 10.2 RAC database
  6. Remove a Node from a 10.2 RAC database
  7. Install a 11.1 RAC Database
  8. Add a Node to a 11.1 RAC database
  9. Remove a Node from a 11.1 RAC database
  10. A ton of other stuff you should know

In the first post and second post, we focused on how to leverage these tool to perform a standard installation and apply patches on top of 10.2 and 11.1 databases. This post will dig into the cloning features of both the Universal Install (OUI) and the Database Configuration Assistant (DBCA).

Foreword

The Universal Install and Database Configuration Assistant Cloning features enable you to:

  • Install the database software once, apply to it all the patches you need, including Patch Set, CPU, and One-Off patches, and create a “Gold Image” of that software you’ll be able to deploy on all the servers you need as soon as they run the same Operating System.
  • Create a database, apply all the scripts you need including the catupgrd.sql, the cpu.sql or any other script associated with patches. You can also run any script that will create a skeleton for installing your application, create tablespaces, create objects, or set parameters. Once done, you’ll be able to create a template from that database and to use it on any servers that run the same operating system and the same database software.

How to clone Oracle database software

You can refer to the product documentation for the whole database software cloning process:

The process is straightforward and consists of three different steps:

(more…)

Oracle 11g ASM Diskgroup Compatibility

By Alex Gorbachev June 18th, 2008 at 3:35 pm
Posted in Oracle
Tags:

Back in April I was at COLLABORATE 08 and delivered a presentation on 11g — Oracle 11g New Features Out of the Box, including Oracle 11g ASM features. The first ASM slide was about diskgroup compatibility, and I have a bit more to share than I said back then.

Every diskgroup in ASM has two compatibility attributes — compatible.asm and compatible.rdbms. In 10.2, the V$ASM_DISKGROUP view has a couple new columns added — COMPATIBILITY and DATABASE_COMPATIBILITY, but only in 11g did Oracle introduce the concept of diskgroup attributes and the V$ASM_ATTRIBUTE view. Thus, there are two ways to check the diskgroup attributes in 11g:

SQL> col COMPATIBILITY form a10
SQL> col DATABASE_COMPATIBILITY form a10
SQL> col NAME form a20
SQL> select group_number, name,
compatibility, database_compatibility from v$asm_diskgroup;

GROUP_NUMBER NAME                 COMPATIBIL DATABASE_C
------------ -------------------- ---------- ----------
           1 DG1                  11.1.0.0.0 11.1.0.0.0
           2 DG2                  10.1.0.0.0 10.1.0.0.0

SQL> col value form a10
SQL> select group_number, name, value from v$asm_attribute;

GROUP_NUMBER NAME                 VALUE
------------ -------------------- ----------
           1 disk_repair_time     3.6h
           1 au_size              1048576
           1 compatible.asm       11.1.0.0.0
           1 compatible.rdbms     11.1

Note that V$ASM_ATTRIBUTES is filled only when compatible.asm is set to 11.1. What’s important is that you can only change compatibility level upwards; there is no way to reset it back to the lower value. Compatibility attributes can be changed online one at a time:

(more…)

Oracle Silent Mode, Part 2: Patching 10.2 And 11.1 Databases

By Grégory Guillou June 18th, 2008 at 2:28 pm
Posted in Oracle
Tags:

This post is the second in a series of ten posts exploring some of the Oracle Universal Installer (OUI), Network Assistant (NETCA), Database Creation Assistant (DBCA), Database Upgrade Assistant (DBUA), and many more syntaxes you can use to script or speed up Oracle Installations. The complete series should look like:

  1. Installation of 10.2 And 11.1 Databases
  2. Patching 10.2 And 11.1 databases (this post!)
  3. Cloning Software and Databases
  4. Installing a 10.2 RAC Database
  5. Add a Node to a 10.2 RAC database
  6. Remove a Node from a 10.2 RAC database
  7. Install a 11.1 RAC Database
  8. Add a Node to a 11.1 RAC database
  9. Remove a Node from a 11.1 RAC database
  10. A ton of other stuff you should know

In the first post, you can find syntaxes to install a 10.2 or a 11.1 database, and how to apply a Patch Set on top of them. This post is way shorter and digs into a couple OPatch, DBUA, and OUI syntaxes. It explains how to apply a one-off patch, how to upgrade a database and how to uninstall a previous ORACLE_HOME.

Foreword

There are basically two ways to upgrade your Oracle Database Software to a new Patch Set level:

  1. The In-Place Way: reuse the same ORACLE_HOME
  2. The Out-of-Place Way necessitates that you create a new ORACLE_HOME for the new Patch Set

If the 10g OFA standard contains only the Base Release version, you will be able to perform an In-Place Upgrade. Thi approach, however, has several drawbacks:

  • It requires that you stop all the components (Listeners, ASM, Instances, Database Console) during the software upgrade.
  • It doesn’t leave the previous ORACLE_HOME install intact, and makes more complex the build of a rollback scenario.
  • If you’ve installed a one-off patch, it is very likely the patchset will erase them, but Inventory will keep track of them.

For all those reasons, it’s safer to use a new ORACLE_HOME and so I won’t cover how to perform an In-Place update. Actually it’s not really different, so you should easily be able to build that scenario by yourself. And if you think: “Well, what the use of keeping only the major Database version in the OFA standard if you advise using a new ORACLE_HOME ?”, the answer is: “Once you’ve release the 10.2.0.3 ORACLE_HOME to use a 10.2.0.4 ORACLE_HOME, with that changed in the OFA standard, you’ll be able to use that ORACLE_HOME for the next Patch Set without reinstalling the software and the names will stay consistent!”. But enough of this foreword.

(more…)

Oracle Silent Mode, Part 1: Installation Of 10.2 And 11.1 Databases

By Grégory Guillou June 6th, 2008 at 3:45 pm
Posted in Oracle
Tags:

This post is the first of a series of ten posts that will explore some of the Oracle Universal Installer (OUI), Network Assistant (NETCA), Database Creation Assistant (DBCA), Database Upgrade Assistant (DBUA), and many more syntaxes you can use to script or speed up Oracle Installations. The agenda should follow the one below:

  1. Installation Of 10.2 And 11.1 Databases (this post!)
  2. Patching 10.2 And 11.1 Databases
  3. Cloning Software and Databases
  4. Installing a 10.2 RAC Database
  5. Add a Node to a 10.2 RAC database
  6. Remove a Node from a 10.2 RAC database
  7. Install a 11.1 RAC Database
  8. Add a Node to a 11.1 RAC database
  9. Remove a Node from a 11.1 RAC database
  10. A ton of other stuff you should know

Actually, I may have to split the post #10 into ten more posts to cover all the other syntaxes you could use with Oracle Enterprise Manager, Application Server, or on Windows. Anyway, for now let’s focus on the very beginning: how to install 10.2 or 11.1 non-RAC database; how to apply the latest patch set; and how to create a instance database from a template.

Foreword

First, just because it’s on the Internet doesn’t make it true — even if it’s on the Pythian Blog. There will be a lot of syntaxes in those ten posts and even if they’ve been all tested, (1) the testing conditions are probably very different from your environment, and (2) the commands have been customized so that they appear generic. Be careful; it’s very likely that the syntaxes will be wrong for you. Test them yourself on a test environment and don’t execute them if you don’t understand what every part of them is supposed to do.

One of the reasons for these posts is that it’s kind of difficult to figure out by yourself how you should run one particular tool. The information is spread across the reference manuals, the response files, the online help, and sometimes Oracle Metalink or people that managed to make it work.

In addition, if the syntax looks similar for all the tools, they differ more than we can guess first. Let’s take some examples to illustrate that and to begin with the syntaxes:

(more…)

Alex Gorbachev at COLLABORATE 08

By Alex Gorbachev April 18th, 2008 at 6:57 pm
Posted in Group Blog PostsOracle
Tags:

I guess I have only one and a half posts about COLLABORATE 08 this year. It’s a bit unfortunate that I couldn’t make the whole conference, but only last day-and-a-half. In addition, I’ve been speaking at the two lasts slots of the conference so it’s been quite busy for me.

As I mentioned already, the scheduling for my presentation got a bit screwed-up due to the last minute call to participate in the speaker panel — “To RAC or Not To RAC: What’s Best for HA”. Thanks to Dan Norris, my session was finally moved to 11:00, which is right after the panel. On the other hand, 11:00 slot is the last IOUG session of the conference. This fact, coupled with last minutes re-scheduling, brought the number of participants down. Even though there were about 30 people and the hall (Korbel 1C) was small enough not to seem empty.

Back to the RAC speaker panel, I enjoyed the discussion and especially the fact that speaker’s opinions on how wide RAC adoption should be were a little different. I took the liberty of starting the discussion with a quite provocative quote — “complexity is the enemy of availability”. Interesting that the other panel speakers seemed to disagree to it to some extent by countering it — use knowledge to fight complexity. Not that I don’t agree with it (on the contrary) but my point was rather, “why make it complex when you can keep it simple?” Some of the reasons for over-complicating systems can be found here.

(more…)

Multi-Column Correlation and Extended Stats in Oracle 11g

By Riyaj Shamsudeen April 9th, 2008 at 1:35 pm
Posted in Group Blog PostsOracleOracle E-Business Suite
Tags:

We all have encountered this situation many times before: the cost-based optimizer assumes no correlation between two columns (until 11g), and this has the effect of erroneously reducing the cardinality of a row source. Incorrect cardinality estimates are one of many root causes for SQL performance issues. Consider the following example.

This code creates a table and populates data with four columns:

create table t_vc as
select mod(n, 100) n1, mod(n, 100) n2 ,
mod(n, 50) n3 , mod(n, 20) n4
from (select level n from dual connect by level <= 10001);

The first two columns, n1 and n2, have a strong correlation: n1 is always equals to n2.

Let’s collect statistics with histograms on all columns.

begin
dbms_stats.gather_Table_stats( user, 'T_VC', estimate_percent => null, method_opt => 'for all columns size 254');
end;
/

Let’s explain the plan for the query, specifying one predicate, exactly 100 rows with a value of 10.

(more…)

Oracle ASM 11g: Does the ASMCMD cp Command Really Work?

By Alex Gorbachev April 8th, 2008 at 1:43 pm
Posted in Oracle
Tags:

Since the introduction of ASM in Oracle 10g Release 1, every ASM administrator has been dreaming of a simple command line tool to copy files between ASM diskgroups and other filesystems. Oracle ASM 10g Release 2 added the handy asmcmd utility, but even though everyone expected a copy command there, it had not been implemented.

The only way to copy files to or from an ASM diskgroup was either to use RMAN, to configure XDB for FTP access, or use the DBMS_FILE_TRANSFER package. No wonder that the cp command is the most popular addition to asmcmd tool in Oracle ASM 11g: the hardest barrier to convincing my customers to use ASM has been the inability to access the files and copy them to the OS filesystem using the command-line copy command. Customers wanted to “feel” the files and be able to easily manipulate them.

While working on a Collaborate 08 presentation on Oracle 11g new features out-of-the-box, I was verifying new commands in Oracle ASM 11g’s asmcmd utility. It turned our that copying files from or to ASM is still a problem.

First, I tried to copy a single text file to an ASM diskgroup:

ASMCMD> cp /home/oracle/.bash_profile +dg2/test.file
source /home/oracle/.bash_profile
target +dg2/test.file
ASMCMD-08012: can not determine file type for file->’/home/oracle/.bash_profile’
ORA-15056: additional error message
ORA-17503: ksfdopn:DGGetFileAttr15 Failed to open file /home/oracle/.bash_profile
ORA-27046: file size is not a multiple of logical block size
Additional information: 1
ORA-06512: at “SYS.X$DBMS_DISKGROUP”, line 207
ORA-06512: at line 3 (DBD ERROR: OCIStmtExecute)

Hmm . . . Okay. Let’s try to do it in multiples of diskgroup blocks: (more…)