Skip to content

Posts from the ‘Administration’ Category

Master Note for Handling Oracle Database Corruption Issues

Very useful document


Master Note for Handling Oracle Database Corruption Issues (Doc ID 1088018.1)

DDL Extract for tables

DDL Extract for tables


ALL Tables from user

set heading off;
set echo off;
Set pages 999;
set long 90000;

spool export_tables_ddl.sql

select dbms_metadata.get_ddl(‘TABLE’,table_name,’TESTUSER’) from user_tables;


spool off


*table_name — Don’t mention anything



A table

select dbms_metadata.get_ddl(‘TABLE’,’EMPLOYEE’) from dual


*EMPLOYEE – table name

ORA-19963 ORA-27041 OSD-04002

While doing restore controlfile to new host in windows server, getting below issue

ORA-19963: error getting logical block size of file F:\BACKUP\O1_MF_S_966071800_
ORA-27041: unable to open file
OSD-04002: unable to open file
O/S-Error: (OS 5) Access is denied.

Solution :

Windows, you need to give full permission of directory to users which contents of backup files.

ORA-27102 OSD-00026 O/S-Error: (OS 1455)

I am trying to restore the database to new host, While doing the first step, I try to start the database,

SQL> startup nomount pfile=’F:\backup\init.ORA’;
ORA-32006: SEC_CASE_SENSITIVE_LOGON initialization parameter has been deprecated

ORA-00600: internal error code, arguments: [kmgs_component_init_5], [15], [], []
, [], [], [], [], [], [], [], []


Solution :

The below error message appeared in the alert log file.

ORA-27102: out of memory
OSD-00026: additional error information
O/S-Error: (OS 1455) The paging file is too small for this operation to complete.
Mon Jan 22 14:21:37 2018
Error: Failed to allocate SGA start_addr 00000007D0000000 size 134217728

It seems to be a Memory issue on the server. I have crosschecked the server RAM and init.ora file Memory target size.  The Server RAM size is lesser than memory target size. so I have adjusted the memory target size in init.ora file according to the Server RAM and tried to start the database as a nomount stage, its okay.

Or you need to increase RAM on the server if you need more.

Oracle 12c SE2 installation guide on OEL 7.4

Please find the document here

Oracle 12c SE2 installation guide on OEL 7

12c SQL loader express mode

In Oracle Database12c, SQL*Loader has a new feature called express mode that makes loading CSV files faster and easier. With express mode, there is no need to write a control file for most CSV files you load. Instead, you can load the CSV file with just a few parameters on the SQL*Loader command line.

Example :

SQL> create table dept(deptno number,deptname varchar2(20),deptlocation varchar2(20));

Table created.

SQL> desc dept;
Name Null? Type
—————————————– ——– —————————-

oracle:oradb]$ cat testload.dat
001,IT Dept,Riyadh
003,HR Dept,Bahrain


[premiadb:oracle:testdb]$ sqlldr userid=testme data=testload.dat table=dept

SQL*Loader: Release – Production on Mon Jan 15 09:28:42 2018

Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.

Express Mode Load, Table: DEPT
Path used: External Table, DEGREE_OF_PARALLELISM=AUTO

Table DEPT:
3 Rows successfully loaded.

Check the log files:
for more information about the load.
[premiadb:oracle:testdb]$ sqlplus testme

SQL*Plus: Release Production on Mon Jan 15 09:28:58 2018

Copyright (c) 1982, 2014, Oracle. All rights reserved.

Enter password:
Last Successful login time: Mon Jan 15 2018 09:28:45 +03:00

Connected to:
Oracle Database 12c Enterprise Edition Release – 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> select * from dept;

———- ——————– ——————–
1 IT Dept Riyadh
2 Accounting Riyadh
3 HR Dept Bahrain


For more detail, Please refer


good trick for changing password securly in oracle

Good information,



ORA-01017: invalid username/password ora_dba group

C:\Users\mazar>sqlplus / as sysdba

SQL*Plus: Release Production on Sun Jan 7 14:15:59 2018

Copyright (c) 1982, 2016, Oracle. All rights reserved.

ORA-01017: invalid username/password; logon denied


Solution: added ora_dba group to user

C:\Windows\system32>net localgroup

C:\Windows\system32>net localgroup ora_dba mazar /add
The command completed successfully.


C:\Users\mazar>sqlplus / as sysdba

SQL*Plus: Release Production on Sun Jan 7 14:21:45 2018

Copyright (c) 1982, 2016, Oracle. All rights reserved.

Connected to:
Oracle Database 12c Enterprise Edition Release – 64bit Production



Trigger for open all pdb

create trigger open_all_pdbs
after startup on database
execute immediate ‘alter pluggable database all open’;
end open_all_pdbs;

Drop database link using sys

Step 1:

select * from dba_db_links

Step 2:  create a procedure

Create or replace procedure Drop_DbLink(schemaName varchar2, dbLink varchar2 ) is
plsql varchar2(1000);
cur number;
uid number;
rc number;
u.user_id into uid
from dba_users u
where u.username = schemaName;
plsql := ‘drop database link “‘||dbLink||'”‘;
cur := SYS.DBMS_SYS_SQL.open_cursor;
c => cur,
statement => plsql,
language_flag => DBMS_SQL.native,
userID => uid
rc := SYS.DBMS_SYS_SQL.execute(cur);



Step 3: Drop database link using sys


exec Drop_DbLink(‘owner’,’dblinkname’);