Tuesday, December 29, 2009

How to change Ubuntu server 9.10 root password

By default there is no root password. By issuing the below command:
derya@ubuntu:~$ sudo passwd root
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated succesfully
derya@ubuntu:~$

Thursday, December 24, 2009

Self update a table which have almost same column values

Updating a table rows whose rows are same except for a few columns. For example all the rows are same except for insert datetime or status like columns.

UPDATE   schema1.table1 a
SET   col4 = 'ABC'
WHERE  a.col3 <
ANY (SELECT   b.col3
FROM   schema1.table1 b
WHERE   a.col1 = b.col1
and a.col2=b.col2);

You can see update results by:

SELECT col1,col2,col3,col4 from  schema1.table1 where col1||col2 in (
SELECT col1||col2
FROM schema1.table1
group by col1,col2
having count(*)>1)

Wednesday, December 23, 2009

Enable Resumable

For long running batch operation even containing DDL operations, module deployments, import and for other stuff.
ALTER SESSION ENABLE RESUMABLE; enables the resumable property.

http://www.oracle-base.com/articles/9i/ResumableSpaceAllocation.php

Monday, December 21, 2009

Getting non-english messages in your Sql*Plus

NLS_LANG parameter in the registry causes this.
You could get your current environment settings from the sql*Plus by:
SQL> SELECT USERENV('language') FROM DUAL;

USERENV('LANGUAGE')
----------------------------------------------------
TURKISH_TURKEY.TR8MSWIN1254

SQL> desc
Kullan²m: DESCRIBE [schema.]object[@db_link]
SQL>

You could change NLS_LANG parameter in the registry:
from
TURKISH_TURKEY.TR8MSWIN1254
to
AMERICAN_TURKEY.TR8MSWIN1254

You must relogin from sqlplus, in order to see the change.

SQL> SELECT USERENV('language') FROM DUAL;

USERENV('LANGUAGE')
----------------------------------------------------
AMERICAN_TURKEY.TR8MSWIN1254

SQL> desc
Usage: DESCRIBE [schema.]object[@db_link]
SQL>

Tuesday, December 15, 2009

Does a database parameter value change need bouncing?

You need a quick look whether a db parameter needs bouncing the db.

issys_modifiable column in v$parameter view tells this. False dos not mean you cannot change it with ALTER SYSTEM, means a bouncing. I think this parameter name must be something like "issys_changeable_in_session" :)

issys_modifiable column name is easier to understand, if it is TRUE you can change in session with ALTER SESSION , FALSE then you cannot.

For sample parameters, below SQL Statement which produced this data:

SELECT   name, issys_modifiable
FROM   v$parameter
WHERE   name in ('session_cached_cursors','object_cache_optimal_size','db_cache_size');























NAMEISSYS_MODIFIABLEMY COMMENT
db_cache_sizeIMMEDIATENo bouncing needed.
object_cache_optimal_sizeDEFERREDA new connection needed.
session_cached_cursorsFALSEBouncing needed.

For more detailed information:

http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/dynviews_2012.htm#REFRN30176

Friday, December 4, 2009

ORA-06508: PL/SQL: could not find program unit being called

Problem:

This strange error is occurred when I tried to execute a procedure.

ORA-20300: Exception in ABC_table when calling xxxproc. SQLERRM:

ORA-06508: PL/SQL: could not find program unit being called

ORA-06512: at "myuser.myproc", line 113

Cause:

No real cause.

Solution:

I execute it by making a new fresh connection and it worked successfully.

Windows (powershell) counterparts of Linux commands

You may find Windows mostly powershell equivalent of frequently used Linux commands here. I will update this post, with newer ones by the ti...