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:~$
Tuesday, December 29, 2009
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)
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
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>
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');
For more detailed information:
http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/dynviews_2012.htm#REFRN30176
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');
| NAME | ISSYS_MODIFIABLE | MY COMMENT |
| db_cache_size | IMMEDIATE | No bouncing needed. |
| object_cache_optimal_size | DEFERRED | A new connection needed. |
| session_cached_cursors | FALSE | Bouncing 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.
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.
Subscribe to:
Posts (Atom)
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...
-
Simple but very handy way of taking exports without knowing database password. expdp \'/ as sysdba\' DIRECTORY=DATA_PUMP_DIR DUMPFIL...
-
It seems an easy topic, I prefer being careful with the easy ones... so it is handy to have all you need, in one place and which will lead i...
-
This directory is created in the home directory of the oracle user, after making a local connection. I had tested it as follows: [oracle@geo...