Skip to main content

Posts

Showing posts from 2011

RMAN: Format Directives:

RMAN: Format Directives: Format Description %a Current database activation id %A Zero-filled activation ID %c The copy number of the backup piece within a set of duplexed backup pieces.bMaximum value is 256 %d Database name %D Current day of the month from the Gregorian calendar in format DD %e Archived log sequence number %f Absolute file number %F Combines the DBID, day, month, year, and sequence into a unique and repeatable generated name %h Archived redo log thread number %I DBID %M Month in the Gregorian calendar in the format MM %n Database name, padded on the right with x characters to a total length of eight characters %N Tablespace name. Only valid when backing up datafiles as image copies. %p Piece number within the backup set. This value starts at 1 for each backup set and is incremented by 1 for each backup piece created. If

How To: Properly MOVE or RENAME oracle datafile

    To properly move the datafile around or rename the datafile, follow this steps:         Login to oracle SQLPlus or Connect to target database using any trird party tool.     bash#sqlplus /nolog     SQL> conn sys as sysdba               Shutdown the database instance with SHUTDOWN command.     SQL> shutdown immediate;             Rename or/and move the datafiles at operating system level.             Start Oracle database in mount state with STARTUP MOUNT command.     SQL> startup mount;            Modify the name or location of datafiles in Oracle data dictionary using following command syntax :     SQL> ALTER DATABASE RENAME FILE ‘<fully qualified path to original data file name>’ TO ‘<new or original fully qualified path to new or original data file name>’;             Open Oracle database instance completely with ALTER DATABASE OPEN command.     SQL> alter database open; =============================================================

DATA PUMP: EXCLUDE / INCLUDE TABLE IMPORT

EXCLUDING TABLES DURING DATA_PUMP IMPORT: impdp USERNAME/PASSWORD schemas=USERNAME directory=DIRECTORY_NAME dumpfile=FILE_NAME.dmp EXCLUDE=TABLE:\"IN \(\'TABLE1\',\'TABLE2\',\'TABLE3\',\'TABLE4\',\'TABLE5\',\'TABLE6\'\)\" impdp ultimus/ultimus schemas=ultimus directory=db_back dumpfile=AFT_EOD.dmp EXCLUDE=TABLE:\"IN \(\'IMG_SIGNATORY_IMAGE\',\'IMG_SIGNATORY_IMAGE_DEL_LOG\',\'IMG_SIGNATORY_INFO\',\'IMG_SIGNATORY_VERIFY_LOG\',\'IMG_BACH_CLG_HIST_IN\',\'IMG_BRM_INST\',\'IMG_NFT_AUTH_LOG\'\)\" EXCLUDING TABLES DURING DATA_PUMP IMPORT - USING  "LIKE "  COMMAND: impdp USERNAME/PASSWORD schemas=USERNAME directory=DIRECTORY_NAME dumpfile=FILE_NAME.dmp EXCLUDE=TABLE:\"like 'IMG_%%'\" EXCLUDE=TABLE:\"IN \(\'EMP\',\'DEPT\'\)\" INCLUDING TABLES DURING DATA_PUMP IMPORT: impdp USERNAME/PASSWORD schemas=USERNAM

Installing Oracle 10g on SOLARIS

Run_ALL_Commands_as_User_ROOT ----------------------------------------------------------------------- Run Check bash# /usr/sbin/prtconf | grep "Memory size" [Check RAM size] bash# /usr/sbin/swap -s [check swap] bash# df -k /tmp [check /tmp size (>400mb)] bash# uname -r [check solaris version] bash# pkginfo -i SUNWarc SUNWbtool SUNWhea SUNWlibm SUNWlibms SUNWsprot SUNWsprox SUNWtoo SUNWi1of SUNWi1cs SUNWi15cs SUNWxwfnt bash# cat /etc/nsswitch.conf | grep hosts bash# hostname bash# domainname Fist of all add 3 OS groups. bash#groupadd dba bash#groupadd oinstall bash#groupadd oper Create user 'oracle' {Determine oracle user exist or not) bash# id -a oracle {if exist, should be look like this= uid=440(oracle) gid=200(oinstall) groups=201(dba),202(oper)) {create oracle user) # useradd -d /export/home/oracle -g dba -G oinstall -m -s /bin/ksh oracle # #chown oracle:dba /export/home/oracle {set password= # passwd -r files oracle

Installing Patch on ORACLE SOLARIS 10.9 from ISO FILE

