Wednesday, 17 July 2013

Transportable tablespace for different datablock size(db block size)

Source:In this machine size of database block is 8K.
1) In source machine create one tablespace TTS and create user  TTS and assign default tablespace to TTS user as TTS tablespace.
2)exec dbms_tts.transport_set_check(‘TTS’);
3)Check for violations  using
Select * from transport_set_violations;
4)keep tablespace TTS in read only
Alter tablespace TTS read only;
5)$ exp file=tts.dmp TABLESPACES=TTS  TRANSPORT_TABLESPACE=Y
Username/password:- sys as sysdba
6)copy dumpfile and datafile to destination machine

Destination:- In this machine size of database block is 4K
Add following parameter in pfile
Db_8K_cache_size=200M
Perform import using below command
[oracle5@fed01 ~]$ imp file=tts.dmp TABLESPACES=TTS TRANSPORT_TABLESPACE=Y DATAF                                                                                        ILES='/u02/oradata/tts/tts01.dbf'
Import: Release 11.2.0.1.0 - Production on Thu Jul 18 04:25:22 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
Username: / as sysdba
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Export file created by EXPORT:V11.02.00 via conventional path
About to import transportable tablespace(s) metadata...
import done in US7ASCII character set and AL16UTF16 NCHAR character set
. importing SYS's objects into SYS
. importing SYS's objects into SYS
. importing TTS's objects into TTS
. . importing table   "TTS1"
. importing SYS's objects into SYS
Import terminated successfully without warnings.

Note If we don’t mention db_8k_cache_size in pfile it will give following error
Export file created by EXPORT:V11.02.00 via conventional path
About to import transportable tablespace(s) metadata...
import done in US7ASCII character set and AL16UTF16 NCHAR character set
. importing SYS's objects into SYS
. importing SYS's objects into SYS
IMP-00017: following statement failed with ORACLE error 29339:
 "BEGIN   sys.dbms_plugts.beginImpTablespace('TTS',5,'SYS',1,0,8192,1,322450,"
 "1,2147483645,8,128,8,0,1,2147483645,8,1197301176,1,4129,321958,NULL,0,0,NUL"
 "L,NULL); END;"
IMP-00003: ORACLE error 29339 encountered
ORA-29339: tablespace block size 8192 does not match configured block sizes
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 86
ORA-06512: at "SYS.DBMS_PLUGTS", line 1682
ORA-06512: at "SYS.DBMS_PLUGTS", line 1813
ORA-06512: at line 1
IMP-00000: Import terminated unsuccessfully
[oracle5@fed01 ~]$ oerr ora 29339
29339, 00000, "tablespace block size %s does not match configured block sizes"
// *Cause:  The block size of the tablespace to be plugged in or
//          created does not match the block sizes configured in the
//          database.
// *Action:Configure the appropriate cache for the block size of this
//         tablespace using one of the various (db_2k_cache_size,
//         db_4k_cache_size, db_8k_cache_size, db_16k_cache_size,
//         db_32K_cache_size) parameters.


Monday, 15 July 2013

oracle apps disable or enable maintenance mode in non interactive mode in oracle applications R12


To enable maintenance mode:

$ cd $AD_TOP/patch/115/sql
$ sqlplus apps/apps
$ @adsetmmd.sql enable;

To disable maintenance mode :

$ cd $AD_TOP/patch/115/sql
$ sqlplus apps/apps
$ @adsetmmd.sql disable;

To enable or disable maintenance mode  using adadmin

http://learnappsdbaskills.blogspot.in/2013/04/disable-maintenance-mode.html


How to speedup copying files using scp command in LINUX

scp output.dat 192.168.111.11:/tmp/               2%   27MB   5.2MB/s   03:01 ETA
scp -c blowfish output.dat 192.168.111.11:/tmp/ 6% 100MB 6.8MB/s 02:52 ETA
scp -c arcfour output.dat 192.168.111.11:/tmp/ 24% 235MB 7.2MB/s 01:42 ETA
To clear history in linux--------history -c

