Put your tips and tricks online - Share your knowledge! Login | Register
 
 
  Search     Advanced search
 

Home | Ask Question | Add tip | My tips | Recent tips & tricks | Suggest a category | FAQ | Forums

Recent tips & tricks

 

 
 
 10 Recent tips & tricks 
 
Sort by 
 
 How to set idle session timeout
su - vi /etc/ssh/sshd_config ClientAliveInterval 86400 ClientAliveCountMax 0
 More...
06/15/16
 
 
Category : Operating Systems > Linux
 
 
 Copy SQL plan baseline into another database
----------------- -- Source database ----------------- sqlplus / VARIABLE cnt NUMBER EXECUTE :cnt := DBMS_SPM.LOAD_PLANS_FROM_CURSOR_CACHE( sql_id => '3x2bacus9sf6x', PLAN_HASH_VALUE => '3966657152'); -- queries DBA_SQL_PLAN_BASELINES select * from DBA_SQL_PLAN_BASELINES; -- Run below if table not exists exec DBMS_SPM.create_stgtab_baseline(TABLE_OWNER=>'DBAUSER', TABLE_NAME=>'STGTAB_BASELINE', TABLESPACE_NAME=>'USERS'); -- Check staging table BEFORE packing baseline select count(*) from DBAUSER.STGTAB_BASELINE; -- CREATOR is the user who created the baseline in ...
 More...
05/26/16
 
 
Category : Databases > Oracle > Performance Tuning
 
 
 Display TX blocking locks
-- Following script detects TX blocking locks: set linesize 160 set trimspool on column name format A28 column type format A18 column sid format 9999 column block format 99 column ctime format 99999 column serial format 99999 column id1 format 99999999 column id2 format 99999999 column LMODE format A12 column request format A12 spool log.lock select /*+ ordered use_merge(X$KSUSE X$KSQEQ) */ ...
 More...
05/29/15
 
 
Category : Databases > Oracle > Performance Tuning
 
 
 Handy ASM commands in SQLPLUS
-- list disks that belong to disk groups col name format a20 col path format a20 select b.NAME, a.NAME, a.PATH, a.TOTAL_MB, a.FREE_MB from V$ASM_DISK a, V$ASM_DISKGROUP b where a.GROUP_NUMBER = b.GROUP_NUMBER order by a.NAME asc, a.PATH asc; -- or list all disks, including candidates col name format a20 col path format a20 select a.NAME, a.PATH, a.TOTAL_MB, a.FREE_MB from V$ASM_DISK a order by ...
 More...
01/07/15
 
 
Category : Databases > Oracle > ASM
 
 
 Check number of messages in propagation queue
SELECT QUEUE_SCHEMA, QUEUE_NAME, (NUM_MSGS - SPILL_MSGS) MEM_MSG, SPILL_MSGS, NUM_MSGS FROM V$BUFFERED_QUEUES
 More...
08/28/13
 
 
Category : Databases > Oracle > Streams & CDC
 
 
 Get bind variables for a specific SQL statement
select sql_id, name, last_captured, value_string from V$SQL_BIND_CAPTURE where sql_id = '5194ttxfzj376';
 More...
05/17/13
 
 
Category : Databases > Oracle > Performance Tuning
 
 
 Data Guard Broker commands
dgmgrl / To show all the properties for database: DGMGRL> SHOW DATABASE VERBOSE "DBNAME"; To change StandbyArchiveLocation property: DGMGRL> EDIT DATABASE "DBNAME" SET PROPERTY StandbyArchiveLocation = '+ARCH01';
 More...
04/03/13
 
 
Category : Databases > Oracle > DR
 
 
 Copy files between ASM diskgroups on different hosts
# in this example ASM instance is listening on port 1531 # # the command below will copy an Oracle managed archived log # from local host to remote server # cp --port 1531 +DATA/DB/ARCHIVELOG/2013_01_10/thread_1_seq_17.411.804355767 sys@host2.+ASM:+FRA/DB/ARCHIVELOG/thread_1_seq_17 # # Generate a shell script to copy multiple files to remote server # ASM directories on the remote server must ...
     
More...

03/12/13
 
 
Category : Databases > Oracle > ASM
 
 
 Run expdp in parallel and other tips on Oracle data pump
-- Use parallel option of export data pump to create multiple dump files expdp userid="'/ as sysdba'" COMPRESSION=ALL DIRECTORY=DB_EXPORT \ DUMPFILE=db_%U.dmp FULL=Y LOGFILE=db_exp.log PARALLEL=16 -- To check the job status select * from dba_datapump_jobs; - To attach to expdp job (go to interactive mode) expdp attach= -- Output dump files into multiple directories with parallel option DUMPFILE=EXPDP1:DB_1_%U.dmp,EXPDP2:DB_2_%U.dmp,EXPDP3:DB_3_%U.dmp,EXPDP4:DB_4_%U.dmp,EXPDP5:DB_5_%U.dmp FILESIZE=10737418240 FULL=Y LOGFILE=EXPLOG:DBexp.log PARALLEL=16
 More...
03/06/13
 
 
Category : Databases > Oracle > exp
 
 
 How to run export / import as sys
If you need to run expdp or impdp as SYS user: userid="'/ as sysdba'"
 More...
03/01/13
 
 
Category : Databases > Oracle > exp
 
 

All categories
Databases | Programming | Hardware | Operating Systems | Networking | Internet | ERP / CRM | Games & Multimedia | Graphics & Design | Miscellaneous | Mobile Phones / Tablets | Office Software

Home |  FAQ |  Terms of Use |  Privacy Policy

© 2005 tiplib.com