Wednesday, November 21, 2012

grep: unknown devices method


# grep -r "-DACE_NDEBUG" .
grep: unknown devices method


solution:
remove -
use #grep -r "DACE_NDEBUG" .


Friday, November 9, 2012

Let's do some shell programming!

1. Check what shell version you have:
$ cat /etc/shells

2. Show which shell you are using currently:
echo $SHELL

3. This is a good website for learning shell:
http://arachnoid.com/linux/shell_programming.html

Monday, November 5, 2012

Failed to install java 1.3 in a x86-64 suse 11

Failed to install java 1.3 in a x86-64 suse 11.

Get the error message like: Error: can't find libjava.so.

It seems that java 1.3 has not x86 64 version.

export not working in Unix

Problem:

Create a script,  aaa.script

export bbb=/opt/ccc

Then, run it by typing ./aaa.script.

After that, # echo bbb and get nothing.

Solution:

run it by typing . aaa.script

Friday, November 2, 2012

make: 1254-057 Shell command needs a leading tab.



Notice that you need to use tab instead of spaces in line 4,7 and 10. Then, everything goes fine.



Don't use make in AIX, use gmake

gcc and g++ in AIX 6.1








I have these files download from http://www-03.ibm.com/systems/power/software/aix/linux/toolbox/ezinstall.html

They have a certain dependency on each other, so the order to execute them needs to be right.

My order 1->3->4->5->2->6

Then I wrote a simple Hello World app and run it. Get warnings like this, but they don't matter.


rpm -Uvh xxxx.rpm

rpm -Uvh xxxx.rpm

Tuesday, October 30, 2012

Oracle jobs

SELECT JOB_NAME, OWNER, ENABLED FROM DBA_SCHEDULER_JOBS;

Tuesday, October 23, 2012

When I tried to recompile a package in sqlplus, the sqlplus window freezes and has not responding.


When I tried to recompile a package in sqlplus, the sqlplus window freezes and has not responding.

The reason is that some objects you are trying to use is locked. Go and check what locks the object.

Monday, October 22, 2012

AIX 6.1 Time Zone and Daylight Saving Time

Time Zone:

http://www-01.ibm.com/support/docview.wss?uid=isg3T1000252

DST problem:

http://www-01.ibm.com/support/docview.wss?uid=isg3T1013017#formatcompare



Summary:

TZ=EST5EDT,M3.2.0/2:00:00,M11.1.0/2:00:00

If you change the System TZ, you need to reboot the machine for activating the change.
If you change the date, you don't need to do rebooting.

Friday, October 19, 2012

SP2-1503: Unable to initialize Oracle call interface

Problem:

Install everything correctly, but can't use sqlplus from both double-click and command line.

Solution:

Run as adminstrator

Set AIX date and time

# date 0819092612
           mmddHHMMyy

all see the man page

mm-month
MM-minutes
yy-last two digits of year

Saturday, October 13, 2012

Vim setting


set tabstop=4
set shiftwidth=4
set number
set backupdir=c:\vim_backup


vi/vim tips

1.Copy and paste

In normal model:

10yy     --Copy next 10 lines
p           --Paste the content


2. Tab multiple lines

v           -- Go into Visual Mode
shift + direction(h,j,k,l or arrows)    -- select lines
> or <      -- indent or unindent

Friday, October 12, 2012

Display the output of oracle procedure

I wrote a simple sample like:

DECLARE
    hello varchar(10);
BEGIN
    dbms_output.put_line('Hello World');

END;
/

When I run it on sqlplus, it showed: PL/SQL procedure successfully completed. Nothing else.

The solution is:

sqlplus> set serveroutput on

Then you can see the output.

Customize gvim in windows 7

nice article:
http://benaiah41.wordpress.com/2012/01/17/customizing-gvim-in-windows-7/

Thursday, October 11, 2012

Unsupported major.minor version 49.0

The application is compiled by java 1.5, but I want to run it on a java 1.4 machine.

Friday, October 5, 2012

panic: JVMST017: Cannot allocate memory in initializeMarkAndAllocBits(markbits1)


$ ./c_report.sh
Starting to compile report
Converting RPT_005.rdf
Unable to alloc heap of requested size, perhaps the maxdata value is too small - see README.HTML for more information.
**Out of memory, aborting**

*** panic: JVMST017: Cannot allocate memory in initializeMarkAndAllocBits(markbits1)
./c_report.sh[14]: 9437210 IOT/Abort trap(coredump)
Converting RPT_008.rdf
Unable to alloc heap of requested size, perhaps the maxdata value is too small - see README.HTML for more information.
**Out of memory, aborting**



