Home » Developer & Programmer » Forms » How to create backup and restore (Windows XP, Oracle Form 6i)
How to create backup and restore [message #601732] Mon, 25 November 2013 02:07 Go to next message
lock_heart
Messages: 36
Registered: November 2013
Member
Hii guys, I've created a application using oracle form 6i. Well now my client want me to add backup and restore option into menu.So that they could take backup of their data regularly but i really don't know how to create backup and restore file option. Can anyone please tell me how to do this...
Re: How to create backup and restore [message #601744 is a reply to message #601732] Mon, 25 November 2013 04:06 Go to previous messageGo to next message
John Watson
Messages: 8929
Registered: January 2010
Location: Global Village
Senior Member
Welcome to the forum. Please read our OraFAQ Forum Guide and please read How to use [code] tags and make your code easier to read

I happen to be developing a programmatic interface to RMAN at the moment. You probably need to use the dbms_backup_restore package, which is not properly documented but is understandble.
Re: How to create backup and restore [message #601746 is a reply to message #601744] Mon, 25 November 2013 04:30 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
Does forms have to be involved or can you just set up nightly backups?
Re: How to create backup and restore [message #601749 is a reply to message #601744] Mon, 25 November 2013 04:34 Go to previous messageGo to next message
lock_heart
Messages: 36
Registered: November 2013
Member
Thanks john, but can you tell me in detail
Re: How to create backup and restore [message #601751 is a reply to message #601749] Mon, 25 November 2013 05:12 Go to previous messageGo to next message
lock_heart
Messages: 36
Registered: November 2013
Member
In the menu i am creating this option. Just like we create menu item for calling form.
Re: How to create backup and restore [message #601752 is a reply to message #601751] Mon, 25 November 2013 05:30 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
I assume that means forms has to be involved.

I ask because doing backups via forms is not normal, most companies just take nightly backups of the DB using the rman, run from a scheduler (db or cron).
There's no easy way to do it from forms as that's just not how it's done.

So are you absolutely sure that forms has to be involved or has your client just asked for this because they don't really understand what's involved in backing up a database?
Re: How to create backup and restore [message #601765 is a reply to message #601749] Mon, 25 November 2013 06:33 Go to previous messageGo to next message
John Watson
Messages: 8929
Registered: January 2010
Location: Global Village
Senior Member
lock_heart wrote on Mon, 25 November 2013 10:34
Thanks john, but can you tell me in detail
I'm not going to do your job for you, and I certainly can't give away intellectual property. Have you looked at the package yet?

Re: How to create backup and restore [message #601786 is a reply to message #601765] Mon, 25 November 2013 13:01 Go to previous messageGo to next message
Adeel Qadir
Messages: 48
Registered: November 2013
Location: Pakistan
Member
You can take backup through push button or menu but you cant do it restore for some data merging and data corruption problem.

Taking a backup by press button or menu is below and understand it step by step.

1. First of all create a push button or menu (Name = Take Backup or any name u want)
2. Copy the below trigger code in push button or menu

begin

host('exp You_User_Name/Your_password@TNS_name file=D:\backups\backup_'||to_char(sysdate,'ddmmrr_hhmiss_am')||'.dmp');

----(D:\backup is file path where backup file saved after creating and to_char(sysdate,'ddmmrr_hhmiss_am' is a automatic creating file name with present sysdate and time.)

if form_success then
message('Backup Created successfully.')
message('Backup Created successfully.')

else
message('Some error Occurred while performing backup action');
end if;
end;





[Updated on: Mon, 25 November 2013 13:03]

Report message to a moderator

Re: How to create backup and restore [message #601787 is a reply to message #601786] Mon, 25 November 2013 13:31 Go to previous messageGo to next message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
Adeel Qadir wrote on Mon, 25 November 2013 14:01
Y
2. Copy the below trigger code in push button or menu

begin

host('exp You_User_Name/Your_password@TNS_name file=D:\backups\backup_'||to_char(sysdate,'ddmmrr_hhmiss_am')||'.dmp');

----(D:\backup is file path where backup file saved after creating and to_char(sysdate,'ddmmrr_hhmiss_am' is a automatic creating file name with present sysdate and time.)


An export is just a logical backup, not a real backup. OP hasn't really said what they mean by backup. For example, table, schema or entire database.
Re: How to create backup and restore [message #601788 is a reply to message #601787] Mon, 25 November 2013 13:46 Go to previous messageGo to next message
lock_heart
Messages: 36
Registered: November 2013
Member
I want to take backup of everything as i am creating an application so it does contain many tables.
Re: How to create backup and restore [message #601804 is a reply to message #601788] Mon, 25 November 2013 23:40 Go to previous messageGo to next message
Adeel Qadir
Messages: 48
Registered: November 2013
Location: Pakistan
Member
in my procedure command will be take full backup of (tables, back end triggers, views, indexes, records and all over)
Re: How to create backup and restore [message #601810 is a reply to message #601804] Mon, 25 November 2013 23:52 Go to previous messageGo to next message
lock_heart
Messages: 36
Registered: November 2013
Member
Thanks I will try this now, so is there any way that we could restore this backup...
Re: How to create backup and restore [message #601813 is a reply to message #601810] Tue, 26 November 2013 00:09 Go to previous messageGo to next message
Littlefoot
Messages: 21807
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Well, that would be a pretty useless job if you created backup and there's no way to restore it, don't you think?
Re: How to create backup and restore [message #601814 is a reply to message #601786] Tue, 26 November 2013 00:12 Go to previous messageGo to next message
lock_heart
Messages: 36
Registered: November 2013
Member
Adeel Qadir wrote on Mon, 25 November 2013 13:01

You can take backup through push button or menu but you cant do it restore for some data merging and data corruption problem.


Well If there is backup then there should be restore option. As i am new to this backup/restore, so i don't know how to do this..
Re: How to create backup and restore [message #601820 is a reply to message #601814] Tue, 26 November 2013 01:31 Go to previous messageGo to next message
Littlefoot
Messages: 21807
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
You have several problems. The major one is that you don't know what you are doing. Another one is that you don't know how you'd do that. Then, you are assigned a task to do something you don't know with a tool that is probably the wrong choice. Smells like a BIG failure.

Maybe you should take step by step and focus on one problem at a time, think it over, read documentation, meet the enemy.

As your client told you to implement "backup" (did you ask them what they mean by saying that? What kind of a backup? Backup what exactly?) into your Forms application, I'm not sure they know what they are talking about or you didn't understand the requirement.

Is it to backup only some data from several tables (for example, INSERT them into another table and UPDATE the source table if something goes wrong)?

Is it a logical backup (export); you can use HOST built-in and run EXP (or EXPDP), but you most probably won't import that back easily because of existing objects, data stored within these objects, whether some of them have to be restored (or all of them), how will referential integrity constraints affect that process etc. Generally speaking, not a straightforward task.

Is it a RMAN backup? I know nothing about it, I'm not a DBA and I don't know what it involves. Lucky me, I don't have to implement it into a Forms application so I won't read any documentation at the moment, but you probably should.

So, go back to your client and do the first step. You and they must understand each other VERY well before you move on to the next step.
Re: How to create backup and restore [message #601866 is a reply to message #601820] Tue, 26 November 2013 09:28 Go to previous messageGo to next message
lock_heart
Messages: 36
Registered: November 2013
Member
Hi... What my client exactly want in backup is that the data entry which are going to made into tables i.e. Insert, update statement so that if anything happen to the data they could restore it.
Re: How to create backup and restore [message #601873 is a reply to message #601866] Tue, 26 November 2013 10:16 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
If they want to be able to completely restore data in the event of hardware failure etc then they definitely do not want inserts/updates. They want RMAN.
I strongly suggest you go and read the documentation on it and learn what it does.
Or go and hire a DBA who knows how to use it.
Re: How to create backup and restore [message #601898 is a reply to message #601873] Tue, 26 November 2013 23:10 Go to previous messageGo to next message
lock_heart
Messages: 36
Registered: November 2013
Member
Thanks cookiemaster i'll read document related to RMAN if some doubt occur then i know where to come Smile
Re: How to create backup and restore [message #602137 is a reply to message #601898] Fri, 29 November 2013 23:57 Go to previous message
Adeel Qadir
Messages: 48
Registered: November 2013
Location: Pakistan
Member
i have mentioned already in my post. Restore command is not comfortable from Button or Menu. because its merging or loss your data, So every Developer manage it manually. In addition when you restore data it required a File name (which one u want to restore) here is a main fault to manage restore automatically because you can not give any file name automatically when user pressed Restore Button. So that its main problem and not manageable.
Previous Topic: RPT2XLS
Next Topic: change user password through form
Goto Forum:
  


Current Time: Thu Apr 18 23:18:21 CDT 2024