Sunday, October 20, 2013

java.sql.SQLException: Got minus one from a read call


If you get this error: pls check the alerts.log file.
.sql.SQLException: Got minus one from a read call


commisionTxnIdnull, levelOneApprovedQuantity=null, levelTwoApprovedQuantity=null, levelThreeApprovedQuantity=null, pybleAmt=0.0, _ntpybleAmt=0.0, _pyinsAmt=0.0, _refTransferIDnull
2013-10-21 10:28:40,075 : 2329 [main] DEBUG com.btsl.db.pool.OJDBCPoolManager  - createPool :: Creating oracle connection pool
2013-10-21 10:28:40,076 : 2330 [main] DEBUG com.btsl.db.pool.OJDBCPoolManager  - createPool 10G :: userid=neeraj1, db password=neeraj1, db_url=jdbc:oracle:thin:@172.23.23.47:1522:orcl, minPoolSize=100 max poolSize=150 oraclePoolLogFile=null
java.sql.SQLException: Got minus one from a read call
        at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
        at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:131)
        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:197)
        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:525)
        at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:413)
        at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:508)
        at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:203)
        at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:33)
        at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:510)
        at oracle.jdbc.pool.OracleDataSource.getPhysicalConnection(OracleDataSource.java:275)
        at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:206)
        at oracle.jdbc.pool.OracleConnectionPoolDataSource.getPhysicalConnection(OracleConnectionPoolDataSource.java:139)
        at oracle.jdbc.pool.OracleConnectionPoolDataSource.getPooledConnection(OracleConnectionPoolDataSource.java:88)
        at oracle.jdbc.pool.OracleImplicitConnectionCache.makeCacheConnection(OracleImplicitConnectionCache.java:1567)
        at oracle.jdbc.pool.OracleImplicitConnectionCache.makeOneConnection(OracleImplicitConnectionCache.java:499)
        at oracle.jdbc.pool.OracleImplicitConnectionCache.defaultUserPrePopulateCache(OracleImplicitConnectionCache.java:218)
        at oracle.jdbc.pool.OracleImplicitConnectionCache.<init>(OracleImplicitConnectionCache.java:194)
        at oracle.jdbc.pool.OracleConnectionCacheManager.createCache(OracleConnectionCacheManager.java:269)
        at com.btsl.db.pool.OJDBCPoolManager.createPool(OJDBCPoolManager.java:270)
        at com.btsl.db.pool.OJDBCPoolManager.getConnection(OJDBCPoolManager.java:67)
        at com.btsl.util.OracleUtil.getConnection(OracleUtil.java:113)
        at com.btsl.common.IDGenerator.getNextID(IDGenerator.java:81)
        at com.btsl.pretups.channel.transfer.businesslogic.ChannelTransferBL.genrateTransferID(ChannelTransferBL.java:129)
        at com.btsl.pretups.processes.ActivationBonusRedemption.process(ActivationBonusRedemption.java:291)
        at com.btsl.pretups.processes.ActivationBonusRedemption.main(ActivationBonusRedemption.java:119)
Caused by: oracle.net.ns.NetException: Got minus one from a read call
        at oracle.net.ns.Packet.receive(Packet.java:243)
        at oracle.net.ns.NSProtocol.connect(NSProtocol.java:259)
        at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:966)
        at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:292)
        ... 20 more


com.btsl.common.BaseException
        at com.btsl.db.pool.OJDBCPoolManager.getConnection(OJDBCPoolManager.java:68)
        at com.btsl.util.OracleUtil.getConnection(OracleUtil.java:113)
        at com.btsl.common.IDGenerator.getNextID(IDGenerator.java:81)
        at com.btsl.pretups.channel.transfer.businesslogic.ChannelTransferBL.genrateTransferID(ChannelTransferBL.java:129)
        at com.btsl.pretups.processes.ActivationBonusRedemption.process(ActivationBonusRedemption.java:291)
        at com.btsl.pretups.processes.ActivationBonusRedemption.main(ActivationBonusRedemption.java:119)
