Friday 27 August 2010

Aumated Statistics Gathering In 11g

If you are looking for the GATHER_STATS_JOB in Oracle 11g, then stop looking. In 11g, this job is part of the daily Oracle Maintenance window, but it is executed as an autotask. Take a look at this Oracle link.

To check if it exists and enabled, use this simple SQL.

select * from dba_autotask_client where client_name = 'auto optimizer stats collection';

Or, to check the log:

select count(*) from dba_scheduler_job_log where additional_info like '%GATHER_STATS_PROG%';

I hope this wills save you some time.

And also.........

Oracle Database 10g introduced the concept automated maintenance task execution during maintenance windows implemented via a WEEKNIGHT_WINDOW and WEEKEND_WINDOW schedule. This included statistics collection by means of the GATHER_STATS_JOB.

In Oracle Database 11g, the WEEKNIGHT_WINDOW and WEEKEND_WINDOW schedules (defined in Oracle Database 10g) are replaced with daily maintenance windows (such as SUNDAY_WINDOW, MONDAY_WINDOW etc). These were replaced in order to add increased flexibility and manageability. One can query dba_scheduler_windows to check the window definitions.

Automatic Maintenance Tasks (including the automated Optimizer Statistics Gathering task) are defined to execute within these daily windows. Using Enterprise Manager is the preferred way to control Automatic Maintenance Tasks, although the DBMS_AUTO_TASK_ADMIN package can also be used.

'Automatic Maintenance Tasks Management ' is an 11g new feature and was implemented to increase the flexibility of statistics collection and to avoid potential resourcing issue when maintenance jobs run alongside user operations. Maintenance operations can potentially use a lot of resource which may, in extreme cases, affect other jobs. To address this, in 11g, maintenance operations are closely linked to resource manager to manage the resources that are used and share them more efficiently.

From the

Oracle� Database New Features Guide
11g Release 1 (11.1)
Part Number B28279-03

"This feature ensures that work during maintenance operations is not affected and that user activity gets the necessary resources to complete."

By spreading the workload over multiple weeknights and managing the resource usage, this feature provides the flexibility to allow maintenance jobs to complete in a timely fashion and for user operations to be unaffected.

Users are still completely free to define other maintenance windows and change start times and durations for the daily maintenance windows.

Oracle Database 10g : AWR and ADDM

Oracle Database 10g : AWR and ADDM

Monday 23 August 2010

AWR report is broken into multiple parts.

AWR report is broken into multiple parts.

1)Instance information:-
This provides information the instance name , number,snapshot ids,total time the report was taken for and the database time during this elapsed time.

Elapsed time= end snapshot time - start snapshot time
Database time= Work done by database during this much elapsed time( CPU and I/o both add to Database time).If this is lesser than the elapsed time by a great margin, then database is idle.Database time does not include time spend by the background processes.

2)Cache Sizes : This shows the size of each SGA region after AMM has changed them. This information
can be compared to the original init.ora parameters at the end of the AWR report.

3)Load Profile: This important section shows important rates expressed in units of per second and
transactions per second.This is very important for understanding how is the instance behaving.This has to be compared to base line report to understand the expected load on the machine and the delta during bad times.

4)Instance Efficiency Percentages (Target 100%): This section talks about how close are the vital ratios like buffer cache hit, library cache hit,parses etc.These can be taken as indicators ,but should not be a cause of worry if they are low.As the ratios cold be low or high based in database activities, and not due to real performance problem.Hence these are not stand alone statistics, should be read for a high level view .

5)Shared Pool Statistics: This summarizes changes to the shared pool during the snapshot
period.

6)Top 5 Timed Events :This is the section which is most relevant for analysis.This section shows what % of database time was the wait event seen for.Till 9i, this was the way to backtrack what was the total database time for the report , as there was no Database time column in 9i.

7)RAC Statistics :This part is seen only incase of cluster instance.This provides important indication on the average time take for block transfer, block receiving , messages ., which can point to performance problems in the Cluster instead of database.

8)Wait Class : This Depicts which wait class was the area of contention and where we need to focus.Was that network, concurrency, cluster, i/o Application, configuration etc.

9)Wait Events Statistics Section: This section shows a breakdown of the main wait events in the
database including foreground and background database wait events as well as time model, operating
system, service, and wait classes statistics.

10)Wait Events: This AWR report section provides more detailed wait event information for foreground
user processes which includes Top 5 wait events and many other wait events that occurred during
the snapshot interval.

11)Background Wait Events: This section is relevant to the background process wait events.

