Exit SQL - compare with the files under unix

Dear Experts,

I'm putting in place an alert mechanism for the RAC load balancing.

I'm running a SQL to see what services RAC instances are currently underway and need to compare this result with a text file on the unix server. If my SQL query shows the services that are running on different instances of that text file, I need to send a warning. For example, SQL result shows * 'db1_obj_lock' runs on 2nd instance * where as text shows file must be run on the 1st instance, I need this to be reported.

I am developing a shell script to do this and need help with your entries. I understand that it's more issue of UNIX, but thought SQL experts might be able to help as they have treated these scenarios. Appreciate your help.
SELECT INST_ID,NAME from gv$active_services where
name in ('db1_obj_lock','db1_app_ro1','db1_app_ro2')
order by name
/

   INST_ID NAME
---------- ----------------------------------------------------------------
         2 db1_obj_lock
         5 db1_app_ro1
         6 db1_app_ro1
         6 db1_app_ro2
         5 db1_app_ro2

srv1:/tmp# cat services.txt (This shows service names and instances they are running on)

db1_jdbc     4
db1_obj_lock 1
db1_app_ro1  5
db1_app_ro1  6
db1_app_ro2  5
db1_app_ro2  6
db1_rpt      1
db1_rpt      2
db1_rpt      3
db1_rpt      4
.
.
.
etc

ORA, DBA wrote:
I think I do something wrong during the creation of the external table:

Please see below create table statement and my select * stmt. Select * null values returns INST_ID select, when I select INST_ID select db1_serv_external, all I get is null values. Is there a clause that miss me in create stmt this column values correctly from external table file OS maps? Appreciate your help

SQL> create table db1_serv_external
2      (name char(18),
inst_id number(2))
3    4       ORGANIZATION EXTERNAL
5       (TYPE ORACLE_LOADER
6     DEFAULT DIRECTORY db1_serv_ext
7      ACCESS PARAMETERS
8        (RECORDS DELIMITED BY NEWLINE
9     FIELDS (name char(18),
10           inst_id integer(2)))
11    LOCATION('db1_svc.lst'));

Table created.

SQL> select * from db1_serv_external;

NAME                  INST_ID
------------------ ----------
db1_jdbc      4
db1_jdbc      1
db1_jdbc      2
db1_jdbc      3
db1_obj_lock  1

db1_obj_lock 1
123456789012
It seems that the longer 'NAME' is only 11 characters; No 18

Tags: Database

