How to take a Hot backup of Oracle database
1: put the db in archive log mode
2: set the db_sid to correct one
3: login to sqlplus
4: verify the name of the db that you are connected to
select name from v$database;
5: check if the db is in archive log made
select log_mode from v$database;
if not in archive log mode
another command to check
archive log list;
6: find where on disk oracle writes archive log when it is in archive log mode
sql> show parameter log_archive_dest_1;
if the value is found to be 0, that means no values will be recorded, so we need to change it
sql> alter system set log_archive_dest_1='LOCATION=c:\database\oradata\finance\archived_logs\'
scope=spfile;
7: shutdown immediate; < this is done just to prepare the db for hot backups >
8: startup the db in mount mode
startup mount;
( 3 startup types : nomount - just starts the instance, mount - locates the control files and open up according to the values, open - finds the datafiles from the control files and opens up the db )
9: put the db in archive log mode
alter database archivelog;
10: open the database
alter database open;
11: check the status of the db
select log_mode from v$database;
SQL> archive log list;
12: create a directory for archived log
check if its empty, if empty we need to switch
sql> alter system archive log current;
run it 5 times < need to put / and enter > , then check the archive log dir , we will find files
13: make a table in the database and insert data in it
create table employees (fname varchar(2));
check the table
desc employees;
insert values
insert into employees values ('Mica');
14: tablespace must be in hot backup mode
check the status
select * from v$backup;
if found not active, then we need to change
we cannot put the db in hot backup mode, unless it is archive log mode
change to hot backup mode
alter database begin backup;
check the status
select * from v$backup;
15: now we can only COPY DBF FILES
copy *dbf <distination location>
16: need to take the db out to hot backup mode
alter database end backup;
17: need to make another archive log switch
alter system archive log current;
18: need to copy control files now, need to do a binary bckup
alter database backup controlfile to '<location>\controlbackup';
19: insert more values to the table
insert into employess values ('NASH')
COMMIT;
make another archive log switch : alter system archive log current;
do the same process for more values
20 : backup all the archive logs to a new location
21: shutdown the db and simulate a hw error, delete all the files from the database folder
22: try to start the sqlplus and db ::: error
23: copy all the backups to the db dir
need to copy the control files, rename the binary backup of the control file and make the copies as needed
24: try to mount the db, error < must use reset logs or noreset logs >
25: need to do a recovering of the database
shutdown
restore the archive logs
startup mount;
recover database until cancel using backup controlfile;
it will ask for a log file :
yes for recovery
cancel for cancelling recovery
26: check status: open the database in readonly
alter database open read only;
check the tables to see the data
shutdown immediate
shartup mount;
recover again : recover database until cancel using backup controlfile;
if oracle is asking for a log that do nto exist , all we have to do is type cancel
27: open the database
alter database open;
need to do reset logs
alter database open resetlogs;
28: check the db that you are connected, check the tables
thanks and regards
VKN
site admin
http://www.nitrofuture.com
A very long list ... let me make it shorter.
SQL> archive log list;If I see this:
Database log mode No Archive ModeI put the database into archivelog mode and leave it there forever.
If it is in archivelog mode:
RMAN> TARGET SYS/<password>@<service_name> NOCATALOG
RMAN> BACKUP DATABASE PLUS ARCHIVELOG;Though there are a lot of things one could do better such as incrementals with block change tracking, creating an RMAN catalog, etc.
Similar Messages
-
How to restore RMAN hot backup to another database on another server?
I want to know how to restore RMAN hot backup from production server to another database on a testing server.
The hot backup is from a database named PROD on the production server
The database to be restored with the hot backup is TEST on the testing server. There is already a PROD database on the testing server and this PROD database must be kept.
I have read some threads about changing initTEST.ora to PROD to restore such backup but (I think) will not work in my case since I already have a PROD database on the testing server.
The version is 11gR2 on Linux but the compatible parameter is set to 10.2.0.1.0.
Thanks for any help.Hi,
Since you are on 11g, hope this helps you http://shivanandarao.wordpress.com/2012/04/28/duplicating-database-without-connecting-to-target-database-or-catalog-database-in-oracle-11g/
881656
Handle: 881656
Status Level: Newbie
Registered: Aug 25, 2011
Total Posts: 53
Total Questions: 31 (31 unresolved)
Looks like forum is of no help to you. To get better responses, consider closing your threads by providing appropriate points if you feel that they have been answered. Keep the forum clean !! -
Hot Backup for oracle database?
Dear all,
I want to change Cold Backup to Hot Backup. Does anyone how to do Hot Backup and has some simple document I can follow? If the database is running in ARCHIVELOG mode, is the size grow very fast or other effect will overcome?
Please advice,
AmyI want to change Cold Backup to Hot Backup. Does
anyone how to do Hot Backup and has some simple
document I can follow?online/hot backup don’t need to shutdown the database we can put the database in backup mode and then start taking backup even though users database activity read/write data going on. This strategy useful if ours database goes for 24x7.
For online/hot backup the database should be in archive mode.
I hope you know how to turn on archive.Before turning on check the archive on or not.
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 1
Next log sequence to archive 2
Current log sequence 2
SQL> you may also check it by connecting to database as sys
SQL> select log_mode from v$database;
LOG_MODE
ARCHIVELOG
SQL> if yours database is not in archive mode then first enable archive,please before turning on the archive take cold backup.
SQL>shutdown immediate
SQL>startup mount
SQL>alter database archivelog
SQL>alter database open;
SQL> archive log list
Now you are able to take hot/online backup ,its upto you you use user managed backup and recovery or use RMAN oracle own shipped free tool for backup and recovery ,however my recommendation would goes for RMAN.
http://download-uk.oracle.com/docs/cd/A97630_01/server.920/a96572/toc.htm
http://www.oracle.com/technology/deploy/availability/htdocs/rman_overview.htm
ARCHIVELOG mode, is the size grow very fast or other
effect will overcome?However, the growing size pace either fast or slow everyday can be impractical it alls depends on activity of yours database operation.You will have to observe it yourself by turning on archive log its vary database to database activity.
Khurram -
Hi
How to take up Hot backups (On-line backup) in Oracle 10g Release 2 in Windows environment.
Pls give me the link or steps for do the hot back-ups.
ThanksI think you are test ENV?
Did you archive the current log file which i mentioned in the earlier post
if so and if you the archived log
Shutdown the DB
Rename the file you copied
move the D:\oradata\*.dbf(whihc was backed up by you)in the original directory and
from sqlplus issue
SQL>startup mount
SQL>recover database
this hould work
But make sure you have the backup before deleting/renaming the the file you backed up by HOTbackup -
How to backup an oracle database?
I am running a oracle server on a windows box.
using the oracle 92 management console and developer tools.
Can someone instruct me on how to create a "job" that will backup my oracle databases on a daily basis?
I am more used to MS-SQL and have no clue how to do it in Oracle.
ThanksHi,
this is my weekly script to backup oracle database.
i run it from cron so you can schedule it in win but you must do same change there
#!/bin/bash
. /etc/profile.d/oracle.sh
TMPDIR=/opt/app/oracle/tmp
$ORACLE_HOME/bin/rman target / nocatalog log=$TMPDIR/backup_full_`date +'%Y%m%d_%H%M'`.log >/dev/null 2>&1 <<EOF
set echo on;
show all;
crosscheck archivelog all;
crosscheck backup ;
delete noprompt expired backup device type disk;
backup device type disk database tag='FULL_BACKUP';
backup device type disk archivelog all not backed up;
delete noprompt obsolete device type disk;
exit;
EOF
exit -
How to Takes Active directory backup and Restore in different Hardware
Hi
how to takes Active directory backup and Restore in different Hardware in Windows server 2003 R2 standard Edition.You can give a look to that: https://support.microsoft.com/kb/249694/?wa=wsignin1.0
This posting is provided AS IS with no warranties or guarantees , and confers no rights.
Ahmed MALEK
My Website Link
My Linkedin Profile
My MVP Profile -
How to handel a Batch job in oracle database
How to handel a Batch job in oracle database?
Regards
alokAlekh wrote:
lists of jobs execute concurrently.Thats a definition we all aware of ;), I meant do you want to execute the jobs in a sequence? is there any dependency? is it more like scheduling?
And What kind of jobs you are talking about? running PL/SQL programs? or stats collection? or DB backup?
Regards,
Prazy -
HOT Backups for smaller databases
Should we schedule hot backups for small databases? the database size is around 1.5 GB. We have already scheduled daily FULL DB Export.
The database is Oracle 8i.RMAN> run {
2> allocate channel ch1 type disk format 'e:\rman_backup\backup%d_DB_%u_%p';
3> backup database;
4> backup archivelog all;
5> release channel ch1;
6> }
RMAN-03022: compiling command: allocate
RMAN-03026: error recovery releasing channel resources
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure during compilation of command
RMAN-03013: command type: allocate
RMAN-06172: not connected to recovery catalog database
RMAN> -
How to insert an image file in Oracle database
hi
can you please tell me how to insert an image file into oracle database????
suppose there is one image file in c:\pictures\rose.jpg. how to insert that file into database? theoretically i know that will be BFILE type but i dont know how to insert that.
will be waiting for your reply........
thanks & regards,
PriyatoshHello,
The easiest way to load a blob is to use SQL loader.
This example comes from the utilities guide:
LOAD DATA
INFILE 'sample.dat'
INTO TABLE person_table
FIELDS TERMINATED BY ','
(name CHAR(20),
1 ext_fname FILLER CHAR(40),
2 "RESUME" LOBFILE(ext_fname) TERMINATED BY EOF)
Datafile (sample.dat)
Johny Quest,jqresume.txt,
Speed Racer,'/private/sracer/srresume.txt',
Secondary Datafile (jqresume.txt)
Johny Quest
500 Oracle Parkway
Secondary Datafile (srresume.txt)
Loading LOBs
10-18 Oracle Database Utilities
Speed Racer
400 Oracle Parkway
regards,
Ivo -
How to insert a image file into oracle database
hi all
can anyone guide me how to insert a image file into oracle database now
i have created table using
create table imagestore(image blob);
but when inserting i totally lost don't know what to do how to write query to insert image fileHi I don't have time to explain really, I did have to do this a while ago though so I will post a code snippet. This is using the commons file upload framework.
Firstly you need a multi part form data (if you are using a web page). If you are not using a web page ignore this bit.
out.println("<form name=\"imgFrm\" method=\"post\" enctype=\"multipart/form-data\" action=\"FileUploadServlet?thisPageAction=reloaded\" onSubmit=\"return submitForm();\"><input type=\"FILE\" name=\"imgSource\" size='60' class='smalltext' onKeyPress='return stopUserInput();' onKeyUp='stopUserInput();' onKeyDown='stopUserInput();' onMouseDown='noMouseDown(event);'>");
out.println(" <input type='submit' name='submit' value='Submit' class='smalltext'>");
out.println("</form>"); Import this once you have the jar file:
import org.apache.commons.fileupload.*;Now a method I wrote to upload the file. I am not saying that this is correct, or its the best way to do this. I am just saying it works for me.
private boolean uploadFile(HttpServletRequest request, HttpSession session) throws Exception {
boolean result = true;
String fileName = null;
byte fileData[] = null;
String fileUploadError = null;
String imageType = "";
String error = "";
DiskFileUpload fb = new DiskFileUpload();
List fileItems = fb.parseRequest(request);
Iterator it = fileItems.iterator();
while(it.hasNext()){
FileItem fileItem = (FileItem)it.next();
if (!fileItem.isFormField()) {
fileName = fileItem.getName();
fileData = fileItem.get();
// Get the imageType from the filename extension
if (fileName != null) {
int dotPos = fileName.indexOf('.');
if (dotPos >= 0 && dotPos != fileName.length()-1) {
imageType = fileName.substring(dotPos+1).toLowerCase();
if (imageType.equals("jpg")) {
imageType = "jpeg";
String filePath = request.getParameter("FILE_PATH");
session.setAttribute("filePath", filePath);
session.setAttribute("fileData", fileData);
session.setAttribute("fileName", fileName);
session.setAttribute("imageType", imageType);
return result;
} And now finally the method to actually write the file to the database:
private int writeImageFile(byte[] fileData, String fileName, String imageType, String mode, Integer signatureIDIn, HttpServletRequest request) throws Exception {
//If the previous code found a file that can be uploaded then
//save it into the database via a pstmt
String sql = "";
UtilDBquery udbq = getUser(request).connectToDatabase();
Connection con = null;
int signatureID = 0;
PreparedStatement pstmt = null;
try {
udbq.setUsePreparedStatements(true);
con = udbq.getPooledConnection();
con.setAutoCommit(false);
if((!mode.equals("U")) || (mode.equals("U") && signatureIDIn == 0)) {
sql = "SELECT SEQ_SIGNATURE_ID.nextval FROM DUAL";
pstmt = con.prepareStatement(sql);
ResultSet rs = pstmt.executeQuery();
while(rs.next()) {
signatureID = rs.getInt(1);
if (fileName != null && imageType != null) {
sql = "INSERT INTO T_SIGNATURE (SIGNATURE_ID, SIGNATURE) values (?,?)";
InputStream is2 = new ByteArrayInputStream(fileData);
pstmt = con.prepareStatement(sql);
pstmt.setInt(1, signatureID);
pstmt.setBinaryStream(2, is2, (int)(fileData.length));
pstmt.executeUpdate();
pstmt.close();
con.commit();
con = null;
if(mode.equals("U") && signatureIDIn != 0) {
signatureID = signatureIDIn.intValue();
if (fileName != null && imageType != null) {
sql = "UPDATE T_SIGNATURE SET SIGNATURE = ? WHERE SIGNATURE_ID = ?";
InputStream is2 = new ByteArrayInputStream(fileData);
pstmt = con.prepareStatement(sql);
pstmt.setBinaryStream(1, is2, (int)(fileData.length));
pstmt.setInt(2, signatureID);
pstmt.executeUpdate();
pstmt.close();
con.commit();
con = null;
} catch (Exception e) {
con = null;
throw new Exception(e.toString());
return signatureID;
} -
What commands used for taking backup of oracle database using BR*Tools
Can somebody please help me urgently to know what are the commands used for taking backup of oracle database using BR TOOLS.Also specifythe commands in detail which can be used for taking backups of oracle database ,Online Redo log files in databse using BRBACK tool,Archiving of offline, redo log files using BRARCHIVE, and Restoring a Database using BRRESTORE tool Commands(Plese specify the commands with their Syntax used).Also specify the commands with their Syntax which are used for taking backup of oracle database(online,Offline redo log files) into Tapedrives using BRTOOLS commands.
Thanking You for helping (in advance).Dear Ashish,
BRBACKUP / BRARCHIVE calls the operating system command to copy the files.
Simple approach to get the commands is as follows.
1. Set the BR_TRACE (as given in the SAP note 29321) and run the command for which you need to know the OS / SQL commands.
2. This will generate the log file with the trace information. This trace has the information of the commands used by the job you have run.
Hope this helps.
Regards,
Madhukar -
How to load text file data to Oracle Database table?
By using Oracle Forms, how to load text file data to Oracle Database table?
Metalink note 33247.1 explains how to use text_io as suggested by Robin to read the file into a Multi-Row block. However, that article was written for forms 4.5 and uses CREATE_RECORD in a loop. There was another article, 91513.1 describing the more elegant method of 'querying' the file into the block by transactional triggers. Unfortunately this more recent article has disappeared without trace and Oracle deny its existence. I know it existed as I have a printed copy in front of me, and very useful it is too.
-
How to generate .SQL format file from oracle database?
How to generate .SQL format file from oracle database?
I have a database of Oracle 8.1.6,now want to generate script file (including table structure,index,etc.) from it,What should I do?
Thanks.Your question pertains to the Database Export/Import. This forum exclusively focusses on the export/import utilities that come along with "Oracle Portal" which is a web-based tool. Could you please post your question under the RDBMS export/import or migration forum.
-
How to take remote disk backup on AIX
Dear All,
I want to take a disk backup of our Development system. I will take the backup on an USB external HDD
which is connected to a Windows XP system. Both the Windows XP and DEV system are on same local network. The external HDD has NTFS file system and has been shared. The server is on AIX 5.3 with oracle 10.2.0.1 with SAP ECC 6.0. Since I am new to AIX Operating System and have little knowledge about AIX, I am unable to access the shared disk in my AIX box. Once I will able to access the shared disk in the AIX system i.e. in the Development server and then only I can configure the corresponding file at SAP level and could take the backup. Please help me how to access the corresponding shared disk from AIX and what configuration I have to do at SAP level for taking disk backup.
Regards
SamirHi 844795,
See this thread:
Re: Backup of OCR and voting disk
The fastest way to find your answer in the forum is to use the forum search.
https://forums.oracle.com/forums/search.jspa?threadID=&q=backup+votedisk&objID=c140&dateRange=last90days&userID=&numResults=15&rankBy=10001
Cheers,
Levi Pereira
It's good etiquette, when your question has been answered to mark it as answered, and mark posts as "correct" or "helpful". Read about
Edited by: Levi Pereira on Nov 21, 2011 2:41 PM # This reply was to user 844795. -
How to include Date for backup of Oracle in a script !!! LINUX
hi,
I need to add date & time for the backup of Oracle 10g on OEL 5 32 bit.
and also how do I get an email when Rman finishes its job
Thanks in advanced.user584721 wrote:
Thanks for the update..
I am using a script called full_dpbackup.sh which contain the following ...
expdp system/oracle schemas=scott directory=test_dir dumpfile=scott.dmp logfile=expdpscott.log mpencryption=all encryption_password=scott reuse_dumpfiles=y compression=all
I need to include the date & time in this script.
Thanks in advanced.That's not a backup, it's an export.
I don't have my linux system handy to debug, but what you want would be something like:
expdp ..... dumpfile=exp_`date`.logThe reverse single quote (I don't know the official term, but it's the character just to the left of the one/exclamation on a US keyboard) tells the shell to substitute the value returned by the command enclosed by the marks. In the example above, it would substitute the value returned by the "date" command. That command has many, many arguments to control the format of what is returned. Look them up an any good nix reference, or just "man date". (As for any good nix reference, you should at a minimum have a copy of "Unix In A Nutshell" on your desk.)
Maybe you are looking for
-
A message came up on my desktop asking me to click on it and it warned me about my toolbars would no longer work. I believe I had just deleted Google Chrome. Now every time I want to go online I have to wait a minute or so before a message comes up a
-
Bug Report: Static LOV's and PDF Printing with Tabular Forms
I have a tabular form, which acts as an editable report. Some columns are 'Standard Report Column' and some are Select Lists, using Static LOV's with the contents of Yes;Y,No;NThe purpose of the page is to allow users to edit yes/no attributes of a r
-
Compress files and folders in OS 10.6
How do I compress files and folders in OS 10.6?
-
Changes in ´Additional tab B´ must only visible to one client
Hello SAP Programmers, When i create addtional custom fields on ´Additional tab B´, these custom fields must only visible to one client(i am logged in as client 400). Is there any way please suggest me. Thanks & Regards, NarsiReddy Cheruku
-
Is it possible access to dashboards by using network users insted of obiee
Hi, can anybody have idea about this is it possible access to dashboard by using network users.insted of obiee users.i.ewhen you are login into presentation services it will ask user name and password. in this case it will not like that when we are l