12)Time Model Statistics: Time mode statistics report how database-processing time is spent. This
section contains detailed timing information on particular components participating in database
processing.This gives information about background process timing also which is not included in database time.

13)Operating System Statistics: This section is important from OS server contention point of view.This section shows the main external resources including I/O, CPU, memory, and network usage.

14)Service Statistics: The service statistics section gives information services and their load in terms of CPU seconds, i/o seconds, number of buffer reads etc.

15)SQL Section: This section displays top SQL, ordered by important SQL execution metrics.

a)SQL Ordered by Elapsed Time: Includes SQL statements that took significant execution
time during processing.

b)SQL Ordered by CPU Time: Includes SQL statements that consumed significant CPU time
during its processing.

c)SQL Ordered by Gets: These SQLs performed a high number of logical reads while
retrieving data.

d)SQL Ordered by Reads: These SQLs performed a high number of physical disk reads while
retrieving data.

e)SQL Ordered by Parse Calls: These SQLs experienced a high number of reparsing operations.

f)SQL Ordered by Sharable Memory: Includes SQL statements cursors which consumed a large
amount of SGA shared pool memory.

g)SQL Ordered by Version Count: These SQLs have a large number of versions in shared pool
for some reason.

16)Instance Activity Stats: This section contains statistical information describing how the database
operated during the snapshot period.

17)I/O Section: This section shows the all important I/O activity.This provides time it took to make 1 i/o say Av Rd(ms), and i/o per second say Av Rd/s.This should be compared to the baseline to see if the rate of i/o has always been like this or there is a diversion now.

18)Advisory Section: This section show details of the advisories for the buffer, shared pool, PGA and
Java pool.

19)Buffer Wait Statistics: This important section shows buffer cache waits statistics.

20)Enqueue Activity: This important section shows how enqueue operates in the database. Enqueues are
special internal structures which provide concurrent access to various database resources.

21)Undo Segment Summary: This section gives a summary about how undo segments are used by the database.
Undo Segment Stats: This section shows detailed history information about undo segment activity.

22)Latch Activity: This section shows details about latch statistics. Latches are a lightweight
serialization mechanism that is used to single-thread access to internal Oracle structures.The latch should be checked by its sleeps.The sleepiest Latch is the latch that is under contention , and not the latch with high requests.Hence  run through the sleep breakdown part of this section to arrive at the latch under highest contention.

23)Segment Section: This portion is important to make a guess in which segment and which segment type the contention could be.Tally this with the top 5 wait events.

Segments by Logical Reads: Includes top segments which experienced high number of
logical reads.

Segments by Physical Reads: Includes top segments which experienced high number of disk
physical reads.

Segments by Buffer Busy Waits: These segments have the largest number of buffer waits
caused by their data blocks.

Segments by Row Lock Waits: Includes segments that had a large number of row locks on
their data.

Segments by ITL Waits: Includes segments that had a large contention for Interested
Transaction List (ITL). The contention for ITL can be reduced by increasing INITRANS storage
parameter of the table.

24)Dictionary Cache Stats: This section exposes details about how the data dictionary cache is
operating.

25)Library Cache Activity: Includes library cache statistics  which are needed in case you see library cache in top 5 wait events.You might want to see if the reload/invalidations are causing the contention or there is some other issue with library cache.

26)SGA Memory Summary:This would tell us the difference in the respective pools at the start and end of report.This could be an indicator of setting minimum value for each, when sga)target is being used..

27)init.ora Parameters: This section shows the original init.ora parameters for the instance during
the snapshot period.

There would be more Sections in case of RAC setups to provide details.




______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________

RMAN CHANGE UNCATALOG



Catalog Backup
Whenever we take any backup through RMAN, in the repository information of the backup is recorded. The RMAN respository can be either controlfile or recovery catalog. However if I take a backup through OS command then RMAN does not aware of that and hence recorded are not reflected in the repository. This is also true whenever we create a new controlfile or a backup taken by RMAN is transferred to another place using OS command then controlfile/recovery catalog does not know about the prior backups of the database. So in order to restore database with a new created controlfile we need to inform RMAN about the backups taken before so that it can pick one to restore.

This task can be done by catalog command in RMAN. With catalog command it can
-Add information of backup pieces and image copies in the repository that are on disk.
-Record a datafile copy as a level 0 incremental backup in the RMAN repository.
-Record of a datafile copy that was taken by OS.

But CATALOG command has some restrictions. It can't do the following.
-Can't catalog a file that belong to different database.
-Can't catalog a backup piece that exists on an sbt device.