arcfour, blowfish, how to copy files faster in linux, imp command for dba, LINUX, Oracle, oracle dba, PERFORMANCE TUNING, scp, scp command in linux, scp make fast, speedup scp command, 

Saturday, 13 July 2013

Existing databases as of today..........


DBMSCompanyFrom
4th Dimension4D S.A.S1984
ADABASSoftware AG1970
Adaptive Server EnterpriseSybase1987
Advantage Database ServerSybase1992
AltibaseAltibase Corp.2000
Apache DerbyApache2004
AsqlMarko Tasic2009
DatacomCA Inc.---
DB2IBM1982
DBISAMElevate Software---
DatawaspSignificant Data Systems2008
ElevateDBElevate Software---
FileMakerFileMaker1984
FirebirdFirebird project2000
InformixIBM 1985
HSQLDBHSQL Development Group2001
H2H2 Software2005
IngresIngres Corp.1974
InterBaseCodeGear1985
LucidDBThe Eigenbase Project2007
MaxDBSAP AG---
Microsoft AccessMicrosoft1992
Microsoft Visual FoxproMicrosoft---
Microsoft SQL ServerMicrosoft1989
MonetDBThe MonetDB Developer Team2004
MySQLOracle Corporation(previously Sun)1996
HP NonStop SQLHP1987
Omnis StudioTigerLogic Inc1982
OpenBase SQLOpenBase International1991
OracleOracle Corporation1979
Oracle RdbOracle Corporation1984
OpenEdgeProgress Software
Corporation
1984
OpenLink VirtuosoOpenLink Software1998
Pervasive PSQL/BitrievePervasive Software---
Polyhedra DBMSENEA AB1993
PostgreSQLPostgreSQL Global
Development Group
1989
Pyrrho DBMSUniversity of Paisley2005
RBaseRBase---
RDM EmbeddedBirdstep Technology1984
RDM ServerBirdstep Technology1990
ScimoreDBScimore2005
SmallSQLSmallSQL2005
SQL AnywhereSybase1992
SQLiteD. Richard Hipp2000
SuperbaseSuperbase1984
TeradataTeradata1984
ValentinaParadigma Software1998


source---
http://satya-dba.blogspot.in/2009/06/databases-in-world.html

How to speedup utlrp.sql script after catupgrd.sql scripts

How to compile invalid objects faster:-


To know Invalid objects issue

select count(*) from dba_objects where status like 'INVALID';

To compile these invalid objects faster than normal case then issue following command in sql prompt

SQL>@?/rdbms/admin/utlrp.sql n;

Where n= no of CPU's + 2

This will compile your invalid objects faster than normal case.

Friday, 12 July 2013

Block Change Tracking file



RMAN's change tracking feature for incremental backups improves incremental backup performance by recording changed blocks in each datafile in a change tracking file. If change tracking is enabled, RMAN uses the change trackingfile to identify changed blocks for incremental backup, thus avoiding the need to scan every block in the datafile.

Change tracking is disabled by default, because it introduces some minimal performance overhead on database during normal operations. However, the benefits of avoiding full datafile scans during backup are considerable, especially if only a small percentage of data blocks are changed between backups. If backup strategy involves incremental backups, then we should enable change tracking.

One change tracking file is created for the whole database. By default, the change tracking file is created as an Oracle managed file in DB_CREATE_FILE_DEST. We can also specify the name of the block change tracking file, placing it in any desired location.

Using change
 tracking in no way changes the commands used to perform incremental backups, and the change trackingfiles themselves generally require little maintenance after initial configuration.

From Oracle 10g, the background process Block Change Tracking Writer (CTWR) will do the job of writing modified block details to block change tracking file.

In a Real Applications Clusters (RAC) environment, the change tracking file must be located on shared storage accessible from all nodes in the cluster.