Installing Patch on ORACLE SOLARIS 10.9 from ISO FILE Suppose the ISO file is located in /datafile/  and the ISO file name is Jan2010.iso Open a terminal window and type. bash-3.00# lofiadm -a /datafile/Jan2010.iso /dev/lofi/1 mount the ISO file bash-3.00# mount -F hsfs /dev/lofi/1 /mnt bash-3.00# cd /mnt/sun/install/ bash-3.00# ./setup-standard.sh when setup-standard.sh is completed bash-3.00# . /.profile run patch unpacker root@SEBLTEST-02 # cd /mnt/sun/patch/x86/10/ root@SEBLTEST-02 # unpack-patches -r -q Synchronize patching bash#sync bash#sync bash#sync

Oracle 10g Performance Tuning Scripts (Sure Shot)

Oracle 10g Performance Tuning Scripts (Sure Shot) ----------------------------------------------------------- -- SHARED POOL TUNING -- Library Cache Hit Ratio should be less than 90%. if not, increase the size of SHARED POOL select gethitratio * 100 "Library Cache Hit Ratio"   from v$librarycache  where namespace = 'SQL AREA'; -- "RELOADS TO PINS RATIO" ratio should be less than 1 percent. Other wise SHARED_POOL_SIZE need to be increased. SELECT SUM(PINS) "EXECUTIONS",        SUM(RELOADS) "CACHE MISSES",        (SUM(RELOADS) / SUM(PINS)) * 100 "RELOADS TO PINS RATIO"   FROM V$LIBRARYCACHE; -- "CACHE HIT RATIO" should be greaer than 90 percent SELECT SUM(PINS) / (SUM(PINS) + SUM(RELOADS)) * 100 "CACHE HIT RATIO"   FROM V$LIBRARYCACHE;     -- check invalidations SELECT NAMESPACE,PINS,RELOADS,INVALIDATIONS FROM V$LIBRARYCACHE; --take advice for shared pool size SELECT SHARED_PO

Configuring EMCTL oracle in 10g

Open a new command prompt on your DB server: bash# emca -config dbcontrol db -------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------- (This command will create and configure repository for dbcontrol In background it will create synonyms, roles for sysman users) You need to know the SID of database , port on which LISTNER for database in running, the password for sysman and system user.   for that go to LSNRCTL and look for services and status STARTED EMCA at Jul 6, 2010 12:33:45 PM EM Configuration Assistant, Version 10.2.0.1.0 Production Copyright (c) 2003, 2005, Oracle. All rights reserved. Enter the following information: Database SID: Listener port number: 1521 Password for SYS user: ******** Password for DBSNMP user: ******* Password for SYSMAN user:

Step By Step Cloning Oracle Database Using RMAN

~`~` Step By Step Cloning Oracle Database 10g Using RMAN`~`~ Delete existing DataFile folder in oradata location.  Login to SQLprompt. SQL> shutdown abort; (target database) Now login to RMAN and set DBID: RMAN>  set DBID 123456 ; (Get it from source database, by connecting RMAN.) Now, if there is no database i.e. you have just installed the target database (software only), then check if the dump destination folders are created at dump destination.Ex. - /app/oracle/admin/ULTIMUS/bdump/. Startup the database in no mount state : SQL> startup nomount; Restore pfile: SQL> restore spfile to pfile '$ORACLE_HOME/dbs/initULTIMUS.ora' from 'BACKUP_DESTINATION/autobackup/2011_06_20/o1_mf_s_744258937_6pofdsx4_.bkp’; (or copy pfile i.e. initULTIMUS.ora from live server then paste it to dbs folder, if the following command is not working). Restart the database with new pfile: SQL> startup force nomount pfile=' $ORACLE

Setting UP IP address in SOLARIS 10.9

Follow the below steps to setup IP address in SOLARIS 10.9 OS: Provide IP address to the file: /etc/hosts Format: 172.17.1.30      database3        loghost Provide masking info to the file: /etc/netmasks Format: 172.17.1.0       255.255.255.0 If not already created, create file “/etc/defaultrouter” and enter your routers IP address Restart the network by issuing the following command: #svcadm restart /network/physical Check the routing table and confirm the network is using the new sttings: #netstat -r Thats it. Now ping any node of your network to make sure its working. Have a good day.

Solution of problem: Resultset Exceeds the Maximum Size (100 MB)

Solution of problem: Resultset Exceeds the Maximum Size (100 MB) I was running a select statement in PL/SQL Developer. it was a short query but the data volume that the query was fetching was huge. But when ever i Click the button Fetch Last Page or press 'ALT+End' button a message box comes after a while saying: Then I started looking for the exact reason of this sort of problem in Google. When I realized there was no direct solution in the web, I started looking the PL/SQL Developer Software menu and found the ultimate solution. The reason of this problem is there is a parameter of maximum result set size in PL/SQL Developer Software which is by default set to 100 MB. To change this parameter you have to go to the following location: 1. Goto Edit Menu and click ' PL/SQL Beautifier Options '. A new window will open. 2. Click SQL Window of " Window Types ". 3. Now Change the value of "Maximum Result Set Size( 0 is unlimited)"