Help SQL - recover data by using the assessment Conditions

Hello

I'm a first time poster so please let me know if I'm in the wrong forum or that you have not provided enough information.

I'm trying to retrieve data from a table called BACKUP_SCHEDULES.  The table has a column for each day of the week, with the following values: null, 0, or 1.  Zero would be for level 0, 1 for level 1 backups and "null" for any backup.  We have an another table called BACKUP_STATUS that lists the databases have been backed up successfully for the day.  I am trying to recover data where it lists all the databases, if saved or not, as if it falls a day where the backup did not run that the result set appears, that is) Monday column has the value "null" to the "orcltest" database, then it will list as a column in the result set (to request backup) as "n/a".

Right now I have a set of results as below:

Database Status Backup date Day of the week
orclprdSJanuary 31, 2014Friday
orcltest
orclqaSJanuary 31, 2014Friday

The above table shows that 'orclprd' and 'orclqa' were correctly backed up for Friday.  The orcltest does not show anything because a backup did not run.  What I want to do is to compare the tables BACKUP_SCHEDULES and BACKUP_STATUS to demonstrate that it has never a backup scheduled on Friday to "orcltest".

Below is an example of what I want to show:

Database Status Backup date Day of the week On-demand
orclprdSJanuary 31, 2014FridayYes
orcltestNO.
orclqaSJanuary 31, 2014FridayYes

As I said, the BACKUP_SCHEDULES table has a column for each day of the week and the question of if a database backup is scheduled on one of these days.  I know that's probably not that clear in my writing so let me know if you need more examples.

Any help would be greatly appreciated.

Thank you

Frank

If you want to use your query, then check out the below query which I modified

SELECT DISTINCT LOWER (dbname) dbname.

To_char (null) status,

To_date (null) backup_date,

TO_CHAR (NULL) 'DOW', 'NO' TO THE REQUEST

OF backup_schedules