2013-10-21 10:28:42,649 : 4903 [main] ERROR com.btsl.pretups.channel.transfer.businesslogic.ChannelTransferBL  - genrateTransferID :: Exception 00000
class=null,method=null,message=00000,date=nullerrorCode=0
        at com.btsl.db.pool.OJDBCPoolManager.getConnection(OJDBCPoolManager.java:143)
        at com.btsl.util.OracleUtil.getConnection(OracleUtil.java:113)
        at com.btsl.common.IDGenerator.getNextID(IDGenerator.java:81)
        at com.btsl.pretups.channel.transfer.businesslogic.ChannelTransferBL.genrateTransferID(ChannelTransferBL.java:129)
        at com.btsl.pretups.processes.ActivationBonusRedemption.process(ActivationBonusRedemption.java:291)
        at com.btsl.pretups.processes.ActivationBonusRedemption.main(ActivationBonusRedemption.java:119)
2013-10-21 10:28:42,650 : 4904 [main] DEBUG com.btsl.pretups.channel.transfer.businesslogic.ChannelTransferBL  - genrateTransferID :: Exited  ID =null
class=ChannelTransferBL,method=genrateTransferID,message=9007,date=2013-10-21errorCode=0
        at com.btsl.pretups.channel.transfer.businesslogic.ChannelTransferBL.genrateTransferID(ChannelTransferBL.java:139)
        at com.btsl.pretups.processes.ActivationBonusRedemption.process(ActivationBonusRedemption.java:291)
        at com.btsl.pretups.processes.ActivationBonusRedemption.main(ActivationBonusRedemption.java:119)
class=ChannelTransferBL,method=genrateTransferID,message=9007,date=2013-10-21errorCode=0
        at com.btsl.pretups.channel.transfer.businesslogic.ChannelTransferBL.genrateTransferID(ChannelTransferBL.java:139)
        at com.btsl.pretups.processes.ActivationBonusRedemption.process(ActivationBonusRedemption.java:291)

        at com.btsl.pretups.processes.ActivationBonusRedemption.main(ActivationBonusRedemption.java:119)
-----------------------After checking  the alerts.log file  you will get this error the do the following--


Mon Oct 21 10:20:26 2013
ORA-00020: maximum number of processes (200) exceeded
 ORA-20 errors will not be written to the alert log for
 the next minute. Please look at trace files to see all
 the ORA-20 errors.
-- need to increase the processes by running this command ---

alter system set processes=500 scope=spfile;
shutdown immediate
startup



Enjoy this....:-) 

Sunday, July 28, 2013

ORA-16032: parameter LOG_ARCHIVE_DEST destination string cannot be translated

[oracle11@db01 ~]$ export ORACLE_SID=orcl

[oracle11@db01 ~]$ sqlplus
SQL*Plus: Release 11.2.0.3.0 Production on Mon Jul 29 10:12:44 2013

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

Enter user-name: sys as sysdba
Enter password:
Connected to an idle instance.

SQL> startup
ORA-16032: parameter LOG_ARCHIVE_DEST destination string cannot be translated
ORA-07286: sksagdi: cannot obtain device information.
Linux Error: 2: No such file or directory

SQL> create pfile='/data01/orcl.ora' from spfile;

File created.

open the pfile and check this parameter and check the path that path is available or not if not then you have to create the folder same as you set  the path in the parameter. and startup the db.


*.log_archive_dest='/data/oracle11_backup/archive'


All The Best.........:)

Thursday, July 25, 2013

ORA-14460: only one COMPRESS or NOCOMPRESS clause may be specified


ORA-14460: only one COMPRESS or NOCOMPRESS clause may be specified


Failing sql is:

CREATE TABLE neer.neeraj( empid number,salary number,lname char(10))…….

ORA-39083: Object type TABLE:"MALI_PRT1"."DAILY_C2S_TRANS_DETAILS" 
failed to create with error:

ORA-14460: only one COMPRESS or NOCOMPRESS clause may be specified

impdp system/manager directory=dump dumpfile=emp.dmp logfile=emp.log remap_schema=hr:neer transform=segment_attributes:n parallel=4

Transform parameter allows you to alter object creation DDL while performing import.  I have tried all the attempt to make the understanding of transform parameter easy.
TRANSFORM = transform_name:value[:object_type]
The transform_name specifies the name of the transform. The possible options are as follows:
  SEGMENT_ATTRIBUTES – If the value is specified as y, then segment attributes (physical attributes, storage attributes, tablespaces, and logging) are included, with appropriate DDL. The default is y.