Similar Questions

  • where to save the files under options the file name is duplicated how to remove an additional folder with the same name

    Under Options in Firefox, I clicked on save the files under downloads, but the file name twice and an additional file with the same name is created in the folder, i.e.:

    G:\Akbar's Songs\HAMARA DOWNLOADS\HAMARA FORUMS DOWNLOADS FORUMS

    As you can see the file repeats, how can I fix it?

    Also the music files, I download from a site of downloads as a WinRar file and I need to open it. Y at - it an option where the file opens automatically in the folder I chose?

    Thanks a lot for your help.

    Hi Akush, when you install 7 - zip, make itself the default application to open .zip and .rar files. So if you double click on the .rar file, it should open in 7 - zip. If you prefer to decompress immediately, right click the file and look for new 7 - zip items in the menu. I can't think of a way to do this automatically, however.

  • After scanning in a file, I can't save the PDF file with a unique file name, it will only back up in its original name; Otherwise, if I save the name of the file under a new name, save it box goes outside and the file is renamed and saved. Help!

    If I analyze the file and its original name is:

    Ssrv395alm76439... and I want to rename it "background."

    If I have the rename, the file won't save. If I leave the file as it will save and I have to go to an additional folder and rename it.

    Help, it's too long. I just click on "Save as" and rename and save the document in the necessary folder at a time!

    Hi Allisonchristinele ,

    Please provide the exact point of the software & OS installed on your system. Also check if it is there any update available for the software after crossing "" help > check updates "»

    Follow this thread to reset the Acrobat preferences:- How to reset preference settings in format Acrobat.

    Like 'save' will save the changes with the file & "save under" will give the window using which can save the file to any location on the system.

    I would like to know is what is happening with some or all the files.

    Also, please try to check with the different user account to reproduce the problem.

    Kind regards

    Christian

  • I have copy of old tbird and seamonkey e-mail files with the files and emails for each. I need to add to new tbird install. can not find a way to do it. Help

    I have copy of old tbird and seamonkey e-mail files with the files and emails for each. I need to add to new tbird install. can not find a way to do it. HELP PLEASE. previous e-mail files are under mail then mail.earthlink* .net and each of the five mail .net is an email address I have. I can't find a way to identify each file by email to the specific email address (IE mail.my E-mail name.net) so I can copy the files and emails from the past to the email addresses now under tbird. previous installed e-mail identities may not be the current configuration of e-mail files in tbird. I think that I must be sure that mail.name.net matches the previous mail.name.net to be able to copy and paste the old to the new. is there a way to find the file name correct the old email and correspond to the new? all my emails very important information are mostly in the old mail electronic id and must be available in the identification of email again (but same) how can I do this?

    http://KB.mozillazine.org/Importing_folders

    Use this module.

    https://addons.Mozilla.org/en-us/Thunderbird/addon/ImportExportTools/

  • I have windows XP: what do I do with the files that won't get defragmented?

    I have windows XP: what do I do with the files that won't get defragmented?

    There are about 4300 MB of files that will not defragment.

    I tried to defrag them for months, but without success.

    These files are generally used, as a result, they get w/o defraged some users

    adjustments. Run disk clean up, go after, in run, type: cmd

    In cmd type: Defrag C:

    Once her thru, type: EXIT

    After, R.Click on "my computer", properties, Advanced tab, performance, swap file button,

    with selected C:, do not select "no paging file", click on set 2 X, close, restart the pc. Once again, XP

    go in run, type: cmd cmd type: Defrag C:

    It will take more time than before, once its type thru,: OUTPUT

    Reopen the system pagefile, click on 'letting the system manage' value set 2 X, close, agree to

    replace the new swap file, restart the pc when prompted.

    Every so often, repeat the process.

  • I'm trying to migrate data from a server to a new one with the file permissions of the files of users and records lost.

    original title: robocopy

    I'm trying to migrate data from a server to a new one with the file permissions of the files of users and records lost. So far, that's what I did, I used \\server1\share \\server2\share/sec /mir robocopy and robocopy \\server1\share \\serve2\share/e/s /copyall. It seams like they copied all files with the permissions of the user for the files, but not files. For example, if a user makes a folder with the files in the folder appear them have permissions appropriate for them but not the root folder or subfolders, they did... How can I fix this and what is the difference between / s /mir and/e/s /copyall?

    Hello

    You can find the Server forums on TechNet support, please create a new post at the following link:

    http://social.technet.Microsoft.com/forums/en/category/WindowsServer/

  • Flight Simulator 2004 install stops at 97% say there is an error with the file world.cab

    While the resettlement of fs2004, the installation stops at 97% saying there is an error with the file world.cab, this damaged disc 4.  Someone at - he found a solution to this?

    Thank you

    Well, if, as you say, the disc is damaged. The solution would be to get another drive.

    Although I would have a look at the following:

    Take a look at the following: http://support.microsoft.com/kb/258496

    I hope that, if necessary, you can get a free replacement disc.

  • I just did a check of norton power Eraser which revealed that I have a problem with the file ntsd.exe.

    original title: problem with file ntsd.exe

    I just did a check of norton power Eraser which revealed that I have a problem with the file ntsd.exe. Does anyone have suggestions about what to do to fix it? Thank you very much.

    Hi JohnABuckley,

    • Are you facing any problem on the computer?

    Ntsd.exe is a process belonging to the Microsoft symbolic debugger that lets you debug applications in user mode.

    As the link below, it says that there is a risk that Norton Power Eraser can select some legitimate programs for removal. You should carefully review the analysis results page before deleting the files. I suggest that you don't delete the file unless you are facing problems with the computer.

    https://www-secure.Symantec.com/Norton-support/JSP/help-solutions.jsp?LG=English&CT=us&docid=20100824120155EN&product=home&version=1&PVID=f-home

  • Downloaded 4 fonts on my computer and all the files unpacked, but says I have to wait until Windows is finished with the files

    I downloaded 4 fonts on my computer and all of the decompressed files. However, my computer telling me I have to wait until Windows is finished with the files. I made sure all Windows programs are disabled, but he still repeats the message. Why is it so?

    Hi Clarissa Tan.

    1. What is the complete message you receive?
    2. Which site did you download the fonts on the computer?

    Method 1

    I suggest you to use the link below to download new fonts on the computer and check if it helps.

    To add a new font to your computer

    http://www.Microsoft.com/resources/documentation/Windows/XP/all/proddocs/en-us/windows_fonts_addnew.mspx?mfr=true

    Download new fonts

    http://www.Microsoft.com/typography/fonts/

    Method 2

    It is possible that some third-party programs installed on the computer is causing the problem.

    I suggest that you set up the computer in a clean boot state and try to install new fonts, check if it helps.

    To help resolve the error and other messages, you can start Windows XP by using a minimal set of drivers and startup programs. This type of boot is known as a "clean boot". A clean boot helps eliminate software conflicts.

    See section to learn more about how to clean boot.

    How to configure Windows XP to start in a "clean boot" State

    http://support.Microsoft.com/kb/310353

    Reset the computer to start as usual

    When you are finished troubleshooting, follow these steps to reset the computer to start as usual:

    1. Click Start , and then click run.
    2. Type msconfig , and then click OK.
      The System Configuration utility dialog box appears.
    3. Click the general tab, click Normal Startup - load all device drivers and services , and then click OK.
    4. When you are prompted, click restart to restart the computer.
  • I can't access the files under a specific user name, no password

    original title: access files

    Received the infamous "blue screen" error  Installed new hard drive and Windows XP Pro.  Installed old drive "blue screen" in a "pregnant" so I could access the files.  Only problem is that I can't access the files under a specific user name, no password.  All of the suggestions.

    In a situation like yours, you need to "Take Ownership" files that you can access on your old disk:

    "How appropriate a file or a folder in Windows XP"
      <>http://support.Microsoft.com/kb/308421 >

    HTH,
    JW

  • Why can't I choose a specific program to get outdoors with the file.

    I save my first projects pro adobe in a folder called projects.  I use to be able to open the file, click on a project and it would open in first pro.  Now, for some reason any the only program I try to open the project with is photoshop.  It will not open a project first pro.  I clicked on open with and chose the first pro to open project files, but the computer won't let me choose first pro.  He just kept photoshop outdoor with the file.

    ... but the computer won't let me choose first pro.  He just kept photoshop outdoor with the file.

    Please provide details...

    is first Pro in the list to open it with?

    If it is not on the list, use this tutorial to add it to the list:

    http://www.Vistax64.com/tutorials/126340-open-add-program.html

  • I can't put one of my photos as a background. It comes up with 'The file that c:\users\daniel\appdata\roaming\microsoft\windows Photo Gallery\Windows Photo Gallery wallpaper.jpg could not be written. Please help me.

    Hi, I have problems on developing an image as a wallpaper on my laptop.

    It comes up with 'The file that c:\users\daniel\appdata\roaming\microsoft\windows Photo Gallery\Windows Photo Gallery wallpaper.jpg could not be written.

    I tried right click and do it the long way to go to appearance and personalization in the control panel in the start menu. None of these work and I wonder why it's happening.

    my computer is Windows vista Home premium and is about half a year. If anyone knows how to solve the problem of it not allow me to set a background please give me suggestions.

    Dan

    Treat it as a corrupted user file.  To fix this usehttp://windows.microsoft.com/en-AU/windows-vista/Fix-a-corrupted-user-profile.  Use the new administrator account to do this.  Follow the directions given and everything will be fine and your new admin account should work normally.  Once you have ccnfired you can access, to all your acccess all of your programs and files, you can delete the old user obsolete and corrupt.

    That's all there is to it.  Now that we know, this is the profile and not the system, the solution has been set for us.

    I hope this helps. Feel free to post back with any questions as you go along.

    Good luck!

    Lorien - MCSA/MCSE/network + / has + - if this post solves your problem, please click the 'Mark as answer' or 'Useful' button at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • When starting a warning pops up saying he had problems with the file: XBD EXE that can be done to correct it?

    When starting a warning pops up saying he had problems with the file: XBD EXE that can be done to correct it?

    Hi r13hunter,

    It seems that some programs running on the computer fails to load at startup of the system. Try these steps and check the result.
    Step 1: Find the program that causes this problem and delete or fix
    a. Click Start, type msconfig and press to enter.
    b. click on Startup tab, in the list, search for the path of the xbd.exe file and the associated program.
    c. Once you have found the path of the item and the associated program, repair or reinstall the program.
    See Uninstall or change a program

    Step 2: If the problem persists, perform the clean boot to find this good program that is causing the problem to the system startup
    a. open the article: http://support.microsoft.com/kb/929135
    b. Article, follow "step 1: perform a clean boot" the implementation of these measures will disable all programs not Microsoft currently running on the computer.
    c. restart the computer and check if the problem persists.
    d. If the problem does not persist in the boot, it means that some programs non-Microsoft is the source of the problem.
    e. to find the program that is causing the problem, try "step 2: enable half the services" to "step 6: resolve the problem.
    f. Once you find the culprit, check if there is any updates to update or fixes to the program. If you find, install them and check the difference or reinstall the latest program.
    g. Article, follow "step 7: reset the computer to start as usual.

    Visit our Microsoft answers feedback Forum and let us know what you think.

  • On Windows 7, how to convert a file with the file Type of "OST" to a file Type of 'PST '?

    I have an old Outlook on a computer file before I want to be able to read about this new computer Win7.

    I could be wrong and certainly can be corrected, but...

    United are a few highlights of what is contained on the Exchange server where this account has been set up.

    Maybe it was a corporate email account that you have taken with you when you left or found in an old backup?
    If so, there are legalities involved and I would not advise to play with the file.

    If they are legitimate emails, free and clear - so maybe the account is still active and you can set up the account and re-download the messages.
    Otherwise, there are several (very expensive) programs that will convert him, about $600 if my memory is.

    Sorry, probably NOT the answer you were hoping for.

    VP Tech Services

  • Synchronize the left pane in the Explorer with the file open

    Is there some way you can sync the tree in the left pane in the Explorer with the file you have open right?  I realize you can use the address bar to make a basic up and down navigation but I often need to move freely through the hierarchy of folders and countless levels of tree in the left pane of the hand opening becomes very tedious.  Since we have been able to do for going on 18 years now, it's a little disconcerting, to say the least, to be withdrawn.

    Sometimes, you need a context!

    I myself discovered that if you right click on an empty space in the left pane (folder), you get a menu containing two options, 'show all files' and 'develop in the current folder. Believing that the empty space is a bit complicated and the options are sticky (it is the same than to go through the 'Folder Options' dialog box), but it's probably the best approximation of what we need to do.

    In fact, I'm used to it already, I just select the (second) option once synchronize the left pane and then deselect it immediately.

