SIEBEL odbcsql Unable to Connect

Logging into “SBA_81_DSN” as “SADMIN” …
ODBC error 81 in SQLConnect:
523 72
(native error 0).
Unable to login using specified ODBC parameters.

The above error appear when you are trying to run the below command:

odbcsql /s SIEBEL8_DSN /u sadmin /p sadmin

Solutions :

Make sure the you set TNS_ADMIN in .profile or .bash_profile , TNS_ADMIN Should be Directed to Client32 bit , Copy tnsnames.ora from Database home to Client32

it will be like the following :

export TNS_ADMIN=/u01/app/oracle/instanctclient32/

Thank you
Osama mustafa

Queryable Patch Inventory New Features 12c

Again !!! Oracle 12c Under test , every time i tested it i discover new features, while i am testing today i found new folder under $ORACLE_HOME called QOPatch , for the first time when i opened this folder i only found two files,

Check the https://support.oracle.com note :

Oracle Database 12.1 : FAQ on Queryable Patch Inventory [ID 1530108.1] 

from the name you can see it’s retrieve  information  using query, and to use query you have to get access to SQL Plus, this features  allow you access to the OPatch information from within the database.  This Package called  DBMS_QOPATCH

Some of Attribute to use with this package :

  • GET_OPATCH_INSTALL_INFO
  • SET_CURRENT_OPINST
  • GET_OPATCH_LIST
  • IS_PATCH_INSTALLED
  • GET_OPATCH_DATA
  • GET_OPATCH_BUGS
  • GET_OPATCH_FILES
  • GET_OPATCH_COUNT
  • GET_OPATCH_PREQS
  • GET_OPATCH_OLAYS
  • PATCH_CONFLICT_DETECTION
  • GET_PENDING_ACTIVITY
  • GET_OPATCH_XSLT
  • GET_OPATCH_LSINVENTORY
  • GET_SQLPATCH_STATUS

Since this function used to get Opatch information within database then you have to access to SQL Plus 
Check the below examples :

SQL> select dbms_qopatch.get_opatch_lsinventory() from dual;

DBMS_QOPATCH.GET_OPATCH_LSINVENTORY()
——————————————————————————–

Another Examples :

SQL> select dbms_qopatch.GET_PENDING_ACTIVITY() from dual;
DBMS_QOPATCH.GET_PENDING_ACTIVITY()
——————————————————————————–

My Database still fresh and not patch yet So you will not find that much of information 
Thank you 
Osama mustafa

ORA-00607/ORA-00600

ORA-00600: internal error code, arguments: [4193], [4271], [4056], [], [], [], [], []

As you see the above error ORA-00600 usually Indicate for Bug, A mismatch has been detected between Redo records and Rollback (Undo)  records. and to solve this issue you need to do the below :

SQL> show parameter undo
NAME                                 TYPE        VALUE
———————————— ———– ——————————
undo_management                      string      AUTO
undo_retention                       integer     900
undo_tablespace                      string      UNDOTBS

SQL> alter system set undo_management=’MANUAL’ scope=spfile;

SQL > Shutdown immediate ;
SQL > Startup ; 

SQL > create undo tablespace NEW_UNDOTBS datafile ‘/u01/app/oracle/oradata/SID/NEW_UNDOTBS01.DBF’ size 1G ;

SQL> alter system set undo_tablespace=’NEW_UNDOTBS’ scope=spfile;

System altered.

SQL> alter system set undo_management=’AUTO’ scope=spfile;

System altered.

 After Shutdown The new Effect Should be Taken And If you want to Drop Old Undo you can do This another option you can use is Take if Offline. Sometimes when you want to drop Old Undo you receive new error : 

SQL> drop tablespace UNDOTBS01 including contents;
ORA-01548: active rollback segment ‘_SYSSMU1_1255349037$’ found, terminate dropping tablespace

So What Can i do Take Offline Or The Below Option :

SQL> select * from v$rollname ;

USN NAME
———- —————–
0   SYSTEM
1  _SYSSMU1$
2 _SYSSMU2$
3 _SYSSMU3$
4 _SYSSMU4$
5 _SYSSMU5$
6 _SYSSMU6$

 SQL > Create Pfile=’/u01/New.init’ from spfile
 File Created

SQL > Shutdown immediate ;

Edit pfile 

*.undo_management=’MANUAL’
*.undo_retention=1800
*.undo_tablespace=’NEW_UNDOTBS’
*._offline_rollback_segments= (_SYSSMU1$,_SYSSMU2$,_SYSSMU3$,_SYSSMU4$,_SYSSMU5$,_SYSSMU6$ )

  • Startup database from new pfile without create spfile ;
  • try to Drop Tablespace Now, this way should work.
  • After drop Undo Tablespace, Remove _offline Parameter and undo_management to AUTO 

Thank you 
Osama Mustafa

Recreate Lost Pfile With Simple Command