STORAGE - If the value is specified as y, the storage clauses are included, with appropriate DDL. The default is y. This parameter is ignored if SEGMENT_ATTRIBUTES=n.
OID - If the value is specified as n, the assignment of the exported OID during the creation of object tables and types is inhibited. Instead, a new OID is assigned. This can be useful for cloning schemas, but does not affect referenced objects. The default value is y.
PCTSPACE – The value supplied for this transform must be a number greater than zero. It represents the percentage multiplier used to alter extent allocations and the size of data files.
The object_type is optional. If supplied, it designates the object type to which the transform will be applied. If no object type is specified then the transform applies to all valid object types.


Sunday, July 14, 2013

ORA-39700: database must be opened with UPGRADE

RMAN> alter database open resetlogs;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of alter db command at 07/15/2013 11:22:31
ORA-01092: ORACLE instance terminated. Disconnection forced
ORA-00704: bootstrap process failure
ORA-39700: database must be opened with UPGRADE option
Process ID: 4308
Session ID: 3726 Serial number: 7
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
ORA-03114: not connected to ORACLE
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of alter db command at 07/15/2013 11:22:31
ORA-01092: ORACLE instance terminated. Disconnection forced
ORA-00704: bootstrap process failure
ORA-39700: database must be opened with UPGRADE option
Process ID: 4308
Session ID: 3726 Serial number: 7


[oracle11@hostname ~]$ sqlplus

SQL*Plus: Release 11.2.0.3.0 Production on Mon Jul 15 11:22:57 2013

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

Enter user-name: sys as sysdba
Enter password:
Connected to an idle instance.

SQL> startup mount with pfile='/u01/neeraj_backup/neer.ora'
ORACLE instance started.

Total System Global Area 1238732800 bytes
Fixed Size                  1344624 bytes
Variable Size            1140853648 bytes
Database Buffers           83886080 bytes
Redo Buffers               12648448 bytes
ORA-02231: missing or invalid option to ALTER DATABASE


SQL> alter database mount;

Database altered.

SQL> create spfile from pfile='/u01/neeraj_backup/neer.ora';

File created.


SQL> shutdown immediate
ORA-01109: database not open


Database dismounted.
ORACLE instance shut down.


SQL> conn
Enter user-name: sys as sysdba
Enter password:
Connected to an idle instance.
SQL> startup upgrade
ORACLE instance started.

Total System Global Area 1238732800 bytes
Fixed Size                  1344624 bytes
Variable Size            1140853648 bytes
Database Buffers           83886080 bytes
Redo Buffers               12648448 bytes
Database mounted.
Database opened.

SQL> spool upgrade.log
SQL>
SQL> @ /u01/app/oracle11/product/11.2.0/dbhome_1/rdbms/admin/catupgrd.sql

connect with sqlplus
and login .....




The catupgrd.sql script determines which upgrade scripts must be run, runs them, and then shuts down the database. You must run the script in the Oracle Database 11g Release 2 (11.2) environment.

The upgrade script creates and alters certain data dictionary tables. It also upgrades or installs the following database components in the new Oracle Database 11g Release 2 (11.2) database:

  •     Oracle Database Catalog Views
  •     Oracle Database Packages and Types
  •     JServer JAVA Virtual Machine
  •     Oracle Database Java Packages
  •     Oracle XDK
  •     Oracle Real Application Clusters
  •     Oracle Workspace Manager
  •     Oracle Multimedia
  •     Oracle XML Database
  •     OLAP Analytic Workspace
  •     Oracle OLAP API
  •     OLAP Catalog
  •     Oracle Text
  •     Spatial
  •     Oracle Data Mining
  •     Oracle Label Security
  •     Messaging Gateway
  •     Oracle Expression Filter
  •     Oracle Rules Manager
  •     Oracle Enterprise Manager Repository
  •    Oracle Database Vault
  • Oracle Application Express
All the best...... :)

Thursday, July 11, 2013

ERROR: ORA-00257: archiver error. and ORA-03113: end-of-file on communication channel

If Anyone face this error so refer this command.....