Solution:

http://www-01.ibm.com/support/docview.wss?uid=swg21524989

Tuesday, October 2, 2012

Jinitiator working on Windows 7

refer to
http://notsomany.wordpress.com/2010/03/30/jinitiator-working-on-windows-7/

Thread: ORA-01552: cannot use system rollback segment for non-system tablespace

The undo_ xxx is set to manual in my pfile and init-ora. So I changed it to AUTO.

ORA-30012: undo tablespace ‘UNDOTBS01′ does not exist or of wrong type

I modified the undo_tablespace in init-ora file and spfile by changing undotbs01 to undotbs02 and it worked.

liboraInstaller.so (Cannot open or remove a file containing a running program.)


 Erroin writing to file
'................/oracle/product/10.2.0/db_1/oui/lib/aix/liboraInstaller.so'.
[................/oracle/product/10.2.0/db_1/oui/lib/aix/liboraInstaller.so (Cannot open or remove a file containing a running program.)]

You will see four options.

click Help
click Retry
click Ignore
click Cancel to stop this installation

The solution is that:

Go to that directory and rename the old file, for example: mv liboraInstaller.so liboraInstaller.so.bak

OUI-18001: The operating system 'AIX Version 6100.05' is not supported.

I am installing ORACLE 10.2.0.2 today on an AIX 6.1 machine. This error poped up when the software is checking the prerequisites of the system. Since AIX 6.1 comes after ORACLE 10.2.0.2, so just ignore the error and keep installing.

Monday, October 1, 2012

Can't shutdown oracle database

Last time, I accidentally deleted the control file and can't shutdown the database by using "shutdown immediate". I was so panic....The solution is that using "shutdown abort"...

TOAD windows 7 (ORA-06413 : Connection Not Open)

Problem:
When using TOAD on Windows 7, it pops up an error:

ORA-06413 : Connection Not Open

Solution:

Copy Quest Software from C:\Program(x86) to C:\Program

alert log

 Check Alert Log for the detailed error messages under ORACLE_HOME/admin/db_name/bdump/alert.log

refer to http://www.adp-gmbh.ch/ora/concepts/alert_log.html

Thursday, September 27, 2012

Easy way to clone a ORACLE db

Refer to

http://www.dba-oracle.com/oracle_tips_db_copy.htm 

and

http://dbaforums.org/oracle/index.php?showtopic=2917

if you want to clone a database TEST -> DENEME 
1 take a backup of your controlfile 
2 take online / offline backup of all your datafiles 
3 make a relevant copy of your init.ora file or make changes to you are deneme initora
4 delete your control file, redo logs and datafiles on DENEME
5 move these files from TEST -> DENEME
6 using the back up of control file create the new control file for deneme 
NOTE the database name needs to be changed from TEST -> DENEME with the 
SET Clause and option resetlogs (depending on hot /cold backup)
7 create the redo log files 
8 startup mount 
9 recover the log files until cancel
10 open database

Wednesday, September 26, 2012

Friday, September 21, 2012

cp : 0653-447 Requested a write of 4096 bytes, but wrote only 3584.


cp : 0653-447 Requested a write of 4096 bytes, but wrote only 3584.
# ulimit -f unlimited
# ulimit -d unlimited

Thursday, September 20, 2012

Import file: expdat.dmp >

exit from Import file: expdat.dmp >
 ctrl -D

UNIX Command

more -p G filename  

go to the end of file

du- sk

check file size

df -G

show disk usage

vi

10yy and p copy 10 lines and paste

ftp

ftp ipaddress

cd , ls or dir

get xxxx
put xxxx


ls -al | tee a.txt

Tar

tar -xvf xxxxx.tar

In

In -s xxxxx.so.6.0.1 xxxxxx.so

uname -a

Show the os information


Vi

Search and Replace

:%s/aaa/bbb/g

replace all aaa with bbb

Can't log in as sysdba

$ sqlplus / as sysdba
not working.

Solution: set the oracle_home and oracle_sid correctly.

Tuesday, September 18, 2012

ORA-28547


ORA-28547: connection to server failed, probable Oracle Net admin error

Check tnsping <target_database>, OK
Check tnsname.ora, OK
Check lsnrctl status, OK
Check sqlnet.ora, OK

Finally, solution from Miss Jennifer:Oracle only allows 8 characters for the database file location.(needs to be confirmed)