If you  lost all my files under $ORACLE_HOME/dbs but database is still up and running, check the below :[oracle@192 ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.5.0 – Production on Fri Mar 15 14:49:58 2013

Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 – Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> spool newfile.ora
SQL>     select name||’=’||value from v$parameter where isdefault = ‘FALSE’;

NAME||’=’||VALUE
——————————————————————————–
processes=150
sga_target=285212672
control_files=/u01/app/oracle/oradata/orcl/control01.ctl, /u01/app/oracle/oradat
a/orcl/control02.ctl, /u01/app/oracle/oradata/orcl/control03.ctl

db_block_size=8192
compatible=10.2.0.1.0
db_file_multiblock_read_count=16
db_recovery_file_dest=/u01/app/oracle/flash_recovery_area
db_recovery_file_dest_size=2147483648
undo_management=AUTO

NAME||’=’||VALUE
——————————————————————————–
undo_tablespace=UNDOTBS2
remote_login_passwordfile=EXCLUSIVE
db_domain=
dispatchers=(PROTOCOL=TCP) (SERVICE=orclXDB)
job_queue_processes=10
background_dump_dest=/u01/app/oracle/admin/orcl/bdump
user_dump_dest=/u01/app/oracle/admin/orcl/udump
core_dump_dest=/u01/app/oracle/admin/orcl/cdump
audit_file_dest=/u01/app/oracle/admin/orcl/adump
audit_trail=TRUE
db_name=orcl

NAME||’=’||VALUE
——————————————————————————–
open_cursors=300
os_authent_prefix=
pga_aggregate_target=94371840

23 rows selected.

SQL> spool off ;

Just edit the new file and startup.

Thank you
Osama Mustafa

ORA-04068: existing state of packages has been discarded

The Below Error happened Usually In RAC environment, and its Indicate to Bugs and you can avoid this error as Work around :

 SQL> alter system set “_disable_fast_validate”=true scope=both;

Please be Noted there’s No Restart need After Modify This Parameter.

Also For Better Solution you can upgrade to 11.2.0.3 Or apply Patch Number 9681133 Which Can Be Downloaded From Https://support.oracle.com

Thank you
Osama Mustafa

Moving Undo/Temporary Tablespace

To Move these tablespace Easily you can create them By Following the below Steps :

sqlplus '/as sysdba'
 
SQL>CREATE TEMPORARY TABLESPACE 
TEMPFILE '/new_location/.dbf' 
SIZE 64M REUSE AUTOEXTEND ON NEXT 28 MAXSIZE unlimited;
 
SQL>ALTER DATABASE DEFAULT TEMPORARY TABLESPACE
 
Drop the Old One By Run the Below Command :
 
SQL>DROP TABLESPACE temp INCLUDING CONTENTS AND DATAFILES;
 
 
For Undo Tablespace Check the below Steps:

 
SQL>create undo tablespace
 datafile '/new_location/.dbf' size 2000m;
 
Make New Tablespace for Database:
 
SQL> alter system set undo_tablespace= undotbs2 ;
 
Drop Old Tablespace
:
 
SQL> drop tablespace undotbs including contents;
 
Thank you 
Osama Mustafa 

ORA-01151: use media recovery to recover block, restore backup if needed

SQL> startup
ORACLE instance started.

Total System Global Area 599785472 bytes
Fixed Size 1288820 bytes
Variable Size 192939404 bytes
Database Buffers 402653184 bytes
Redo Buffers 2904064 bytes
Database mounted.
ORA-01172: recovery of thread 1 stuck at block 4545 of file 1
ORA-01151: use media recovery to recover block, restore backup if needed
SQL>

Cause :
  There is block corruption in tablespace.

Solution :

 SQL> shutdown immediate;
SQL> startup mount;
SQL> recover database;
SQL> alter database open;

 

Find Resote Point Rman

Some Times you need to Restore your Database To Earlier time , and before doing that you have to check weather database have valid to do that or not

Simple Query :

SQL>  select resetlogs_change#,to_char(resetlogs_time,
 'DD-MON-YYYY HH24:MI:SS') Last_resetlog_time from v$database_incarnation;
 
RESETLOGS_CHANGE# LAST_RESETLOG_TIME
----------------- --------------------
1 11-SEP-2008 22:57:51
88033 23-MAY-2011 10:12:42
 
Or Sometimes you could Use v$restore_point , Such as
 
SELECT scn, time, database_incarnation#, guarantee_flashback_database from
v$restore_point;
 
 
Thank you 
Osama Mustafa 

ORA-20222: Workload was not captured in the current database



Happy New Year For All , And Wish you All Best 

ORA-20222 “Given capture_id \”%s\” is invalid or the corresponding capture failed”

ORA-20222: Workload was not captured in the current database. Cannot export!
ORA-06512: at “SYS.DBMS_WORKLOAD_CAPTURE”, line 1588
ORA-06512: at line 2

 Regarding to Https://support.oracle.com Note :

DATABASE CAPTURE AND REPLAY COMMON ERRORS AND REASONS [ID 463263.1]
This Error 

is a generic error message that can occur due other underlying error during Capture.
Check the error accompanying with ORA-20222.

Ensure correct directory name is used including check the case-sensitivity of the directory name.
The directory name is case sensitive. Ensure READ and WRITE privilege on the DIRECTORY object to the which is the capture is written.

Thank you 
Osama mustafa

Happy New Year Again .