Oracle saves enough change-tracking information to enable incremental backups to be taken using any of the 8 most recent incremental backups as its parent.

Although RMAN does not support backup and recovery of the change-tracking file itself, if the whole database or a subset needs to be restored and recovered, then recovery has no user-visible effect on change tracking. After the restore and recovery, the change tracking file is cleared, and starts recording block changes again. The next incremental backup after any recovery is able to use change-tracking data.

After enabling change
 tracking, the first level 0 incremental backup still has to scan the entire datafile, as the changetracking file does not yet reflect the status of the blocks. Subsequent incremental backup that use this level 0 as parent will take advantage of the change tracking file.



Enabling and Disabling Change Tracking

We can enable or disable change tracking when the database is either open or mounted. To alter the change tracking setting, we must use SQL*Plus to connect to the target database with administrator privileges.

To store the change tracking file in the database area, set DB_CREATE_FILE_DEST in the target database. Then issue the following SQL statement to enable change tracking:
SQL> ALTER DATABASE ENABLE BLOCK CHANGE TRACKING;  

We can also create the change
 tracking file in a desired location, using the following SQL statement:
SQL> ALTER DATABASE ENABLE BLOCK CHANGE TRACKING USING FILE '/u02/rman/rman_change_track.f';

The 
REUSE option tells Oracle to overwrite any existing file with the specified name.
SQL> ALTER DATABASE ENABLE BLOCK CHANGE TRACKING USING FILE '/u02/rman/rman_change_track.f' REUSE;

To disable change
 tracking, use this SQL statement:
SQL> ALTER DATABASE DISABLE BLOCK CHANGE TRACKING;  

If the change
 tracking file was stored in the database area, then it will be deleted when we disable change tracking.

Checking Whether Change Tracking is enabled
From SQL*Plus, we can query V$BLOCK_CHANGE_TRACKING to determine whether change tracking is enabled or not. 

SQL> select status from V$BLOCK_CHANGE_TRACKING;
        ENABLED   => block change tracking is enabled.
        DISABLED  => block change tracking is disabled.

Query V$BLOCK_CHANGE_TRACKING to display the filename.
SQL> select filename from V$BLOCK_CHANGE_TRACKING;

Moving the Change Tracking File
If you need to move the change tracking file, the ALTER DATABASE RENAME FILE command updates the control file to refer to the new location.

1.
 If necessary, determine the current name of the change tracking file:

SQL> SELECT filename FROM V$BLOCK_CHANGE_TRACKING;
        /u02/rman/rman_change_track.f

2.
 Shutdown the database.
SQL> SHUTDOWN IMMEDIATE

3.
 Using host operating system commands, move the change tracking file to its new location.
$ mv /u02/rman/rman_change_track.f /u02/rman_new/rman_change_track.f

4.
 Mount the database and move the change tracking file to a location that has more space. For example:

SQL> ALTER DATABASE RENAME FILE '/u02/rman/rman_change_track.f' TO '/u02/rman_new/rman_change_track.f';

5.
 Open the database.
SQL> ALTER
 DATABASE OPEN;

SQL> SELECT filename FROM V$BLOCK_CHANGE_TRACKING;
        /u02/rman_new/rman_change_track.f
If you cannot shutdown the database, then you must disable change tracking and re-enable it, at the new location:
SQL> ALTER DATABASE DISABLE BLOCK CHANGE TRACKING;
SQL> ALTER DATABASE ENABLE BLOCK CHANGE TRACKING USING FILE '/u02/rman_new/rman_change_track.f';

If you choose this method, you will lose the contents of the change tracking file. Until the next time you complete a level 0 incremental backup, RMAN will have to scan the entire file.

Estimating Size of the , on Disk
The size of the change tracking file is proportional to the size of the database and the number of enabled threads of redo. The size is not related to the frequency of updates to the database.

