Friday, 16 November 2012

“Device eth0 does not seem to be present” – cloned VM’s


This is because when RHEL clones a VM it gives it a new MAC address.
You can see that instead of just eth0 there is eth1 now too by:
cat /etc/udev/rules.d/70-persistent-net.rules

Two options to fix it:
1. Edit the above file and re-rewrite correct MAC address.
or
2a. up the eth1 ( ifconfig eth1 up)
2b. Go to /etc/sysconfig/network-scripts and rename the file ifcfg-eth0 to ifcfg-eth1, then edit MAC address same as 70-persistent-net.rules  for eth1 in ifcfg-eth1.

Done !!

Tuesday, 13 November 2012

Keypass & Putty

Keypass & Putty


Putty Step:

1. Save connection session in Putty as normal.

Keypass Step :


  1. add new entry in Keypass
  2. Title should be your saved putty session name
  3. Username (OS username)
  4. Password (OS user password)
  5. Repeat should be same as Password field
  6. URL - it should be like this [putty_path][Title][Username][Password] 
cmd://"H:\desktop\putty.exe" -load "{TITLE}" -l {USERNAME} -pw {PASSWORD}



Job done!!

RMAN-08137: WARNING: archive log not deleted as it is still needed



Use following command at your own risk , because it deletes all your archivelog by ignoring the retention period  or without caring that they have been applied on STANDBY database or not.

If you use the DELETE command with the optional FORCE keyword, RMAN deletes the specified backups, but ignores any I/O errors, including those that occur when a backup is missing from disk or tape. It then updates the RMAN repository to reflect the fact that the backup is deleted, regardless of whether RMAN was able to delete the file or whether the file was already missing. For example:


rman > delete force noprompt archivelog all completed before 'sysdate -7';


another e.g. DELETE FORCE NOPROMPT BACKUPSET TAG 'weekly_bkup';

Monday, 10 September 2012

11g - automatically changes audit_trail to OS



11g - automatically changes audit_trail to OS



From Audit Trail-----


Mon Sep 10 10:53:06 2012
alter database open read only
AUDIT_TRAIL initialization parameter is changed to OS, as DB is NOT compatible for database opened with read-onlyccess




SYS@STANDBY >> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SYS@STANDBY >> startup mount
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE instance started.

Total System Global Area  217157632 bytes
Fixed Size                  2225064 bytes
Variable Size             159386712 bytes
Database Buffers           50331648 bytes
Redo Buffers                5214208 bytes
Database mounted.
SYS@STANDBY >> show parameter audit

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
audit_file_dest                      string      /cluster/app/grid/product/11.2
                                                 .0/db_1/admin/STANDBY/adump
audit_sys_operations                 boolean     FALSE
audit_syslog_level                   string
audit_trail                          string      DB
SYS@STANDBY >> alter database open read only;

Database altered.

SYS@STANDBY >> show parameter audit

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
audit_file_dest                      string      /cluster/app/grid/product/11.2
                                                 .0/db_1/admin/STANDBY/adump
audit_sys_operations                 boolean     FALSE
audit_syslog_level                   string
audit_trail                          string       OS
SYS@STANDBY >>
SYS@STANDBY >>
SYS@STANDBY >> alter database recover managed standby database using current logfile disconnect;

Database altered.

Wednesday, 15 August 2012

Simple shellscript for Crontab


#!/bin/bash
export ORACLE_SID=$1
export PATH=$PATH:/usr/local/bin
export ORAENV_ASK=NO
. /usr/local/bin/oraenv

testsh() {
        $ORACLE_HOME/bin/sqlplus /nolog <
        conn / as sysdba
        alter session set nls_date_format='DD-MM-YYYY HH24:MI:SS';
        select sysdate from dual;
        exit
EOF
        return $?
}

testsh



Tuesday, 14 August 2012

srvctl commands


What is srvctl? it is the Server Control Utility, we use SRVCTL to start and stop the database and instances, manage configuration information, and to add, move or remove instances and services.
These are some of the srvctl commands I frequently use, this is not a complete reference guide.
I organized the commands as follow:
  • To start a rac database
  • To stop a rac database
  • To check status and configurations
  • To start and stop instances
  • To start, stop and manage services
Start a rac database (order: nodeapps – asm – database)
srvctl start nodeapps -n nodename
srvctl start asm -n 
nodename
srvctl start database -d dbname
options are: srvctl start database -d 
dbname -o open | -o mount | -o nomount
Stop a rac database (order: database – asm – nodeapps)
srvctl stop database -d dbname -o immediate
options are: srvctl stop database -d dbname -o normal | -o transactional | -o immediate | -o abort
srvctl stop asm -n nodename
options are: srvctl stop asm -n nodename -o immediate
srvctl stop nodeapps -n nodename
To check status and configurations
Nodeapps:
srvctl status nodeapps -n nodename
srvctl config nodeapps -n nodename
ASM:
srvctl status asm -n nodename
srvctl config asm -n nodename
Database:
srvctl status database -d dbname
srvctl config database -d dbname (shows instances name, node and oracle home)
Instance:
srvctl status instance -d dbname -i instancename
Services:
srvctl status service -d dbname
To start and stop instances
srvctl start instance -d dbname -i instancename
srvctl stop instance -d dbname -i instancename
To start, stop and manage services
srvctl status service -d dbname
srvctl config service -d dbname
srvctl start service -d dbname -s servicename
srvctl stop service -d 
dbname -s servicename
srvctl relocate service -d dbname -s servicename -i instancename -t newinstancename [-f]
srvctl documentation for Oracle 10G R2 and 11G