Thursday 29 December 2011

Disable AWR

Package for disabling AWR without a Diagnostic Pack license in Oracle [ID 436386.1]


#####################   Or ###################################################



Here’s an odd little observation that came out of the UKOUG conference last week:
If you’re running 10g, and don’t have the relevant performance pack and diagnostic licences there are various views you are not allowed to query, packages you are not allowed to run, and reports you are not allowed to read.
To support the performance diagnostics, though, your database is probably churning away constantly dumping all sorts of useful data into the memory structures and tables that you are not allowed to access.
But that’s no longer a problem – it looks as if you can disable the AWR collection very easily in 10.2 with the following procedure call:

execute dbms_workload_repository.modify_snapshot_settings(interval => 0)


There’s just one problem with this – you can’t run this package unless you’re licensed to run the AWR. So if you want to disable the AWR, it looks like you have to pay to run it first.

Monday 5 December 2011

Clone Oracle DATABASE

Don't forget the steps to clone the Oracle Database

STEP 1: 
SQL> create pfile from spfile;
SQL > alter database backup controlfile to trace;
Get the last trace file from udump and edit as below and save as control.ctl
Use the Second part
STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "OLDLSQ" NORESETLOGS
NOARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 2
MAXDATAFILES 240
MAXINSTANCES 1
MAXLOGHISTORY 113
LOGFILE
GROUP 1 ('/u03/oradata/oldlsq/log1a.dbf',
'/u03/oradata/olslsq/log1b.dbf') SIZE 30M,
GROUP 2 ('/u04/oradata/oldlsq/log2a.dbf',
'/u04/oradata/oldlsq/log2b.dbf') SIZE 30M
DATAFILE
'/u01/oradata/oldlsq/system01.dbf',
'/u01/oradata/oldlsq/mydatabase.dbf'
;

 
STEP 2: Shutdown the old database

STEP 3:  copy datafiles, tempfiles,redo to new location, Also copy password file,initOra.file.
STEP 4: Create the bdump, udump and cdump directories
             
STEP 5: Edit controlfile per new location and also change below term.

Old:
CREATE CONTROLFILE REUSE DATABASE "OLDLSQ" RESETLOGS
New:
CREATE CONTROLFILE SET DATABASE "NEWLSQ" RESETLOGS
STEP 6: Edit pfile as per  new location. 
STEP 7: follow below steps to start database.
Check $ORACLE_SID(new sid)
Delete spfileNewSID if exist.
SQL> startup nomount;
SQL> @control.ctl
SQL>  alter database open resetlogs;
n  Add temporary tablespace ( use traced controlfile to get the syntax)
SQL> create spfile from pfile;
SQL > startup force;

Thursday 1 December 2011

Minimal X11 Client on CentOS/REHL 5


To run X client apps remotely on CentOS5 from your X server requires installation of a couple of small packages.
yum install xorg-x11-apps — installed with dependancies to get basic X11 client components. Also includes xeyes and xclock, useful for testing.
yum install xorg-x11-xauth — needed for ssh authentication.
ssh -X user@client
xclock