Hot Backup Scripts for database backup and apps backup |
Thursday, September 14, 2006 |
|
We have moved to http://onlineAppsDBA.com kindly check http://onlineAppsDBA.comin future
Yesterday I discussed about backup Overview & cold backup if you have not gone though it you can read it from
http://becomeappsdba.blogspot.com/2006/09/backup-recovery-in-oracle-apps.html
Yesterday I mentioned that I am going to post about hot backup scripts , here it comes
Enable Archive Log First check if your database is in Archive mode SQL> archive log list Database log mode Archive Mode Automatic archival Enabled If you see Automatic archival is enabled that means database is in archive mode . If not then
SQL>SHUTDOWN SQL>STARTUP MOUNT SQL>ALTER DATABASE ARCHIVELOG; SQL>ALTER DATABASE OPEN; SQL>alter system set LOG_ARCHIVE_DEST_1 ='LOCATION=/your/archive/location/arch' scope=spfile; SQL>shutdown immediate SQL>Startup Steps are for database 10g , These commands may vary according to your database version. After that for Hotbackup Change tablespace mode to begin backup like alter tablespace tablespace_name begin backup; you have to do this for all tablesapces in your database except temporary tablespace (This can be tedious work if you are doing it manually so here is script to do so )
SQL>set head off SQL>spool beginbackup.sql SQL>select 'alter tablespace ' tablespace_name ' begin backup;' from dba_tablespaces; SQL>spool off
This will create file beginbackup.sql with entry for all tablespaces, remove any unnecessary lines & then execute this script into SQL like SQL>@beginbackup.sql (Once you execute this script this will put all tablespaces in to begin backup mode)
Now create backup of your control file in Human Readable format like alter database backup controlfile to trace as '/some/path'; you can reuse it by removing comment at beginning & replace them with connect / as sysdba
Then 1. Copy all your datafiles, redo logs and control file from your database server to backup location. after datafiles are copied don't forget to end backup for all tablespace here is the scripts SQL>set head off SQL>spool endbackup.sql SQL>select 'alter tablespace ' tablespace_name ' end backup;' from dba_tablespaces; SQL>spool off
This will create file endbackup.sql with entry for all tablespaces, remove any unnecessary lines & then execute this script into SQL like SQL>@endbackup.sql (Once you execute this script this will put all tablespaces in to end backup mode)
This completes your datafiles backup but you still have to backup database software & oracle Applications Middle Tier
2. Copy database software $ORACLE_HOME from server to backup location 3. Copy Apps Middle tier all TOPs (APPL_TOP, COMMON_TOP, ORA_TOP)
TIP: Sometime if you copy application tier while apache is Up , you copy httpd.pid or httpd_pls.pid from $IAS_ORACLE_HOME/Apache/Apache/logs/httpd.pid and if in restored Instance Apache doesn't start & complain about httpd.pid or httpd_pls.pid already exists , you can simply delete these two files from restored Instance & start Apache Web Server.
Please note I am not in town for another 4 days so I'll not be able to Upadte this Site till Tuesday. Thanks in Advance for your patience. |
We have moved to kindly check onLineAppsDBA.com in future
|
|
del.icio.us
¦
Digg This
¦
My Yahoo
¦
Reddit
¦
BlinkList
¦
Furl It
¦
Email This
¦
Leave Your Comments
|
posted by Atul Kumar @ 10:12 AM
|
|
22 Comments: |
-
Hi; Just want to say Atul u r the best teacher.I'm learning alot from u. God bless ya!!
-
Hi Atul
We do not backup the redologs in hot backup.We backup the archives that are produced during the hot backup. Also i did not understand why u want a human readable format of the controlfile? Instead you need to backup your controlfiles with .ctl extension, that is the correct procedure.
vikki
-
I try to generate script for begin and end backup, is most efficient:
set head off; spool beginbackup.sql; select 'alter tablespace ' || tablespace_name || ' begin backup;' from DBA_TABLESPACES where tablespace_name <> 'TEMP'; spool out;
and:
set head off; spool beginbackup.sql; select 'alter tablespace ' || tablespace_name || ' end backup;' from DBA_TABLESPACES where tablespace_name <> 'TEMP'; spool out;
but not understand the part for: Then 1. Copy all your datafiles, redo logs and control files .....
"this copy is a normal os copy: cp *.dbf /u02/hot_backup/oradata"????
I need your help..
-
Yes it is normal o.s. copy. Make sure you are backing up archives as well generated during this process.
-
Thanks Athul, Your help resolve my big problem. I interest in your criteria about this:
Is mos efficient create multiples schema 's in oracle database for best manage and monitoring the db and efficient backup and restore process... or
Install oracle standard for a 5 standard tablespaces.
I 'm show a presentation for my boss, he propose install oracle standard install, but i not...
I need your opinion respect to.
Thanks...
-
what do you mean by multiple schemas here ??
If you are talking about OATM , OATM in my opinion is better to manage.
-
My English is not good, i from Dominican Republic, speak Spanish...
I ; m refer to distinct schemas, is a distinct users or (applications) for group your object in the database.
My work place is a Telecommunication company (ISP as residential telephonic services)
In Development ambient existing multiples Tablespaces: monitor, commissioning, billing, etc., .., .., .,
My boss said to production database not take a equal schema, but i not accord with her..
I write a propose for this to my boss.
thanks..
-
hi Atul, Till now my client was taking oracle application 11i nightly cold backps on tapes. Now we are implementing rman hot backups. But my question is related to applications part . How should i plan for the application backup 1. Should i take the application file system backup of production every day? 2.should i bring down the application every night for the file system backup (like currently doing for cold backup) 3. Shall i take the file system backup every day with out shutting down the application services
Please guide me what would be your best suggestion for this
-
Sweta
1. Should i take the application file system backup of production every day?
Yes if you want to protect your CM log and output files as these are the only files which you might be interesed in rest others don't change (other log file you should not be interested in , in case of disk failure)
2.should i bring down the application every night for the file system backup (like currently doing for cold backup)
Not required , if you hit any issue during apache start after recovery move *.pid file from $IAS_ORACLE_HOME/Apache/Apache/logs
3. Shall i take the file system backup every day with out shutting down the application services
Check point 1
We have moved to http://OnLineAppsDBA.com so in future kindly contact me on On Line Apps DBA site .
Forward this site to your friends.
-
Hi Atul How to copy from one location to another in Windows environment? I used COPY command.. but it shows error.. Pls give the full syntax of those command..
Thanks
-
when we are take hot backup that time datafiles get freezed on same time if my database users doing more transaction on database that time how all data is going in to datafiles.shall we do export of same time.
-
we cann't put all files in begin backup mode simultaneously.bcause if this is a big database means in terabytes so many archives will generate simultaneously, we can't save t many archives. so we put only single tablespace in backupmode at one time. Assume that your database has two tablespaces, USERS and TOOLS. To back up the files for these two tablespaces, first put the tablespace in backup mode by using the ALTER statement as follows: SQL>alter tablespace USERS begin backup;After the tablespace is in Backup mode, you can use the SELECT statement to list the data files for the USERS tablespace, and the copy (cp) command to copy the files to the backup location. Assume that the USERS tablespace has two data files—users01.dbf and users02.dbf. SQL>select file_name from dba_data_files where tablespace_name='USERS'; $cp /u01/oracle/users01.dbf /u10/backup $cp /u01/oracle/users01.dbf /u10/backupThe following command ends the backup process and puts the tablespace back in normal mode. SQL>alter tablespace USERS end backup;You have to repeat this process for all tablespaces. You can get the list of tablespaces by using the following SQL statement: SQL>select tablespace_name from dba_tablespaces;
-
Atul, I need your help, I am new dba and need help on backingup archivelog database to tape using. How do I do that?
-
Hi, Atul I have gone through your script. Why do you make a script if you want entaire tablespaces in begin backup mode mode. I think if you want you can go ahead with alter database begin backup nad copy the files one by one.
Yaa As nidhi said there will be a lot of I/O s and will cause performance issue.
#### Think about this.
Please put tablespace in backup mode and copy the datafiles (OS Level) and place the tablespace in end backup. and jump for other tablespace and carry on this till you complete all the tablespaces.
Regards Nagaraj Chidella
-
hi there,
Is there any way to make this automatic everynight? WE have requirement to create Oracle APps Database from Hot backup every night for reporting purpose. NO Full Application cloning is required, just DB part.
Thanks a lot in advance.
-
hi atul, i have problem in creating a catalog in rman backup, I did created a tablespace for catalog and also user but when i issue the command "rman catalog=rman/rman@orcl" it says cant open catalog=rman/rman@orcl. plz help me
-
wht should be set in parameter file if we go the hotbackup log_archive_dest=
-
Hi! I think, for 10g Database
alter database begin backup;
copy files
then alter database end backup;
will do the thing.
-
Hi Atul,
Can you please explain about the Logical backup of the database with commands?
Regards, Sudhakar Oracle Apps DBA consultant
-
how to take the hotbackup of APPL_TOP, COMMON_TOP, ORA_TOP
-
Hi i think no need to tacke temporary tablespace backup,if we take backup controlfile to trace in hot backup or cold backup.we can create temporary tablespace after opening the database,at the time of recovery it may not ask for temporary tablespace recovery.bcz in controlfile temporary tablespace will add after database opend only.
-
HI Atul;
Your posts are quite informative and helpful;
I need a confirmation from you on the this backup mode cloning option; IS THIS FOR R12 or 11i? Or is it applicable in both areas?
Hasan
|
|
<< Home |
|
|
|
Hi;
Just want to say Atul u r the best teacher.I'm learning alot from u. God bless ya!!