Maybe you are looking for

  • When I deleted a picture of my MacBook, why it also remove the external hard drive?

    So I tried to help my wife to free up space on his MacBook Pro by putting all of his photos on an external hard drive. After iPhoto slide the hard disk and wait 40 minutes so that he could transfer, I wanted to make sure it worked. I ejected the disk

  • Why the address bar is glitched appears?

    For some reason any today locking/globe icon which means that if a site is encrypted or not, seems to have space to his right off. The address bar also become entirely yellow all of a sudden for encrypted pages. The end close the menu button dropdown

  • Error code: 80070643 (cannot install SP1)

    I was making a few mistakes update .net framework, so I did a manual reinstall but end what it suggests, you're done with windows update.  I get errors Security Update for Microsoft .NET Framework 3.5 SP1 More information: http://go.Microsoft.com/fwl

  • PE1800 - riflettore [CF]

    Sul PE1800 con service tag 851YG2J TR e giudizio uno dei due alimentatori. Per favore mi una quotazione by the sostituzione mandate? Oppure in UN codice per reperirlo sul mercato. Grazie.

  • reader_sl.exe - application error appearing followed 0xc0000022

    The above message appears when starting at the top, I was clicking on ok but am uncertain if long term there could be problems for my laptop although up to this point, everything seems ok. I am running windows 7 and this problem seems to have happene