P6 8.3 Professional - how to backup database connections?
Is there a way?
Hello Daniel,
this is how my Path=E:\instantclient_11_2;...... variable looks like. I have put tnsnames.ora and sqlnet.ora in E:\instantclient_11_2 and this is how
TNS_ADMIN=E:\instantclient_11_2 looks like.
Contents of tnsnames.ora
# tnsnames.ora Network Configuration File: E:\app\Administrator\product\11.2.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.3.27)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
Contents of sqlnet.ora
# sqlnet.ora Network Configuration File: E:\app\Administrator\product\11.2.0\dbhome_1\network\admin\sqlnet.ora
# Generated by Oracle configuration tools.
# This file is actually generated by netca. But if customers choose to
# install "Software Only", this file wont exist and without the native
# authentication, they will not be able to connect to the database on NT.
SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
still the same error
Database connection failed: Error Message:
Bad public user name or password. Cannot load OCI DLL: oci.dll;
I tried both ORCL and //172.16.3.27:1521/ORCL as connection strings.
should instant client used be 32 bit as well?
regards, Prasad
Similar Messages
-
When and How to close database connection in JSP?
Hi there,
I am using MySQL and JDBC 3.0, in my system, When and How to close database connection in JSP?
Thanks in advance.
Lonely Wolf
<%@ page session="true" language="java" %>
<jsp:include page="checkauthorization.jsp" />
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql" %>
<%--
Execute query, with wildcard characters added to the
parameter values used in the search criteria
--%>
<sql:query var="availablecomputerList" dataSource="jdbc/Bookingcomputer" scope="request">
SELECT * FROM computer where status=0
order by s_code
</sql:query>
<html>
<head>
<title>Search Result</title>
</head>
<body bgcolor="white">
<center>
<form action="checkin.jsp" method="post">
<input type="submit" value="Back to Check-in Page">
</form>
<c:choose>
<c:when test="${availablecomputerList.rowCount == 0}">
Sorry, no available computer found.
</c:when>
<c:otherwise>
The following available computers were found:
<table border="1">
<th>Computer</th>
<th>Description</th>
<th>Status</th>
<c:forEach items="${availablecomputerList.rows}" var="row">
<tr>
<td><c:out value="${row.s_code}" /></td>
<td><c:out value="${row.description}" /></td>
<td><c:out value="${row.status}" /></td>
</tr>
</c:forEach>
</table>
</c:otherwise>
</c:choose>
</center>
</body>
</html>when should you close the connection? when you're done with it.
how should you close the connection? like this: conn.close();
that said, doing this in a JSP page is bad form and not recommended
JSP's typically don't contain ANY business or data logic -
How to get database connection in applet
Hi,
I am trying to prepare database connection in applet. After preparing connection with database it'll read same values from table.
At the time of development it works fine. I have used esclipse IDE for coding and testing.
But when I try to call that applet from browser. It is giving ClassNotFound exception.
Does anybody know How to get database connection in applet ?
Please help me if anybody know solution for this.
Thanks,
RajeshAs per my knowledge is conserned
1 u can get the database connection in a jsp page and u send the result set as param to the applet and u can use retrieved values as if they were of the same applet if u r interested i can send the db connetion coding for jsp my id [email protected] -
How to backup database using sql query?
Hello,i'm student, i'm researching oracle database,i want to backup database that using sql query (like backup query in SQL SERVER) ,how to do that ??
Thank!No, database backups cannot be done from within the database.
Commands for backups are outside of the database.
See the "2 Day DBA Guide" http://download.oracle.com/docs/cd/E11882_01/server.112/e10897/toc.htm
and the "Backup and Recovery Users's (actually Adminsitrator's) Guide : http://download.oracle.com/docs/cd/E11882_01/backup.112/e10642/toc.htm
Hemant K Chitale -
How to backup database using RMAN on another server's tape?
Dear All,
Please give me an advise what parameters I should set up in RMAN to backup database on another server's tape.
Best wishies,
GiviI am connected to the database server from the server
where I have tape, but Rman is searching tape on
database server.I am not sure I understabd the above statement, but at the Operating System Level, you must ensure that from the Server you are running RMAN, it is configured to see the Tape Drive of the other Server. Once the Remote Tape is mounted with any name (say sbt) on the Local Server (however it is done with), then RMAN can configure the channels to use it.
If you cannot get this access at the Operating System Level, then do not bother trying RMAN to access it. -
How to access database connection from datatsource in a standalone java ap
My java standalone application wants connection to database with lookup to datasource name which is configured in the oc4j app server.
Please guide me with some ideas to acheieve this.user510497,
Following sample program requires access to classes in "oc4j.jar" file.
Test environment:
* Server:
+ OC4J stand-alone 10.1.2.0.2
+ Red Hat Enterprise Linux AS release 3
+ Java HotSpot(TM) Client VM (build 1.4.2_08-b03, mixed mode)
+ Oracle Database 10g Release 10.1.0.4.0 - 64bit Production
* Client
+ Microsoft Windows XP Professional Version 2002 Service Pack 2
+ Java HotSpot(TM) Client VM (build 1.5.0_08-b03, mixed mode, sharing)
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.SQLException;
import java.util.Properties;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.sql.DataSource;
public class DataSrc2 {
public static void main(String[] args) {
Connection conn = null;
Properties l_props = new Properties();
l_props.put(Context.INITIAL_CONTEXT_FACTORY,
"com.evermind.server.rmi.RMIInitialContextFactory");
l_props.put(Context.PROVIDER_URL, "ormi://your_OC4J_host/");
l_props.put(Context.SECURITY_PRINCIPAL, "your_OC4J_user");
l_props.put(Context.SECURITY_CREDENTIALS, "your_OC4J_password");
Context l_jndiContext = null;
try {
l_jndiContext = new InitialContext(l_props);
Object l_obj = l_jndiContext.lookup("default-data-source");
DataSource ds = (DataSource) l_obj;
conn = ds.getConnection("scott","tiger");
DatabaseMetaData dbmd = conn.getMetaData();
System.out.println(dbmd.getDatabaseProductVersion());
catch (NamingException x_naming) {
x_naming.printStackTrace();
catch (SQLException xSql) {
xSql.printStackTrace();
finally {
if (l_jndiContext != null) {
try {
l_jndiContext.close();
catch (NamingException x_naming) {
System.err.println("Failed to close JNDI context.");
x_naming.printStackTrace();
if (conn != null) {
try {
conn.close();
catch (SQLException xSql) {
System.err.println("Failed to close [database] connection.");
xSql.printStackTrace();
}NOTES:
1. Datasource lookup name is value of "default-data-source" attribute of "orion-application" element in file:
<OC4J_HOME>/j2ee/home/config/application.xmlGood Luck,
Avi. -
How to get database connection in common java class
hi friendz,
plz help me...
I am using JDEV 11.1.2.2.0 version.
my problem is I'm writing common java class which can reuse any application.
in this case when im create database connection like this,
String username = "a";
String password = "b";
String thinConn = "jdbc:oracle:thin:@IP:1521:database";
DriverManager.registerDriver(new OracleDriver());
Connection conn =
DriverManager.getConnection(thinConn, username, password);
conn.setAutoCommit(false);
return conn;
but this statement not working in java class.its working only backing bean.
import oracle.jdbc.OracleDriver;
DriverManager.registerDriver(new OracleDriver());
how can i do that??
hope your help
-Harsh-What is the error message in Java class?
With JDBC 4.0 driver the DriverManager class has added support for the Java SE Service Provider mechanism to the getConnection() and getDrivers() methods using which JDBC drivers may be loaded automatically. The following Class.forName() method is not required to be invoked.
Class.forName(“oracle.jdbc.OracleDriver”);
Only the following is required to obtain a connection.
String url="jdbc:oracle:thin:@localhost:1521:ORCL";
Connection connection = DriverManager.getConnection(url,"oe", "pw"); -
How create a database connection only one for lot of AM
Hi ,
In My Application am having lot of Application module its containing database connection per AM its connecting to same database only if i want to make it unique connction how i can proceed. which is correct way any one can help me
Thanks
PrabeethsoyThe source trace show how the JUApplication was created and saved to BindingContext.
1. private static void invokeBeginRequest(
BindingContext bindingCtx, HashMap requestCtx)
Object obj;
Iterator iter = bindingCtx.valuesIterator();
while (iter.hasNext())
obj = iter.next();
if (obj instanceof DCDataControlManagement)
2.First type is DCDataControlReference ====> ((DCDataControlManagement)obj).beginRequest(requestCtx);
3. ADFBindingFilter chain.doFilter(request, response);
4. DCDataControl control = actionBinding.getDataControl();
5. JUCtrlActionBinding
public final DCDataControl getDataControl()
if (mDataControl == null)
if (getDef() instanceof JUCtrlActionDef )
String name = ((JUCtrlActionDef)getDef()).getDataControlName();
if (name != null && getBindingContainer() != null)
BindingContext ctx = getBindingContainer().getBindingContext();
if (ctx != null)
6. ========>mDataControl = ctx.findDataControl(name);
if (mDataControl == null)
if (getIteratorBinding() != null)
mDataControl = getIteratorBinding().getDataControl();
else if (getBindingContainer() != null)
mDataControl = getBindingContainer().getDataControl();
return mDataControl;
7. BindingContext
public DCDataControl findDataControl(String name)
return (DCDataControl)get(name);
public Object get(Object key)
Object rtn = mDCMap.get(key);
if (rtn == null)
rtn = mBCMap.get(key);
else
if (rtn instanceof DCDataControlReference)
// remove the reference in order to prevent re-entrancy.
remove(key);
*8. Create JUApplicaion======> rtn = ((DCDataControlReference)rtn).getDataControl(this);*
*9. save JUApplication with AM ======> put(key, rtn);*
return rtn;
10. DCDataControlReference
public DCDataControl getDataControl(BindingContext ctx)
String name = getName();
DataControlFactory factory;
try
Class factoryClass = JBOClass.forName(mDef.getFactoryClass());
factory = (DataControlFactory)factoryClass.newInstance();
catch(Exception e)
throw new JboException(e);
// JRS this is a backwards compatibility step. The generic
// DataControlFactoryImpl used to perform this mapping such
// that the bean class will be faulted back the definition class
// if null. I am performing this mapping at RT only in order
// to maintain the DT integrity (i.e. I don't want the DT to start
// faulting the bean class as the definition class when writing the
// DC def).
if (mDef.getBeanClass() == null)
mDef.setBeanClass(mDef.getDefinitionClass());
*11. create JUApplicaion =====> DCDataControl dc = (DCDataControl)factory.createSession(*
ctx, mDef.getName(), mUserParams, mDef);
SessionContext sessionCtx = ctx.getSessionContext();
if (sessionCtx != null)
dc.setSessionContext(sessionCtx);
// fire the deferred beginRequest notication on the new datacontrol
if (mRequestContext != null)
12.======>dc.beginRequest(mRequestContext);
mRequestContext = null;
return dc;
} -
How to manage database connections
Hi, I have been trying to find the best way of doing database connections, My application will not be used by many users since its an intranet application used by administrators only to change settings.
I want to be able to connect to db from a servlet but not have to make the connection all the time, I was thinking of creating my own ContinuousConnection class which basically keeps the connection and all you do is getConnection which checks if the connection is "up" or not, if it is up then just give it as the return value else, just create a new connection since the driver class has already been loaded...if it is null then just load the driver and make the connection.
this way in differenet functions that i have in the servlet dont have to make connections all the time.
Is there a better way of doing this?
I was thinking of putting the connection object in the data section of the servlet, but then it is more or less like static data amongst all threads created to run the servlet and I dont know what would happen if 2 querries are run from the same connection by different serving threads...can someone please explain me this..
I know a good way of managing connections is using a pool..but i dont know how useful is that here...also i am not very familiar with a pool..can someone please explain me the idea behind it..and how it works...that would be just perfect.
Thank you very much.
AnkurIIRC to setup tomcat connection pooling when using an Oracle database (for example):
Add something like this to the server.xml file:
<Context path="/myProject" docBase="myProject" debug="0"
reloadable="true" crossContext="true">
<Resource name="jdbc/ORAC" auth="Container" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/ORAC">
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>oracle.jdbc.driver.OracleDriver</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbc:oracle:thin:@xxx.xxx.xxx.xxx:1521:XXXX</value>
</parameter>
<parameter>
<name>username</name>
<value>xxxxx</value>
</parameter>
<parameter>
<name>password</name>
<value>xxxxx</value>
</parameter>
<parameter>
<name>removeAbandoned</name>
<value>true</value>
</parameter>
<parameter>
<name>logAbandoned</name>
<value>true</value>
</parameter>
<parameter>
<name>maxActive</name>
<value>20</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>10</value>
</parameter>
<parameter>
<name>maxWait</name>
<value>-1</value>
</parameter>
</ResourceParams>
</Context> This needs to go in between the <Host> ... </Host> tags (probably at the bottom) in the server.xml file (${CATALINA_HOME}/conf). You must put this in the correct place in the xml file or you'll get errors.
Then you need to add this to your web.xml file:
<resource-ref>
<description>Oracle Datasource</description>
<res-ref-name>jdbc/ORAC</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>Again this needs to go in the correct place (as per the dtd)
Then to get a connection:
final Context initContext = new InitialContext();
final DataSource ds = (DataSource) initContext.lookup("java:/comp/env/jdbc/ORAC");
final Connection conn = ds.getConnection();You probably want to wrap getting these connections in a class (i.e. with a getConnection method). And remember to close the connections when you've finished with them. -
How to create database connection and how to call it using Java
Hi,
Good day! I'd like to know how I can create a db connection in JDev, then use this connection to retrieve data using a Java Class? I've seen using New Gallery > Database Connection. But I'm not sure how I can access this connection using Java and display some output from the retrieved records.
Any steps/tutorial link is appreciated.
Thanks in advance,
RianHi,
If you need to access the connection in the entity object then refer http://download.oracle.com/docs/cd/E15523_01/web.1111/b31974/bcadvgen.htm#BABEIFAI i.e in MODEL.
But if you want to access connection in ViewController part of application then you need to do it manually.For this i am giving you my code for reference.------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import javax.faces.context.FacesContext;
import oracle.jdbc.pool.OracleDataSource;
public class DataHandler {
String jdbcUrl = null;
String userid = null;
String password = null;
Connection conn;
public static final String CONNECTION_STRING =
FacesContext.getCurrentInstance().getExternalContext().getInitParameter("connectionString");
public static final String USER_NAME =
FacesContext.getCurrentInstance().getExternalContext().getInitParameter("userName");
public static final String PASSWORD =
FacesContext.getCurrentInstance().getExternalContext().getInitParameter("password");
public DataHandler(String jdbcUrl, String userid, String password,
boolean shouldConnect) throws SQLException {
this.jdbcUrl = jdbcUrl;
this.userid = userid;
this.password = password;
if (shouldConnect) {
connect();
public void connect() throws SQLException {
OracleDataSource ds;
ds = new OracleDataSource();
ds.setURL(jdbcUrl);
conn = ds.getConnection(userid, password);
public Connection getConnection() {
return conn;
public ResultSet executeQuery(String sql) throws SQLException {
Statement s = conn.createStatement();
return s.executeQuery(sql);
public void closeConnection() throws SQLException {
if (!conn.isClosed()) {
conn.close();
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -
How to configure database connectivity in OC4J App server.
Hi,
I am working on Oracle ESB flows. I have the flow inserting rows into database table using database connection that I have defined. I havent set up connection settings in OC4J EM console.
I dont wonder when JDeveloper is inserting rows into tables, as connection is explicitely defined in JDeveloper.
Now I login to EM enviroment and click on Home, click on Web Services tab, and when I use this flow as a Web Service end point and feed values through the form that it provided, it also works. But since I havent defined any connection properties in App Server explicitely, I wonder where is it getting connection properties(JNDI name) from.
I want to configure some settings in Testing Environment and am kind of stuck at this point.
Thanks,Hi.
When you don't have JNDI configured, OC4J uses the design time connection defined in the Adapter's WSDL. Look for the following description in your Adapter WSDL:
<!-- Your runtime connection is declared in
J2EE_HOME/application-deployments/default/DbAdapter/oc4j-ra.xml
These 'mcf' properties here are from your design time connection and
save you from having to edit that file and restart the application server
if your JNDI is missing.
These 'mcf' properties are safe to remove.
-->
Now, for JNDI configuration, you can use the SOA Suite tutorial as a reference:
http://download.oracle.com/docs/cd/B31017_01/core.1013/b28937/setting_up.htm#CIHBHEFC
There you can find the steps to create a connection pool, data source, etc.
Denis -
I am trying to create a JDeveloper/Data Connection using com.oracle.ias.jdbc.db2.DB2Driver. The driver is registered from a User Libraries: DataDirect JDBC. I have the following class path for the library:
E:\DataDirect\3.4\lib\YMdb2.jar;E:\DataDirect\3.4\lib\YMbase.jar;E:\DataDirect\3.4\lib\YMutil.jar
I have no trouble configuring the connection but when I test it and I got No suitable driver Vendor code 0. Whats wrong? I have successfully created several database connections using Oracle thin driver. This is first time I am using a third party driver. Has any one successfully create a database connection using the com.oracle.ias.jdbc.db2.DB2Driver?Hi
Since the error points to the unavailability of the driver class,can you double check your library claspath entries again.
I just tried a DB2 connection using the following properties and the connection went through fine:
Driver class name: com.oracle.ias.jdbc.db2.DB2Driver
URL: jdbc:merant:db2://<host_name>:50000;DatabaseName=SAMPLE
Thanks
Prasanth -
How to obtain database connection via PL/SQL
Dear friends,
I need to obtain the database name where user is connected - using PL/SQL. That is, if I type "select user from dual" I obtain the connected user; is there some similar way for me to obtain database connection?
Thanks, and best regards,
FranklinSELECT sys_context('USERENV', 'DB_NAME') FROM dual;
SELECT sys_context('USERENV', 'INSTANCE') FROM dual;
You can choose whichever you want to use. :-)
Instace parameter will give you INSTANCE_ID (matches with GV$INSTANCE) so not that much useful I guess.
Edited by: Satish Kandi on Oct 6, 2008 9:32 PM -
How to backup database in Oracle 8.1.6
Hello all,
I have an odd question that i meet a error when i backup my
database in Oracle 8.1.6 using backup management in DBA studio.
I find the failed detail is verified error.why?but it be done in
Oracle 8.0.5.
Thank you ahead.
Best Regards.
Devon.QDear Amardeep,
The OP opened 2 threads, one how to clone and other one how to rename a database 8. The article I send show how to clone the DB (one of the steps in the clone article is how to rename the DB from"PROD" to "Test"). ;)
This is the other thread:
easy way to clone database
Cheers,
Francisco Munoz Alvarez
www.oraclenz.com -
How to close database connections in Crystal Reports
I am using the following code to connect to database. I can either pass JNDIName or I can provide values for others by leaving JNDI name empty.
If i use JNDI name, it will use a connection from the connection pool of App Server (in my case Weblogic), but it is not releasing the connection after use. Connection remains even if I logoff from the application. If i keep my max connections as 15 in weblogic, after clicking the page with crystal report 15 times all will remain active and users will not be able to login to the application.
If i use connectionString and others without using JNDI Name, it directly connects to database. So it creates a connection in database server directly without using connection pool of weblogic. If i check weblogic, it shows no connection in use as expected, but if i check database, i can see the no. of connections increasing everytime a user clicks a crystal report page.
When the connection touches the maximum allowed connection in server, every application using the same server goes down
How can I close the connection which was created for the viewing the report?
String reportName = "/reports/BankBalance.rpt";
ReportClientDocument clientDoc = (ReportClientDocument) session.getAttribute(reportName);
if (clientDoc == null)
clientDoc = new ReportClientDocument();
clientDoc.setReportAppServer(ReportClientDocument.inprocConnectionString);
// Open report
clientDoc.open(reportName, OpenReportOptions._openAsReadOnly);
String connectString = ""; // jdbc:sybase:Tds:DBSERVERNAME:9812/DBNAME?ServiceName=DBNAME
String driverName = ""; // com.sybase.jdbc3.jdbc.SybDriver
String JNDIName = "DS_APP";
String userName = "";
String password = "";
// Switch all tables on the main report and sub reports
CRJavaHelper.changeDataSource(clientDoc, userName, password, connectString, driverName, JNDIName);
// logon to database
CRJavaHelper.logonDataSource(clientDoc, userName, password);
// Store the report document in session
session.setAttribute(reportName, clientDoc);
// Create the CrystalReportViewer object
CrystalReportViewer crystalReportPageViewer = new CrystalReportViewer();
String reportSourceSessionKey = reportName+"ReportSource";
Object reportSource = session.getAttribute(reportSourceSessionKey);
if (reportSource == null)
reportSource = clientDoc.getReportSource();
session.setAttribute(reportSourceSessionKey, reportSource);
// set the reportsource property of the viewer
crystalReportPageViewer.setReportSource(reportSource);
crystalReportPageViewer.setHasRefreshButton(true);
crystalReportPageViewer.setToolPanelViewType(CrToolPanelViewTypeEnum.none);
// Process the report
crystalReportPageViewer.processHttpRequest(request, response, application, null);the sample shows how to clear RAS and Enterprise resources after viewing report.
1. If you use unmanaged RAS - as I can see you using setReportAppServer, then remove the enterprise related stuff : instantiating and cleaning code.
The sample code is meant to give you an idea on how you can release the resources after done with viewing report. In your case all you need to do for cleaning is call close() on ReportDocumentObject. The sample will need to be modified for your requirements.
Maybe you are looking for
-
I have been given permission for unlocking my iphone 3 GS from Orange. I want to set up the phone for my wife to use with a new number and carrier. Do I unlock under my itunes account first ( I now have a new iphone on this account) or set one up for
-
Sharing music from one library to two different iPods
I have an itunes account with a large music library that I use with my own ipod. My daughter is getting her own iPod soon. Can I share my library on her device?
-
Converting Time Difference to Human-Readable Time
Hello everyone, I just posted a thread about an hour ago on how to get the difference between the current time and two tables. My results are as follows: Call Moddate Modtime Age Open 2009-04-09 13:47:08 2.57 The age is this command: roun
-
[SOLVED]: Weird font issues with infinality-bundle on upgrade
Ive been using the infinality-bundle for some time with no problem until a recent update, and it seems like all my fonts got replaced with stranger ones. Below is a screenshot of my font problem and a snippet from my pacman.log. [2013-10-15 18:56] [
-
Use Firefox Sync to store bookmarks in the cloud?
Can I setup Firefox Sync even if I only have one device? If so, can I use Firefox Sync to backup my bookmarks to the cloud (instead of using a third-party extension?) I'm guessing that Sync stores bookmarks in the cloud because how else would it be a