Examples of Catalog command
1)Catalog an archive log: To catalog two archived logs named /oracle/oradata/arju/arc001_223.arc and /oracle/oradata/arju/arc001_224.arc the command is,
RMAN>CATALOG ARCHIVELOG '/oracle/oradata/arju/arc001_223.arc', '/oracle/oradata/arju/arc001_224.arc';

2)Catalog a file copy as an incremental backup: To catalog datafile copy '/oradata/backup/users01.dbf' as an incremental level 0 backup your command will be,
RMAN>CATALOG DATAFILECOPY '/oradata/backup/users01.dbf' LEVEL 0;
Note that this datafile copy was taken backup either using the RMAN BACKUP AS COPY command, or by using operating system utilities in conjunction with ALTER TABLESPACE BEGIN/END BACKUP.

3)Catalog multiple copies in a directory: To catalog all valid backups from directory /tmp/backups issue,
RMAN>CATALOG START WITH '/tmp/backups' NOPROMPT;

4)Catalog files in the flash recovery area: To catalog all files in the currently enabled flash recovery area without prompting the user for each one issue,
RMAN>CATALOG RECOVERY AREA NOPROMPT;

5)Catalog backup pieces: To catalog backup piece /oradata2/o4jccf4 issue,
RMAN>CATALOG BACKUPPIECE '/oradata2/o4jccf4';

Uncatalog Backup
In many cases you need to uncatalog command. Suppose you do not want a specific backup or copy to be eligible to be restored but also do not want to delete it.
To uncatalog all archived logs issue,
RMAN>CHANGE ARCHIVELOG ALL UNCATALOG;

To uncataog tablespace USERS issue,
RMAN>CHANGE BACKUP OF TABLESPACE USERS UNCATALOG;

To uncatalog a backuppiece name /oradata2/oft7qq issue,
RMAN>CHANGE BACKUPPIECE '/oradata2/oft7qq' UNCATALOG;