WHERE dbname NOT IN (SELECT LOWER (s.dbname)

OF s backup_status

WHERE TO_DATE (backup_date, 'MON-DD-YYYY') = TO_DATE (SYSDATE, ' DD-MON-YYYY ""))

UNION ALL

SELECT LOWER (dbname) dbname,

status,

backup_date,

To_char (backup_date, 'Day') "DOW,"

'YES' ON DEMAND

OF backup_status

WHERE TO_DATE (backup_date, 'MON-DD-YYYY') = TO_DATE (SYSDATE, ' MON-DD-YYYY "")

ORDER BY ASC dbname;

Tags: Database

Similar Questions

  • Need help to recover data from delta vmdk

    Hello

    I have a big problem.

    He had a guest Ubuntu 8.04 Server installed on VMWare ESXi 4.1

    It is a virtual machine size 200 GB.

    Since then, it was running on 99% complete, I tried to increase the size to help

    vmkfstools x 210 G /vmfs/datastore1/LinuxServer/LinuxServer.vmdk


    But then he started giving the error

    "Failed to open (The parent virtual disk has been modified since the child was created)."

    We had the hell of the data on the virtual machine, and the admin had not saved any of them.

    And on top of these, the guy who created the virtual machine installed Ubuntu over LVM. ()

    Then I noticed that in the settings of the virtual machine, the HARD drive was made to a vmdk to delta as LinuxServer-000001 - delta.vmdk (81 GB)

    but the main file seems to be LinuxServer - flat.vmdk(210GB).

    To try to start the computer again, I messed all CIDs, now I don't know who is what.

    On one last try, I tried to create an another VM pointed flat vmdk.

    Which seems to start properly, but many files have disappeared.

    Is there a a way to recover the data by using the vmdk delta?

    Please help someone.

    Hi Vishnu,

    I already mentioned in the post where I gave you the files: "what I did is that I reduced the size of the disk original back to 200 GB.

    Basic disk size was brought to 210 GB, but it was originally of 200 GB. However the Flash disk was always set to 200 GB, so I reduced the size of the Original Base i.e. the flat.vmdk disk using the pointer file hard.

    Concerning

  • If I convert PDF to Word in Hebrew that he reverse, peut ypu help me? If I use the pdf export program it will turn out OK?

    If I convert PDF to Word in Hebrew that he reverse, peut ypu help me? If I use the pdf export program it will turn out OK?

    Known limit of Acrobat export feature. It cannot properly manage the alphabets from right to the left like Hebrew, Arabic and Farsi.

    No date for the resolution of this limitation.

    -Dov

  • How to recover data up to the current timestamp

    The emp table I want to recover data up to the present time how can I do that (until the second current)

    This link will help

    http://www.Oracle.com/technetwork/issue-archive/2012/12-Jan/o12plsql-1408561.html

  • I try to recover my system using the xp pro installation disc get message that the version on the computer is newer tha the version on the cd

    I try to recover my system using the xp pro installation disc get message that the version on the computer is newer tha the version on the cd

    You have probably updated to SP-1 and SP - 2 maybe since then and the CD is without both.

    You try to restore the system from the cd, or re - install the OS from it?

  • Inserting data by using the query

    Hello

    In a book, I read the Sub statement:

    Inserting data by using the query (DML)

    If the user wants to transfer data from a table to another table in the insert statement are used independently of data that can be processed or not processed form.

    Can someone clarify what is the significance of this (processed or unprocessed form).


    Thank you.

    Why don't you ask the author of the book.

    How can we know what the author means when you take a quote out of context and don't provide any reference so that we can see exactly what is shown to you.

    I can only imagine that they are referring to data that are queried directly, "like what", another table, or who was interrogated and manipulated before be inserted.

  • Can satellite A210 - 11K - I recover my data before using the recovery disk?

    Hello

    Basically, my laptop has been slain in a loop of startup repair so my only option is to use the recovery CD. However, I have some files I have not back upward until my laptop decided to do not on me. Is there a way in which I can retrieve these files while at the same time fixing my laptop?

    I am running Windows Vista SP1.

    Thanks for any help,

    Felix

    Hello

    You can save your data if you put the HARD drive into an external HARD drive enclosure. Then, you can connect it to a laptop or PC and you can save the data on it or burn it to a DVD.
    All that s!

    These cases of disc HARD external are very good markets. I bought my drive enclosure external HARD on eBay and it s works well.

    But there is no other way to save the data as the Toshiba recovery disc erase the whole HARD drive and every disk HARD will be erased.

    Welcome them

  • Satellite M300 - how do I back up the data before using the recovery disk

    Hello everyone,

    Today, I closed my laptop Toshiba Satellite M300.
    Just after a few seconds, it automatically in service and reported some "boot error".

    She also suggested I put on the recovery CD. When I put the CD, nothing happened.
    After awhile, I read the instructions in the CD cover that says that I have to hold the C button and it will start the recovery process.

    How the process goes, the system told me that all the files that I had in the computer would be removed.
    Is it possible how I could back up my documents before as I recover my Vista?

    I would be very grateful if someone could help me!

    Sincerely,

    Milan

    Hello

    If I understand correctly, you are not able to boot into the Windows operating system; According to the normal starting procedure or by using safe mode. Is this good?

    If Yes, then I don't see many options to get access to the files on the HARD drive.
    What you could try is to remove the HARD drive and use an external USB 2.5 enclosure to connect the HARD drive on another computer.
    Then you could test whether it is possible to access the HARD disk and save the data.

    The Toshiba Recovery disk does not any option that allows you to save the data, the drive formats the HARD drive and erases all partitions.

  • Difficulty accessing data by using the function of Ago - the end of the previous month

    Hey,.

    Recently, I met a problem that I can't fix on my own.


    I need to compare my portfolio to the current date / specified with the portfolio for intelligence and for the end of the previous month (the last day of the previous month).

    It looks like this :

    Capture.JPG

    My fact table consists of the list of contracts of loan that is updated daily. The data for the new day are added to the table, which actually resemble a large sandwich of various portfolios.


    To recover the data for the current/specified date and intelligence is not a problem. Current date - the date is read (can 10.08.2014), the day before - I use the Ago function (e.g., 09.08.2014).

    The real problem is getting the data for the last day of the month previous (e.g. 31.07.2014), since I can't put a specific to the function of Ago offset (10 days in our example), as the number of days from the end of the previous month is constantly - changing is a daily report.


    The best solution would be setting the offset function there is a dynamic value, which would change according to the user selects the date of the report. Can be based on the number of days in the month. BI strictly prohibits using anything that is not an integer in the offset value, so this isn't an option.


    I tried a work around using formulas in columns, like: FILTER ('facts of agreements'. "" Outstanding "USING ("Posting Date". "" Id of the day ' = TIMESTAMPADD (SQL_TSI_DAY, TIMESTAMPADD (1), (SQL_TSI_DAY, 'Date of Report'.) "Number of the day in the month" *-(1) + 1, DATE ' @{report_date}'))). "

    It did not work, since the data I receive are dated the last day of the previous month and date, which is applied to get the data for the current date filter / specified, it cuts.


    Tried to create another time the hierarchy, with the ends of period (week, month, quarter, year) and use it as a level at the Ago. He does work in part, offset the end of 1 month, but I can't bind the data, I get to the date of the report, as the Ago function returns random dates.


    I tried to search if people have had the same problems and it seems I'm the only one. I'm really desperate at this point, not even sure it's possible to get the result I need everything.

    So, please advise!


    Aurore

    Finally got sorted! Hoorey!

    Here's how it's done:

    I created a presentation variable 'report_date' for the user to choose the date of the desired report. That this formula has added to the column:

    FILTER ('facts of agreements'. "" Outstanding "USING ("facts of agreements". (("" Days late max "> 30))-there is (FILTER ('facts of agreements'. "" Outstanding "USING ("facts of agreements". ((("" Days late max "> 30)), TIMESTAMPDIFF (SQL_TSI_DAY, TIMESTAMPADD (SQL_TSI_DAY, DAYOFMONTH (DATE ' @{report_date}') *-1, DATE ' @{report_date}" "), DATE ' @{report_date}'))

    Basically, this formula is used to calculate the difference between the current amount of the portfolio and the amount of portfolio for the last day of the last month (or at the end of last month), where only loans with number of days late over 30 are included.

    In the service there, I used a TIMESTAMPDIFF as a compensation formula to calculate the difference in days between the date of the report and the end of last month. Now no matter what date the user chooses it will give the correct difference in days.

    Really easy, but it took me a little time to get there.

    Hope this helps someone

  • Data acquisition using the USB-GPIB 82357 B interface for 4395 impedance Analyzer has:

    Hi all

    I tried to communicate Analyzer 4395A impedance with interface USB GPIB 82357 B using the command of expert keysight and Labview module tutorial. I couldn't able to find orders of SCPI (Standard for programmable Instruments orders) for 4395 A impedance Analyzer in the expert keysight command. Please help me on the subject of what are the other possibilities to acquire data from the Analyzer of impedance 4395 A using the interface USB GPIB 82357 B.? Is it possible to get LABVIEW plug & play drivers for USB-GPIB 82357 B interface? Our main goal is to control the parameters of impedance measurement and draw F vs IZI and theta vs F as well as get parameters of equivalent circuit on a PC with LABVIEW GUI.

    Can't wait to help.

    Hello!

    I agree with 'heavy '. For more information on how to program a 3rd device contact the manufacturer because they have the knowledge. Unless there is already a LabVIEW driver for this device, you would have to implement that yourself and need information from the manufacturer.

    Regarding your question if the GPIB-USB is unsuitable, it is quite easy to answer: If you want to communicate with a peripheral GPIB NI GPIB-USB can do this. But you would probably need a driver to use the GPIB of meaningful communication bus.

    Best regards

    Christoph

  • Help with fft vibrations without using the package of noise and vibrations

    I'm looking for help in the analysis of vibrations. I use an example updated NI 9233 VI, to get a signal from the accelerometer for display using a FFT power spectrum. I'm not entirely sure if it works, because it's the first time I've ever done vibration analysis on LabView. So if you could explain a thing or two about vibrations or TFF, I'd be more than willing to hear from you. I have included my code along with a photo of an analysis of vibration of the computer, I work with. (even when I don't know if his work that I just thought it would be good to show an output)

    Brandon

    Data sheet:

    I have LabView 2011

    I FPGA, real-time

    I have a model of research of Wilcoxon accelerometer 797-33

    With an NI 9233

    On a cRio-9012

    Hi Brandon,.

    You can use the FFT Complex (photo attached) to calculate the magnitude of the acceleration at different frequencies. You will need to take a little further to build a new waveform with this release, which includes d0, df and the output of the FFT. In order to calculate the df, please refer to the user manual on page 10-3. With respect to the scale that is output by the FFT, it must be same as input. Hope this helps to answer your questions. Thank you!

    See you soon,.

    CARISA Leal

  • What program to burn a data DVD, using the software provided on a 1900 Pavilion's?

    Usage: XP Service Pack 3

    Hi, I'm trying to burn a disc of data on a 1900 Pavilion DVD and I do not know what program to use the suite provided with it.

    InterVideo Home Theater etc is for the movies, but also Windows Movie maker.

    Windows Media Center is not available because until now I can see on thr PC.

    All the tips on the installed with PC suite or I need to install Nero etc?

    Thanks for your reply,

    I guess I assumed that HP would have a package burning in their suite of packages. I don't know if she was there.

    Just as a note of caution the program that I downloaded as it was suggested "Free Easy Burner" it came with a program of "Searchnu.com406" who hijacked my browser.

    I removed it using the restore after searching the Internet for advice.

    Everything seems fine now.

    I thank you again for your help and think that this topic is closed.

  • Recover a database using the archivelogs

    We have restored a backup of cold base using avamar from one server to another. All data, controlfiles, pfiles files are in place right after restoration. It is a 9i database. All I have to do now is to recover the database to a point in time which is 3 days after the last cold backup. I have all necessary archivelogs that transferred to destination Ark. Here are the steps that I think we need to do to recover the database using the archivelogs until the point in time with RMAN:

    RUN {}

    BOOTABLE MEDIA;

    RECOVER THE DATABASE;

    ALTER DATABASE OPEN;

    }

    Please let me know if I'm missing something here.

    your third step is able, as sybrand_b said that your DB is already in a consistent state.

    The backup controlfile clause must notify oracle that SNA to controlfile is not common and needs recovery to bring back to the most recent State, is recommended to use the backup controlfile clause if you are recovering from an old controlfile or recreated controlfile.

    Mark post below to roll forward from a cold backup.

    Hemant Oracle DBA blog: RollForward from backup to cold

  • SQL * sequential data Loader in the treatment Record file?

    If I use the will of classic way SQL * Loader process a data file in the order from top to bottom?  I have a file with header and the detail records without value found in the detail records that can be used to connect to the header records.  The only option is to derive a header value via a sequence (nextval) and then fill in the detail records with the same value from the same sequence (currval).  But to do SQL * Loader should treat the file in the exact order that the data has been written to the data file.  I read through the 11 g Oracle® database utilities SQL * Loader sections looking for evidence that this is what's going to happen, but have not found this information and I don't want to assume that SQL * Loader will always process the data file records in order.

    Thank you

    Support of Oracle responded with the following statement.

    "Yes, SQL * LOADER file data from top down process."
    This has been affected in the note below:

    "SQL * Loader - how to load a single logical record physical records line breaks include (Doc ID 160093.1).

    Jason

  • How to import from an Oracle data source using the Administration tool?

    Trying to create a repository using the tool of Administration and elected to import using the "SPOUT 10 g / 11 g.
    However, after you have entered the name of Data Source, the user name and password, I still get error "the connection failed".

    According to the help, the data source name must be the full connection string. I guess that means in the format < host >: < port >: < service >. Also, I guess the username and password are the DB schema.

    Any ideas why I can't connect?

    Jin

    I tried the tnsnames.ora road, but it still doesn't work. I created a file tnsnames.ora in \Oracle_BI1\network\admin. Is this correct?

    Yes

    Try to ping your tnsnames command prompt

    tnsping service_name

    I'm assuming that I don't need an installation of the Oracle client on the same PC I have (Windows) Oracle BI 11g installed on. Is this correct?

    on which box you are trying to import tables? Client Oracle installed box or not? .If not you put tns entries in your Inbox

    Thank you
    saichand.v

Maybe you are looking for

  • Need drivers Win XP for Satellite L305D-S5873

    Hallo Sorry for my bad English. I have a problem with my lap top toshiba satellite L300D S5873. I can't find the drivers for Windows XP Home edition. I want isnstall Xp but I have no drivers.I look at everywear in the American site and google, but I

  • secondary issue

    Hi all I have trouble with the display of some Subvi frontpanel on the main façade of the VI and I can not only know why. Can you help me? I have 3 screws, the main VI which calls all screws Sub and displays their frontpanels. SP_rand just generates

  • HP Pavilion TouchSmart 15-n029: HDMI output not working not not on HP Pavilion 15

    Hi guys, I'm new here on the HP Forum. My problems started when I got my new laptop and I HATED windows 8. If one of my friends had a drive with Windows 7 above. After installation nothing worked, no WiFi, USB, HDMI and so on. I have serched the days

  • How to install a Dell Vista computer creative webcam

    I am trying to install a creative to my Dell webcam, can anyone help? I am tryin to install a webcam to my Dell com. creative, but I'm missing and disks that can go with it. Is there another way to access the info, I might need out of internet?

  • Is it wrong to be install/uninstall a lot?

    Hi, new Droid user here... I wonder if when I uninstall an app, it deletes it completely? Or can she leave pieces behind which will be finally to clutter things up like what is happening in the registry on a PC?