Java code to take database backup

Hi,
I need java code which can take Ms.access database backup on 15th of every month. Please help me to do that.
Advance thanks

make a batch file to copy the little db from it's location to the backup location or invoke the backup command with the correct commandline parameters so you do not get prompted for input, go into the Windoz scheduler and tell it to run the batchfile on the 15th of ever month. Doing this with a language is going to be a problem in logistics you do not have to deal with.

Similar Messages

  • Clob/blob in java-code stored in database

    Hi!
    I want to write some java-code (CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED...)
    where I want to return an image as blob.
    For doing that I have to initialize the blob in the java-code -correct?
    I see many examples like
    oracle.sql.BLOB.createTemporary(conn, false,oracle.sql.BLOB.DURATION_CALL)
    In PL/SQL there is some similar:
    dbms_lob.createtemporary(lob_loc => xmlclob, cache => TRUE, dur => dbms_lob.SESSION);
    If I have to initialize the blob in the java source, how to do that (using empty_blob, but why using oracle...createTemporary then?)?
    I don't want an connection to an remote database, the java-code will be in the database, so can I call createTemporary without >conn<?
    (Oracle 10gR2, Windows, Linux, AIX)
    The picture will be generated calling other java-code loaded with loadjava.
    The java-source I want to write will be wrapped with PL/SQL.
    Greetings
    Bjørn

    Hi!
    It seems you can do this:
              try {
                   conn = new OracleDriver().defaultConnection();                graphblob = oracle.sql.BLOB.createTemporary(conn, false,oracle.sql.BLOB.DURATION_CALL); // must init
                   System.out.println("Blob is init");
              } catch ( java.sql.SQLException sEx ) {
                   throw new RuntimeException ("No connection", sEx);
    http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:1285601748584
    http://www.unix.org.ua/orelly/oracle/guide8i/ch09_08.htm
    /Bjoern

  • Export java code out of database?  difference between Prod and Test

    Hi all,
    I'm a seasoned DBA, but I have never really dealt with Java, so this is all new to me. Within one of my test databases (10.2.0.3.0), I have a database package - within the package is a procedure that has this Java call:
    language java name 'com.clinapps.pmd.etl.interfaces.forecasting.itemtrial.helper.SSFItemOutboundPMDHelper.processSSFItemInterface()';
    This Java code goes and exports a file to .xml format. The basic problem is that in our Test environment, there is a problem in the xml file that gets generated - the second line is missing the first few characters. However, in all of our other environments, including Production and Validation, it all works fine - the xml file is good. What has me confused, is that we've done several database refreshes, where we export from production, then import it down to test. So from everything I'm looking at, the schema is exactly the same - but something is different, causing the issue in the xml file that is being generated. I was wondering if I could get into the database and export the Java code, then that is something where I could confirm if there's a difference or not, from Prod to Test.
    Does anyone have any input/feedback on how to do this? I've been googling, and tried several methods, including dbms_metadata.get_ddl, and DBMS_JAVA.EXPORT_SOURCE, but I can't get anything to work.
    Or if anyone has any other thoughts on how to debug/troubleshoot this, I'd appreciate any ideas!!
    Thank you from a Java newbie!!

    OK, that is helping me get somewhere!! If I change the query to this, I am getting results:
    select obj_num,long_name from SYS."KU$_JAVA_CLASS_VIEW" where LONG_NAME like '%SSFItemOutboundPMDHelper%';
    171879
    com/clinapps/pmd/etl/interfaces/forecasting/itemtrial/helper/SSFItemOutboundPMDHelper
    Note that it has the / instead of the . as the differentiator
    Now if I do the second query, I see this:
    SQL> select * from SYS."KU$_JAVA_OBJNUM_VIEW" where OBJ_NUM=171879;
    OBJ_NUM DATAOBJ_NUM OWNER_NUM OWNER_NAME
    NAME NAMESPACE SUBNAME
    TYPE_NUM TYPE_NAME CTIME MTIME
    STIME STATUS REMOTEOWNER
    LINKNAME
    FLAGS OID SPARE1 SPARE2 SPARE3
    SPARE4
    SPARE5
    SPARE6
    171879 123 PMD50
    /34bae3f1_SSFItemOutboundPMDHe 1
    29 JAVA_CLASS 2012-06-28 10:44:22 2012-06-28 10:44:22
    2012-06-28 10:44:22 1
    8 6 65535
    Any thoughts on where to go from here??

  • Take database backup programmatically

    Hi,
    I am writing a simplified excel uploader tool for my client. I want to programmatically take the backup of company database whenever my tool is used to upload data into SAP database.
    Which method of which object should I use?
    Thanks.

    Hello,
    If you are working on Linux,
    Step-1: Set environment from Oracle user:
    $ . oraenv (and then specify SID: orcl)
    Step-2: Start RMAN:
    $ rman target /
    or
    $ RMAN
    RMAN> connect target database sys/oracle_4U
    Step-3: Take backup of your database:
    RMAN> backup database;
    OR,
    RMAN> BACKUP DATABASE PLUS ARCHIVELOG;
    Thanks,
    Ashish Shukla

  • Need to take Reprository backup in SAP BI7.0

    Hi,
          Now I am using SAP BI7.0 server and I am planning to take backup.
    I am planning to take the backup only the Metadata Repository. I need only the Structure to take backup because I am not having space to take Database backup so I am planning to take Repository backup only.
    Any Once can suggest how to take Metadata Repository from RSA1 t-code.
    Any One can give the replay ASAP.

    Check the Key Fields in the DSO. 
    Ex: Key Fields are EMPID, JOB and Data Fields are Startdate and end date...
    When you are trying to load the following data
    1221   HR  01.01.2009        12.12.2009
    1221   HR  01.01.2010         12.12.2010
    Once you hve loaded the above data you will get only one record in DSO.
    ONce you include the Startdate and enddate fields in KEYFIELDS of DSO you will get two records.
    May be you are also facing the similar issue.  Have a check with Key fields of DSO.

  • Code include from database through servlet into jsp

    Hi all,
    Im alittle stuck at the moment. I need to store code in a database that will be retrieved and displayed on a webpage. I know how to retrieve the information and display it if it is just normal data. The data in the database will be html along with java code that has to be included into the jsp page. Im doing the retrieve in a java bean and the servlet uses that bean to pass the information to the jsp.
    How can i include to code into the jsp so that it doesnt show as text but is included into the jsp?? Is this possible??
    Niall

    Hi,
    If you are storing Java code in your database (a Java class file), perhaps you could use class loader and 1) retrieve your code as regular file, 2) use class loader to load it, 3) run methods from your newly created class.
    Maybe you can write some sample code that loads any class from a file and calls methods on it, then you could modify that code and fit it in your servlet/JSP code.
    Mark

  • Java code and jsp interaction

    Hi,
    How does one interact between java code and jsp page.That is, if the java code does say database connection, the web page should tell that the connection has been made,just like an application but this will work on the web server not in the console.Kindly let me know.
    As

    Just curious but where do these questions come from? A course you are taking or you are building something for a hobby?
    If you are building some small simple web-app it's probably quicker to embed code right onto your JSP page.
    There are various levels of abstracting your web-app separating display from logic from the model.
    The following are techniques from simple web-apps to more complicated ones.
    -Embedding script right into your JSP
    -Using beans
    -Using custom tags ( I think there are some standard ones now, struts seems to be a popular buzzword)
    -Including a servlet to handle your requests redirect, update bean content grab info form your database and forward to a JSP. (Read up on model 2 architecture.)
    To include as much detail as possible would be to write a book. Fortunately many have so I don't have to fit one in this tiny reply box.
    Hope that was somewhat useful.

  • LMS 4.2.3 Database Backup Issue

    Hi All,
    I was unable to take database backup of  the LMS. Its failing with the below error.
    Error :Backup Failed: Error(404) Insufficient space on destination
    Where on destination drive i have space of 150GB Free space. but still LMS throwing the error.
    Backup is failing. Any suggestion how much the size of the database. how can we check?/
    Regards,
    Channa

    Hi VInod/Martin,
    The backup is failing
    Backup to 'E:/LMSDBBKP_Backups/Today's_new_backup' started at: [Fri Oct 17 18:00:00 2014]
    [Fri Oct 17 18:02:10 2014]  ERROR(405): Insufficient disk space on backup destination volume.
    Available Space is 188090140Kb and required space for backup is 226175301Kb.
    [Fri Oct 17 18:02:10 2014]  Backup failed: 2014/10/17 18:02:20
    The DB file size very huge.i wanted to reduce database file size by performance data purge.but now am unable to purge performance data from the purge settings.. its giving an error "Cannot connect to JRM, Check whether JRM is up and running".
    i can see the jrm is up and running normally.
    is there any way i can purge the performance data from the backend ??
    Regards,
    Channa

  • SQL Server Database backup

    Hi Team ,
    I have SQL Cluster 2012 server running with Couple of Critical data base instance . Each instance installed in different drive.
    One of my application database is having mdf of size 1 Gb and ldf is 250 GB . Database is set to full recovery model.
    Now I want to change recovery model to simple and want to shrink the los also. before than I want to take database backup.
    I have 50 GB space left in drive .
    i want to take full database backup on same drive .please let me know how much space i need on that drive to take full backup.
    thanks
    Ravi

    There are two options for you here
    1. Take transaction log backup and try shrinking the log file but you might have to take multiple transaction log backups to actually shrink the log file
    2. If you are switching from full recovery to simple you dont need to take full backup reason is switching from full to simple breaks log chain so its better to have Transaction log backup and like Praveen suggested if you take transaction log backup with
    compression it likely it would fit in free space. But you have to try.
    3. This you have to do on your own risk: (If backup of log in point 2 fails) I dont think changing from full recovery to simple would cause any
    data loss. So you can switch to simple shrink logs switch back to full and schedule frequent log backups
    Reason why log grew so much because you did not took sufficient transaction log backups. So create maintenance plan which would take frequent log backups also if you dont want point in time recovery for this database let it be in simple recovery
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it
    My Technet Wiki Article
    MVP

  • DBACockpit Configuration - Remote Database backup of Java Stack.

    Hi All,
    I am configuring remote database backup of my SAP Java stack system.
    I have successfully connected the system in dbacockpit. I have gateway installed also on the remote host system. but Database scheduling on DB13 failed.
    On the OS of CEN system, I can connect to the host system of the remote using the OPS$ logon and i.e
    sqlplus /@SID as sysdba  - (It connected, to confirm i querried the v$instance I was also able to shutdown the remote system)
    E:\>sqlplus /@SID as sysdba
    SQL*Plus: Release 10.2.0.4.0 - Production on Wed May 18 15:37:46 2011
    Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bit Production
    With the Partitioning, OLAP and Data Mining options
    But when I ran the brtools to perform the backup I got this error.
    "BR0301W SQL error -12560 at location BrDbConnect-2, SQL statement:

    Hi Niyi,
    This is a TNS error. The system is not able to connect TNS by using br*tools.
    Firstly, check your environment variables. They should be as same as java system environmnt variables.
    Secondly, check the link below;
    [BR0301W SQL error -1017;
    You need to create a synonym and SAPUSER table for the gateway installation <sid>adm user on Java database. By doing so, br*tools will be able to connect to the java database.
    Best regards,
    Orkun Gedik

  • Problem when connecting locally to Oracle Database 10g from Java code

    Good afternoon,
    I try to connect to my local Oracle 10g from JAVA code. Could somebody tells me what are the 'values' to enter in place of 'value1, value2, value3' in the following:
    final String connectionURLThin = "jdbc:oracle:thin:@value1:value2:value3";
    I tried to put my 'user' and 'pw' credentials I used when connecting with SQL*PLUS:
    value1=my_user_name
    value2=my_pw
    value3=my_schema
    but it doest work. Besides where could have I to put the 'WORKSPACE" name?
    Thanks for any help.
    Claude
    Details:
    ERR MESSAGE----------------------
    Exception in thread "main" java.lang.NoClassDefFoundError: oracle/dms/instrument/ExecutionContextForJDBC
    at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:365)
    at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
    at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:854)
    at java.sql.DriverManager.getConnection(DriverManager.java:620)
    at java.sql.DriverManager.getConnection(DriverManager.java:200)
    at javaapplication6.ConnectionExample.driverManager(ConnectionExample.java:138)
    at javaapplication6.Main.main(Main.java:36)
    Caused by: java.lang.ClassNotFoundException: oracle.dms.instrument.ExecutionContextForJDBC
    at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:319)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:264)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:332)
    ... 8 more
    Java Result: 1
    BUILD SUCCESSFUL (total time: 0 seconds)
    ---------------------ERR MESSAGE
    JAVA code------------------it compiles but throw an error when running there -> (*)...
    final String driverClass = "oracle.jdbc.driver.OracleDriver";
    final String connectionURLThin = "jdbc:oracle:thin:@jeffreyh3:1521:CUSTDB";
    final String userID = "scott";
    final String userPassword = "tiger";
    final String queryString = "SELECT" +
    " user " +
    " , TO_CHAR(sysdate, 'DD-MON-YYYY HH24:MI:SS') " +
    "FROM dual";
    public void driverManager() {
    Connection con = null;
    Statement stmt = null;
    ResultSet rset = null;
    try {
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    con = DriverManager.getConnection(connectionURLThin, userID, userPassword); // (*) prob here
    stmt = con.createStatement ();
    rset = stmt.executeQuery(queryString);
    rset.close();
    stmt.close();
    } catch (SQLException e) {e.printStackTrace();
    --------------------JAVA JDK 1.6
    My system ------------------------
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
    PL/SQL Release 10.2.0.1.0 - Production
    CORE 10.2.0.1.0 Production
    TNS for Linux: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production

    Yes, the network connection could not be established. Like the error said.
    What you're asking about is the exact reason, but that could be any number of things and not at all related to code. You could have the wrong host, the wrong port. A firewall could be blocking the outgoing connection, a firewall could be blocking the incoming connection. Etc. etc.

  • Populate Flex Tree from Java Code (Database)

    Hi
    Can someone please help me? I'm very new to using flex. I'm
    basically trying to create a tree that is populated from data in my
    database. I am using hibernate to fetch that data.
    The plan is to basically create the tree in Java code (since
    I don't want any processing done on the client PC) and then pass
    this to the flex tree (or an actionscript data structure that is
    compatible as the tree datasource)
    I am creating the java tree using DocumentImpl. Is this
    correct? What class would work?
    Element e = null;
    Node n = null;
    Document xmldoc= new DocumentImpl();
    Element root = xmldoc.createElement("USERS");

    quote:
    Originally posted by:
    ntsiii
    Stop running and get a map (read the documents)
    This is hardly a useful comment and must discourage new users
    from asking questions. If you think the documentation relating to
    the use of the tree control is straightforward then I beg to
    differ.
    If you are aware of a clear example of how to use the data
    tree with a php backend returning a remote data object please
    enlighten me. Meanwhile I continue my search but not within the
    livedocs.
    One site I have found that may be of use is
    http://flexdiary.blogspot.com/2009/01/lazy-loading-tree-example-file-posted.html
    Not everyone is an expert.

  • Can I take a backup of a database in standby mode?

    Can I run backup on a database that is in standby mode because it is the DR box receiving log shipping?
    Does that work in SQL 2005?  How about SQL 2000?
    Thanks.
    Josh
    ps - I know I should just try it, I've already Googled it - with mixed results.

    https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=466121
    Please allow backup of database in standby mode!
    This comes up as a very common requirement in HA/DR planning. Logs are shipped over a (relatively) small pipe to a DR site, for days or weeks or months. As part of a (partial) failover plan, we need a full backup of a current version of the database to restore on another server on the DR side - but we cannot take the main DR (secondary) copy out of standby without breaking the log chain. Yes, we might have to pause the application of logs - or possibly not - in order to take the backup of a large-ish database. But the alternative is shipping a large backup all the way from production over that small pipe, which can be prohibitive.
    Thanks for the reminder, Tibor.
    Josh

  • How to create a oracle database by java code?

    how to create a oracle database by java code?
    please give some ways then that way's code

    I'm not sure what you mean with "database". Do you mean an Oracle instance or an Oracle user/schema (probably the latter, because that's the equivalent to a MS SQL Database).
    Creating an instance is definitely not possible from within Java. To create a new user this should be possible, as this can be done with SQL:
    GRANT connect,resource TO <newuser> IDENTIFIED BY <password>;
    I'm always cautious with questions like this. In 90% of the cases there is something wrong with the initial design. Creating a database shouldn't be something the application is doing.
    Thomas

  • Connecting to the Oracle 10g Database through Java code

    I have a Oracle 10g database to be connected to.
    Through sql plus, I can connect to it using the following command
    sqlplus "sys@pmi as sysdba"and password is 'password'
    how do I connect to this db through my Java code?
    I tried
    _connection = DriverManager.getConnection("jdbc:oracle:thin:@10.245.4.100:1521:pmi as sysdba", "sys", "password");but it gave the exception "ExceptionIo exception: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=169869568)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4))))"
    I also tried
    _connection = DriverManager.getConnection("jdbc:oracle:thin:@10.245.4.100:1521:pmi", "sys", "password");but this gives the exception "ExceptionORA-28009: connection as SYS should be as SYSDBA or SYSOPER"
    Can anyone please help me in writing the line of code

    You need to use the getConnection syntax that requires a Properties object.
    http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.htm#05_05
    - cafal

Maybe you are looking for

  • Can my iMac be upgraded to...

    Can I upgrade my iMac to OS 10.6.x based on the information below which is my build? Hardware Overview Running Mac OS X - Version 10.5.8   Model Name: iMac   Model Identifier: iMac8,1   Processor Name: Intel Core 2 Duo   Processor Speed: 3.06 GHz   N

  • JDBC Adapter configuration not initialized Error

    Hi, I am doing a RFC to JDBC scenario in PI 7.1. I am getting the following error: com.sap.engine.interfaces.messaging.api.exception.MessagingException: JDBC Adapter configuration not initialized: null In communication channel monitoring, it shows th

  • Installation issue with Java

    Hi there , I am installing Netweaver on my machine , ( ABAP + JAVA ) i have error while the installation happens " Dispatcher running server 0; unknown " "FCO-00011" Java couldn startup Thanks in advance

  • JRE System-level settings does not work - JRE1.6.30

    Good day, I need to set deployment.security.mixcode parameter to "DISABLE" within of deployment.properties configuration file. Also I wish to place the deployment.properties configuration file is not user-specific path. The default location is <User

  • Assigning of PR document types to Network and WBS Element

    Dear Experts, We have created Purchase Requisition document type as ZPRJ for Project system to create a automatic PR. When we run Project Builder the Auto PR will get create for Network by selecting the PR document type ZPRJ. But PR for WBS element i