Clone non-rac Grid Infrastructure
Posted: May 17, 2012 | Author: admin | Filed under: General DBA | Leave a comment »[oracle@my562b bin]$ perl clone.pl -silent ORACLE_BASE=/apps/oracle ORACLE_HOME=/apps/11.2.0/grid ORACLE_HOME_NAME=Ora11g_gridinfrahome1 INVENTORY_LOCATION=/apps/oraInventory
What a mess .. trying force delete and re-configuring GRID Home
$ORACLE_HOME/perl/bin/perl -I $ORACLE_HOME/perl/lib -I $ORACLE_HOME/crs/install $ORACLE_HOME/crs/install/roothas.pl -delete[oracle@my562b admin]$ asmcmd
Best Practices for Gathering Optimizer Statistics
Posted: April 17, 2012 | Author: admin | Filed under: General DBA | Comments OffA must read for everyone: twp-bp-optimizer-stats-04042012-1577139.pdf
ASM Disk Group Configuration
Posted: April 16, 2012 | Author: admin | Filed under: ASM, Exadata, General DBA, Linux | Comments Off
ASM Disk Group Configuration |
|||
|
Everyone should be leveraging ASMLIB instead of using block devices to create our ASM disk groups Proper ASM configuration and standardization and following best practices is just as important in a virtualized environment as it is in a bare metal environment |
|||
First, create ASMLIB disks with oracleasm
lrwxrwxrwx 1 root root 9 Apr 28 16:22 DATA501_disk003p1 -> ../dm-105
lrwxrwxrwx 1 root root 9 Apr 28 16:22 DATA101_disk003p1 -> ../dm-100
lrwxrwxrwx 1 root root 8 Apr 28 16:22 DATA101_disk001p1 -> ../dm-99
lrwxrwxrwx 1 root root 9 Apr 28 16:22 DATA101_disk002p1 -> ../dm-102
lrwxrwxrwx 1 root root 9 Apr 28 16:22 DATA501_disk005p1 -> ../dm-110
lrwxrwxrwx 1 root root 9 Apr 28 16:22 DATA101_disk004p1 -> ../dm-101
lrwxrwxrwx 1 root root 9 Apr 28 16:22 DATA101_disk000p1 -> ../dm-104
lrwxrwxrwx 1 root root 9 Apr 28 16:22 DATA501_disk006p1 -> ../dm-111
lrwxrwxrwx 1 root root 9 Apr 28 16:22 DATA501_disk008p1 -> ../dm-107
lrwxrwxrwx 1 root root 9 Apr 28 16:22 DATA501_disk004p1 -> ../dm-112
lrwxrwxrwx 1 root root 9 Apr 28 16:22 DATA501_disk000p1 -> ../dm-108
lrwxrwxrwx 1 root root 9 Apr 28 16:22 DATA501_disk002p1 -> ../dm-109
lrwxrwxrwx 1 root root 9 Apr 28 16:22 DATA501_disk001p1 -> ../dm-103
lrwxrwxrwx 1 root root 9 Apr 28 16:22 DATA501_disk007p1 -> ../dm-106
Naming Convention Legend for Disks
As root: Make changes to the following lines:
# ORACLEASM_SCANORDER: Matching patterns to order disk scanning
ORACLEASM_SCANORDER=”dm-”
# ORACLEASM_SCANEXCLUDE: Matching patterns to exclude disks from scan
ORACLEASM_SCANEXCLUDE=”sd”
|
Important Notes:
RAID 10 /etc/init.d/oracleasm createdisk DATA101_DISK000 /dev/mapper/DATA101_disk000p1
/etc/init.d/oracleasm createdisk DATA101_DISK001 /dev/mapper/DATA101_disk001p1
/etc/init.d/oracleasm createdisk DATA101_DISK002 /dev/mapper/DATA101_disk002p1
/etc/init.d/oracleasm createdisk DATA101_DISK003 /dev/mapper/DATA101_disk003p1
/etc/init.d/oracleasm createdisk DATA101_DISK004 /dev/mapper/DATA101_disk004p1
RAID 5
——
/etc/init.d/oracleasm createdisk DATA501_DISK000 /dev/mapper/DATA501_disk000p1
/etc/init.d/oracleasm createdisk DATA501_DISK001 /dev/mapper/DATA501_disk001p1
/etc/init.d/oracleasm createdisk DATA501_DISK002 /dev/mapper/DATA501_disk002p1
/etc/init.d/oracleasm createdisk DATA501_DISK003 /dev/mapper/DATA501_disk003p1
/etc/init.d/oracleasm createdisk DATA501_DISK004 /dev/mapper/DATA501_disk004p1
/etc/init.d/oracleasm createdisk DATA501_DISK005 /dev/mapper/DATA501_disk005p1
/etc/init.d/oracleasm createdisk DATA501_DISK006 /dev/mapper/DATA501_disk006p1
/etc/init.d/oracleasm createdisk DATA501_DISK007 /dev/mapper/DATA501_disk007p1
/etc/init.d/oracleasm createdisk DATA501_DISK008 /dev/mapper/DATA501_disk008p1
/etc/init.d/oracleasm createdisk DATA501_DISK009 /dev/mapper/DATA501_disk009p1
SQL> alter system set asm_diskstring=’/dev/oracle’,'ORCL:PD*’;
System altered.
Add the following to the init+ASM1.ora on each node
For automatic mount of diskgroups
asm_diskgroups=’DATA03′,’DATA60′,’FRA03′,’FRA60′,’DATA101′,’DATA501′
#asm_diskstring=’/dev/oracle’
asm_diskstring=’/dev/oracle’,'ORCL:PD*’
For the time being, manually mount the diskgroups on each node:
SQL> alter system set asm_diskstring=’/dev/oracle’,'ORCL:PD*’;
System altered.
SQL> alter diskgroup DATA101 mount;
Diskgroup altered.
SQL> alter diskgroup DATA501 mount;
Diskgroup altered.
Creating ASM Disk Groups
RAID 10 DATA Disk Group
+ASM1 > cat cr_DATA101.sql create diskgroup DATA101 external redundancy disk ‘ORCL:DATA101_DISK000′,
‘ORCL:DATA101_DISK001′,
‘ORCL:DATA101_DISK002′,
‘ORCL:DATA101_DISK003′,
‘ORCL:DATA101_DISK004′
ATTRIBUTE ‘au_size’ = ’4M’,
‘compatible.rdbms’ = ’11.1′,
‘compatible.asm’ = ’11.1′;
RAID 5 DATA Disk Group create diskgroup DATA501 external redundancy disk ‘ORCL:DATA501_DISK000′,
‘ORCL:DATA501_DISK001′,
‘ORCL:DATA501_DISK002′,
‘ORCL:DATA501_DISK003′,
‘ORCL:DATA501_DISK004′,
‘ORCL:DATA501_DISK005′,
‘ORCL:DATA501_DISK006′,
‘ORCL:DATA501_DISK007′,
‘ORCL:DATA501_DISK008′,
‘ORCL:DATA501_DISK009′
ATTRIBUTE ‘au_size’ = ’4M’,
‘compatible.rdbms’ = ’11.1′,
‘compatible.asm’ = ’11.1′;
|
||
Parse OSWatcher Logs for cpu utilization
Posted: March 1, 2012 | Author: admin | Filed under: General DBA, Linux, RAC | Comments OffUsing logrotate to manage log files
Posted: February 29, 2012 | Author: admin | Filed under: ASM, General DBA, Linux | Comments OffWe are leveraging the logrotate linux executable to rotate ASM log files, database alert log files, and listener log files. With log rotate we have the option to compress the previous version of the log file, keep X amount of copied of the log file, rotate the log file on a hourly/daily/weekly/monthly intervals, etc.
rac22:/apps/oracle/general/sh
dbca delete database in silent mode
Posted: February 25, 2012 | Author: admin | Filed under: General DBA | Comments OffRMANDR – oracle: ksh del_DBATOOLS_dbca.txt
RAC with NFS
Posted: January 30, 2012 | Author: admin | Filed under: General DBA, Linux, RAC | Comments OffIn the table below
- Binaries is the shared mount points where the Oracle Home and CRS_HOME is installed.
- Datafiles includes Online Logs, Controlfile and Datafiles
- nfsvers and vers are identical on those OS platforms that has nfsvers. The ver option is an alternative to the nfsvers option. It is included for compatibility with other operating systems,
|
Operating System |
Mount options for Binaries | Mount options for Oracle Datafiles | Mount options for CRS Voting Disk and OCR |
| Sun Solaris * |
rw,bg,hard,nointr,rsize=32768, vers=3,suid |
rw,bg,hard,nointr,rsize=32768, wsize=32768,proto=tcp,noac, forcedirectio, vers=3,suid |
rw,bg,hard,nointr,rsize=32768, wsize=32768,proto=tcp,vers=3, noac,forcedirectio |
| AIX (5L) ** |
rw,bg,hard,nointr,rsize=32768, vers=3,timeo=600 |
cio,rw,bg,hard,nointr,rsize=32768, |
cio,rw,bg,hard,intr,rsize=32768, |
| HPUX 11.23 *** – | rw,bg,vers=3,proto=tcp,noac, hard,nointr,timeo=600, rsize=32768,wsize=32768,suid |
rw,bg,vers=3,proto=tcp,noac, forcedirectio,hard,nointr,timeo=600, rsize=32768,wsize=32768,suid |
rw,bg,vers=3,proto=tcp,noac, forcedirectio,hard,nointr,timeo=600 ,rsize=32768,wsize=32768,suid |
| Windows | Not Supported | Not Supported | Not Supported |
| Linux x86 # **** |
rw,bg,hard,nointr,rsize=32768, |
rw,bg,hard,nointr,rsize=32768, wsize=32768,tcp,actimeo=0, vers=3,timeo=600 |
rw,bg,hard,nointr,rsize=32768, |
| Linux x86-64 # **** |
rw,bg,hard,nointr,rsize=32768, wsize=32768,tcp,vers=3, timeo=600, actimeo=0 |
rw,bg,hard,nointr,rsize=32768, wsize=32768,tcp,actimeo=0, vers=3,timeo=600 |
rw,bg,hard,nointr,rsize=32768, wsize=32768,tcp,vers=3, timeo=600,actimeo=0 |
| Linux – Itanium | rw,bg,hard,nointr,rsize=32768, wsize=32768,tcp,vers=3, timeo=600, actimeo=0 |
rw,bg,hard,nointr,rsize=32768, wsize=32768,tcp,actimeo=0, vers=3,timeo=600 |
rw,bg,hard,nointr,rsize=32768, wsize=32768,tcp,vers=3, timeo=600,actimeo=0 |
* NFS mount option “forcedirectio” is required on Solaris platforms when mounting the OCR/CRS files when using Oracle 10.1.0.4 or 10.2.0.2 or later (Oracle unpublished bug 4466428)
** AIX is only supported with NAS on AIX 5.3 TL04 and higher with Oracle 10.2.0.1 and later (NetApp)
*** NAS devices are only supported with HPUX 11.23 or higher ONLY
**** As per BUG 11812928, the ‘intr’ & ‘nointr’ are deprecated in OEL 5.6 kernels and up including Oracle Linux 6. It is harmless to still include it, but the “NFS: ignoring mount option: nointr” will appears. This message can be ingnored.
# These mount options are for Linux kernels 2.6 and above for older kernels please check Note 279393.1
filesystemio_options = DIRECTIO
Single Instance
|
Operating System |
Mount options for Binaries | Mount options for Oracle Datafiles |
| Sun Solaris * (8, 9, 10) |
rw,bg,hard,rsize=32768,wsize=32768,vers=3,nointr,proto=tcp,suid |
rw,bg,hard,rsize=32768,wsize=32768,vers=3,[forcedirectio or llock],nointr,proto=tcp,suid |
| AIX (5L) ** |
rw,bg,hard,rsize=32768,wsize=32768,vers=3,intr,timeo=600,proto=tcp |
rw,bg,hard,rsize=32768,wsize=32768,vers=3,cio,intr,timeo=600,proto=tcp |
| HPUX 11.23 **** | rw,bg,hard,rsize=32768,wsize=32768,vers=3,nointr,timeo=600,proto=tcp,suid | rw,bg,hard,rsize=32768,wsize=32768,vers=3,nointr,timeo=600,proto=tcp, suid, forcedirectio |
| Windows | Not Supported | Not Supported |
| Linux x86 # |
rw,bg,hard,rsize=32768,wsize=32768,vers=3,nointr,timeo=600,tcp | rw,bg,hard,rsize=32768,wsize=32768,vers=3,nointr,timeo=600,tcp,actimeo=0* |
| Linux x86-64 # | rw,bg,hard,rsize=32768,wsize=32768,vers=3,nointr,timeo=600,tcp | rw,bg,hard,rsize=32768,wsize=32768,vers=3,nointr,timeo=600,tcp,actimeo=0* |
| Linux – Itanium | rw,bg,hard,rsize=32768,wsize=32768,vers=3,nointr,timeo=600,tcp | rw,bg,hard,rsize=32768,wsize=32768,vers=3,nointr,timeo=600,tcp |
* actime=0 or noac can be used
Create Seeded Database with dbca
Posted: November 29, 2011 | Author: admin | Filed under: General DBA, RMAN | Comments OffCreate a golden image of your database and create a template of that database for future database provisioning
Create Seeded Database with dbca
With proper planning and infrastructure, you should be able to provision a new database in matter of minutes rather than days. You can create a template of a golden image of your database with all the corporate standards, auditing requirements and security compliance components.
PSU Compliance
Posted: July 14, 2011 | Author: Charles.Kim | Filed under: General DBA | Leave a comment »As part of the best practice compliance, you should apply the latest Patch Set Update (PSU) or be at a N-1 PSU release cycle specific to your database release. For the latest PSU, please check the following Metalink note:
• Oracle Recommended Patches — Oracle Database [ID 756671.1]
As of end of February 2011, 11.2.0.2.1 PSU is available by downloading patch number 10248523. For Oracle Database 11g Release 1 customers, 11.1.0.7.6 Patch Set Update (Patch 10248531) is available, and the Data Guard Broker Recommended Patch Bundle #1 is also available (Patch 7628357).
Database Growth Trend Report By The Week
Posted: July 14, 2011 | Author: Charles.Kim | Filed under: General DBA | Leave a comment »Here’s a new version of the database growth report. The new version determines the growth trend for the database for the past one year. Check out this script:
set pages 255 lines 2000 trims on compute sum of growth_in_gb on report col week_number for a35 break on report select to_char(creation_time, 'ww mon yyyy') week_number, round(sum(bytes)/1024/1024/1024,1) growth_in_gb from sys.v_$datafile where creation_time > SYSDATE-365 group by to_char(creation_time, 'ww mon yyyy') order by 1 /
Posted by Charles Kim, Oracle ACE Director