Enter user-name: neeraj
Enter password:
ERROR:
ORA-00257: archiver error. Connect internal only, until freed.


Warning: You are no longer connected to ORACLE.


SQL> startup mount
ORACLE instance started.

Total System Global Area 1603411968 bytes
Fixed Size            2213776 bytes
Variable Size          905971824 bytes
Database Buffers      687865856 bytes
Redo Buffers            7360512 bytes
Database mounted.
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-03113: end-of-file on communication channel
Process ID: 30790
Session ID: 4519 Serial number: 5



SQL> startup mount
ORACLE instance started.

Total System Global Area 1603411968 bytes
Fixed Size            2213776 bytes
Variable Size          905971824 bytes
Database Buffers      687865856 bytes
Redo Buffers            7360512 bytes
Database mounted.

SQL> alter system set db_recovery_file_dest_size=6g scope=spfile;

System altered.

SQL> shutdown immediate
ORA-01109: database not open


Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 1603411968 bytes
Fixed Size            2213776 bytes
Variable Size          905971824 bytes
Database Buffers      687865856 bytes
Redo Buffers            7360512 bytes
Database mounted.
Database opened.

All d best.... :)
enjoy.....

Wednesday, July 10, 2013

An Introduction to SQL Server 2005 Integration Services

Microsoft SQL Server 2005 Integration Services (SSIS) :-
                                                                                                      is a platform for building high performance data integration solutions, including the extraction, transformation, and loading (ETL) of packages for data warehousing. SSIS is the new name assigned to the component formerly branded as Data Transformation Services (DTS).

ETL process and concepts :-
ETL stands for Extraction, Transformation and Loading. ETL is a process that involves the following tasks:
  • Extracting :- data from source operational or archive systems which are the primary source of data for the data warehouse
  • Transforming :- the data - which may involve cleaning, filtering, validating and applying business rules
  • Loading :- the data into a data warehouse or any other database or application that houses data

Data Integration Requirements
In view of this diversity of data, business needs, and user requirements, the Information Technology department has specified the following set of data integration requirements:
  • They must provide reliable and consistent historical and current data integrated from a variety of internal and external sources.
  • To reduce lags in data acquisition, data from providers and vendors must be available via Web services or some other direct mechanism such as FTP.
  • They need to cleanse and remove duplicate data and otherwise enforce data quality.
  • Increasing global regulatory demands require that the company maintain clear audit trails. It is not enough to maintain reliable data; the data needs to be tracked and certified.


Figure 1

RMAN-06059: expected archived log not found


RMAN-06059: expected archived log not found


RMAN> backup database plus archivelog;


Starting backup at 10-JUL-13
current log archived
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup plus archivelog command at 07/10/2013 14:37:21
RMAN-06059: expected archived log not found, loss of archived log compromises recoverability
ORA-19625: error identifying file /oracle/flash_recovery_area/neeraj/archivelog/2013_05_27/o1_mf_1_3898_8t6fsgmn_.arc
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3

RMAN>crosscheck archivelog all;
RMAN>delete noprompt expired archivelog all;

RMAN>backup database plus archivelog;

starting backup...........



Tuesday, April 30, 2013

Xlib: connection to ":3.0" refused by server Xlib: No protocol specified


This is a soluation for the problem  Xlib: connection to ":0.0" refused by server - X ;


 Hi, I can't run any program . getting this  Xlib: connection to ":0.0" refused by server Xlib: No protocol specified xeyes Xlib: connection to ":0.0" refused by server Xlib: No protocol



[oracle@hostname ~]$ dbca
Xlib: connection to ":3.0" refused by server 
   Xlib: No protocol specified

Need to login with the user not root....

[oracle10@db01 ~]$ vi ~/.vnc/xstartup
[oracle10@db01 ~]$ vncserver
You will require a password to access your desktops.
Password: type new password
Verify: retype
--(xauth:  creating new authority file /usr/oracle/.Xauthority
New 'db01.ct.com:3 (oracle10)' desktop is db01.ct.com:3 ,Creating default startup script /usr/oracle/.vnc/xstartup
Starting applications specified in /usr/oracle/.vnc/xstartup
Log file is /usr/oracle/.vnc/db01.ct.com:3.log)

