Posts

Showing posts from November, 2022

SQL SERVER BUILD STEPS

  1 ST STEP ============ Window server build ======= INstall the VM and assign the storage to local drive . 2 gb RAM 25 GB DISK SPACE. One is Domain server 80 GB OF STORAGE AND IP 10.10.10.1 TCS.COM domain. One is db server for PROD 25 GB OF STORAGE AND IP 10.10.10.2 One is db server for TEST 25 GB OF STORAGE AND IP 10.10.10.3 One is db server for DEv 25 GB OF STORAGE AND IP 10.10.10.4 2 ND STEP ======= Creating Domain name server as Active Directory service =========== click on server manager ->add roles and features->next->next->active directory domain servic->add features ->next->next->next->Install.. Click on Flag symbol->promote this servers as a Domain ->Add new forest->Root domain name->TCS.COM->next->password ->confirm password ->next->next->next>next->Install===Domain server Domain server completed . 3 RD STEP ========Network configuration ...

RMAN BACKUPS DETAILS CHECK

  set lines 200 pages 200; col END_TIME for a20; col ELAPSED_TIME for a25; SELECT T.SESSION_KEY, T.INPUT_TYPE, T.STATUS, T.SUM_BACKUP_PIECES_IN_GB, T.START_TIME, T.END_TIME, T.SECONDS ELAPSED_TIME FROM ( SELECT SESSION_KEY, INPUT_TYPE, STATUS, OUTPUT_BYTES/1024/1024/1024 SUM_BACKUP_PIECES_IN_GB, TO_CHAR (START_TIME, 'dd/mm/yyyy hh24:mi') START_TIME, TO_CHAR (END_TIME, 'dd/mm/yyyy hh24:mi') END_TIME, TIME_TAKEN_DISPLAY SECONDS FROM V$RMAN_BACKUP_JOB_DETAILS WHERE INPUT_TYPE='ARCHIVELOG' ORDER BY SESSION_KEY DESC) T WHERE ROWNUM <= 1; set lines 200 pages 200; col END_TIME for a20; col ELAPSED_TIME for a25; SELECT T.SESSION_KEY, T.INPUT_TYPE, T.STATUS, T.SUM_BACKUP_PIECES_IN_GB, T.START_TIME, T.END_TIME, T.SECONDS ELAPSED_TIME ...

RMAN restore with Backup

ssh in001i97@10.217.45.86 welcomejune@2022 ssh ibm_admin@172.22.8.53 ibm_admin ssh 10.242.98.25 ibm_admin MX10OR90BSAB/ 10.242.98.25 SID: BTPROPQ1 Port: 1529 ===================Source Side =================== @db_status.sql select dbid from v$database; col file_name format a90 select file_name from dba_data_files order by file_name; col member for a90 select member from v$logfile; show parameter controlfile show parameter spfile; SQL> create pfile='/home/oracle/initCALCOPQ1.ora' from spfile; col "Database Size" format a20 col "Free space" format a20 select round(sum(used.bytes) / 1024 / 1024 /1024) || ' GB' "Database Size" , round(free.p / 1024 / 1024 /1024) || ' GB' "Free space" from (select bytes from v$datafile union all select bytes from v$tempfile union all select bytes from v$log) used , (select sum(bytes) as p from dba_free_space) free group by free.p / connect ...

Manual Database creation 11g version

MANUAL DATABASE CREATION – 11g version Lets say we will create a database named ACTIONAL 1. Create the PATHS for database files to be stored. Control Files Archive Location Database Files Redolog Files Location 2.Now create the init.ora file( in $ORACLE_HOME/dbs location) *.bitmap_merge_area_size=10485760 *.compatible='11.2.0.0.0' *.control_files='/u31_Actional/actional/oradata/control01.ctl','/u31_Actional/actional/oradata/control02.ctl','/u31_Actional/actional/oradata/control03.ctl' *.control_management_pack_access='NONE' *.cursor_sharing='SIMILAR' *.db_block_size=8192 *.db_cache_advice='ON' *.db_domain='' *.db_file_multiblock_read_count=128 spfile.db_files=500 *.db_files=500 *.db_name='actional' =======> Database Name *.diagnostic_dest='/u01' *.dml_locks=5000 *.fast_start_mttr_target=0 *.job_queue_processes=4 *.log_archive_dest_1='LOCATION=/u31_Actional/archive' #### Archivelog ...

SQL TRACE ENABLE FOR BAD QUERY

