Monday, August 15, 2016

what are the input source for SQL tunning advisor in oracle database?

SQL tuning advisor inputs:


1.addm
2.awr
3.cursor cache
4.STS(SQL tuning Sets)

what are the statements we can apply SQL profiles in oracle database?

SQL Profiles apply to the following statement types:


SELECT statements
UPDATE statements
INSERT statements (only with a SELECT clause)
DELETE statements
CREATE TABLE statements (only with the AS SELECT clause)
MERGE statements (the update or insert operations)

Thursday, August 4, 2016

what is the pre-request for converting standby database to max protection & max availability?

Here is the pre-request for converting standby database to Max.availability & Max Protection

1)need to create Standby Redo log
2)DB  Flashback would be turned ON
3)Log Transport mode should be SYNC

Wednesday, August 3, 2016

script to find out wait event objects in oracle database.

Steps to get the wait event object name

select event,p1,p2,p3 from V$session_wait where
sid in (select sid from v$session where username='BALA');

where P1--file# P2 block number


define __FILE = &1
define __BLOCK = &2

select segment_name from dba_extents where file_id = &__FILE
and &__BLOCK between block_id and block_id + blocks - 1 and rownum = 1 ;

set echo on

Friday, July 29, 2016

Steps to restore oracle database using RMAN & resetting the incarnation.

Steps to restore oracle database using RMAN & resetting the incarnation.

Step#1
Connect to the rman & identify the backup piece
<server_name>:<OSuser_name> 49> rman target /

Recovery Manager: Release 11.2.0.3.0 - Production on Sun Jul 17 22:21:14 2016

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: <DB_name> (not mounted)

