How to create backup using sql commands

can i create a backup using sql/sqlplus commands

I would actually advice you to use RMAN, instead of backup using sql commands, but if you want or have a requirment to do so..
First off all you should ensire that your databasse is in archilog mode.. (ALL PRODUCTION DATABASES should be in archivelog mode)
you can do it using sql*plus
archive log list
Then if you would like to make a cold backup (the only one posible in noarchivelog mode)
ypu have to
shutdown immediate
copy all database files (you don't need to copy redo logs) to another device
startup - to startup database
Actually I will suggest that your read User manager Recovery guide from oracle documentation
tahiti.oracle.com
Best Regards
Krystian Zieja / mob

Similar Messages

  • How to create db using sql commands?

    Had logged in to default database with the default login nmae and password. Under this default database, am i able to create another database in it? If so, what is the sql command to create/delete the new db?

    Chapter 2
    http://download-east.oracle.com/docs/cd/B10501_01/server.920/a96521.pdf
    Joel P�rez

  • How do I write this SQL command in Oracle

    Hi all
    I wriote this SQ L statement in Ms SQL Server. How do I write this sql command in Oracle?
    ALTER VIEW dbo.ConsumptionAS SELECT TOP 100 PERCENT ID,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200710' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Oct2007,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200711' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Nov2007,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200712' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Dec2007,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200801' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Jan2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200802' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Feb2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200803' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Mar2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200804' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Apr2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200805' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS May2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200806' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Jun2008 ,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200807' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Jul2008 ,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200808' AND NbrDaysUsed != 0 THEN (QtyUsed/ NbrDaysUsed) * 748.05 ELSE 0 END)) AS Aug2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200809' AND NbrDaysUsed != 0 THEN (QtyUsed NbrDaysUsed) * 748.05 ELSE 0 END)) AS Sep2008
    FROM dbo.MasterConsumption WHERE YEAR_MONTH >= '200710' AND YEAR_MONTH <= '200809' GROUP BY ID ORDER BY ID
    I am very interested in this part:
    SUM(CASE WHEN YEAR_MONTH = '200710' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Oct2007
    thanks
    Edited by: user631364 on Oct 27, 2008 8:25 AM
    Edited by: user631364 on Oct 27, 2008 8:26 AM
    Edited by: user631364 on Oct 27, 2008 8:27 AM

    Thank you!!
    Now let me aslk the second part of my question.
    This sql command:
    ALTER VIEW dbo.ConsumptionAS SELECT TOP 100 PERCENT ID,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200710' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Oct2007,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200711' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Nov2007,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200712' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Dec2007,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200801' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Jan2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200802' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Feb2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200803' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Mar2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200804' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Apr2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200805' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS May2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200806' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Jun2008 ,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200807' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Jul2008 ,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200808' AND NbrDaysUsed != 0 THEN (QtyUsed/ NbrDaysUsed) * 748.05 ELSE 0 END)) AS Aug2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200809' AND NbrDaysUsed != 0 THEN (QtyUsed NbrDaysUsed) * 748.05 ELSE 0 END)) AS Sep2008
    FROM dbo.MasterConsumption WHERE YEAR_MONTH >= '200710' AND YEAR_MONTH <= '200809' GROUP BY ID ORDER BY ID
    was created with this query in SQL Server and then I saved it in a store procedure, that I scheduled to run montlhy
    SET ANSI_NULLS ON
    DECLARE @SQLString NVARCHAR(4000)
    /* Build the SQL string once.*/
    SET @SQLString = 'ALTER VIEW dbo.Consumption AS SELECT TOP 100 PERCENT ID, CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = ' +
    "'" + dbo.CONLastMonth_fn(getdate(), month(getdate()) - 12) +
    "'" +
    ' AND NbrDaysUsed != 0 THEN (QtyUsed/ NbrDaysUsed) * 748.05 ELSE 0 END)) AS ' +
    dbo.CONMonthInEnglish(getdate(), month(getdate()) - 12) +
    … (GOES FROM current month -12 to current month -1)
    , CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = ' +
    "'" + dbo.CONLastMonth_fn(getdate(), month(getdate()) - 1) +"'" +
    ' AND NbrDaysUsed != 0 THEN (QtyUsed/ NbrDaysUsed) * 748.05 ELSE 0 END)) AS ' +
    dbo.CONMonthInEnglish(getdate(), month(getdate()) - 1) +
    ' FROM dbo.MasterConsumption WHERE YEAR_MONTH >= ' +
    "'" + dbo.CONLastMonth_fn (getdate(), month(getdate())-12 ) +"'" +
    ' AND YEAR_MONTH <= ' +
    "'" + dbo.CONLastMonth_fn (getdate(), month(getdate())-1 ) +"'" +
    ' GROUP BY ID ORDER BY ID '
    EXEC sp_executesql @SQLString
    Is that something that can be done in Oracle in the same way?
    Do you use another approach?
    please advice
    Edited by: user631364 on Oct 27, 2008 10:19 AM
    Edited by: user631364 on Oct 27, 2008 10:21 AM
    Edited by: user631364 on Oct 27, 2008 10:21 AM
    Edited by: user631364 on Oct 27, 2008 10:22 AM
    Edited by: user631364 on Oct 27, 2008 10:23 AM
    Edited by: user631364 on Oct 27, 2008 10:23 AM
    Edited by: user631364 on Oct 27, 2008 10:24 AM

  • How to create backup file on itunes for ipod touch 4g game apps data? Is there a way to do it? I want to try an app on my friend's computer, but you can't add apps on another computer without having your own ipod's data being deleted. Thx for any help!

    How to create backup file on itunes for ipod touch 4g game apps data? Is there a way to do it? I want to try an app on my friend's computer, but you can't add apps on another computer without having your own ipod's data being deleted. Thx for any help!
    I want to know how to create a backup file (because I'm pretty new with itunes, and it's hard to use it for me still), how to store my app data/media/videos, etc. And how I can retrieve them back when I'm done with the app I tried on my friend's computer.
    If anyone can help, it'd be great! Thank you so much!

    Sure-glad to help you. You will not lose any data by changing synching to MacBook Pro from imac. You have set up Time Machine, right? that's how you'd do your backup, so I was told, and how I do my backup on my mac.  You should be able to set a password for it. Save it.  Your stuff should be saved there. So if you want to make your MacBook Pro your primary computer,  I suppose,  back up your stuff with Time machine, turn off Time machine on the iMac, turn it on on the new MacBook Pro, select the hard drive in your Time Capsule, enter your password, and do a backup from there. It might work, and it might take a while, but it should go. As for clogging the hard drive, I can't say. Depends how much stuff you have, and the hard drive's capacity.  As for moving syncing from your iMac to your macbook pro, should be the same. Your phone uses iTunes to sync and so that data should be in the cloud. You can move your iTunes Library to your new Macbook pro
    you should be able to sync your phone on your new MacBook Pro. Don't know if you can move the older backups yet-maybe try someone else, anyways,
    This handy article from Apple explains how
    How to move your iTunes library to a new computer - Apple Support''
    don't forget to de-authorize your iMac if you don't want to play purchased stuff there
    and re-authorize your new macBook Pro
    time machine is an application, and should be found in the Applications folder. it is built in to OS X, so there is nothing else to buy. double click on it, get it going, choose the Hard drive in your Time capsule/Airport as your backup Time Machine  and go for it.  You should see a circle with an arrow on the top right hand of your screen (the Desktop), next to the bluetooth icon, and just after the wifi and eject key (looks sorta like a clock face). This will do automatic backups  of your stuff.

  • How to create indexes using CREATE TABLE statement

    Hi,
    Can anyone please tell me how to create indexes using CREATE TABLE staement? This point is part SQL Expert exam (1Z0-047) and please guide me to use which books for this particular exam.
    Thanks in advance.

    Can anyone please tell me how to create indexes using CREATE TABLE staement?e.g. creating a primary key or a unique constraint will generate indexes along with the create table syntax:
    SQL> create table t (a integer primary key, b integer unique)
    Table created.
    SQL> select   index_name, index_type, uniqueness
      from   user_indexes
    where   table_name = 'T'
    INDEX_NAME                     INDEX_TYPE                  UNIQUENES
    SYS_C0016575                   NORMAL                      UNIQUE  
    SYS_C0016574                   NORMAL                      UNIQUE  
    2 rows selected.

  • How to create and use mutable array of UInt8

    Hello!
    If I get it right, UInt8 *buffer, buffer - is a pointer to a start of array?
    Then how to create and use mutable array of UInt8 pointers?
    The main target is a creation of the module that will store some byte array requests and will send all of them at the propriate moment.

    I try
    - (void) scheduleRequest:(UInt8 *)request {
    if (!scheduledRequests) scheduledRequests = [[NSMutableArray array] retain];
    [scheduledRequests addObject:request];
    But get warning:"passing argument 1 of 'addObject:' from incompatible pointer type"

  • HOW TO CREATE  and  USE EVENTS IN WORKFLOWS .

    HOW TO CREATE  and  USE EVENTS IN WORKFLOWS with the help of classes.
    What i am doing is..
    open se24
    event tab->event name->parameters
    method tab->method name->event handler->copy parameters
    interface tab->if_workflow->enter
    tell me what else to do step by step
    Another important thing is that HOW to use these class events to trigger the workflows.
    REPLY ASAP
    THXS IN ADVANCE

    Hi,
    Pl. see this blog...
    Raising ABAP OO events for workflow
    Regards,
    JOy.

  • How to Create  and use of Coherence servers in weblogic serevr 11g (10.3.6)?

    how to Create  and use of Coherence servers in weblogic serevr 11g (10.3.6)?

    See the below discussion
    How to create and use Webservice controls using WSDL in weblogic portal10.3
    Thanks,
    Venkat Sarvabatla

  • How to create and use dynamic queue in JMS

    Plz tell me how to create and use a dynamic queue in jms and can reciever file lookup it as it lookup any server configurred queue(written in the server).

    Hi,
    We can use Azure File services to do this, for more information, please have a look at this article:
    http://blogs.msdn.com/b/windowsazurestorage/archive/2014/05/12/introducing-microsoft-azure-file-service.aspx. The Azure File service exposes file shares using the standard SMB 2.1 protocol. Applications running in Azure can now easily share files between
    VMs using standard and familiar file system APIs like ReadFile and WriteFile.
    Best Regards,
    Jambor
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to create database from .sql file

    how to create database from .sql file..?? i put the sintax query in a sql file.. and i want to call it in java code..
    ho to do it..??

    why do you want to do this from java?
    i just don't see the point.
    find your dba and have him/her run it for you

  • Restrictions for using sql commands and operators in loader control file

    Hi ,
    It suppose that there is a lot of restrictions and limitations when using sql commands and operators in the loader control files, same as it seems I cannot use (or) when with case statement, also it seems there is certain length for the case,
    So guys, what are the common limitations and restrictions to be avoided in the loader control file ?
    Your efforts are highly appreciated
    Ash

    Hi Ash,
    if you need to do more complicated logic its better to define the file to be loaded as an external table. You can then use any sql function you like against the external table rather than messing around with what you can and can;t do in a sqlldr control file.
    You can use the external_table option of sqldr to generate the definition.
    Regards,
    Harry
    http://dbaharrison.blogspot.com/

  • Requesting all to help me how to create lsmw using idoc method

    hi
    thanx for ur answer
    requesting every body in the forum to help me how to create lsmw using idoc method.
    regards,
    balaji

    Hi Balaji,
    LSMW using IDOC is similar to using flat file method. Here you are getting data from IDOC container and mapping data with Idoc segments insted of flatfile column.
    Hope this is what you are looking for. If helpful then don’t forget to reward me for that
    Darshan

  • How to create database using shell script

    hai
    how to create database using shell script

    The documentation details the steps to create a database manually. Another option is to use DBCA to create the scripts. DBCA will give you a complete set of scripts that will create a database.
    http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14231/create.htm#sthref220

  • How to create crossword using Adobe captivate

    how to create crossword using Adobe captivate

    OK.  Again I am not needing clarification here.  Did you INSERT the SWF as an animation into the Captivate project? Or, did you keep the SWF as an external file?  If the SWF is external to the main Cp SWF then perhaps it's not working when you publish because the content cannot find the SWF.  If you have made sure that the SWF is definitely in the publish location, check whether or not you have that location set as a trusted location in your Flash Global Security settings.

  • How to export data to .csv and send that file to folder using sql commands?

    Really hoping someone can provide some code sample or point me in the right direction (with examples using sql).
    I am using oracle 11g with plsql developer. My requirement is that the data retrieval should be automatic. That means when query a data in oracle table , the data should be convert into .csv file and then it should send that to some specific folder.
    Example: Assume that student_sub1 table have all students subject1 data.when i write a query like select * from student_sub1 where student=1, the student1 data should convert into .csv file and then the .csv file should go to student1 folder.
    Hence I am requesting you to suggest me how write a sql code to convert the data into .csv file and to create a folder to send that file using oracle.
    Your inputs helps me alot.
    Thanks in advance!!!!
    Waiting for your replies.... Cheers

    981145 wrote:
    Really hoping someone can provide some code sample or point me in the right direction (with examples using sql).
    I am using oracle 11g with plsql developer. My requirement is that the data retrieval should be automatic. That means when query a data in oracle table , the data should be convert into .csv file and then it should send that to some specific folder.
    Example: Assume that student_sub1 table have all students subject1 data.when i write a query like select * from student_sub1 where student=1, the student1 data should convert into .csv file and then the .csv file should go to student1 folder.
    Hence I am requesting you to suggest me how write a sql code to convert the data into .csv file and to create a folder to send that file using oracle.
    Your inputs helps me alot.
    Thanks in advance!!!!
    Waiting for your replies.... CheersSET COLSEP ,
    spool student1.csv
    select * from student_sub1 where student=1;
    spool off
    How do I ask a question on the forums?
    SQL and PL/SQL FAQ
    Handle:     981145
    Status Level:     Newbie
    Registered:     Jan 10, 2013
    Total Posts:     25
    Total Questions:     10 (8 unresolved)
    I extend my condolences to you since you rarely get answers to your questions here.

Maybe you are looking for

  • How to save a PDF in Acrobat XI after making changes without changing the document name

    Whenever I work in Adobe Acrobat XI, I am forced to 'save as' when trying to save the changes I have just made.  I am unable to save the document under the same name I have been working on it under (the way you can do in every other program).  This h

  • Creating different instances of one class

    Hi everyone thanks so much for all the help so far! I want to create a new instance of class coauthorship everytime the loop goes around to a new record! However thats not whats happening it only creates 1 instance of coauthorship and it is overwritt

  • Bug in Track Naming when importing folder?

    Hey All- Hopefully this is an easy problem to fix! I just imported my entire mp3 collection which on my HD labeled like this: D:\mp3\Artist - Album\01 - Track Name.mp3 ... and so forth. I have spent alot of time making sure all my tags are correct; e

  • Change Volume size after partition

    I just formatted a drive and partitioned it. I haven't add any data on both of them and I changed my mind about the size of them. Is it ok to change their sizes in disk utility? or would be better to format them again and repartition? thanks in adava

  • Backup Assistant Failure on iPhone 4s - no contacts after 'success'

    I recently upgraded to a new iPhone 4s and used backup assistant per Verizon's instructions. Yes, I turned of my wireless network access and it appeared to successfully transfer all my contacts. Gave me a 'success' msg with the number of contacts tra