Shell Script to Add Date to Filenames

Below Shell Script will append Date to all FileNames in Directory with extension .TXT. Also it will create a folder with the Date and move the files to it. #!/bin/bash FILE="$(date +%Y%m%d)" cd /bi_dataload mkdir -p /bi_dataload/BI_$FILE for f in *.TXT do mv -n "$f" /bi_dataload/BI_$FILE/"${f%%.*}"_"$FILE".TXT done

ksvcreate: Process(m000) creation failed. Error in Alert log due to DNS ip change.

Today on one of our 10g (10.2.0.1, don't ask !) production databases  running on AIX 5.3 we saw the following message in the alert log. ksvcreate: Process(m000) creation failed The database slowed down to a crawl. We couldn't login even SQLPLUS, even sqlplus -prelim couldn't bring up the instance. On starting the instance we got … Continue reading ksvcreate: Process(m000) creation failed. Error in Alert log due to DNS ip change.

Hang anaylze oracle 11g

What to do when a production database goes hanging and there is no time left and your boss is standing on your head. This article could be just be your life saver http://www.dbi-services.com/index.php/blog/entry/oracle-is-hanging-dont-forget-hanganalyze-and-systemstate

Change SYSMAN Password in Cloud Control 12c

Change OEM SYSMAN passwordIncase you have forgotten the sysman password1. Login to Cloud Control 12c databaseSQL> alter user sysman identified by abc123;2. Stop OMS$OMS_HOME/bin/emctl stop oms( DO not use -all postfix)3. Change password in Repository$OMS_HOME/bin/emctl config oms -change_repos_pwd -use_sys_pwd -sys_pwd sys123 -new_pwd abc123changing passwords in backend ... Passwords changed in backend successfully.Updating repository password in … Continue reading Change SYSMAN Password in Cloud Control 12c

Change NLS_DATE_FORMAT via logon triggers

NLS_DATE_FORMAT is a parameter heavily dependent on a session. A good practice is to write a logon trigger depending on the application requirement to set this parameter write at the session logon. It can be done via a small script for a logon trigger. [sourcecode language="sql"] CREATE OR REPLACE TRIGGER SCOTT.CHANGE_DATE_FORMAT AFTER LOGON ON DATABASE WHEN ( … Continue reading Change NLS_DATE_FORMAT via logon triggers