RMAN> connect catalog rman/****@RCAT;

connected to recovery catalog database

Database needs to be in nomunt state.

Step#2
Restore the ctl file
RMAN> restore controlfile from '/tmp/DD_Backup/<server_name>/<DB_name>/database/<DB_name>_ctl_spfile_c-238613855-20160717-05';

Starting restore at 17-JUL-16
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=317 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=380 device type=DISK

channel ORA_DISK_2: skipped, AUTOBACKUP already found
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:15
output file name=/oracle/<DB_name>/control1/cntrl<DB_name>.dbf
output file name=/oracle/<DB_name>/control2/cntrl<DB_name>.dbf
output file name=/oracle/<DB_name>/control3/cntrl<DB_name>.dbf
Finished restore at 17-JUL-16

RMAN> alter database mount;

database mounted
released channel: ORA_DISK_1
released channel: ORA_DISK_2
step #3 check the incarnation & reset the incarnation to use old backups
RMAN> list incarnation of database <DB_name>;


List of Database Incarnations
DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
------- ------- -------- ---------------- --- ---------- ----------
3038857 3038858 <DB_name>      238613855        PARENT  1          10-JAN-11
3038857 25197016 <DB_name>      238613855        CURRENT 220087209  17-JUL-16

RMAN> reset database to incarnation 3038858;

database reset to incarnation 3038858

RMAN>
Step#3 restore the DB where the app team wants to rollforward
RMAN> run
{
allocate channel dev1 type disk;
allocate channel dev2 type disk;
set until time "to_date('2016-07-17:09:00:00', 'yyyy-mm-dd:hh24:mi:ss')";
restore database;
recover database;
release channel dev1;
release channel dev2;
}
2> 3> 4> 5> 6> 7> 8> 9> 10>
allocated channel: dev1
channel dev1: SID=317 device type=DISK

allocated channel: dev2
channel dev2: SID=380 device type=DISK

executing command: SET until clause

Starting restore at 17-JUL-16

channel dev1: starting datafile backup set restore
channel dev1: specifying datafile(s) to restore from backup set
channel dev1: restoring datafile 00002 to /oracle/<DB_name>/sapdata888/undo_1/undo.data1
channel dev1: reading from backup piece /tmp/DD_Backup/<server_name>/<DB_name>/database/DF_<DB_name>_2016_07_17_08_00_6307_1_917424023_53rathsn_1_1
channel dev2: starting datafile backup set restore
channel dev2: specifying datafile(s) to restore from backup set
channel dev2: restoring datafile 00005 to /oracle/<DB_name>/sapdata1/user_1/user.data1
channel dev2: reading from backup piece /tmp/DD_Backup/<server_name>/<DB_name>/database/DF_<DB_name>_2016_07_17_08_00_6309_1_917424078_55rathue_1_1
channel dev2: piece handle=/tmp/DD_Backup/<server_name>/<DB_name>/database/DF_<DB_name>_2016_07_17_08_00_6309_1_917424078_55rathue_1_1 tag=TAG20160717T080023
channel dev2: restored backup piece 1
channel dev2: restore complete, elapsed time: 00:00:26
channel dev2: starting datafile backup set restore
channel dev2: specifying datafile(s) to restore from backup set
channel dev2: restoring datafile 00001 to /oracle/<DB_name>/sapdata777/system_1/system.data1
channel dev2: reading from backup piece /tmp/DD_Backup/<server_name>/<DB_name>/database/DF_<DB_name>_2016_07_17_08_00_6310_1_917424086_56rathum_1_1
channel dev2: piece handle=/tmp/DD_Backup/<server_name>/<DB_name>/database/DF_<DB_name>_2016_07_17_08_00_6310_1_917424086_56rathum_1_1 tag=TAG20160717T080023
channel dev2: restored backup piece 1
channel dev2: restore complete, elapsed time: 00:00:35
channel dev2: starting datafile backup set restore
channel dev2: specifying datafile(s) to restore from backup set
channel dev2: restoring datafile 00003 to /oracle/<DB_name>/sapdata777/sysaux_1/sysaux.data1
channel dev2: reading from backup piece /tmp/DD_Backup/<server_name>/<DB_name>/database/DF_<DB_name>_2016_07_17_08_00_6311_1_917424181_57rati1l_1_1
channel dev1: piece handle=/tmp/DD_Backup/<server_name>/<DB_name>/database/DF_<DB_name>_2016_07_17_08_00_6307_1_917424023_53rathsn_1_1 tag=TAG20160717T080023
channel dev1: restored backup piece 1
channel dev1: restore complete, elapsed time: 00:01:04
channel dev1: starting datafile backup set restore
channel dev1: specifying datafile(s) to restore from backup set
channel dev1: restoring datafile 00004 to /oracle/<DB_name>/sapdata1/sr3db_1/sr3db.data1
channel dev1: reading from backup piece /tmp/DD_Backup/<server_name>/<DB_name>/database/DF_<DB_name>_2016_07_17_08_00_6308_1_917424023_54rathsn_1_1
channel dev2: piece handle=/tmp/DD_Backup/<server_name>/<DB_name>/database/DF_<DB_name>_2016_07_17_08_00_6311_1_917424181_57rati1l_1_1 tag=TAG20160717T080023
channel dev2: restored backup piece 1
channel dev2: restore complete, elapsed time: 00:00:27
channel dev1: piece handle=/tmp/DD_Backup/<server_name>/<DB_name>/database/DF_<DB_name>_2016_07_17_08_00_6308_1_917424023_54rathsn_1_1 tag=TAG20160717T080023
channel dev1: restored backup piece 1
channel dev1: restore complete, elapsed time: 00:02:15
Finished restore at 17-JUL-16

Starting recover at 17-JUL-16

starting media recovery

archived log for thread 1 with sequence 16600 is already on disk as file /oracle/<DB_name>/oraarch/<DB_name>arch1_16600_740086239.dbf
channel dev1: starting archived log restore to default destination
channel dev1: restoring archived log
archived log thread=1 sequence=16598
channel dev1: reading from backup piece /tmp/DD_Backup/<server_name>/<DB_name>/archivelog/AL_<DB_name>_2016_07_17_08_00_6313_1_917424329_59rati69_1_1
channel dev2: starting archived log restore to default destination
channel dev2: restoring archived log
archived log thread=1 sequence=16599
channel dev2: reading from backup piece /tmp/DD_Backup/<server_name>/<DB_name>/archivelog/AL_<DB_name>_2016_07_17_08_00_6314_1_917424329_5arati69_1_1
channel dev2: piece handle=/tmp/DD_Backup/<server_name>/<DB_name>/archivelog/AL_<DB_name>_2016_07_17_08_00_6314_1_917424329_5arati69_1_1 tag=TAG20160717T080528
channel dev2: restored backup piece 1
channel dev2: restore complete, elapsed time: 00:00:02
channel dev1: piece handle=/tmp/DD_Backup/<server_name>/<DB_name>/archivelog/AL_<DB_name>_2016_07_17_08_00_6313_1_917424329_59rati69_1_1 tag=TAG20160717T080528
channel dev1: restored backup piece 1
channel dev1: restore complete, elapsed time: 00:00:08
archived log file name=/oracle/<DB_name>/oraarch/<DB_name>arch1_16598_740086239.dbf thread=1 sequence=16598
archived log file name=/oracle/<DB_name>/oraarch/<DB_name>arch1_16599_740086239.dbf thread=1 sequence=16599
archived log file name=/oracle/<DB_name>/oraarch/<DB_name>arch1_16600_740086239.dbf thread=1 sequence=16600
media recovery complete, elapsed time: 00:00:05
Finished recover at 17-JUL-16

released channel: dev1

released channel: dev2

RMAN> alter database open RESETLOGS;

database opened
new incarnation of database registered in recovery catalog
starting full resync of recovery catalog
full resync complete

step#4
Take a full backup of database once database is open.

Wednesday, May 4, 2016

step by step to drop table space in oracle SAP database using BRTOOLS

SERVER_NAME:oraTEST 10> brtools
BR0651I BRTOOLS 7.00 (32)

BR0280I BRTOOLS time stamp: 2016-05-04 14.07.09
BR0656I Choice menu 1 - please make a selection
-------------------------------------------------------------------------------
BR*Tools main menu

 1 = Instance management
 2 - Space management
 3 - Segment management
 4 - Backup and database copy
 5 - Restore and recovery
 6 - Check and verification
 7 - Database statistics
 8 - Additional functions
 9 - Exit program

Standard keys: c - cont, b - back, s - stop, r - refr, h - help
-------------------------------------------------------------------------------
BR0662I Enter your choice:
2
BR0280I BRTOOLS time stamp: 2016-05-04 14.07.10
BR0663I Your choice: '2'

BR0280I BRTOOLS time stamp: 2016-05-04 14.07.10
BR0656I Choice menu 5 - please make a selection
-------------------------------------------------------------------------------
Database space management

 1 = Extend tablespace
 2 - Create tablespace
 3 - Drop tablespace
 4 - Alter tablespace
 5 - Alter data file
 6 - Move data file
 7 - Additional space functions
 8 - Reset program status

Standard keys: c - cont, b - back, s - stop, r - refr, h - help
-------------------------------------------------------------------------------
BR0662I Enter your choice:
3
BR0280I BRTOOLS time stamp: 2016-05-04 14.07.17
BR0663I Your choice: '3'

BR0280I BRTOOLS time stamp: 2016-05-04 14.07.17
BR0657I Input menu 83 - please check/enter input values
-------------------------------------------------------------------------------
BRSPACE options for drop tablespace

 1 - BRSPACE profile (profile) ...... [initTEST.sap]
 2 - Database user/password (user) .. [/]
 3 ~ Tablespace name (tablespace) ... []
 4 - Confirmation mode (confirm) .... [yes]
 5 - Scrolling line count (scroll) .. [20]
 6 - Message language (language) .... [E]
 7 - BRSPACE command line (command) . [-p initTEST.sap -s 20 -l E -f tsdrop]

Standard keys: c - cont, b - back, s - stop, r - refr, h - help
-------------------------------------------------------------------------------
BR0662I Enter your choice:
3
BR0280I BRTOOLS time stamp: 2016-05-04 14.07.19
BR0663I Your choice: '3'

BR0280I BRTOOLS time stamp: 2016-05-04 14.07.19
BR0681I Enter string value for "tablespace" []:
PSAPTEST
BR0280I BRTOOLS time stamp: 2016-05-04 14.07.24
BR0683I New value for "tablespace": 'PSAPTEST'

BR0280I BRTOOLS time stamp: 2016-05-04 14.07.24
BR0657I Input menu 83 - please check/enter input values
-------------------------------------------------------------------------------
BRSPACE options for drop tablespace

 1 - BRSPACE profile (profile) ...... [initTEST.sap]
 2 - Database user/password (user) .. [/]
 3 ~ Tablespace name (tablespace) ... [PSAPTEST]
 4 - Confirmation mode (confirm) .... [yes]
 5 - Scrolling line count (scroll) .. [20]
 6 - Message language (language) .... [E]
 7 - BRSPACE command line (command) . [-p initTEST.sap -s 20 -l E -f tsdrop -t PSAPTEST]

Standard keys: c - cont, b - back, s - stop, r - refr, h - help
-------------------------------------------------------------------------------
BR0662I Enter your choice:
4
BR0280I BRTOOLS time stamp: 2016-05-04 14.07.39
BR0663I Your choice: '4'

BR0280I BRTOOLS time stamp: 2016-05-04 14.07.39
BR0681I Enter string value for "confirm" (yes|no|force) [yes]:

BR0280I BRTOOLS time stamp: 2016-05-04 14.07.58
BR0683I New value for "confirm": 'no'

BR0280I BRTOOLS time stamp: 2016-05-04 14.07.58
BR0657I Input menu 83 - please check/enter input values
-------------------------------------------------------------------------------
BRSPACE options for drop tablespace

 1 - BRSPACE profile (profile) ...... [initTEST.sap]
 2 - Database user/password (user) .. [/]
 3 ~ Tablespace name (tablespace) ... [PSAPTEST]
 4 - Confirmation mode (confirm) .... [no]
 5 - Scrolling line count (scroll) .. [20]
 6 - Message language (language) .... [E]
 7 - BRSPACE command line (command) . [-p initTEST.sap -c -s 20 -l E -f tsdrop -t PSAPTEST]

Standard keys: c - cont, b - back, s - stop, r - refr, h - help
-------------------------------------------------------------------------------
BR0662I Enter your choice:
c
BR0280I BRTOOLS time stamp: 2016-05-04 14.08.05
BR0663I Your choice: 'c'
BR0259I Program execution will be continued...

BR0291I BRSPACE will be started with options '-p initTEST.sap -c -s 20 -l E -f tsdrop -t PSAPTEST'

BR0280I BRTOOLS time stamp: 2016-05-04 14.08.05
BR0670I Enter 'c[ont]' to continue, 'b[ack]' to go back, 's[top]' to abort:
c
BR0280I BRTOOLS time stamp: 2016-05-04 14.08.17
BR0257I Your reply: 'c'
BR0259I Program execution will be continued...

###############################################################################

BR1001I BRSPACE 7.00 (32)
BR1002I Start of BRSPACE processing: setcdtev.tsd 2016-05-04 14.08.17
BR0484I BRSPACE log file: /oracle/TEST/sapreorg/setcdtev.tsd

BR0280I BRSPACE time stamp: 2016-05-04 14.08.17
BR1009I Name of database instance: TEST
BR1010I BRSPACE action ID: setcdtev
BR1011I BRSPACE function ID: tsd
BR1012I BRSPACE function: tsdrop
BR0126I Unattended mode active - no operator confirmation required

BR0280I BRSPACE time stamp: 2016-05-04 14.08.17
BR0657I Input menu 310 - please check/enter input values
-------------------------------------------------------------------------------
Options for dropping of tablespace PSAPTEST

 1 * Number of files in tablespace (files) . [1]
 2 * Total tablespace size in MB (size) .... [100]
 3 - Force tablespace drop (force) ......... [no]
 4 - SQL command (command) ................. [drop tablespace PSAPTEST]

Standard keys: c - cont, b - back, s - stop, r - refr, h - help
-------------------------------------------------------------------------------
BR0662I Enter your choice:
c
BR0280I BRSPACE time stamp: 2016-05-04 14.08.41
BR0663I Your choice: 'c'
BR0259I Program execution will be continued...

BR0280I BRSPACE time stamp: 2016-05-04 14.08.42
BR1070I Searching for segments in tablespace PSAPTEST...
BR0285I This function can take several seconds/minutes - be patient...

BR0280I BRSPACE time stamp: 2016-05-04 14.08.42
BR1071I Tablespace PSAPTEST is empty

BR0280I BRSPACE time stamp: 2016-05-04 14.08.42
BR0370I Directory /oracle/TEST/sapreorg/setcdtev created

BR0280I BRSPACE time stamp: 2016-05-04 14.08.42
BR0319I Control file copy created: /oracle/TEST/sapreorg/setcdtev/cntrlTEST.old 16302080

BR0280I BRSPACE time stamp: 2016-05-04 14.08.42
BR0768I Tablespace PSAPTEST set OFFLINE

BR0280I BRSPACE time stamp: 2016-05-04 14.08.42
BR1090I Dropping tablespace PSAPTEST...

BR0280I BRSPACE time stamp: 2016-05-04 14.08.42
BR1016I SQL statement 'drop tablespace PSAPTEST' executed successfully
BR1069I Tablespace PSAPTEST dropped successfully

BR0280I BRSPACE time stamp: 2016-05-04 14.08.42
BR0794I Database file /oracle/TEST/sapdata3/test_1/test.data1 deleted
BR0480I Directory /oracle/TEST/sapdata3/test_1 deleted

BR0280I BRSPACE time stamp: 2016-05-04 14.08.42
BR0340I Switching to next online redo log file for database instance TEST ...
BR0321I Switch to next online redo log file for database instance TEST successful

BR0280I BRSPACE time stamp: 2016-05-04 14.08.42
BR0319I Control file copy created: /oracle/TEST/sapreorg/setcdtev/cntrlTEST.new 16302080

BR0280I BRSPACE time stamp: 2016-05-04 14.08.42
BR1020I Number of tablespaces processed: 1
BR1003I BRSPACE function 'tsdrop' completed

BR1008I End of BRSPACE processing: setcdtev.tsd 2016-05-04 14.08.42
BR0280I BRSPACE time stamp: 2016-05-04 14.08.42
BR1005I BRSPACE completed successfully

###############################################################################

BR0292I Execution of BRSPACE finished with return code 0

BR0280I BRTOOLS time stamp: 2016-05-04 14.08.42
BR0256I Enter 'c[ont]' to continue, 's[top]' to cancel BRTOOLS:
s
BR0280I BRTOOLS time stamp: 2016-05-04 14.09.04
BR0257I Your reply: 's'
BR0679I Do you really want to cancel BRTOOLS? Enter y[es]/n[o]:
y
BR0280I BRTOOLS time stamp: 2016-05-04 14.09.06
BR0257I Your reply: 'y'
BR0260E BRTOOLS cancelled by user

BR0280I BRTOOLS time stamp: 2016-05-04 14.09.06
BR0654I BRTOOLS terminated with errors

steps to create new table space in oracle SAP database using BRTOOLS

I have tried to create table-space with "TEST" ,but the system is NOT allowing and we have to create Table space  starting with PSAP and TBS name should be minimum 7 character length.

Here is the step to create NEW table space in Oracle SAP Database.

SERVER_NAME:oraTEST 35> brtools
BR0651I BRTOOLS 7.00 (32)

BR0280I BRTOOLS time stamp: 2015-05-04 13.46.10
BR0656I Choice menu 1 - please make a selection
-------------------------------------------------------------------------------
BR*Tools main menu

 1 = Instance management
 2 - Space management
 3 - Segment management
 4 - Backup and database copy
 5 - Restore and recovery
 6 - Check and verification
 7 - Database statistics
 8 - Additional functions
 9 - Exit program

Standard keys: c - cont, b - back, s - stop, r - refr, h - help
-------------------------------------------------------------------------------
BR0662I Enter your choice:
2
BR0280I BRTOOLS time stamp: 2015-05-04 13.46.13
BR0663I Your choice: '2'

BR0280I BRTOOLS time stamp: 2015-05-04 13.46.13
BR0656I Choice menu 5 - please make a selection
-------------------------------------------------------------------------------
Database space management

 1 = Extend tablespace
 2 - Create tablespace
 3 - Drop tablespace
 4 - Alter tablespace
 5 - Alter data file
 6 - Move data file
 7 - Additional space functions
 8 - Reset program status

Standard keys: c - cont, b - back, s - stop, r - refr, h - help
-------------------------------------------------------------------------------
BR0662I Enter your choice:
2
BR0280I BRTOOLS time stamp: 2015-05-04 13.46.15
BR0663I Your choice: '2'

BR0280I BRTOOLS time stamp: 2015-05-04 13.46.15
BR0657I Input menu 82 - please check/enter input values
-------------------------------------------------------------------------------
BRSPACE options for create tablespace

 1 - BRSPACE profile (profile) ...... [initTEST.sap]
 2 - Database user/password (user) .. [/]
 3 ~ Tablespace name (tablespace) ... []
 4 - Confirmation mode (confirm) .... [yes]
 5 - Scrolling line count (scroll) .. [20]
 6 - Message language (language) .... [E]
 7 - BRSPACE command line (command) . [-p initTEST.sap -s 20 -l E -f tscreate]

Standard keys: c - cont, b - back, s - stop, r - refr, h - help
-------------------------------------------------------------------------------
BR0662I Enter your choice:
3
BR0280I BRTOOLS time stamp: 2015-05-04 13.46.19
BR0663I Your choice: '3'

BR0280I BRTOOLS time stamp: 2015-05-04 13.46.19
BR0681I Enter string value for "tablespace" []:
PSAPTEST
BR0280I BRTOOLS time stamp: 2015-05-04 13.46.27
BR0683I New value for "tablespace": 'PSAPTEST'

BR0280I BRTOOLS time stamp: 2015-05-04 13.46.27
BR0657I Input menu 82 - please check/enter input values
-------------------------------------------------------------------------------
BRSPACE options for create tablespace

 1 - BRSPACE profile (profile) ...... [initTEST.sap]
 2 - Database user/password (user) .. [/]
 3 ~ Tablespace name (tablespace) ... [PSAPTEST]
 4 - Confirmation mode (confirm) .... [yes]
 5 - Scrolling line count (scroll) .. [20]
 6 - Message language (language) .... [E]
 7 - BRSPACE command line (command) . [-p initTEST.sap -s 20 -l E -f tscreate -t PSAPTEST]

Standard keys: c - cont, b - back, s - stop, r - refr, h - help
-------------------------------------------------------------------------------
BR0662I Enter your choice:
c
BR0280I BRTOOLS time stamp: 2015-05-04 13.46.33
BR0663I Your choice: 'c'
BR0259I Program execution will be continued...

BR0291I BRSPACE will be started with options '-p initTEST.sap -s 20 -l E -f tscreate -t PSAPTEST'

BR0280I BRTOOLS time stamp: 2015-05-04 13.46.33
BR0670I Enter 'c[ont]' to continue, 'b[ack]' to go back, 's[top]' to abort:
c
BR0280I BRTOOLS time stamp: 2015-05-04 13.46.35
BR0257I Your reply: 'c'
BR0259I Program execution will be continued...

###############################################################################

BR1001I BRSPACE 7.00 (32)
BR1002I Start of BRSPACE processing: setcdrgt.tsc 2015-05-04 13.46.35
BR0484I BRSPACE log file: /oracle/TEST/sapreorg/setcdrgt.tsc

BR0280I BRSPACE time stamp: 2015-05-04 13.46.35
BR1009I Name of database instance: TEST
BR1010I BRSPACE action ID: setcdrgt
BR1011I BRSPACE function ID: tsc
BR1012I BRSPACE function: tscreate

BR0280I BRSPACE time stamp: 2015-05-04 13.46.35
BR0657I Input menu 305 - please check/enter input values
-------------------------------------------------------------------------------
Main options for creation of tablespace in database TEST

 1 - Tablespace name (tablespace) ......... [PSAPTEST]
 2 - Tablespace contents (contents) ....... [data]
 3 - Segment space management (space) ..... [auto]
 4 # Database owner of tablespace (owner) . []
 5 # Table data class / tabart (class) .... []
 6 - Data type in tablespace (data) ....... [both]
 7 # Joined index/table tablespace (join) . []
 8 ~ Uniform size in MB (uniform) ......... []

Standard keys: c - cont, b - back, s - stop, r - refr, h - help
-------------------------------------------------------------------------------
BR0662I Enter your choice:
c
BR0280I BRSPACE time stamp: 2015-05-04 13.46.40
BR0663I Your choice: 'c'
BR0259I Program execution will be continued...

BR0280I BRSPACE time stamp: 2015-05-04 13.46.40
BR0657I Input menu 306 - please check/enter input values
-------------------------------------------------------------------------------
Space options for creation of tablespace PSAPTEST (1. file)

 1 - Tablespace file name (file) .......... [/oracle/TEST/sapdata3/test_1/test.data1]
 2 ~ Raw disk / link target (rawlink) ..... []
 3 - File size in MB (size) ............... [100]
 4 - File autoextend mode (autoextend) .... [no]
 5 # Maximum file size in MB (maxsize) .... []
 6 # File increment size in MB (incrsize) . []
 7 - SQL command (command) ................ [create tablespace PSAPTEST extent management local autoallocate segment space management auto datafile '/oracle/TEST/sapdata3/test_1/test.data1' size 100M autoextend off]

Standard keys: c - cont, b - back, s - stop, r - refr, h - help
-------------------------------------------------------------------------------
BR0662I Enter your choice:
c
BR0280I BRSPACE time stamp: 2015-05-04 13.46.51
BR0663I Your choice: 'c'
BR0259I Program execution will be continued...

BR0280I BRSPACE time stamp: 2015-05-04 13.46.51
BR1091I Next data file can be specified now

BR0675I Do you want to perform this action?
BR0676I Enter 'y[es]' to perform the action, 'n[o]/c[ont]' to skip it, 's[top]' to abort:
n
BR0280I BRSPACE time stamp: 2015-05-04 13.46.54
BR0257I Your reply: 'n'
BR0678I The action will be skipped...

BR0280I BRSPACE time stamp: 2015-05-04 13.46.54
BR0370I Directory /oracle/TEST/sapreorg/setcdrgt created

BR0280I BRSPACE time stamp: 2015-05-04 13.46.54
BR0319I Control file copy created: /oracle/TEST/sapreorg/setcdrgt/cntrlTEST.old 16302080

BR0280I BRSPACE time stamp: 2015-05-04 13.46.54
BR0370I Directory /oracle/TEST/sapdata3/test_1 created

BR0280I BRSPACE time stamp: 2015-05-04 13.46.54
BR1089I Creating tablespace PSAPTEST...

BR0280I BRSPACE time stamp: 2015-05-04 13.46.55
BR1016I SQL statement 'create tablespace PSAPTEST extent management local autoallocate segment space management auto datafile '/oracle/TEST/sapdata3/test_1/test.data1' size 100M autoextend off' executed successfully
BR1060I Tablespace PSAPTEST created successfully with file: /oracle/TEST/sapdata3/test_1/test.data1 100M

BR0280I BRSPACE time stamp: 2015-05-04 13.46.55
BR0340I Switching to next online redo log file for database instance TEST ...
BR0321I Switch to next online redo log file for database instance TEST successful

BR0280I BRSPACE time stamp: 2015-05-04 13.46.55
BR0319I Control file copy created: /oracle/TEST/sapreorg/setcdrgt/cntrlTEST.new 16302080

BR0280I BRSPACE time stamp: 2015-05-04 13.46.55
BR0670I Enter 'c[ont]' to continue, 'b[ack]' to go back, 's[top]' to abort:
s
BR0280I BRSPACE time stamp: 2015-05-04 13.47.02
BR0257I Your reply: 's'
BR0679I Do you really want to cancel BRSPACE? Enter y[es]/n[o]:
y
BR0280I BRSPACE time stamp: 2015-05-04 13.47.08
BR0258W Wrong reply: 'y'
BR0679I Do you really want to cancel BRSPACE? Enter y[es]/n[o]:
y
BR0280I BRSPACE time stamp: 2015-05-04 13.47.11
BR0257I Your reply: 'y'
BR0260E BRSPACE cancelled by user

BR1008I End of BRSPACE processing: setcdrgt.tsc 2015-05-04 13.47.11
BR0280I BRSPACE time stamp: 2015-05-04 13.47.11
BR1007I BRSPACE terminated with errors

###############################################################################

BR0292I Execution of BRSPACE finished with return code 4

BR0668I Warnings or errors occurred - you can continue to ignore them or go back to repeat the last action

BR0280I BRTOOLS time stamp: 2015-05-04 13.47.11
BR0670I Enter 'c[ont]' to continue, 'b[ack]' to go back, 's[top]' to abort:
s
BR0280I BRTOOLS time stamp: 2015-05-04 13.47.13
BR0257I Your reply: 's'
BR0679I Do you really want to cancel BRTOOLS? Enter y[es]/n[o]:
y
BR0280I BRTOOLS time stamp: 2015-05-04 13.47.15
BR0257I Your reply: 'y'
BR0260E BRTOOLS cancelled by user

BR0280I BRTOOLS time stamp: 2015-05-04 13.47.15
BR0654I BRTOOLS terminated with errors
SERVER_NAME:oraTEST 36>

Tuesday, May 3, 2016

steps to add data file to table space in SAP oracle database using BRTOOLS

Here is the list of steps to follow to add data file in existing table space.
extending Tablespace size was differant in oracle SAP DB

SERVER_NAME:oraTEST 2> brtools
BR0651I BRTOOLS 7.00 (32)

BR0280I BRTOOLS time stamp: 2015-05-03 14.21.41
BR0656I Choice menu 1 - please make a selection
-------------------------------------------------------------------------------
BR*Tools main menu

 1 = Instance management
 2 - Space management
 3 - Segment management
 4 - Backup and database copy
 5 - Restore and recovery
 6 - Check and verification
 7 - Database statistics
 8 - Additional functions
 9 - Exit program

Standard keys: c - cont, b - back, s - stop, r - refr, h - help
-------------------------------------------------------------------------------
BR0662I Enter your choice:
2
BR0280I BRTOOLS time stamp: 2015-05-03 14.21.49
BR0663I Your choice: '2'

BR0280I BRTOOLS time stamp: 2015-05-03 14.21.49
BR0656I Choice menu 5 - please make a selection
-------------------------------------------------------------------------------
Database space management

 1 = Extend tablespace
 2 - Create tablespace
 3 - Drop tablespace
 4 - Alter tablespace
 5 - Alter data file
 6 - Move data file
 7 - Additional space functions
 8 - Reset program status

Standard keys: c - cont, b - back, s - stop, r - refr, h - help
-------------------------------------------------------------------------------
BR0662I Enter your choice:
1
BR0280I BRTOOLS time stamp: 2015-05-03 14.21.53
BR0663I Your choice: '1'

BR0280I BRTOOLS time stamp: 2015-05-03 14.21.53
BR0657I Input menu 81 - please check/enter input values
-------------------------------------------------------------------------------
BRSPACE options for tablespace extension

 1 - BRSPACE profile (profile) ...... [initTEST.sap]
 2 - Database user/password (user) .. [/]
 3 ~ Tablespace name (tablespace) ... []
 4 - Confirmation mode (confirm) .... [yes]
 5 - Scrolling line count (scroll) .. [20]
 6 - Message language (language) .... [E]
 7 - BRSPACE command line (command) . [-p initTEST.sap -s 20 -l E -f tsextend]

Standard keys: c - cont, b - back, s - stop, r - refr, h - help
-------------------------------------------------------------------------------
BR0662I Enter your choice:
3
BR0280I BRTOOLS time stamp: 2015-05-03 14.21.56
BR0663I Your choice: '3'

BR0280I BRTOOLS time stamp: 2015-05-03 14.21.56
BR0681I Enter string value for "tablespace" []:
PSAPSR3DB
BR0280I BRTOOLS time stamp: 2015-05-03 14.22.11
BR0683I New value for "tablespace": 'PSAPSR3DB'

BR0280I BRTOOLS time stamp: 2015-05-03 14.22.11
BR0657I Input menu 81 - please check/enter input values
-------------------------------------------------------------------------------
BRSPACE options for tablespace extension

 1 - BRSPACE profile (profile) ...... [initTEST.sap]
 2 - Database user/password (user) .. [/]
 3 ~ Tablespace name (tablespace) ... [PSAPSR3DB]
 4 - Confirmation mode (confirm) .... [yes]
 5 - Scrolling line count (scroll) .. [20]
 6 - Message language (language) .... [E]
 7 - BRSPACE command line (command) . [-p initTEST.sap -s 20 -l E -f tsextend -t PSAPSR3DB]

Standard keys: c - cont, b - back, s - stop, r - refr, h - help
-------------------------------------------------------------------------------
BR0662I Enter your choice:
c
BR0280I BRTOOLS time stamp: 2015-05-03 14.22.15
BR0663I Your choice: 'c'
BR0259I Program execution will be continued...

BR0291I BRSPACE will be started with options '-p initTEST.sap -s 20 -l E -f tsextend -t PSAPSR3DB'

BR0280I BRTOOLS time stamp: 2015-05-03 14.22.15
BR0670I Enter 'c[ont]' to continue, 'b[ack]' to go back, 's[top]' to abort:
c
BR0280I BRTOOLS time stamp: 2015-05-03 14.22.19
BR0257I Your reply: 'c'
BR0259I Program execution will be continued...

###############################################################################

BR1001I BRSPACE 7.00 (32)
BR1002I Start of BRSPACE processing: setbywqd.tse 2015-05-03 14.22.19
BR0484I BRSPACE log file: /oracle/TEST/sapreorg/setbywqd.tse

BR0280I BRSPACE time stamp: 2015-05-03 14.22.19
BR1009I Name of database instance: TEST
BR1010I BRSPACE action ID: setbywqd
BR1011I BRSPACE function ID: tse
BR1012I BRSPACE function: tsextend

BR0280I BRSPACE time stamp: 2015-05-03 14.22.20
BR0657I Input menu 303 - please check/enter input values
-------------------------------------------------------------------------------
Options for extension of tablespace PSAPSR3DB (1. file)

 1 * Last added file name (lastfile) ....... [/oracle/TEST/sapdata3/sr3db_3/sr3db.data3]
 2 * Last added file size in MB (lastsize) . [1000]
 3 - New file to be added (file) ........... [/oracle/TEST/sapdata3/sr3db_4/sr3db.data4]
 4 ~ Raw disk / link target (rawlink) ...... []
 5 - Size of the new file in MB (size) ..... [1000]
 6 - File autoextend mode (autoextend) ..... [no]
 7 # Maximum file size in MB (maxsize) ..... []
 8 # File increment size in MB (incrsize) .. []
 9 - SQL command (command) ................. [alter tablespace PSAPSR3DB add datafile '/oracle/TEST/sapdata3/sr3db_4/sr3db.data4' size 1000M autoextend off]

Standard keys: c - cont, b - back, s - stop, r - refr, h - help
-------------------------------------------------------------------------------
BR0662I Enter your choice:
5
BR0280I BRSPACE time stamp: 2015-05-03 14.22.51
BR0663I Your choice: '5'

BR0280I BRSPACE time stamp: 2015-05-03 14.22.51
BR0682I Enter integer value for "size" (1-32767) [1000]:
100
BR0280I BRSPACE time stamp: 2015-05-03 14.22.56
BR0683I New value for "size": '100'

BR0280I BRSPACE time stamp: 2015-05-03 14.22.56
BR0657I Input menu 303 - please check/enter input values
-------------------------------------------------------------------------------
Options for extension of tablespace PSAPSR3DB (1. file)

 1 * Last added file name (lastfile) ....... [/oracle/TEST/sapdata3/sr3db_3/sr3db.data3]
 2 * Last added file size in MB (lastsize) . [1000]
 3 - New file to be added (file) ........... [/oracle/TEST/sapdata3/sr3db_4/sr3db.data4]
 4 ~ Raw disk / link target (rawlink) ...... []
 5 - Size of the new file in MB (size) ..... [100]
 6 - File autoextend mode (autoextend) ..... [no]
 7 # Maximum file size in MB (maxsize) ..... []
 8 # File increment size in MB (incrsize) .. []
 9 - SQL command (command) ................. [alter tablespace PSAPSR3DB add datafile '/oracle/TEST/sapdata3/sr3db_4/sr3db.data4' size 100M autoextend off]

Standard keys: c - cont, b - back, s - stop, r - refr, h - help
-------------------------------------------------------------------------------
BR0662I Enter your choice:
c
BR0280I BRSPACE time stamp: 2015-05-03 14.23.00
BR0663I Your choice: 'c'
BR0259I Program execution will be continued...

BR0280I BRSPACE time stamp: 2015-05-03 14.23.00
BR1091I Next data file can be specified now

BR0675I Do you want to perform this action?
BR0676I Enter 'y[es]' to perform the action, 'n[o]/c[ont]' to skip it, 's[top]' to abort:
n
BR0280I BRSPACE time stamp: 2015-05-03 14.23.08
BR0257I Your reply: 'n'
BR0678I The action will be skipped...

BR0280I BRSPACE time stamp: 2015-05-03 14.23.08
BR0370I Directory /oracle/TEST/sapreorg/setbywqd created

BR0280I BRSPACE time stamp: 2015-05-03 14.23.08
BR0319I Control file copy created: /oracle/TEST/sapreorg/setbywqd/cntrlTEST.old 16302080

BR0280I BRSPACE time stamp: 2015-05-03 14.23.08
BR0370I Directory /oracle/TEST/sapdata3/sr3db_4 created

BR0280I BRSPACE time stamp: 2015-05-03 14.23.08
BR1088I Extending tablespace PSAPSR3DB...

BR0280I BRSPACE time stamp: 2015-05-03 14.23.09
BR1016I SQL statement 'alter tablespace PSAPSR3DB add datafile '/oracle/TEST/sapdata3/sr3db_4/sr3db.data4' size 100M autoextend off' executed successfully
BR1051I Tablespace PSAPSR3DB extended successfully with file: /oracle/TEST/sapdata3/sr3db_4/sr3db.data4 100M

BR0280I BRSPACE time stamp: 2015-05-03 14.23.09
BR0340I Switching to next online redo log file for database instance TEST ...
BR0321I Switch to next online redo log file for database instance TEST successful

BR0280I BRSPACE time stamp: 2015-05-03 14.23.09
BR0319I Control file copy created: /oracle/TEST/sapreorg/setbywqd/cntrlTEST.new 16302080

BR0280I BRSPACE time stamp: 2015-05-03 14.23.09
BR0670I Enter 'c[ont]' to continue, 'b[ack]' to go back, 's[top]' to abort:
s
BR0280I BRSPACE time stamp: 2015-05-03 14.23.22
BR0257I Your reply: 's'
BR0679I Do you really want to cancel BRSPACE? Enter y[es]/n[o]:
y
BR0280I BRSPACE time stamp: 2015-05-03 14.23.26
BR0257I Your reply: 'y'
BR0260E BRSPACE cancelled by user

BR1008I End of BRSPACE processing: setbywqd.tse 2015-05-03 14.23.26
BR0280I BRSPACE time stamp: 2015-05-03 14.23.26
BR1007I BRSPACE terminated with errors

###############################################################################

BR0292I Execution of BRSPACE finished with return code 4

BR0668I Warnings or errors occurred - you can continue to ignore them or go back to repeat the last action

BR0280I BRTOOLS time stamp: 2015-05-03 14.23.26
BR0670I Enter 'c[ont]' to continue, 'b[ack]' to go back, 's[top]' to abort:
s
BR0280I BRTOOLS time stamp: 2015-05-03 14.23.28
BR0257I Your reply: 's'
BR0679I Do you really want to cancel BRTOOLS? Enter y[es]/n[o]:
y
BR0280I BRTOOLS time stamp: 2015-05-03 14.23.30
BR0257I Your reply: 'y'
BR0260E BRTOOLS cancelled by user

BR0280I BRTOOLS time stamp: 2015-05-03 14.23.30
BR0654I BRTOOLS terminated with errors

usoak521:oraTEST 3>


Tuesday, April 26, 2016

command to collect full stats on oracle SAP database.

here is the command to collect full stats on Oracle SAP database.

brconnect -u / -c -f stats -t all -p 4

t---> all tables
f --> force
p-->paralellism

Wednesday, April 20, 2016

query eating more Temp space and throwing ORA-01652: unable to extend temp segment by even for one row


Hi All,
I had situation  when tried to fetch some amount of records from v$rman_backup_job_details,its keep eating lot of temp space and finally throws error on 10204.


ORA-01652: unable to extend temp segment by 256 in tablespace TEMP 

finally identified there was a bug and below is the work around.

you are likely to be running in to Bug 5466436

The workaround for this issue is to delete statistics from the X$KCCRSR ie:
exec dbms_stats.DELETE_TABLE_STATS('SYS','X$KCCRSR');
- this deletes the statistics on the fixed object  and
exec dbms_stats.LOCK_TABLE_STATS('SYS','X$KCCRSR');
- this locks that object so that statistics will not be collected in future.