1. Aktifkan mode archive log. Masuk ke SQL : sqlplus / as sysdba

Cek archive log-nya sudah dalam keadaan aktif atau belum.

Tampilan diatas merupakan tampilan pada saat archive mode belum diaktifkan


2. Backup database menggunakan RMAN

import java.sql.*;
public class OracleConection {
private Connection con;
OracleConection(){
con=null; //inisialisasi koneksi database
}
public ResultSet dbOpen() {
String dbname="jdbc:odbc:oraconnect"; //sesuaikan dengan data sources name yang telah dibuat pada konfigurasi ODBC
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");//load koneksi driver odbc
con=DriverManager.getConnection(dbname,"scott","tiger");
if (con==null)
System.err.println("Koneksi ke Database gagal");
else
System.err.println("Koneksi ke Database Berhasil");
}catch(ClassNotFoundException ex) {
System.err.println("Driver Error");
ex.printStackTrace();
System.exit(1);
}catch(SQLException ex) {
System.err.println("Tidak Berhasil Koneksi dengan Northwind");
System.exit(1);
}
ResultSet rs=null;
Statement st;
try {
System.out.println("Employees\n" + "===========");
st=con.createStatement();
rs=st.executeQuery("select empno, ename, job from emp where deptno = 20 order by empno asc;");
}catch(SQLException ex){
ex.printStackTrace();
}
return(rs);
}
public void showEmployee (ResultSet rs) throws SQLException {
ResultSetMetaData rsData = rs.getMetaData();
String kolom1 = rsData.getColumnName(1);
String kolom2 = rsData.getColumnName(2);
String kolom3 = rsData.getColumnName(3);
while (rs.next()){
System.out.print(rs.getString(kolom1)+" ");
System.out.print(rs.getString(kolom2)+" ");
System.out.println(rs.getString(kolom3)+" ");
}
}
public void dbClose(){
try {
con.close();
}
catch(SQLException sqlex){
System.err.println("Error :Koneksi Database tidak Bisa diputus");
}
}
public static void main(String argv[]) throws Exception {
OracleConection app=new OracleConection(); //objek class OracleConection
ResultSet rs; //objek untuk menampung hasil query
rs=app.dbOpen();
app.showEmployee(rs);
app.dbClose();
}
}