Connecting to Oracle Database - Not Connecting
I am new to JAVA and for the first time I am trying to connect to an Oracle data using JAVA. Well, I am getting an error when trying to connect to the database. What I can see the error has to do that the strings passed to make the databases connection are NULL. So, an error (see error below).
Question
How come the "connection" varriable is NULL?
It appears that the hold "try" session is not executed. Is this session out of order?
ERROR
Could not find the database connection: null
Database connection before call: null
Exception in thread "main" java.lang.NullPointerException
at TestOCIApp.main(TestOCIApp.java:39)
========= JAVA Program START =======
//import java.sql.*;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class TestOCIApp {
public static void main(String args[]) throws ClassNotFoundException,
SQLException {
Connection connection = null;
try {
// Load the JDBC driver
String driverName = "oracle.jdbc.driver.OracleDriver";
Class.forName(driverName);
// Create a connection to the CCMS PROD database
String serverName = "192.168.2.144";
String portNumber = "1521";
String sid = "op01ccdb01";
String url = "jdbc:oracle:thin:@" + serverName + ":" + portNumber + ":" + sid;
String username = "user-id";
String password = "password";
connection = DriverManager.getConnection(url, username, password);
System.out.println("connection value: " + connection);
} catch (ClassNotFoundException e) {
// Could not find the database driver
System.out.println("Could not find the database connection: " + connection);
} catch (SQLException e) {
// Could not connect to the database
System.out.println("Could not connect to the database connection: " + connection);
System.out.println("Database connection before call: " + connection);
Statement stmt = connection.createStatement();
ResultSet rset = stmt.executeQuery("select 'Hello OCI driver tester '||USER||'!' result from dual");
while (rset.next())
System.out.println(rset.getString(1));
rset.close();
stmt.close();
connection.close();
========= JAVA Program END =========
The try section is being executed just fine but only partially because you get the exception "ClassNotFoundException", which means it cannot load the Oracle driver class (so it fails at the line where it says):
Class.forName(driverName);You catch this exception, and then just print a line "Could not find the database connection: null". Then you let the code continue, obviously without having initialized your variables yet.
I would recommend rewriting those catch blocks to throw a new RuntimeException so the code will not continue further when an error is detected in the try, or to not catch them not all if you donot want to handle them there in a proper fashion.
As to your problem, you probably have not added the ojdbc14.jar to your project, and that's why it cannot find the OracleDriver class.
Finally, try to add {noformat}{noformat} around your code when you post code. It makes it a lot more readable.
Similar Messages
-
Hi Gurus,
I tried to start up the database by issuing the command on my Dev server
c:\>sqlplus/nolog
connect / as sysdba
"startup,"
and I am getting the following error:
ORA-03113 end-of-file on communication channel
And the second time I issued the command, I got the following errors:
ORA-24324 service handle not initialized
ORA-01041 internal error. hostdef extension doesn't exist.
O.S IS WINDOWS 2003.
ORACLE RDBMS Version: 10.2.0.2.0
Pls advice.
Thanks.Dump file c:\oracle\dev\102\rdbms\trace\dev_ora_3396.trc
Wed Aug 04 20:12:35 2010
ORACLE V10.2.0.2.0 - Production vsnsta=0
vsnsql=14 vsnxtr=3
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
Process Id: 0x0000098c Thread Id : 0x00000d44 Time : Wed Aug 04 20:12:35
Excp. Code: 0xc0000005 Excp. Type: ACCESS_VIO Flags: 0x00000000
Registers -
eip = 00b14c0f esp = 04bfd3a4 ebp = 04bfd405 edi = 04ac80a0 esi = 04bfd3e0
eax = 00b14c08 ebx = 04c8bb8d ecx = 04bfd35d edx = 04bfd3d4
ecs = 0000001b eds = 00000023 ees = 00000023 ess = 00000023
egs = 00000000 efs = 0000003b
eflags = 00010202
End of Registers -
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
Windows Server 2003 Version V5.2 Service Pack 1
CPU : 4 - type 586, 2 Physical Cores
Process Affinity : 0x00000000
Memory (Avail/Total): Ph:3169M/3743M, Ph+PgF:23279M/23643M, VA:1930M/2047M
Instance name: dev
Redo thread mounted by this instance: 0 <none>
Oracle process number: 0
Windows thread id: 3396, image: ORACLE.EXE (SHAD)
2010-08-04 20:12:35.704
ksedmp: internal or fatal error
ORA-07445: exception encountered: core dump [ACCESS_VIOLATION] [_kxfpmxdf+7] [PC:0xB14C0F] [ADDR:0xB14C08] [UNABLE_TO_WRITE] []
Current SQL information unavailable - no SGA.
Call Stack Trace -
calling call entry argument values in hex
location type point (? means dubious value)
_kxfpmxdf+7 00000000
A0608A23 CALL??? 00000000
Binary Stack Dump -
========== FRAME [1] (_kxfpmxdf+7 -> 00000000) ==========
Inaccessible memory range: 00000000 -> 00000400
========== FRAME [2] (A0608A23 -> 00000000) ==========
Dump of memory from 0x04BFD405 to 0x04BFD505
4BFD400 04BFD464 608A23C9 04AC80A0 [d....#.`....]
4BFD410 03218A54 04C8004C 04C8BB8C 04ACAD60 [T.!.L.......`...]
4BFD420 00000000 00000000 00000061 000000BB [........a.......]
4BFD430 00000001 04A19B50 04A19B80 00000000 [....P...........]
4BFD440 00000000 04A19B80 04C68080 04C805C4 [................]
4BFD450 04C8004C 03218A54 04ACAD60 031FF3F0 [L...T.!.`.......]
4BFD460 04AC80B0 04BFD48C 608E68C1 04AC80A0 [.........h.`....]
4BFD470 03218A54 04C8004C 04C805C4 00000000 [T.!.L...........]
4BFD480 00194FE0 00194FE0 00000000 04BFDB64 [.O...O......d...]
4BFD490 0044807A 04AC80A0 03218A54 04C8004C [z.D.....T.!.L...]
4BFD4A0 00000000 00000000 00000000 00000000 [................]
Repeat 5 times
4BFD500 00000000 00000000 [........]
Argument/Register Address Dump -
End of Call Stack Trace -
===================================================
PROCESS STATE
Process global information:
process: 00000000, call: 00000000, xact: 00000000, curses: 00000000, usrses: 00000000
No process is allocated.
KSFD PGA DUMPS
Number of completed I/O requests=0 flags=0
END OF PROCESS STATE
PINNED BUFFER HISTORY (oldest pin first)
SGA is not mapped - only buffer DBAs will be dumped
END OF PINNED BUFFER HISTORY
No block in buffer pin history is suitable for redo dump.
No cursors.
Archival Runtime State -
SGA unmapped
End of Archival Runtime State - -
Oracle database not getting Up after patch upgrade
Hi,
I have upgraded my oracle database from 10.0.2.1 to 10.0.2.4. after this databse is not coming up. I am able to start/stop listner but while starting SAP it is not able to start databse. Pasting error log below.
Wed Jun 24 14:56:45 PDT 2009
LOGFILE FOR STARTING ORACLE
Trying to start CRD database ...
Wed Jun 24 14:56:45 PDT 2009
checking required environment variables
ORACLE_HOME is >/oracle/CRD/102_64<
ORACLE_SID is >CRD<
Wed Jun 24 14:56:45 PDT 2009
check initora
Wed Jun 24 14:56:45 PDT 2009
check initora
Wed Jun 24 14:56:45 PDT 2009
checking V2 connect
TNS Ping Utility for Linux: Version 10.2.0.4.0 - Production on 24-JUN-2009 14:56:45
Copyright (c) 1997, 2007, Oracle. All rights reserved.
Used parameter files:
/usr/sap/CRD/SYS/profile/oracle/sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (COMMUNITY = SAP.WORLD) (PROTOCOL = TCP) (HOST = CRM) (PORT = 1527))) (CONNECT_DATA = (SID =
CRD) (GLOBAL_NAME = CRD.WORLD)))
OK (0 msec)
tnsping: V2 connect to CRD
Wed Jun 24 14:56:45 PDT 2009
Connect to the database to check the database state:
R3trans: connect check finished with return code: 12
Database not available
Wed Jun 24 14:56:45 PDT 2009
Shutdown database
First trying to shutdown the database - May be,
the database is in the nomount or mount state
Wed Jun 24 14:56:45 PDT 2009
starting database
SQL*Plus: Release 10.2.0.4.0 - Production on Wed Jun 24 14:56:45 2009
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to an idle instance.
ORACLE instance started.
Total System Global Area 1224736768 bytes
Fixed Size 2083560 bytes
Variable Size 620758296 bytes
Database Buffers 587202560 bytes
Redo Buffers 14692352 bytes
Database mounted.
ORA-01092: ORACLE instance terminated. Disconnection forced
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, Data Mining and Real Application Testing options
Wed Jun 24 14:56:53 PDT 2009
Connect to the database to verify, that the database is now open
R3trans check finished with return code: 12
ERROR: Startup of database failed
Notify Database Administrator.
/usr/sap/CRD/SYS/exe/run/startdb: Terminating with error code 12
thanks,
BhanuHi,
I have tried to start and stop oracle from SPLplus but no luck. i am pasting alert log file which is saying some block courruption......
Starting up ORACLE RDBMS Version: 10.2.0.4.0.
System parameters with non-default values:
processes = 80
sessions = 96
event = 10191 trace name context forever, level 1
sga_max_size = 1224736768
shared_pool_size = 587202560
shared_pool_reserved_size= 57982058
filesystemio_options = setall
control_files = /oracle/CRD/origlogA/cntrl/cntlrCRD.dbf, /oracle/CRD/origlogB/cntrl/cntrlCRD.dbf, /oracle/CRD/sapdata1/cntrl/cntrlCRD.dbf
control_file_record_keep_time= 30
db_block_size = 8192
db_cache_size = 587202560
compatible = 10.2.0
log_archive_dest = /oracle/CRD/oraarch/CRDarch
log_buffer = 14246912
log_checkpoint_interval = 0
db_files = 254
log_checkpoints_to_alert = TRUE
dml_locks = 4000
undo_management = AUTO
undo_tablespace = PSAPUNDO
undo_retention = 43200
recyclebin = off
remote_os_authent = TRUE
remote_login_passwordfile= EXCLUSIVE
job_queue_processes = 1
background_dump_dest = /oracle/CRD/saptrace/background
user_dump_dest = /oracle/CRD/saptrace/usertrace
core_dump_dest = /oracle/CRD/saptrace/background
optimizer_features_enable= 10.2.0.1
sort_area_size = 2097152
sort_area_retained_size = 0
db_name = CRD
open_cursors = 800
optimpeek_user_binds = FALSE
pga_aggregate_target = 773094113
workarea_size_policy = AUTO
statistics_level = typical
PMON started with pid=2, OS id=25204
PSP0 started with pid=3, OS id=25206
MMAN started with pid=4, OS id=25208
DBW0 started with pid=5, OS id=25210
LGWR started with pid=6, OS id=25212
CKPT started with pid=7, OS id=25214
SMON started with pid=8, OS id=25216
RECO started with pid=9, OS id=25218
CJQ0 started with pid=10, OS id=25220
MMON started with pid=11, OS id=25222
MMNL started with pid=12, OS id=25224
Wed Jun 24 15:06:19 2009
ALTER DATABASE MOUNT
Wed Jun 24 15:06:24 2009
Setting recovery target incarnation to 1
Wed Jun 24 15:06:24 2009
Successful mount of redo thread 1, with mount id 182910572
Wed Jun 24 15:06:24 2009
Database mounted in Exclusive Mode
Completed: ALTER DATABASE MOUNT
Wed Jun 24 15:06:24 2009
ALTER DATABASE OPEN
Wed Jun 24 15:06:24 2009
Beginning crash recovery of 1 threads
parallel recovery started with 2 processes
Wed Jun 24 15:06:24 2009
Started redo scan
Wed Jun 24 15:06:24 2009
Completed redo scan
1 redo blocks read, 0 data blocks need recovery
Wed Jun 24 15:06:24 2009
Started redo application at
Thread 1: logseq 16126, block 2, scn 1104239482
Wed Jun 24 15:06:24 2009
Recovery of Online Redo Log: Thread 1 Group 2 Seq 16126 Reading mem 0
Mem# 0: /oracle/CRD/origlogB/log_g12m1.dbf
Mem# 1: /oracle/CRD/mirrlogB/log_g12m2.dbf
Wed Jun 24 15:06:24 2009
Completed redo application
Wed Jun 24 15:06:24 2009
Completed crash recovery at
Thread 1: logseq 16126, block 3, scn 1104259484
0 data blocks read, 0 data blocks written, 1 redo blocks read
Wed Jun 24 15:06:25 2009
LGWR: STARTING ARCH PROCESSES
ARC0 started with pid=16, OS id=25232
Wed Jun 24 15:06:25 2009
ARC0: Archival started
ARC1: Archival started
LGWR: STARTING ARCH PROCESSES COMPLETE
ARC1 started with pid=17, OS id=25234
Wed Jun 24 15:06:25 2009
Thread 1 advanced to log sequence 16127 (thread open)
Thread 1 opened at log sequence 16127
Current log# 3 seq# 16127 mem# 0: /oracle/CRD/origlogA/log_g13m1.dbf
Current log# 3 seq# 16127 mem# 1: /oracle/CRD/mirrlogA/log_g13m2.dbf
Successful open of redo thread 1
Wed Jun 24 15:06:25 2009
MTTR advisory is disabled because FAST_START_MTTR_TARGET is not set
Wed Jun 24 15:06:25 2009
ARC0: Becoming the 'no FAL' ARCH
ARC0: Becoming the 'no SRL' ARCH
Wed Jun 24 15:06:25 2009
ARC1: Becoming the heartbeat ARCH
Wed Jun 24 15:06:25 2009
SMON: enabling cache recovery
Wed Jun 24 15:06:25 2009
Errors in file /oracle/CRD/saptrace/usertrace/crd_ora_25226.trc:
ORA-00704: bootstrap process failure
ORA-39700: database must be opened with UPGRADE option
Wed Jun 24 15:06:25 2009
Error 704 happened during db open, shutting down database
USER: terminating instance due to error 704
Instance terminated by USER, pid = 25226
ORA-1092 signalled during: ALTER DATABASE OPEN...
Thanks,
Bhanu -
Oracle database not starting up in oracle 10g RAC
Hi!
Recently I came across one problem with one node oracle 10g RAC.When the Oracle database is started,while opening it is giving ORA-03113:End of file on communication channel error.When I saw the the alert trace file and other trace files I found Disk group is exhausted error and it is not able to create .dbf files.Actually it is not a production server and I gave archive log destination in SAN.Even the spfile(content of init_database.ora) is in SAN..
I tried Asmcmd utility to delete the archive log files.As the oracle is not available I am not able to asmcmd prompt.
How to change the destination of archive log and to remove the old archive log files(as it is a testing environment we can remove) from SAN?Please let me know.
Thanks & Regards
Srikanth MVSkeithrust wrote:
On VMware there's a known issue with Oracle databases on a Windows client not starting up properly all the time and a manual startup using oradim -start -sid <whatever> is required to get it fully running. Hmmm, doing it several time, and never seen such issue. Which "known issue" and by who are you talking about ?
I created a brand new Oracle VM Windows 2003 32-bit server, installed the Oracle drivers for paravirtualization, and whammo, the problem is still hereI'm sure, you miss something somewhere in the config. Right now, you're on supported configuration, you could either raise a SR to the support, or get help from your peer on Oracle Database General forum.
Ah, but it's not a Windows issue. On a non-VM Windows box the database starts just fine all the time. Again, this is a known issue acknowledged by Oracle on the VMware side, I'm just surprised it exists on the Oracle VM side.Again, give more details about this "known issue". Never heard about that, eventhough I've been around for years.
I was afraid you were going to ask that. I'll have to search for it again, but I think you can do the same as well....Well, I doubt you could find a Metalink note about Oracle on VMWare. So far, Oracle has always refused to support database on OS virtualized on VMWare (or any VM software other than Oracle VM). Based on that, you could be sure, your "known issue" is not an issue on Oracle VM.
If you want more help, again, give more details about your issue.
Nicolas. -
Oracle Database Not Starting Up Properly
On VMware there's a known issue with Oracle databases on a Windows client not starting up properly all the time and a manual startup using oradim -start -sid <whatever> is required to get it fully running. I kinda figured that I wouldn't run into the exact same issue on Oracle VM. I created a brand new Oracle VM Windows 2003 32-bit server, installed the Oracle drivers for paravirtualization, and whammo, the problem is still here. I didn't find anything in this forum about the database not starting up, so I'm wondering if others are running into the same problem and how to resolve the issue. Thanks a bunch for your help.
keithrust wrote:
On VMware there's a known issue with Oracle databases on a Windows client not starting up properly all the time and a manual startup using oradim -start -sid <whatever> is required to get it fully running. Hmmm, doing it several time, and never seen such issue. Which "known issue" and by who are you talking about ?
I created a brand new Oracle VM Windows 2003 32-bit server, installed the Oracle drivers for paravirtualization, and whammo, the problem is still hereI'm sure, you miss something somewhere in the config. Right now, you're on supported configuration, you could either raise a SR to the support, or get help from your peer on Oracle Database General forum.
Ah, but it's not a Windows issue. On a non-VM Windows box the database starts just fine all the time. Again, this is a known issue acknowledged by Oracle on the VMware side, I'm just surprised it exists on the Oracle VM side.Again, give more details about this "known issue". Never heard about that, eventhough I've been around for years.
I was afraid you were going to ask that. I'll have to search for it again, but I think you can do the same as well....Well, I doubt you could find a Metalink note about Oracle on VMWare. So far, Oracle has always refused to support database on OS virtualized on VMWare (or any VM software other than Oracle VM). Based on that, you could be sure, your "known issue" is not an issue on Oracle VM.
If you want more help, again, give more details about your issue.
Nicolas. -
Oracle database not able to connect in network
Hi all,
I have one problem.I have created a new database in Oracle 9i.This database I am trying to connect as system user,with a password.I am able to connect the darabase
locally,but I am not able to connect to this database in network.Lan connection and everything is oK.Its giving error as
An error occurred while establishing the connection:
Type: java.sql.SQLException Error Code: 17002
Message:
Io exception: The Network Adapter could not establish the connection
can anyone help me out in this issue?
thanks and regards
DhaneshYou are attempting to connect to an Oracle instance using JDBC and you are receiving the following error.
java.sql.SQLException: Io exception:
The Network Adapter could not establish connection
SQLException: SQLState (null) vendor code (17002)
Any or all of the following conditions may also apply:
1) You are able to establish a SQL*Plus connection from the same
client to the same Oracle instance.
2) You are able to establish a JDBC OCI connection, but not a Thin
connection from the same client to the same Oracle instance.
3) The same JDBC application is able to connect from a different
client to the same Oracle instance.
4) The same behavior applies whether the initial JDBC connection
string specifies a hostname or an IP address.
Also
The Network Adapter exception is caused because:
1. The database host name or port number is wrong.
2. The database TNSListener has not been started. The TNSListener may be started with the lsnrctl utility.
Please let us know where is the actual problem , then we can help you out.
HTH
Amkotz -
Oracle Database not starting ORA-01034: ORACLE not available and ORA-27101
Dear Sir,
today i have restarted the database server (11gR2) after that database service is not starting, the error message is
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86_64 Error: 2: No such file or directory
Process ID: 0
Session ID: 0 Serial number: 0[oracle@bladb ~]$ export $ORACLE_HOME
-bash: export: `/oracle/product/11.2.0/dbhome_1': not a valid identifier
[oracle@bladb ~]$ sqlplus sys/manager as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Fri May 3 17:46:28 2013
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.
[oracle@bladb ~]$ tail -20 /oracle/product/11.2.0/dbhome_1/startup.log
SQL> Connected to an idle instance.
SQL> ORA-00845: MEMORY_TARGET not supported on this system
SQL> Disconnected
/oracle/product/11.2.0/dbhome_1/bin/dbstart: Database instance "bladb" warm started.
/oracle/product/11.2.0/dbhome_1/bin/dbstart: Starting up database "bladb"
Fri May 3 17:40:24 IST 2013
SQL*Plus: Release 11.2.0.1.0 Production on Fri May 3 17:40:24 2013
Copyright (c) 1982, 2009, Oracle. All rights reserved.
SQL> Connected to an idle instance.
SQL> ORA-00845: MEMORY_TARGET not supported on this system
SQL> Disconnected
/oracle/product/11.2.0/dbhome_1/bin/dbstart: Database instance "bladb" warm started. -
Need to fatch the data from sqlserver to Oracle DATABASE ;not migration
Hello,
What is the easiest method to insert/refresh data into Oracle Tables from SQLSERVER 2005 table.Do I need ODBC connection and how it works in the PL/SQL to create the connection and fetch the data from sqlserver.
Thanks,
SarabmannI need to fetch from ORACLE back-end ,for example I want to install the mechanism at the back-end server where if I write stored procedure and call this link which enable me to fetch the data from sqlserver.
Environment:- Linux as OS
Oracle 10G as a Database -
Oracle Database not open automatically on restarting the server
Hello,
I am using Oracle8i Release 8.1.6.0.0 - Production. And OS windows 2000.
I installed oracle 8i. On restarting the server the database is not up automatically.
I check the following services. All are in automatice mode.
ORACLETNSListerner
ORacleserviceSID
Oraclewebassistant.
I tried the following option also.
ORADIM -edit -sid -startmode auto.
still not working.
Anyone please suggest the solution for this.
Thanks & Regards
KrishnaDo you have any Antivirus installed in that server, sometimes antivirus blocks oracle autostart. try with uninstalling antivirus if it is .
Thanks -
Default value from Oracle database not working
Hi Everyone:
We use JHeadstart 10.1.3.1.
I have an Oracle table that has 2 fields that are both mandatory and have default values. We have been spending a lot of time putting this type of business logic in the database so that these checks do not have to happen in the JHeadstart Application.
The mandatory field is being brought into our Entity Object (as the mandatory checkbox is checked), but the default values do not seem to be getting pulled from the database. Even though the default value is defined at the database level, when trying to insert a new row into the table, a value must be filled in by the User running the application, otherwise an Oracle error is received that it is a mandatory field and must have a value. This happens when I am running the ApplicationModule by right-clicking it and clicking on "Test" as well as when running the Application
Does JDeveloper not pull default values from the database? Is there something I am missing?
Just for clarity, we have developed a re-usable library of entity objects that imports all of our Business Components similar to the following link
http://download-uk.oracle.com/docs/cd/B32110_01/web.1013/b25947/bcadvgen007.htm#CHEFECGD This is working well, but want to mention it here in case it is a consideration.
Thanks in advance.
Mary
U of WSteven:
Thanks so much for taking the time to reply. Good to hear from you. Hope you are keeping warm in the Netherlands!
During synchronization or initial creation of the Business Components from the Oracle tables, JDeveloper brings over the mandatory attribute as defined in the database.
Would it be possible, in a future release, to also bring over the default values found in the database and assign them to the "Default" property in the Entity Objects Editor?
I always like to follow the best practice of defining something in one spot to make maintenance as easy as possible and avoid manual steps.
Thanks very much for your time.
Mary B
U of Windsor -
Retrieve data from a synonym in oracle database through db connect
Hi Everyone,
I have created certain synonym for some tables in oracle. I want to retrieve data from it through db connect but where through source system and then selecting database tables, only tables and views are available.
Synonyms are not available to create data sources and retrieve the data from it. Why is it so. Is this a limitation of db connect.
Can anyone please let me know about it.
Thanks,
Joshua.Hi,
You want to import data from an external Oracle database into your BW 3.X. To do this, you can connect the external database to the BW 3.X release as a source system using the external database connect. BW 3.X here represents BW 3.0, BW 3.1 and BW 3.5 because in other (DB relevant) parts, all 3 versions are based on the same source code.
General information
The above function allows you to load data from an external Oracle database (not a BW database) into your BW 3.0 system.
There may also be constellations which cannot be used directly through the DB Connect access. However, it should be possible to find an adequate, customer-specific solution for most of these scenarios.
In such situations, the resulting work falls into the area of Consulting and cannot be handled via Support.
Successful implementation of a connection requires corresponding expertise and experience in the use of the source database in the areas:
- Tools
- SQL syntax
- DB-specific functions
Corresponding knowledge of the source application is also required to ensure that semantically relevant data arrives in the BW system.
Procedure
You should execute the following steps to connect the source system (Q) to the BW system (BW):
Installing the client software on an BW application server
Of course, you only need to install the client software if you are using BW with a non-Oracle database.
Use the Oracle setup program on the database CD (runInstaller on Unix) to start the OracleInstaller. Follow the program instructions and the DB installation instructions to install the Oracle Client software on BW.
Testing connection setup from BW to Q
After you install the client software on BW, try to set up a connection from BW to the server on Q. You may need to adjust the tnsnames.ora or sqlnet.ora files for this, to introduce the Oracle systems (to which contact should be made) to BW. You can test the connection by executing the command "tnsping QDB" on BW to check whether the client has established contact to the QDB database on the Q system.
Creating a separate U user in Q
We recommend that you create a separate U user in Q for connection to BW. This means that authorization and administration questions can be solved centrally.
Displaying data sources in Q for the U user
To provide U data for users other than U, you can create views on other user tables as user U:
CREATE OR REPLACE VIEW viewname AS
SELECT * FROM QDB.tablename
You may have to grant SELECT privileges to user U in the QDB schema:
GRANT select ON QDB.tablename TO U
Of course, you can also restrict or reformat data in the view arrangement (for example, change from internal date format into the SAP date format). JOIN operations using several tables are also available.
!!! Synonyms do not yet work!!!
Synonyms that you can create as described below are another option for providing a complete table for the user U:
CREATE SYNONYM synoname FOR QDB.tablename
!!! Synonyms do not (yet) work!!!
After you have displayed the require data for user U, you can simply use
SELECT * FROM <view or table>
on the Q system to check which data is returned.
You can now open a link to Q as user U in the BW system with SQLPLUS and check, using the same SELECT, whether this data is also seen in the Oracle client. If this is not the case, there is probably a connection problem.
Creating a connection from BW to Q in BW
Including data sources of user U user in Q in BW.
Solution
Supported BW, Basis and BW 3.0B database versions, Basis 6.20 Support Package 2 (or higher)
Oracle 8.1 (or higher, see below)
Possible problems
- Synonyms do not (yet) work!
Up to now, only tables and views have been used as data sources for the DB Connect from the R3 Basis. As soon as synonyms are also used in the Basis, you will be able to convert created views (or even replicated tables) to synonyms as a workaround.
With Basis 6.40 at the earliest, therefore as of BW 3.5, you will also be able to use synonyms. Until then, the following will help:
CREATE VIEW <view_on_synonym> AS SELECT * FROM <synonym>
- The source DB must have at least the release version of the BW DB.
Oracle only ensures the support of client-server links if the version of the client is not higher than that of the server. So if BW has Oracle version 8.1 and, as in the case of Dbconnect, is run as a client against the server of the source database, the source database must have at least release Oracle 8.1 or higher.
Of course, you have the option to install the Oracle client software of a lower version and then use this for the DB connect. This is also the procedure used to work with a DB connect on external databases of other vendors.
Furthermore, the implementation of the DBconnect function in BW uses SAP Basis functions. Specifications of Oracle 8.1 database catalogs are used here. The source database must therefore have at least Version 8.1.
- Oracle Client Software Version
If you want to connect from an Oracle BW DB to an Oracle source DB, for the DB connect you naturally use the client software that you already installed on each application server.
If you want to connect from a non-Oracle BW DB to an Oracle source DB, check item 3 of note 521230 to see which Oracle client software version is released with your BW R3 kernel and use this version.
- Date and time fields in Oracle and their conversion into SAP-compatible column formats
Example with a DATE field:
Since a SAP table does not have a DATE field (date values are NUMC(8) and time specifications are NUMC(6)), we will use the Oracle DBA_TABLES system table as an example.
SQL> desc dba_tables;
The Oracle DBA_TABLES system table has a LAST_ANALYZED field. This is a DATE type field and is recognized as a date field of 7 characters by DBA_CONNECT. However, the import does not work because the DATE is a 7-byte conglomerate of "...century, year, month, date, hour, minute and second." (extract from the Oracle documentation).
To make this DATE field legible for DB connect, you must use the TO_CHAR function in a VIEW. This should display the following examples:
SQL> select LAST_ANALYZED from dba_tables
where table_name like 'RS%' and rownum < 10 ;
The formatting used here is the default used implicitly by SQLPLUS.
SQL> select to_char(LAST_ANALYZED,'YYYYMMDD') as dat from dba_tables where table_name like 'RS%' and rownum < 10 ;
The result now has the SAP compatible format YYYYMMDD and should be loaded correctly by the DB connect as a date.
SQL> select to_char(LAST_ANALYZED,'HH24MISS') as tim from dba_tables where table_name like 'RS%' and rownum < 10 ;
The result now has the SAP compatible format HHMMSS and should be loaded correctly by the DB connect as a time.
You can use the following example for more detailed experiments:
SQL> select to_char(
TO_DATE('03-FEB-2001 04:05:06','DD-MON-YYYY HH24:MI:SS'),
'YY-MM-DD HH24-MI-SS') as datim from dual;
with the result:
DATIM
01-02-03 04-05-06
When you create a VIEW and use the TO_CHAR function (or other functions), you should easily be able to avoid problems with the interpretation of date/time specifications (and other reformatting).
Details about the functions and the formats are contained in the Oracle documentation.
- Special characters
A words that contain special characters can only be imported correctly if the code pages in BW and in the source system are identical. If the code pages are not the same, DB Connect can be used if the characters to be imported appear under the first 127 characters of the character set.
The use of multibyte code pages in the source system for saving data using character sets with more than 256 characters (Kanji, Katakana, Hiragana, Korean, Chinese, Tagalog, Khmer, Arabic, Cherokee, and so on) can cause the characters to become corrupt.
For questions concerning the code pages, also refer to the FAQ note 606359 and question/answer 19 that appears there. -
How to load a java script in oracle database
Is it possible to load d java script in Oracle database. while the object type is
java resource ..RENUJP wrote:
I meant to load a javascript to oracle database not to oracle appliocation.
like loadjava....
I can load a javascript to oracle database.. but i can't call it...Please re-read the comments above, especially the part about this not being a javascript nor oracle forum. Exactly what part about this information don't you understand? -
Importing from an Oracle database converted from non-unicode to unicode - SSIS 2012
Hi,
I've some SSIS 2012 pkgs that read from a non-unicode Oracle database to a non-unicode SQL Server database.
Few days later, the Oracle database will be converted to unicode one and so I need to update the SQL database and the SSIS pkgs. Obiously no data conversion transformations are present in the pkgs. I'd like to avoid to add more of these data conversions.
As a first step, I'm trying to convert a SQL table to unicode format, but it isn't possible to convert non-unicode and unicode string data types.
I did not expect to have an error about the conversion from to non-unicode Oracle database (not yet converted) to unicode SQL Server database: a such conversion doesn't lost any information content. For me, it is right to have an error by from unicode to
non-unicode conversion.
Any suggests to solve this issue with a minimum development effort? Many thanksNope once you change datatypes to unicode you've to refresh metadata settings within SSIS packages for it to work fine. SSIS doesnt have the ability to do metadata changes at runtime. So someone has to update package metadata information to make them unicode
to make sure it works correctly after the changes.
What you can do is create test dbs in oracle and sql in uncode and create some modified packages based on it. Once you make changes to production dbs you need to move these modified copies also to production after making necessary config value changes like
servername,dbname,folder paths etc and then they will continue to work normally without causing any further downtimes to the customer.
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs -
Compression for oracle database and index compression during import of data
Hi All,
I have a query , in order to import into oracle database and also have compression and index compression , do we have some kind of load args for r3load and also do we have to change the tpl file ?Hello guy,
I did this kind of compression within migration project before.
I performed index compress first and then export -> import with table compress.
One thing you should take care, delete nocompress flag from TARGET.SQL (created by program SMIGR_CREATE_DDL, program SMIGR_CREATE_DDL created pure non-compression objects for these considered non-standard tables). For table columns > 255, we should not delete this flag.
Regarding to the index compress in source system, please check the following notes:
Note 1464156 - Support for index compression in BRSPACE 7.20
Note 1109743 - Use of Index Key Compression for Oracle Databases
Note 682926 - Composite SAP note: Problems with "create/rebuild index"
Best Regards,
Ning Tong -
Not able to connect remote oracle database over VPN
I can not connect remote oracle database over VPN. tnsping is ok and it shows the server information of remote database. i can also telnet the 1521 port of remote database server. I can connect the same server when it is located in the same LAN. Please help me out this is very urgent.
6b6c669e-6baa-45c4-a6dc-444aef2d5e7a wrote:
I can not connect remote oracle database over VPN. tnsping is ok and it shows the server information of remote database. i can also telnet the 1521 port of remote database server. I can connect the same server when it is located in the same LAN. Please help me out this is very urgent.
First, this is a forum of volunteers. There is no "urgent" here.
"Urgent" means one of two things -
1) people are dying, or
2) you have a customer-facing, revenue-producing production system that is down.
(And to get some perspective on the second case, keep the first in mind.)
For the first, you call whatever civil emergency service seems appropriate.
For the second, you open an SR with Oracle - which requires a paid-up support contract. For *them* to consider your problem "urgent", you will need to demonstrate that your problem falls under item #2. I seriously doubt your problem fits that criteria.
You don't have a support contract? Now you know the exact dollar figure that your company places on the data.
That said, you need to understand a few things about your specific problem,
First, port 1521 is only used by the listener to accept a connection request. Once it gets that request (and finds that it is for a service (sid) that it knows about, it will fork a server process and tell the requesting client that it can communicate with that server process over some other port .. a randomly chosen port number in the "high" range. It could be your vpn is blocking that other port, whereas your internal firewall is not.
But this is just an educated guess since I cannot find "can not connect remote oracle database over VPN" in any error message manual. If you had mentioned the VPN along with an actual oracle error message we could be much more precise in our diagnoses and recommendations.
---- edit 22 Sep
It occurred to me that I just assumed you were using the same client machine in both cases ... a laptop that you use both at work (local network) and home (vpn). If that assumption is false, there are probably problems with your tns setup on the home (vpn) machine.
But again, it would be much easier to help if you gave us an actual error message.
Maybe you are looking for
-
How to make panel collection with auto height in a ADF page
Hi, I developed a page in ADF of version JDev 11.1.1.4.0 where I had a adf table under adf panel collection. Now I want to change the height based on my screen resolution. For width I used the styleClass as "AFStretchWidth" but couldnt find any optio
-
Missing information on time line
http://i46.tinypic.com/9ibbir.jpg Can't see audio name etc. Please take a look at the jpg. Any help would be much appreciated. Michael
-
Does Apple have any program for Anti Virus or something that speeds its operations
-
JWSDP 2.0 examples failing to compile
I am using JWSDP 2.0, JDK 1.5.0_06 AND tOMCAT 5.5.18. While compiling "fromjava" example of JWSDP 2.0, I am getting error java.lang.NoClassDefFoundError: javax/xml/bind/annotation/AccessType I tried searching this class in all the jar files available
-
When I open firefox or open a new tab I get a new window popping up very anoying how do I stop this
the new window has the following address in the box: http://www.ilitili.com/sc?p=YTI3MzE3NjQzNjYd8Api9ERuBcS22NpNt6ZJZZGQlaoEcxCmmO%2Fb9%2FYsNvEOjIm9x0J19TiuJOBz7kBeRrouq%2BRv%2BakLy78WlwMFtFOKIgsVVJUresdkRgyXFZ5FrL59Fk8sJIvMDbjRZgasNkOIiRhTPQgUstws%