Archive

Archive for January, 2011

create ssh trust between HP-UX and Tru64

January 28, 2011 Leave a comment

On HP-UX


su - oracle

cd .ssh

ssh-keygen -t dsa

ssh-keygen -e -f id_dsa.pub > id_dsa2_`hostname`.pub

cat id_dsa2_`hostname`.pub

On Tru64


su - oracle

cd .ssh2

vi id_dsa2_<hp-ux-servername>.pub

Copy and paste the output of the cat id_dsa2_`hostname`.pub command from hp-ux in to this file and save it

echo "Key id_dsa2_<hp-ux-servername>.pub" >> authorization

This should allow login to tru64 from hp-ux without prompting you for a password. However scp wont work due to the incompatibilities between hp-ux and Tru64.

If you need to transfer files you can use sftp but it no good if you want to tranfer directories and subdirectories. The way round it is to do the following

If you have secure shell (ssh) access to both hosts, there is a pretty easy way to move an entire directory structure from host A to host B in one line:

from host A:
tar -cf - directory | ssh user@hostB "cd target_dir; tar -xf -"

Where directory is the directory you want to move and target_dir is the destination directory on the remote host.</div>

Another option would be to setup rsync


rsync -aE -e ssh directory user@hostB:target_dir

or from hostB

rsync -aE -e ssh user@hostA:directory target_dir

You can also use the z (--compress) switch to rsync if network throughput is an issue.

Advertisements
Categories: Linux

Performance problems with tablespace queries

January 12, 2011 Leave a comment

Check your oracle recycle bin as your query explain plan is probably using info from the recycyle bin

the recycle bin is enable by default

to switch the recycyle bin off


To disable for the entire database
SQL> ALTER SYSTEM SET recyclebin = OFF;
To disable for a session
SQL> ALTER SESSION SET recyclebin = OFF;

show content of your recycle bin


show recyclebin ;

Clear Recycle bin


to remove  dropped objects for the current user
SQL> PURGE RECYCLEBIN;

ro remove dropped objects for all users
SQL> purge DBA_RECYCLEBIN;

Check space occupied by the Recycle bin 8K database

select allocated_k, free_k, recycle_able_k
  from
( select nvl(sum(bytes)/1024,0) free_k from dba_free_space
   where tablespace_name = '&&tsname'),
( select sum(bytes)/1024 allocated_k from dba_data_files
   where tablespace_name = '&&tsname'),
( select nvl(sum(space) * 8,0) recycle_able_k from dba_recyclebin
   where ts_name = '&&tsname')
/

if freespace reported aganist the dba_free_space does not include the space occupied by the recycyle objects
Objects in the Recycle Bin will be automatically purged by the space reclamation process if

1. A user creates a new table or adds data that causes his/her quota to be exceeded.
2. The tablespace needs to extend its file size to accommodate create/insert operations.

Categories: Oracle