Typically, the space required for block change tracking is approximately 1/30,000 the size of the data blocks to be tracked. The following two factors that may cause the file to be larger than this estimate suggests:
·                     To avoid overhead of allocating space as database grows, the change tracking file size starts at 10MB, and new space is allocated in 10MB increments. Thus, for any database up to approximately 300GB the file size is no smaller than 10MB, for up to approximately 600GB the file size is no smaller than 20MB, and so on.

·                     For each datafile, a minimum of 320K of space is allocated in the change tracking file, regardless of the size ofthe file. Thus, if you have a large number of relatively small datafiles, the change tracking file is larger than for databases with a smaller number of larger datafiles containing the same data.

Tuesday, 9 July 2013

how to add customization to apache configuration file.

Overview

As we know AutoConfig is a tool that simplifies and standardizes configuration management tasks in an Oracle Applications environment.
The configuration generated by AutoConfig may not always meet your specific requirements and it may be necessary to customize AutoConfig to get your environment up and running.

Steps to preserve autoconfig:


First find template file for apache configuration file using adtmplreport.sh script located in $AD_TOP/bin



[applmgr3@fed01 ~]$ cd $AD_TOP/bin
[applmgr3@fed01 bin]$ ls adtmplreport.sh
adtmplreport.sh
[applmgr3@fed01 bin]$ adtmplreport.sh
Usage:
        adtmplreport.sh [help]
        adtmplreport.sh contextfile=<contextfilepath> [log=<logfilepath>]
                [[listcustom] | [product=<product>[listcustom] ]]|
                [target=<targetfilepath>|template=<templatefilepath>]
                [verbose]

Valid arguments for adtmplreport.sh:
        help            : prints usage information
        contextfile     : Complete path to Applications context file.
        log             : Complete path to the Log file to log the
                          information. If not specified, the file will
                          be created automatically in
                          [apps tier]
                          $INST_TOP/admin/log directory
                          [db tier]
                          $ORACLE_HOME/appsutil/log/<s_contextname> directory
        product        : Product to be reported
        template       : Location of template file to be reported on
        target         : Location of target file to be reported on
        verbose        : Displays the output on the screen.
        listcustom     : Lists customizations.

[applmgr3@fed01 bin]$ adtmplreport.sh contextfile=$CONTEXT_FILE target=/u03/applmgr3/inst/apps/PROD_fed01/ora/10.1.3/Apache/Apache/conf/httpd.conf

#########################################################################
          Generating Report .....
#########################################################################
For details check log file: /u03/applmgr3/inst/apps/PROD_fed01/admin/log/07102203.log

[applmgr3@fed01 bin]$ cat /u03/applmgr3/inst/apps/PROD_fed01/admin/log/07102203.log
=================================================================
Starting Utility to Report on Templates and their  Targets  at Wed Jul 10 22:03:28 IST 2013
Using ATTemplateReport.java version 120.0


[ INFO_REPORT ]

[FND_TOP]
TEMPLATE FILE   : /u03/applmgr3/apps/apps_st/appl/fnd/12.0.0/admin/template/httpd_conf_1013.tmp
TARGET FILE     : /u03/applmgr3/inst/apps/PROD_fed01/ora/10.1.3/Apache/Apache/conf/httpd.conf



Modify the configuration file(target file - httpd.conf) as per requirement.For xample add some lines to conf file
“RedShore Technologies---Ameerpet”

Now change the customisation in template file


Key points:-
 Sometimes patch brings new version of template files. Template files will be copied to Standard
template file location rather than Custom template file location. So, in these conditions AutoConfig
fails with conflicts error.

 Whenever we are getting AutoConfig version conflicts, we need to take a backup of existing custom
directory template file and we have to copy new Standard template file to custom directory and we
can add customizations to the file.

 You cannot customize all AutoConfig template files. The AutoConfig templatefile cannot be customized if the “LOCK” keyword appears in the template file’s entry in the

product driver file.

 AutoConfig ignores custom template files that are marked with “LOCK”.