Backup Oracle database with bat file

Today, I've found how to backup/export Oracle database with bat file. I've just created it for only one schema first. Why I'm using to import Oracle with bat file because of there is no auto backup feature in Oracle (as far as I know). That's why it's needed to create bat file and integrate with window task scheduler (run daily).

First of all, open Notepad and save as OracleBackup.bat first. Then, paste following code into this file.

view plain print about
1@echo off
2echo Importing Oracle Start
3echo =======================
4exp system/password file=C:/ppshein.dmp grants=y owner='ppshein';
5echo ==========================
6echo Importing Oracle End

[More]

Your Ad Here

Get free exam simulator from uCertify

 

uCertify, leading IT certification provider company is willing to spring for a license, that's a full license, for any of their test prep kits for one of my blog readers. The only requirement to get the full license is that you write a review of the software, within 30 days, that will be a guest post here on this blog.
 
So, I am offering this to all of my blog readers. Today is Nov 30, 2011. To get a chance to win the prep kit license, go to the ucertify site and take a look at the available tests. Decide which you would like to take.
 
Once you've made your choice, come back here and post a comment about which you would like and why you want to take it. Doesn't have to be anything big; just a couple of sentences is fine.
 
Make sure you either leave a real email address or you are signed in when you leave the comment. You don't need to leave your email address in the text of your comment if you are signed in. I can send you a message via the it toolbox messaging system in that case.
 
I will randomly choose the winner from the comments on Dec 10, 2011. So, you have about 10 days to post a comment.
 
Once I have notified the winner and they agree to review the software in a guest post here on this blog, I will give the info to Ucertify and they'll hand out the license.
 
The guest post doesn't need to be huge. At least a few hundred words which is just a page or two of double spaced text. As an example, this  blog post is over 400 words. I'll be glad to proofread and edit it if you would like me to mail me (pyaephyoeshein[at]gmail[dot]com).

Oracle Database SQL Expert

Being developer, we must need to know how to write SQL query, functions, views and stored procedures for our development as long as we are not using ORM. I'm not sure using ORM is kinda useful or not in our development life cycle but we shouldn't forget our writing query skill. That's why I need to practise 1Z0-047 for enhancing my Oracle query skill with 1Z0-047 exam simulator of ucertify,

[More]

Oracle 11g: SQL Fundamentals (1Z0-051) exam guide

In this 2011, I feel like myself to take almost certification of what I know and what I'm using in my development space. Being programmer, I didn't say almost certificates are needed but just like non-computer science graduated like me, those certificate are very needed. Because almost people won't know why I'm surviving in IT without having computer science graduate. That's why I believe I'm not wrong to take certificate. 

When I was in Myanmar, we use Microsoft SQL as our database because which is simple and easy to use with their UI. When I started working in Singapore (2009), our company use Oracle as database system instead of Microsoft SQL. Since that time, I'm addictive at Oracle because of the way of writing stored procedure, functions and views. That's why I think I need to have at least one Oracle certificate to let people know that I know Oracle.

That's why I decided to take 1Z0-051 exam of Oracle. It's called SQL Fundamentals exam which is suitable for me to take as beginner state of Oracle developer. Below is the exam topic of 1Z0-051.

[More]

Create new Listener and TNS in Oracle

Yesterday, I knew how to create new Listener and TNS in Oracle. It's kinda simple if you know how to do. If not, so complicated

Create new Listener in Oracle

First of all, we need to go Oracle first. Then, we need to go Configuration and migration tools > Net Manager.

[More]

My first web based mobile project

Here is my first web-based project for my company. Our target is for customer who want to register Patient thru online. This project is based for iPad but it can work either on Android based tablet. For this project, I've used jQueryMobile framework, Coldfusion 9 and Oracle 11g. For jQueryMobile part, I've created our own customize theme for this project and added some JS coding into jQueryMobile existing scripts. Just example: my boss want me to highlight which field has been filled up by users and need to categorize for mandatory field. As you know, it's difficult to change or add some JS coding into their existing core JS file because we need to know the flow of existing JS coding. Likewise, what we add or change JS coding will impact the whole existing JS coding. I took 2 days to study the whole existing JS coding but it's not enough time honestly for it.