SQL >> select 'Change backuppiece TAG='''|| TAG || ''' Uncatalog ; ' from rc_backup_piece where db_id = '952695440' and device_type = 'SBT_TAPE'

order by start_time

Result

----------------------------------------------------------------------
RMAN> Change backuppiece TAG='TAG20091021T200329' Uncatalog ;

RMAN> Change backuppiece TAG='TAG20091021T200337' Uncatalog ;
RMAN> CHANGE BACKUPPIECE TAG=' TAG20091023T200131' UNCATALOG;

RMAN> CHANGE BACKUPSET COMPLETED BEFORE 'sysdate-30' DELETE;

RMAN> CHANGE CONTROLFILECOPY '/u01/app/oracle/rman/backup/control01.ctl' UNCATALOG;

RMAN> CHANGE DATAFILECOPY '/u01/app/oracle/rman/backup/users01.ctl' UNCATALOG;

RMAN> CHANGE CONTROLFILECOPY '/tmp/cf.cpy' UNCATALOG;

RMAN> CHANGE BACKUPSET 121,122,127,203,300 UNCATALOG;

RMAN> CHANGE BACKUPPIECE 'ilif2lo4_1_1' UNCATALOG;


I want to remove RMAN catalog entries older than 30 days. The backup pieces have long since been moved off the system.


http://www.orafaq.com/scripts/unix/purgecat.txt

Just change the line
echo "CHANGE BACKUPSET $key DELETE;" >>$CMDFILE

in that script to
echo "CHANGE BACKUPSET $key UNCATALOG;" >>$CMDFILE

and also this line
list backupset of database
from time 'SYSDATE-3000' until time 'SYSDATE-$DAYSTOKEEP'


orrrrrrrrrrrrrrrrrrrrrr

RMAN> list backupset completed between '17-JAN-2011' and 'sysdate' ; --- to check today's backup
RMAN> change backupset completed before 'sysdate-30' delete;

RMAN> crosscheck backup completed before 'sysdate-30';
RMAN> delete expired backup completed before 'sysdate-30';

RMAN> list backupset tag 'VLE_LIVE_DISK' completed between "sysdate-1" and "sysdate";
RMAN> list backupset completed between "sysdate-3" and "sysdate-2";
RMAN> backup backupset completed between "sysdate-3" and "sysdate-2" format '/mnt/OracleBackup/BSQUAT/RmanOnline/FRA_BSQUAT_20100820_%U.frabak';
backup format 'FRA_%d_%T_%U.frabak'

Check Controlfile backup

run {
allocate channel d1 type='sbt_tape';
set until time "to_date('09-25-2014 20:00:00','mm-dd-yyyy hh24:mi:ss')";
restore controlfile preview;

}


Monday 9 August 2010

ASM – Intelligent Data Placement

Oracle Database 11g Release 2 adds intelligent data placement (IDP) support for JBOD (just a bunch of disks) configurations for ASM disk groups. IDP leverages geometry of disks and will place hot files on the outer most edge of the spindles and cold files in the inner rings of the drives. In addition, files that are accessed with similar patterns are placed close to each other to reduce latency.

IDP is supported by both ASM Configuration Assistant (ASMCA) and Enterprise Manager.

The outermost tracks provide greater speed and higher bandwidth. IDP works at disk group attribute level or at the file level and can be modified after the disk group is created. IDP is suited for situations where:
1. Disk groups that are > 25% full
2. Database datafiles are accessed at different rates
3. JBOD configurations – LUNs carved out of SANs are not suited for IDP

You can set IDP for only new files. Existing files must go through a rebalance operation to leverage IDP. In order to leverage IDP, both COMPATIBLE.ASM and COMPATIBLE.RDBMS disk group attributes must be set to a value of 11.2.0 or higher. IDP can be set with the following SQL syntax:

1

1.  ALTER DISKGROUP DATA ADD TEMPLATE

2

2.  ALTER DISKGROUP DATA MODIFY TEMPLATE


 

3

3.  ALTER DISKGROUP DATA MOFIFY FILE

For example:

1

alter diskgroup data add template hotfiles attributes (hot mirrorhot);

IDP information can be retrieved by querying V$ASM_DISK, V$ASM_DISK_IOSTAT, V$ASM_FILE and V$ASM_TEMPLATE views.

Columns from V$ASM_DISK that are of particular interest are:

01

HOT_READS                      NUMBER

02

HOT_WRITES                     NUMBER


 

03

HOT_BYTES_READ                     NUMBER

04

HOT_BYTES_WRITTEN                  NUMBER


 

05

COLD_READS                     NUMBER

06

COLD_WRITES                        NUMBER


 

07

COLD_BYTES_READ                    NUMBER

08

COLD_BYTES_WRITTEN             NUMBER


 

09

HOT_USED_MB                        NUMBER

10

COLD_USED_MB                       NUMBER

New columns in v$asm_template that apply to IDP are:

1

PRIMARY_REGION                     VARCHAR2(4)

2

MIRROR_REGION                  VARCHAR2(4)

Friday 6 August 2010

SQL DEVELOPER AND TAF

  1. Make sure You have install Oracle Client with OCI ( To check OCI –Search OCI.dll in client installed folderè it should be here "C:\Oracle\product\11.1.0\client_1\BIN")
  2. In Database Connection window , user "Connection Type" = "Advance".
  3. It will open "Custome JDBC URL" Box.
  4. Type Below connection string as per your environment:


     

    jdbc:oracle:oci:@(DESCRIPTION =

    (ADDRESS = (PROTOCOL = TCP)(HOST = rac1-vip)(PORT = 1521))

    (ADDRESS = (PROTOCOL = TCP)(HOST = rac2-vip)(PORT = 1521))

    (LOAD_BALANCE = ON)

    (CONNECT_DATA =

    (SERVER = DEDICATED)

    (SERVICE_NAME = bsquat)

    (FAILOVER_MODE =

    (TYPE = SELECT)

    (METHOD = BASIC)

    (RETRIES = 180)

    (DELAY = 5)

    )

    )

    )


     


     

  5. Test + Save + Try !!
  6. Job Done !!!

Oracle Database Server Patchset Information, Versions: 8.1.7 to 11.2.0

[ID 268895.1]


 

Oracle 11g Release 2

====================


 


Note 880782.1 - ALERT: Oracle 11g Release 2 (11.2) Support Status and Alerts


 

11.2.0.1.0 - Base Release


 

11.2.0.1.1 - Patch Set Update (PSU 1): Note 9352237.8

11.2.0.1.2 - Patch Set Update (PSU 2): Note 9654983.8


 

11.2.0.2.0 - Planned


 

Platform Specific Fix Information for Windows


Note 1114533.1 - 11.2.0.x Oracle Database and Networking Patches for Microsoft Platforms


 


 


 

Oracle 11g Release 1

====================


 


Note 454507.1 - ALERT: Oracle 11g Release 1 (11.1) Support Status and Alerts


 

11.1.0.6.0 - Base Release

11.1.0.7.0 - Patch Set #1, List of fixes: Note 601739.1


 

11.1.0.7.1 - Patch Set Update (PSU 1): Note 8833297.8

11.1.0.7.2 - Patch Set Update (PSU 2): Note 9209238.8

11.1.0.7.3 - Patch Set Update (PSU 3): Note 9352179.8

11.1.0.7.4 - Patch Set Update (PSU 4): Note 9654987.8


 

Platform Specific Fix Information for Windows


Note 560295.1 - 11.1.0.x Oracle Database and Networking Patches for Microsoft Platforms


 


 


 

Oracle 10g Release 2

====================


 


Note 316900.1 - ALERT: Oracle 10g Release 2 (10.2) Support Status and Alerts


 

10.2.0.1.0 - Base Release

10.2.0.2.0 - Patch Set #1, List of fixes: Note 358749.1

10.2.0.3.0 - Patch Set #2, List of fixes: Note 391116.1

10.2.0.4.0 - Patch Set #3, List of fixes: Note 401436.1


 

10.2.0.4.1 - Patch Set Update (PSU 1): Note 8576156.8

10.2.0.4.2 - Patch Set Update (PSU 2): Note 8833280.8

10.2.0.4.3 - Patch Set Update (PSU 3): Note 9119284.8

10.2.0.4.4 - Patch Set Update (PSU 4): Note 9352164.8


 

10.2.0.5.0 - Patch Set #4, List of fixes: Note 1088172.1


 

Platform Specific Fix Information for Windows


Note 342443.1 - 10.2.0.x Oracle Database and Networking Patches for Microsoft Platforms


 


 


 

Oracle 10g Release 1

====================


 


Note 263719.1 - ALERT: Oracle 10g Release 1 (10.1) Support Status and Alerts


 

10.1.0.2.0 - Base Release

10.1.0.3.0 - Patch Set #1, List of fixes: Note 280552.1

10.1.0.4.0 - Patch Set #2, List of fixes: Note 295763.1

10.1.0.5.0 - Patch Set #3, List of fixes: Note 335869.1 ==> Last Patch Set


 

Platform Specific Fix Information for Windows


Note 276548.1 - 10.1.0.x Oracle Database and Networking Patches for Microsoft Platforms


 


 


 

Oracle9i Release 2

==================


 


Note 189908.1 - ALERT: Oracle9i Release 2 (9.2) Support Status and Alerts


 

9.2.0.1 - Base Release

9.2.0.2 - Patch Set #1, List of fixes: Note 246017.1

9.2.0.3 - Patch Set #2, List of fixes: Note 245939.1

9.2.0.4 - Patch Set #3, List of fixes: Note 245758.1

9.2.0.5 - Patch Set #4, List of fixes: Note 263791.1

9.2.0.6 - Patch Set #5, List of fixes: Note 283897.1

9.2.0.7 - Patch Set #6, List of fixes: Note 308894.1

9.2.0.8 - Patch Set #7, List of fixes: Note 358776.1 ==> Last Patch Set


 

Platform Specific Fix Information for Windows


Note 211268.1 - 9.2.0.x Oracle Database and Networking Patches for Microsoft Platforms


 


 


 

Oracle9i Release 1

==================


 


Note 149018.1 - ALERT: Oracle9i (9.0.1) Support Status and Alerts


 

9.0.1.0 - Base Release

9.0.1.1 - Patch Set #1, List of fixes: Note 257622.1

9.0.1.2 - Patch Set #2, List of fixes: Note 257623.1

9.0.1.3 - Patch Set #3, List of fixes: Note 257624.1

9.0.1.4 - Patch Set #4, List of fixes: Note 257625.1 ==> Last Patch Set


 

9.0.1.5 - Note 257626.1 - The 9.0.1.5 Patch Set is only intended for iAS

Infrastructure Database installations and not for general use.


 

Platform Specific Fix Information for Windows


Note 166926.1 - 9.0.1.x Oracle Database and Networking Patches for Microsoft Platforms


 


 


 

Oracle8i Release 3

==================


 


Note 120607.1 - ALERT: Oracle8i Release 3 (8.1.7) Support Status and Alerts


 

8.1.7.0 - Base Release

8.1.7.1 - Patch Set #1

8.1.7.2 - Patch Set #2

8.1.7.3 - Patch Set #3

8.1.7.4 - Patch Set #4 ==> Last Patch Set


 

Generic Fix Information:


Note 120613.1 - 8.1.7.X Patch Sets - List of Bug Fixes by Problem Type


 

Platform Specific Fix Information for Windows


Note 161713.1 - 8.1.7.x / 8.1.6.x Oracle Database and Networking Patches for Microsoft Platforms


 


 


 

Additional References

=====================

Note 742060.1 - Release Schedule of Current Database Patch Sets

Note 161549.1 - Oracle Database Server and Networking Patches for Microsoft Platforms

Note 169547.1 - Understanding and Obtaining Oracle RDBMS Patchsets


 

Note 161818.1 - Oracle Server (RDBMS) Releases Support Status Summary

Note 223718.1 - Oracle Server Availability and Certification MATRIX

Note 207303.1 - Client / Server / Interoperability Support Between Different Oracle Versions


 

Note 756671.1 - Oracle Recommended Patches -- Oracle Database

Note 854428.1 - Intro to Patch Set Updates (PSU)


 


 

OPatch References

=================

Note 224346.1 - OPatch - Where Can I Find the Latest Version of OPatch?


 

NI cryptographic checksum mismatch error: 12599

In testing of Oracle Enterprise Manager 11g R1 Grid Control we noticed frequent ORA-12599 errors in the alert logs of the monitored databases including the repository database. Upon further investigation we found that the ORA-12599 error message, such as the one below, was generated every time a connection was made to the target database as SYSDBA through Oracle Enterprise Manager 11g R1 Grid Control.

TNS-12599: TNS:cryptographic checksum mismatch

ns secondary err code: 2526

nt main err code: 0

nt secondary err code: 0

nt OS err code: 0

Wed Aug 04 17:20:17 2010

***********************************************************************

NI cryptographic checksum mismatch error: 12599.

VERSION INFORMATION:

TNS for Linux: Version 11.2.0.1.0 - Production

Oracle Bequeath NT Protocol Adapter for Linux: Version 11.2.0.1.0 - Production

TCP/IP NT Protocol Adapter for Linux: Version 11.2.0.1.0 - Production

Time: 04-AUG-2010 17:20:17

Tracing not turned on.

Tns error struct:

ns main err code: 12599

TNS-12599: TNS:cryptographic checksum mismatch

ns secondary err code: 2526

nt main err code: 0

nt secondary err code: 0

nt OS err code: 0

Wed Aug 04 18:26:17 2010

Thread 1 advanced to log sequence 81 (LGWR switch)

Current log# 3 seq# 81 mem# 0: +DATA/bsqrac/onlinelog/group_3.259.725990619

Current log# 3 seq# 81 mem# 1: +FRA/bsqrac/onlinelog/group_3.259.725990621

Wed Aug 04 18:26:17 2010

Archived Log entry 26 added for thread 1 sequence 80 ID 0x2879dc97 dest 1:

Wed Aug 04 22:00:00 2010

Setting Resource Manager plan DEFAULT_MAINTENANCE_PLAN via parameter

No errors were returned back to Grid Control nor did any of the process performed fail to complete. If you are seeing these messages in your alert logs you and you are not using encryption you can see if you are experiencing the same issue by simply logging into a database as SYSDBA through Grid Control and then log out of the database. If you are experiencing the same issue you should find two ORA-12599messages in the alert log for the database one associated with the log in and one associated with the log out.

Our support ticket has been assigned Bug 9899797: 12599 ERRORS IN ALERT LOG WHEN CONNECT TO 11.2 DB AS SYSDBA IN GC 11.1. The following are bug numbers listed in My Oracle Support that are similar to what has been described in this document. All have a status of 16 – Support bug screening.

Bug 9850366: NI CRYPTOGRAPHIC CHECKSUM MISMATCH ERROR WHILE LOGGING OUT OF TARGET DB IN EM
Bug 9871805: LOGIN TO OEM CAUSES NI CRYPTOGRAPHIC CHECKSUM MISMATCH ERROR: 12599 MESSAGES IN
Bug 9844654: GC 11G REPOSITORY DB ALERT.LOG SHOWS TNS-12599
Bug 9881906: TNS ERROR IN ALERT LOG FOR 11.2 DB REPOSITORY
Bug 9830641: ORA-12599: TNS:CRYPTOGRAPHIC CHECKSUM MISMATCH

ORA-00600: internal error code, arguments: [qcsgpvc3]

ORA-00600: internal error code, arguments: [qcsgpvc3], [], [], [], [], [], [], []

One of our Production database we are getting following ORA-00600 error

OS: Windows 2003

DB: 11.1.0.6.0

ORA-00600: internal error code, arguments: [qcsgpvc3], [], [], [], [], [], [], []

Solution:

There is no solution yet on metalink...

Kindly submit "Trace Files" & "Alert Log" to Oracle Support

Above Error Fixed In the 11.2 Version

Metalink Note: 756784.1

Temporary Workaround:

If

An ORA-600 can occur while recompiling stored PLSQL if a procedure / function argument name matches to a columnname referred to in that function / procedure .

Then

Change the Function/procedure's argument name so that it does not match to any column name being referred in the function/procedure body.

Thursday 5 August 2010

Top 10 Backup and Recovery best practices

Top 10 Backup and Recovery best practices.


This document assumes that you are doing the Backup and Recovery basics
- Running in Archivelog mode
- multiplexing the controlfile
- Taking regular backups
- Periodically doing a complete restore to test your procedures. 

Questions and Answers

1. Turn on block checking.
REASON: The aim is to detect, very early the presence of corrupt blocks in the database.
This has a slight performance overhead, but will allow Oracle to detect early
corruption caused by underlying disk, storage system, or I/O system problems.

SQL> alter system set db_block_checking = true scope=both;


2. Turn on block tracking when using RMAN backups (if running 10g)
REASON: The block tracking file contains a bitmap that is used during incremental backups

Each bit represents an extent, so only those extents that have been modified will be read and backed up.

If this is not used, all blocks must be read to determine if they have been modified since the last backup.

SQL> alter database enable block change tracking using file â€Ã‚˜/u01/oradata/ora1/change_tracking.fâ€Ã‚™;


3. Duplex log groups and members and have more than one archive log dest.
REASON: If an archivelog is corrupted or lost, by having multiple copies in multiple locations,
the other logs will still be available and could be used.

If an online log is deleted or becomes corrupt, you will have another member that can be
used to recover if required.

SQL> alter system set log_archive_dest_2='location=/new/location/archive2' scope=both;
SQL> alter database add logfile member '/new/location/redo21.log' to group 1;


4. When backing up the database use the 'check logical' parameter
REASON: This will cause RMAN to check for logical corruption within a block as well as the normal
head/tail checksumming. This is the best way to ensure that you will get a good backup.

RMAN> backup check logical database plus archivelog delete input;


5. Test your backup.
REASON: This will do everything except actually restore the database. This is the best method to
determine if your backup is good and usable before being in a situation where it is
critical and issues exist.

RMAN> restore validate database;


6. Have each datafile in a single backup piece
REASON: When doing a partial restore RMAN must read through the entire piece to get the
datafile/archivelog requested. The smaller the backup piece the quicker the restore can
complete. This is especially relevent with tape backups of large databases or where the
restore is only on individual / few files.

RMAN> backup database filesperset 1 plus archivelog delete input;


7. Maintain your RMAN catalog/controlfile
REASON: Choose your retention policy carefully. Make sure that it compliments your tape subsystem
retention policy, requirements for backup recovery strategy. If not using a catalog,
ensure that your controlfile record keep time instance parameter matches your retention policy.

SQL> alter system set control_file_record_keep_time=21 scope=both;
This will keep 21 days of backup records.

Run regular catalog maintenance.
REASON: Delete obsolete will remove backups that are outside your retention policy.
If obsolete backups are not deleted, the catalog will continue to grow until performance
becomes an issue.

RMAN> delete obsolete;

REASON: crosschecking will check that the catalog/controlfile matches the physical backups.
If a backup is missing, it will set the piece to 'EXPIRED' so when a restore is started,
that it will not be eligible, and an earlier backup will be used. To remove the expired
backups from the catalog/controlfile use the delete expired command.

RMAN> crosscheck backup;
RMAN> delete expired backup;


8. Prepare for loss of controlfiles.

set autobackup on
REASON: This will ensure that you always have an up to date controlfile available that has been
taken at the end of the current backup not during.

RMAN> configure controlfile autobackup on;

keep your backup logs
REASON: The backup log contains parameters for your tape access, locations on controlfile backups
that can be utilised if complete loss occurs.

9. Test your recovery

REASON: During a recovery situation this will let you know how the recovery will go without
actually doing it, and can avoid having to restore source datafiles again.

SQL> recover database test;


10. Do not specify 'delete all input' when backing up archivelogs
REASON: Delete all input' will backup from one destination then delete both copies of the
archivelog where as 'delete input' will backup from one location and then delete what has
been backed up. The next backup will back up those from location 2 as well as new logs
from location 1, then delete all that are backed up. This means that you will have the
archivelogs since the last backup available on disk in location 2 (as well as backed up
once) and two copies backup up prior to the previous backup.

RAC ---RMAN Configuration :

RMAN> show all;

RMAN configuration parameters for database with db_unique_name xxxxx are:

CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 15 DAYS;

CONFIGURE BACKUP OPTIMIZATION OFF;

CONFIGURE DEFAULT DEVICE TYPE TO DISK;

CONFIGURE CONTROLFILE AUTOBACKUP ON;

CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '+FRA/bsquat/autobackup/%F';

----OR-----

CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/mnt/OracleBackup/BSQUAT/RmanOnline/%F';

CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO COMPRESSED BACKUPSET;

CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1;

CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1;

CONFIGURE CHANNEL 1 DEVICE TYPE DISK CONNECT '*';

CONFIGURE MAXSETSIZE TO UNLIMITED;

CONFIGURE ENCRYPTION FOR DATABASE OFF;

CONFIGURE ENCRYPTION ALGORITHM 'AES128';

CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE;

CONFIGURE ARCHIVELOG DELETION POLICY TO BACKED UP 1 TIMES TO DISK;

CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_bsquat1.f';

------------------------------------------------ Limit Backup Piece size --------------------

RMAN> CONFIGURE CHANNEL 1 DEVICE TYPE DISK CONNECT 'sys/xxxx@target' MAXPIECESIZE = 500M;

----Optional to default auto backup location of Controlfile Configuration .---

RMAN> backup current controlfile format '/mnt/OracleBackup/BSQUAT/RmanOnline/FRA_%d_%T_%U.ctl';

RMAN> backup as backupset spfile format '/mnt/OracleBackup/BSQUAT/RmanOnline/FRA_%d_%T_%U.spfile';

Single Instance RMAN Configuration :

RMAN> show all;

using target database control file instead of recovery catalog

RMAN configuration parameters for database with db_unique_name VOLDEV are:

CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 15 DAYS;

CONFIGURE BACKUP OPTIMIZATION OFF;

CONFIGURE DEFAULT DEVICE TYPE TO DISK;

CONFIGURE CONTROLFILE AUTOBACKUP ON;

CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/mnt/OracleBackup/voldev/RmanOnline/%F';

CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO COMPRESSED BACKUPSET;

CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1;

CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1;

CONFIGURE CHANNEL 1 DEVICE TYPE DISK FORMAT '/mnt/OracleBackup/voldev/RmanOnline/%d_%D%M%Y_s%s_p%p';

CONFIGURE MAXSETSIZE TO UNLIMITED;

CONFIGURE ENCRYPTION FOR DATABASE OFF;

CONFIGURE ENCRYPTION ALGORITHM 'AES128';

CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE;

CONFIGURE ARCHIVELOG DELETION POLICY TO BACKED UP 1 TIMES TO DISK;

CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_voldev.f';

RMAN CRON JOB:

[oracle@vol-oracledev ~]$ crontab -l

00 22 * * 5 /fra/backupScript/backupFRIDAY.sh >> /fra/backupScript/backupFRIDAY.log 2>&1

00 22 * * 1-4 /fra/backupScript/backupMON2THU.sh >> /fra/backupScript/backupMON2THU.log 2>&1

backupFRIDAY.sh

#!/bin/bash

export DATE=$(date +%Y-%m-%d__%A_%H@%M@%S)

export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1

export ORACLE_SID=voldev

export PATH=$PATH:$ORACLE_HOME/bin

#export NLS_DATE_FORMAT=.DD-MON-YY HH24:MI:SS.

rman catalog rman/xxxx@voldev target sys/xxxxx@voldev msglog /fra/flash_recovery_area/VOLDEV/onlinelog/logs/rman_INCR_0_bk__voldev_${DATE}.log <<EOF

RUN

{

backup incremental level 0 device type disk tag '%TAG' database;

backup device type disk tag '%TAG' archivelog all not backed up;

crosscheck backup;

delete noprompt expired backup;

delete noprompt obsolete device type disk;

crosscheck archivelog all;

delete noprompt expired archivelog all;

}

EXIT;

EOF

backupMON2THU.sh

#!/bin/bash


export DATE=$(date +%Y-%m-%d__%A_%H@%M@%S)

export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1

export ORACLE_SID=voldev

export PATH=$PATH:$ORACLE_HOME/bin

#export NLS_DATE_FORMAT=.DD-MON-YY HH24:MI:SS.

rman catalog rman/xxxx@voldev target sys/xxxxx@voldev msglog /fra/flash_recovery_area/VOLDEV/onlinelog/logs/rman_INCR_1_bk__voldev_${DATE}.log <<EOF

RUN

{

backup incremental level 1 device type disk tag '%TAG' database;

backup device type disk tag '%TAG' archivelog all not backed up;

}

EXIT;

EOF