Posts

Showing posts from 2024

shelll scrips

  cat TEST_DB https://www.funoracleapps.com/2021/06/shell-script-to-change-sys-and-system.html TEST1 TEST2 TEST3 TEST4 Script: #!/bin/bash ################################################################################# #PURPOSE: TEST DB SYS and SYSTEM password change script # Usage : sys_system_pass_change.sh [PROD]/[TEST] #Author Version Date #Himanshu Singh 1.0 15-AUG-2020 # ################################################################################## #######################Before change system password prefix####################### prefx=dundb ##############Change the below value before canging system password################## newprefx=ebs123 . $HOME/testdb.env checkfile=TNS_DB_CHECK.log passch=PASS_CHANGE.log RECEIPENTS=support@funoracleapps.com RUN_USER=`who am i |awk '{print $1}'` if [ $# -ne 1 ] then echo "No Parameter passed!! ==\>Either Pass TEST or PROD\<== Exiting" exit 1; fi if [ "$1" == "TEST" ] then inst_f...

tablespace move

 set feedback off set echo off set serverout off set pages 0 set lines 200  col name new_val dbname noprint select name from v$database; spool mvlobs_&&dbname\.sql prompt spool mvlobs_&&dbname select 'alter table ' || owner || '.' || table_name || ' move lob(' || column_name || ') store as (tablespace '||tablespace_name||'_NEW);' from dba_lobs where tablespace_name not in ('SYSTEM', 'SYSAUX', 'UNDOTBS1','USERS','TEMP') order by tablespace_name; prompt spool off spool off set feedback off set echo off set serverout off set pages 0 set lines 200  col name new_val dbname noprint select name from v$database; spool mvtabs_&&dbname\.sql prompt spool mvtabs_&&dbname select 'alter table '||owner||'.'||table_name||' move tablespace '||tablespace_name||'_NEW;'  from dba_tables  where tablespace_name not in ('SYSTEM', 'SYSAUX', 'UNDOTB...