Below is some of my change logs into jQueryMobile existing JS coding for this project.

[More]

The powerful of DECODE in Oracle

In these days, I needed to manipulate Query statement in Oracle. Because, for database part, we don't want our CF to calculate the amount of our system. That's why we just let Oracle to do as much as database part can do. Because we don't want JRun can be more loaded because of such calculation and minor cases and we are always try to assign less process for our CF. Today, I need to develop some calculation in our projects for the following cases.

view plain print about
1<cfif ONHAND_QTY + PROJECTED_QTY GT MIN_QTY>
2    <!--- ONHAND_QTY + PROJECTED_QTY ARE GREATER THAN MIN_QTY --->
3    <cfset IsReplenish = "Y">
4<cfelse>
5    <!--- ONHAND_QTY + PROJECTED_QTY ARE NOT GREATER THAN MIN_QTY --->
6    <cfset IsReplenish = "N">
7</cfif>

[More]

MAX function is kinda slow in Oracle

In these days, I'm on HL7 project for my company. In this project, most of processes are created within Oracle Stored Procedure. Most of Oracle stored procedure, we need to retrieve the last record from table. At that time, we sometimes use "MAX" built-in function of Oracle. Using "MAX" function in Oracle is very simple and cannot write complicated query to get last record from table like query after query method with RomNUM. But the one I haven't noticed is the performance of retrieving data.

That's why I've wrote two query statements and test in PLSQL developer.

Using MAX function

view plain print about
1SELECT MAX(PATIENT_ID) FROM NH_PATIENT
2
3<!--- executing time --->
40.047 seconds

Using query and query Using MAX function

view plain print about
1SELECT PATIENT_ID FROM
2 (SELECT PATIENT_ID FROM NH_PATIENT
3 ORDER BY PATIENT_ID DESC) CLONE_USER
4WHERE ROWNUM = 1
5
6<!--- executing time --->
70.031 seconds

So, we should avoid using "MAX" function if we really don't need to use.

Usage of cursor and non-cursor in Oracle

Today I oddly found the different between using non-cursor and cursor in Oracle. Generally, using these two usages are same but kind of different memory usage and error handling.

Advantage and disadvantage Of Cursor

Using so many cursors in stored procedures, functions and views can be high memory usage in Server. Because every cursors take individual space in memory while creating and processing. If return value is NULL from this cursor, Oracle will not throw error message to application.

Example coding of using cursor

view plain print about
1CREATE OR REPLACE PROCEDURE PPS_TEST
2 (P_PERSON_ID IN NUMBER)
3IS
4 L_MENU VARCHAR2(50);
5 L_ERR_MSG VARCHAR2(200);
6
7 CURSOR C_PP (P_PERSON_ID NUMBER) IS
8 SELECT NAME FROM PERSON
9 WHERE PERSON_ID = P_PERSON_ID;
10
11BEGIN
12 OPEN C_PP(P_PERSON_ID);
13 FETCH C_PP INTO L_MENU;
14 CLOSE C_PP;
15EXCEPTION
16    WHEN OTHERS THEN
17     L_ERR_MSG := SQLERRM;
18        RAISE_APPLICATION_ERROR(-20000, L_ERR_MSG);
19END;

[More]

Create List String in Oracle

Create list string in Coldfusion is very simple. We just use ValueList function of Coldfusion. What we can do it in Oracle? As we all know, there are a lot of built-in functions in Oracle and new more functions are including whenever upgrading Oracle version. Being not DBA (database administrator), I cannot know how many built-in functions are in Oracle and how many new functions are added into each version.

Today, I need to create list string in Oracle. My first though, I would search built-in function like ValueList in Oracle. As my though, I've search again and again but have no result at all. That's why, I decided myself to create new function for creating list string as follow:

[More]

More Entries

Top of Page