Wednesday, October 20, 2010

set your ORACLE_SID to an ASM instance
using asmcmd locate the directory that contains the archive log files. for example..

ASMCMD> cd +POC2FLASH/POC2DWH/ARCHIVELOG
using 'rm' command you can delete the directory.

But don't forget to remove the archive log details from the control file or the RMAN catalog
For this you need to connect to the target database using rman
rman target sys/ nocatalog
rman>crosscheck archivelog all
rman>delete expired archivelog all

Monday, October 18, 2010

DHCP hostname.

Set the hostname: `# hostname `
Add ‘HOSTNAME=’ to ‘/etc/sysconfig/network’ (makes the change permanent).
Add ‘DHCP_HOSTNAME=’ to ‘/etc/sysconfig/network-scripts/ifcfg-eth0′
Restart the networking service: `# service network restart`

Tuesday, September 7, 2010

Mount entire driver image

if you dump your entire Hard driver using DD. you can view the content of the Image using the following comment.

assume you have create a hd image in /home/backup/hd.dump

1). fdisk /home/backup/hd.dump
You must set cylinders.
You can do this from the extra functions menu.

Disk /mnt/storage/disk_image: 0 MB, 0 bytes
255 heads, 63 sectors/track, 0 cylinders, total 0 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x41172ba5

Device Boot Start End Blocks Id System
/home/backup/hd.dump1 63 64259 32098+ de Dell Utility
/home/backup/hd.dump2 * 64260 78108029 39021885 7 HPFS/NTFS
Partition 2 has different physical/logical endings:
phys=(1023, 254, 63) logical=(4861, 254, 63)

2). then take the start of the partition that you want to edit 64260 in this case and multiply it by 512 ie 512*64260=32901120

then mount like this:

3). mount -o loop,offset=32901120 -t auto /home/backup/hd.dump /mnt/images ( assume the /mnt/images exists).

Tuesday, August 31, 2010

change HP server boot order remotely using iLo

1). SSH to HP server
2). cd system1/bootconfig1
3). show bootsource1 #please write down the bootorder number, I use 1 in this case
4). set bootsource1 bootorder=1 'this will give you the descriptive msg'
5). set bootsource$b bootorder=$p 'replace $b and $p to the device and boot order you want to set'

6). voila. reboot the machine.

Friday, August 13, 2010

add temp table space

alter tablespace temp add tempfile size 128m autoextend on next 32m maxsize 8g;

Saturday, August 7, 2010

Oracle turn on Archive mode

his is a two-step process. email if you have questions: fayoubi@gmail.com

STEP ONE : Modify your initSID.ora

Modify your initSID.ora to include the following three lines:

log_archive_start = true
log_archive_dest = /mount_point/oradata/SID/ARCHIVE/arch
log_archive_format = _%s.arc

log_archive_start: This parameter specifies whether archiving should be started automatically when the database is started.

log_archive_dest: This value specifies the default location of the file to be used when archiving redo log files.

log_archive_format: This parameter is used to specify the default file name format for the archive log files, this value is appended to the log_archive_dest value ( %s is the log sequence number ).

STEP TWO : Starting archive logging

The final step to starting archive logging, involves an Oracle SQL*DBA command which is run when the database is mounted but not open.

With the database shut down, use one of the many DBA tools available to manually start the database ( I still prefer to use SQL*DBA ) and execute the following sequence of commands:

startup mount exclusive
connect internal
alter database archivelog;
alter database open;

Now check to ensure archive logging is running. Whilst still connected internal, execute the command archive log list as shown below:

SQLDBA> archive log list
Database log mode ARCHIVELOG
Automatic archival ENABLED
Archive destination /mount_point/oradata/SID/ARCHIVE/arch
Oldest online log sequence 2
Current log sequence 3
SQLDBA>

Wednesday, July 7, 2010

how to fix ORA-00600: internal error code, arguments: [kcratr1_lastbwr]

if your Oracle gives you ORA-01033: ORACLE initialization or shutdown in progress when your app is trying to connect Oracle. (or DBA account with ORA-00600: internal error code, arguments: [kcratr1_lastbwr])

below is the commands to fix it.

login as sysdba;

SQL> shutdown;
SQL> startup mount;
SQL> recover database;
SQL> alter database open;

it should fix the problem.

Wednesday, May 26, 2010

How to fix 'No converter found for 'org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer"

if you are seeing 'No converter found for 'org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer' in your log when you using the spring+hibernate+dwr combination,

to solve this problem,

change the converter='bean' to converter="hibernate3" in the convert tag.

for example.



to

Wednesday, April 21, 2010

launch java program with remote debugging capability.

export javadg="java -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"

Monday, March 8, 2010

Move a directory over the network

tar -c -f - -p --numeric-owner $source_dir_1 | \
ssh $destination_host "cd $destination_location ; tar -x -p"