[oracle10@db01 ~]$ vi ~/.vnc/xstartup

Uncomment  both the parameter  (# remove the hash sign  starting both of the line)
unset SESSION_MANAGER
 exec /etc/X11/xinit/xinitrc

 [oracle10@db01 ~]$ service vncserver start
-bash: service: command not found

[oracle10@db01 ~]$ vncserver
New 'db01.ct.com:4 (oracle10)' desktop is db01.ct.com:4
 Starting applications specified in /usr/oracle/.vnc/xstartup
 Log file is /usr/oracle/.vnc/db01.ct.com:4.log

[oracle10@db01 ~]$ dbca
now dbca will run successfully.......



All The Best........:)

Saturday, February 9, 2013

Move a table from one tablespace to another

There are many ways to move a table from one tablespace to another. For example,

ORA-01502: index 'MANU.SYS_C0010803' or partition of such index is in unusable state

conn with sys
see the tablespace

SQL> select tablespace_name,contents from dba_tablespaces;
TABLESPACE CONTENTS
---------- ---------
SYSTEM           PERMANENT
UNDOTBS1     UNDO
SYSAUX          PERMANENT
TEMP             TEMPORARY
USERS           PERMANENT
EXAMPLE    PERMANENT
AD                PERMANENT
AD12             TEMPORARY
8 rows selected.

see the default tablespace of the users

SQL> select username,default_tablespace from dba_users;
USERNAME                       DEFAULT_TABLESPACE
------------------------------ ------------------------------
MDSYS                          SYSAUX
ORDSYS                         SYSAUX
EXFSYS                         SYSAUX
DMSYS                          SYSAUX
DBSNMP                         SYSAUX
SCOTT                          USERS
WMSYS                          SYSAUX
TSMSYS                         USERS
MANU                           AD
BI                             USERS
PM                             USERS

-----to see the tables in the tablespace;

SQL> col owner format a10
SQL> col segment_name format a15
SQL> col tablespace_name format a10

SQL> select owner,segment_name,tablespace_name,segment_type from dba_segments where owner='MANU';
OWNER      SEGMENT_NAME    TABLESPACE SEGMENT_TYPE
---------- --------------- ---------- ------------------
MANU       AD              AD         TABLE
MANU       DEPT            AD         TABLE
MANU       EMP             AD         TABLE


----now change the default tablespace ad into users---

SQL> alter user manu default tablespace users quota unlimited on users;

SQL> select username,default_tablespace from dba_users where username='MANU';

USERNAME                       DEFAULT_TABLESPACE
------------------------------ ------------------------------
MANU                           USERS

manu's tables are in the ad tablespace and now i want to transfer into the one tablespace "users"

SQL> select owner,segment_name,tablespace_name,segment_type from dba_segments where owner='MANU';

OWNER      SEGMENT_NAME    TABLESPACE SEGMENT_TYPE
---------- --------------- ---------- ------------------
MANU       AD              AD         TABLE
MANU       DEPT            AD         TABLE
MANU       EMP             AD         TABLE

--move the table from ad tablespace to users tablespace---

SQL> alter table manu.ad move tablespace users;

Table altered.

SQL> alter table manu.emp move tablespace users;

Table altered.

SQL> alter table manu.dept move tablespace users;

Table altered.

SQL> select owner,segment_name,tablespace_name,segment_type from dba_segments where owner='MANU';

OWNER      SEGMENT_NAME    TABLESPACE SEGMENT_TYPE
---------- --------------- ---------- ------------------
MANU       AD              USERS      TABLE
MANU       DEPT            USERS      TABLE
MANU       EMP             USERS      TABLE

Enter user-name: sys as sysdba
Enter password:

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> SELECT 'ALTER INDEX '||OWNER||'.'||INDEX_NAME||' REBUILD;' FROM DBA_INDEXES WHERE STATUS = 'UNUSABLE';

'ALTERINDEX'||OWNER||'.'||INDEX_NAME||'REBUILD;'
--------------------------------------------------------------------------------
ALTER INDEX MANU.SYS_C0010803 REBUILD;
ALTER INDEX MANU.INDX REBUILD;

SQL> ALTER INDEX MANU.SYS_C0010803 REBUILD;

Index altered.

All the best ....... :)