. bdrsat_test.env IN node2 : ssh oracle@ -bash-4.1$ . oraenv ORACLE_SID = [BDRSAT1] ? BDRSAT2 ORACLE_HOME = [/home/oracle] ? /oracle/dbbase/product/11.2.0.4/dbhome SELECT INST_ID,SID,SERIAL#,OSUSER,username, machine, status,to_char(LOGON_TIME,'DD-MON-YYYY HH24:MI:SS'),PROGRAM FROM GV$SESSION where username='DS_EMIWEBRS' and osuser='tj2ee02' order by 7; SELECT INST_ID,SID,SERIAL#,OSUSER,username, machine, status,to_char(LOGON_TIME,'DD-MON-YYYY HH24:MI:SS'),PROGRAM FROM GV$SESSION where username='DS_EMIWEBRS'; SELECT OWNER, TRIGGER_NAME, STATUS FROM DBA_TRIGGERS WHERE TRIGGER_NAME LIKE 'SET_TRACE_ON_LOGON%'; SQL> SELECT OWNER, TRIGGER_NAME, STATUS FROM DBA_TRIGGERS WHERE TRIGGER_NAME LIKE 'SET_TRACE_ON_LOGON%'; OWNER TRIGGER_NAME STATUS ------------------------------ ------------------------------ -------- SYS SET_TRACE_ON_LOGON_JDELCAST DISABLED SYS SET_TRACE_ON_LOGON_JDURAN DIS...

Schema Refresh

  Export schema DATCREDITOCO select owner,segment_name,sum(bytes/1024/1024) from dba_segments where segment_name='DATCREDITOCO'; select owner,segment_name,sum(bytes/1024/1024) from dba_segments where owner='DATCREDITOCO'; expdp directory=EXPIMP dumpfile=SR3367495_DATCREDITOCO.dmp logfile=SR3367495_DATCREDITOCO.log schemas=DATCREDITOCO expdp schemas=CONVERSION directory=EXP_HDD dumpfile=CONVERSION_data.dmp logfile=CONVERSION.log content=METADATA_ONLY impdp remap_schema=CONVERSION:QA_CONVERSION directory=EXP_HDD dumpfile=CONVERSION_data.dmp logfile=QA_CONVERSION.log content=METADATA_ONLY select owner,count(*) from dba_objects where owner in ('CONVERSION','QA_CONVERSION'); expdp schemas=CONVERSION directory=EXP_HDD logfile=CONVERSION.log ESTIMATE_ONLY=y content=METADATA_ONLY create user QA_CONVERSION identified by welcome default tablespace DATA TEMPORARY TABLESPACE "TEMP2"; grant create session,connect to QA_CONVERSION; DEFAU...

Fragmentation in oracle

  check the indexes and LOB on tables and also PCT free value for the tables... select table_name,bytes/(1024*1024*1024) from dba_table where table_name='&table_name'; -- keep a track to match after fragmentation Check the indexes on the table select index_name from dba_indexes where table_name='&TABLE_NAME'; STEP 3: Check actual table size, fragmented size and percentage of fragmentation in a table. REPORTE_SKU_UNQ IDETRNEE IDETRNEEP1 HP_VTEX_ERROR_JASON NO index LOG_ACCESOS no index EDSR REPORTE_SKU_UNQ EPMM IDETRNEE EDSR HP_VTEX_ERROR_JASON LOG_ACCESOS Let's find the name of the LOB segments and their corresponding indexes:(The LOB indexes are internal data structures only. See this post.) SELECT OWNER,TABLE_NAME,SEGMENT_NAME,COLUMN_NAME,INDEX_NAME FROM DBA_LOBS WHERE TABLE_NAME='REPORTE_SKU_UNQ' AND OWNER IN ('EDSR'); SELECT OWNER,TABLE_NAME,SEGMENT_NAME,COLUMN_NAME,INDEX_NAME FROM DBA_LOBS WHERE TABLE_NAME=...

How to find long running sessions in Oracle database

http://javeedkaleem.blogspot.com/2010/02/what-to-do-when-high-cpu-utilization.html b564ggw7zxtxz SQL> !uname -a AIX splmpmmbd1 1 7 00F7CF974C00 SQL> !topas Exiting from topas SQL> !topas Exiting from topas SQL> select count(1) from v$process; COUNT(1) ---------- 2711 SQL> select count(*) from v$session where status='ACTIVE'; COUNT(*) ---------- 124 SQL> select count(*) from v$session where status='INACTIVE'; COUNT(*) ---------- 2589 select rownum as rank, a.* from ( SELECT sess.username,sess.sql_id,v.sid, program, v.value/(100*60) CPUMins,sess.machine FROM v$statname s , v$sesstat v, v$session sess WHERE s.name = 'CPU used by this session' and sess.sid = v.sid and v.statistic#=s.statistic# and v.value>0 ORDER BY v.value DESC) a where rownum < 11; RANK USERNAME SQL_ID SID Program CPU Mins MACHINE ---------- ------...