How to trap ora-28000 (account is locked) from a remote db in pl/sql ??

i need to trap an ora-28000 (account is locked) exception comming from a remote db in my pl/sql block.
something like ...
declare
account_locked exception;
pragma exception_init(account_locked,-28000);
e number;
begin
begin     
select dummy into e from dual@remote;
-- assign a query to a ref cursor
exception when acount_locked then
-- assign a different query to a ref cursor (not invloving the remote table)
end;
end;
/

Here example, from local 10.2.0.3 to remote 8.1.7.4 :
SQL> conn system/demo102@demo102
Connected.
SQL> create database link mydbl connect to scott identified by tiger using 'demo817';
Database link created.
SQL> create or replace procedure myproc
  2  is
  3    account_locked exception;
  4    pragma exception_init(account_locked,-28000);
  5    e number;
  6  begin
  7    select count(*) into e from emp@mydbl;
  8    dbms_output.put_line('ALL WORKD FINE');
  9  exception when account_locked then dbms_output.put_line('ACCOUNT LOCKED WAS CATCHED');
10            when others then        dbms_output.put_line('ACCOUNT LOCKED WAS NOT CATCHED');
11  end;
12  /
Procedure created.
SQL> conn system/manager@demo817
Connected.
SQL> alter user scott account lock;
User altered.
SQL> conn system/demo102@demo102
Connected.
SQL> set serveroutput on
SQL> exec myproc
ACCOUNT LOCKED WAS CATCHED
PL/SQL procedure successfully completed.
SQL> Here example, from local 8.1.7.4 to remote 10.2.0.3, I got the same error as your, but nothing to do with account locked or not, need to set to FALSE the GLOBAL_NAMES on the 8i db :
SQL> conn system/manager@demo817
Connected.
SQL> create database link mydbl connect to scott identified by demo102 using 'demo102';
Database link created.
SQL> create or replace procedure myproc
  2  is
  3    account_locked exception;
  4    pragma exception_init(account_locked,-28000);
  5    e number;
  6  begin
  7    select count(*) into e from emp@mydbl;
  8    dbms_output.put_line('ALL WORKD FINE');
  9  exception when account_locked then dbms_output.put_line('ACCOUNT LOCKED WAS CATCHED');
10            when others then        dbms_output.put_line('ACCOUNT LOCKED WAS NOT CATCHED');
11  end;
12  /
create or replace procedure myproc
ERROR at line 1:
ORA-04052: error occurred when looking up remote object
[email protected]
ORA-00604: error occurred at recursive SQL level 1
ORA-02085: database link MYDBL.US.ORACLE.COM connects to
DEMO102.REGRESS.RDBMS.DEV.US.ORACLE.COM
SQL> alter system set global_names=false;
System altered.
SQL> create or replace procedure myproc
  2  is
  3    account_locked exception;
  4    pragma exception_init(account_locked,-28000);
  5    e number;
  6  begin
  7    select count(*) into e from emp@mydbl;
  8    dbms_output.put_line('ALL WORKD FINE');
  9  exception when account_locked then dbms_output.put_line('ACCOUNT LOCKED WAS CATCHED');
10            when others then        dbms_output.put_line('ACCOUNT LOCKED WAS NOT CATCHED');
11  end;
12  /
Procedure created.
SQL> conn system/demo102@demo102
Connected.
SQL> alter user scott account lock;
User altered.
SQL> conn system/manager@demo817
Connected.
SQL> set serveroutput on
SQL> exec myproc
ACCOUNT LOCKED WAS CATCHED
PL/SQL procedure successfully completed.
SQL> HTH,
Nicolas.

Similar Messages

  • Ora-28000 (Account is Locked)

    After installation Oralce 10g ..it takes to this weblink
    http://192.168.1.135:1158/em/console/logon/logon...asking for username and password...
    In the normal mode i typed scott/tiger iam getting Ora 28000...What is the Username and password i have to give their...

    Did you create default schemas like HR, Scott etc. ? By default schemas like Scott, HR will be locked in 10g.
    Please login as DBA and unlock them.
    SQL> alter user scott
    account unlock;
    Did you remember the password for scott which you set while installation ? If not change it.
    SQL> alter user scott
    identified by user558229;
    FYI, the link you provided here is for enterprise manager. Please read about it here.
    http://download-east.oracle.com/docs/cd/B19306_01/em.102/b31949/toc.htm

  • SRKIM: r11.5.10:Patch 적용 시 Ora-28000 account locked on the apps account

    Purpose
    Release 11.5.10
    adpatch 로 patch 적용 시 Ora-28000 account locked on the apps account Error에 대한 solution을 알아 보도록 한다.
    Symptom
    adpatch 로 patch 적용 시 아래와 같은 error 가 발생 하면서 더 이상 patch 작업을 진행 할 수가 없다.
    Ora-28000 account locked on the apps account Error
    Solution
    해당 error 는 apps user 에 대한 password attempt 가 profile 에 지정된 limit 을 초과 해서 해당 account 에 lock 이 걸려 발생하는 error 이므로 아래와 같이 변경을 해 주도록 한다.
    1. 아래 sql 로 profile option 설정을 확인 한다.
    select PROFILE, RESOURCE_NAME, RESOURCE_TYPE, LIMIT
    from dba_profiles
    where profile='AD_PATCH_MONITOR_PROFILE';
    2. 1번 sql 수행 시 limit 이 설정 되어 있음이 확인 되면 아래와 같이 조치 한다.
    SQL> alter profile AD_PATCH_MONITOR_PROFILE limit failed_login_attempts unlimited;
    SQL> alter profile default limit failed_login_attempts unlimited password_lock_time 1/1440;
    SQL> alter user apps account unlock;
    -- 현재 apps account 가 lock 이 발생한 상태 이므로 unlock 작업도 수행 해 준다.
    3. 다시 adpatch 작업을 수행 한다.
    Reference
    Note. 420001.1 - adpatch Ora-28000 Account Locked apps

    Hi ,
    I've followed the below steps to update schema password please let me know if there is something wrong      
    1- Through web console I Navigated to Datasources "Summary of JDBC Data source " -> configuration then i ve changed schemaaa password for all the below data sources
    EDNDATASource
    EDNLocalTxDataSource
    mds-oim
    mds-owsm
    mds-soa
    oimJMSStoreDS
    oimOperationsDB
    OraSDPMDataSource
    SOADataSource
    SOALocaLTxtDataSource
    2- In the WebLogic Administrative console, navigate to Security Realms, myrealm, and then Providers.
    - Click OIMAuthenticationProvider
    - Click Provider Specific.
    -In the DBPassword field, enter the new Oracle Identity Manager database schema password
    3. Change domain credential store configuration:
    - Login to Enterprise Manager by using the following URL http://ADMIN_SERVER/em
    - Navigate to Weblogic Domain, and then DOMAIN_NAME.
    - Right click oim, and navigate to Security, Credentials, and then oim.
    - Select OIMSchemaPassword, and click Edit.
    - In the Password field, enter the new password, and click OK
    4. Restart the WLS AdminServer
    5. Start the SOA managed server

  • HT2534 how can i create an account in itunes from Bangladesh ?

    how can i create an account in itunes from Bangladesh ?

    If you go to the artist's/group's page in the store then you should be able to do it e.g. search for the artist in the store, and on the right-hand side of the results page there should be list of content categories that match that search, and below it a link for the artist
    Click on the artist's name to go to a screen listing their items, and at the top right of that screen there should be a 'share' icon'
    Click on that and on the popup you should have an option for 'alert me' (I haven't used it but I assume that it works).
    You can see what alerts that you have, and remove them, by logging into your account via the Store > View Account menu option - on your account's screen there should be an Alerts link

  • How to Select data using same column name from 3 remote database

    Hi,
    Can anyone help me on how to get data with same column names from 3 remote database and a single alias.
    Ex.
    SELECT *
    a.name, b.status, SUM(b.qty) qantity, MAX(b.date) date_as_of
    FROM
    *((table1@remotedatabase1, table1@remotedatabase2, table1@remotedatabase3)a,*
    *(table1@remotedatabase1, table1@remotedatabase2, table1@remotedatabase3)b)*
    WHERE b.dept = 'finance'
    AND a.position = 'admin'
    AND a.latest = 'Y' AND (b.status <> 'TRM') AND b.qty > 0;
    GROUP BY a.name, b.status ;
    NOTE: the bold statements is just an example of what I want to do but I always gets an error beacause of ambiguous columns.
    Thanks in advnce. :)
    Edited by: user12994685 on Jan 4, 2011 9:42 PM

    user12994685 wrote:
    Can anyone help me on how to get data with same column names from 3 remote database and a single alias.Invalid. This does not make sense and breaks all scope resolution rules. And whether this is in a single database, or uses tables across databases, is irrelevant.
    Each object must be uniquely identified. So you cannot do this:
    select * from (table1@remotedatabase1, table1@remotedatabase2, table1@remotedatabase3) a3 objects cannot share the same alias. Example:
    SQL> select * from (dual, dual) d;
    select * from (dual, dual) d
    ERROR at line 1:
    ORA-00907: missing right parenthesisYou need to combine the objects - using a join or union or similar. So it will need to be done as follows:
    SQL> select * from (select * from dual d1, dual d2) d;
    select * from (select * from dual d1, dual d2) d
    ERROR at line 1:
    ORA-00918: column ambiguously definedHowever, we need to have unique column names in a SQL projection - so the join of the tables need to project a unique set of columns. Thus:
    SQL> select * from (select d1.dummy as dummy1, d2.dummy as dummy2 from dual d1, dual d2) d;
    DUM DUM
    X   X
    SQL> I suggest that you look closely at what scope is and how it applies in the SQL language - and ignore whether the objects referenced are local or remote as it has no impact to fundamentals of scope resolution.

  • How can I remove an account and apps from another user from my Ipod. My nephew used to live with me and everytime I sync my Ipod his stuff is added to mine. I have no way to contact him for his password.

    I need to know how to remove an iTunes account associated with my computer. My nephew used to live with me but has moved out. Everytime I sync my iPod touch his stuff is added to my device. I have no way to contact him to get his password. How can I make this go away. He listened to music that is very offensive to me and I dont want it in my library or playlists. Any help would be greatly appreciated.
    Thank you in advance,
    Shelly

    You can use computer iTunes to help.
    Connect your iPod Touch to Computer's iTunes
    In iTunes, select your iPod Touch under DEVICES (left pane).
    On right pane select Music at the top.
    Now you can de-select the music/playlist or anything you don't want and click Sync button bottom right.
    You can do the above for Apps, Books, etc.
    You can of course, de-authorize the computer in iTunes menu Store.
    Note: That will make everything using his AppleID inaccessible.

  • How do I set up imac to print from a remote printer connected by a cable to a PC?, How do I set up imac to print from a remote printer connected by a cable to a PC?

    How do I set up my Imac to print from a remote printer connected by a cable to a PC running Windpws XP?

    Hi Duane,
    Thanks for clarifying the hardware setup. Using the S-video connection from Hi8 to the DV converter is a good workflow. If you are showing a few errant lines at the bottom, that is a by-product of analog tape and please keep in mind that they are likely in the "overscan" area which normally does not show up to the TV viewer, though you see it in the edit software because you see the full overscan image edge-to-edge. So you probably don't have to worry about that, but if it bugs you, you can use the CROP effect to remove, or create a black title overlay to "hide" that stuff. As you said earlier, you can scale the whole picture up, but that is going to soften the image, not good.
    As for shrinking the picture - this is only helpful when producing HD content (i.e Blu-ray) and mixing in some SD source material. I see this used on HD documentaries a lot. When they need to show some older SD footage, it is shown "actual size" over some sort of background. By showing the SD clip at actual size, it is not scaled at all and keeps it's quality on the HD display. If making a DVD, which is standard definition, then there is nothing to gain from this practice and it would in fact make things worse because you are reducing the resolution!
    For a 75-minute project, I would use CBR 7.0 encoding to MPEG-2 for DVD.
    Jeff Pulera
    Safe Harbor Computers

  • How to trap ORA-12520: TNS:listener could not find available handler in OEM

    Hi,
    We are using 11G in Linux. We are often receiving "ORA-12520: TNS:listener could not find available handler for requested type of server" error though listener is working properly. My client would like to trap this error through OEM. Can any one please advise me how to implement this one.
    We are using 11GR1 OEM in our system.
    Thanks in-advance.
    Regards
    DBA.

    Hello,
    You may see system parameters used to start the database via the interface:
    home->administration->about database->parameters
    you may want to modify the PROCESSES parameter to a higher value.
    This parameter also modifies the derived SESSIONS parameter, who specifies the maximum number of sessions possible.
    These parameters are static, so you need to restart the db after changing.
    You can as well see the limit reached by some values querying
    select * from v$resource_limit;
    These parameters are described in detail in the Reference manual.
    HTH,
    Andrea

  • How can I switch my accounts/files/data from my Macbook to iMac

    I have a 3 year old Macbook running Leopard, and my wife has a brand new iMac running Snow. I have a user account on her comp (not admin), and I want to copy all of my files/user info from my laptop to her computer. Is this possible? How do I approach this without reinstalling the OS or changing admin rules?

    JBL514 wrote:
    I have a 3 year old Macbook running Leopard, and my wife has a brand new iMac running Snow. I have a user account on her comp (not admin), and I want to copy all of my files/user info from my laptop to her computer. Is this possible? How do I approach this without reinstalling the OS or changing admin rules?
    The +Migration Assistant+ app will help. But there's no easy way to combine accounts (the one already on her Mac and the one on your MacBook.)
    Your best bet is probably to use +Migration Assistant+ to transfer the account from your MacBook, per [Using Migration Assistant|http://web.me.com/pondini/AppleTips/Migrate.html].
    Then manually copy what you can from one account to the other. See [Transferring files from one User Account to another|http://web.me.com/pondini/AppleTips/Transfer.html] for some general guidelines.
    Transferring apps is difficult, because you can either transfer all of them or none of them; you can't "pick and choose." If you have 3rd-party apps that she doesn't, your best bet is probably to reinstall them, rather than trying to migrate them.

  • How can i change my account on itunes from gmail to mobileme?

    I get a message saying MM members already have an accout. If so, how can i change this?
    If i use my MM login, will i be able to use all the apps that i bought on my iphone and ipad?

    Hey there Fonz111,
    It sounds like you have a new email address you would like to use to replace the email address you are currently using for your Apple ID, without losing any of the info you have in the account. You can update the email address with this article named:
    Apple ID: Changing your Apple ID
    http://support.apple.com/kb/ht5621
    To change your Apple ID, follow these steps:
    Go to My Apple ID (appleid.apple.com), click "Manage your Apple ID", and sign in.
    If you have two-step verification turned on, you'll be asked to send a verification code to the trusted device associated with your Apple ID. If you are unable to receive messages at your trusted device, follow the guidelines for what to do if you can't sign in with two-step verification.
    In the "Apple ID and Primary Email Address section," click Edit.
    Enter the email address you want to use, then click Save Changes. Apple will send a verification email to that address.
    Open the email from Apple, then click Verify Now in the email.
    When the My Apple ID page opens, sign in with your renamed Apple ID.
    If you have two-step verification turned on, you'll be asked to send a verification code to the trusted device associated with your Apple ID.
    After you see a message indicating that verification is complete, remember to update all of the stores and services that you use with your Apple ID.
    Thank you for using Apple Support Communities.
    All the very best,
    Sterling

  • How do I combine double accounts after migration from eMac to iMac?

    After using migration assistant I have two accounts, one for my old eMac and one for my new iMac.
    Both were running Mac OS (10.5.7)
    Also, the Mailboxes in the old eMac account are not in Mail any longer. Can they be found and restored?
    Floyd

    You are welcome!
    For the log out issue have a look: "Apple / System Preferences / Security" and besure that the box for "Log out after ?? minutes of inactivity" is unhecked.
    Then Run Repair Disk Permissions from this [How to Repair Disk Permissions|http://www.simplehelp.net/2007/05/14/how-to-repair-disk-permissions -in-os-x> link and test it for a day or so befor you reinstall the OS X.

  • How do I transfer my account to Ipad2 from IPad1?

    I am giving my earlier model IPAD to a friend and want to remove my account info from the old Ipad and transnfer it to the new Ipad2. How do I do this?

    the previous answers are accurate, but to make sure everything you want is moved over.
    1. connect your old ipad
    a. in itunes click file - transfer purchases from (name) ipad
    a.1.   IF you have not authorised your computer it will ask you to do so, enter itunes user Id, pw, then select authorise.
    b. right click on your ipad's name (under devices on the left column in itunes) and select backup
    c. sync your information (if you havn't allready done so)
    d. here is the choice you have, either select the restore in the summary tab (center of itunes) and restore as new, or select on the ipad (settings - general - reset - reset all settings, then erase content) - make sure to not let it sync after restore by slide to cancel sync.   verify the information is gone by going to the
    settings - store - (should be no itunes account showing)
    2. new ipad,  after setting up your wifi or 3g connection which ever applies go to settings - store - sign in.
    a. restore the ipad2 from the backup of the ipad (update if required ipad2 ios version must be same or higher then ipad ios version)
    b. sync your apps/music/itunes content to your device.
    c. verify mail settings/other personal information/configurations
    d. enjoy
    c. also always helpful to make a backup after completing the processes.. just in case 

  • How to unlock my macair caused by locked from iclouds

    Please help.
    since my macair lock by iclouds ..how to unlock by our self without bring mac to apple store

    @austin,thanks, I enter passcode on mymacair., buat after that my mac air restart automaticlly. so now
    system was showing Disk Utility., I Try to install Lion X.. but it seems cannot download from apple site..
    it''s never succeed. i was trying several time. but still does not help.
    @Csound1: Fist time I just test to lock..but after that i leave my mac air for a while to use windows.
    after that my mac air locked!!!
    Thanks

  • HT1918 I've moved to Norway and I've lived in Australia for the last 3 years. Does anybody know how to switch my user account to Norway from Australia?

    There's also 1.74$ credit on the account which I'd like to spend but my Australian credit card has expired and I no longer hold an Australian bank account. Any chance I could just donate the money somehow or get IT to fix this up for me?

    Before you try that... have a look at Changing the Country here...
    http://support.apple.com/kb/HT1311
    If no joy... Use the above Link to Contact iTunes.

  • How do I check my account for purchases from the App Store

    A regular payment is coming out of my card I would like to know what this is for

    Here are the reasons.
    1. It's buggy.
    2. It's a security nightmare.
    3. It uses too much memory.
    4. It uses too much battery.
    5. It does not support touch gestures.
    6. Adobe was never able to produce a workable version for any Apple devices.
    7. Flash usage is declining.
    and so on...
    Because of all that, Adobe has stopped Flash development for mobile devices.

Maybe you are looking for

  • Procedure error.

    Hello, I tried to create a procedure without any errors, but while executing I get error. ====================================================== create or replace procedure pod_connect as v_date date; v_hldg_cusip fund_holding_d.hldg_instrument_id%TY

  • Best practice to show ICON instead Label for ADF Component

    Hi, I am using JDeveloper 11.1.1.6. My requirement is to use Icons instead Label text for my ADF components. Those are in one Form layout wich means that if I just used a panelgroup horizontal and put then the image and then the input component, the

  • How to "insert" current datetime in SQL Server

    I am having trouble converting current datetime into proper format that can be used to insert values in the SQL Server database.Among other things, I also tried SimpleDateFormat which does not recognise the month value of Date() object. I have been a

  • Code explanation help

    Declare CURSOR curEMP is      Select Empno,Fname,Lname,Sal From Emp; varEmpno Emp.Empno%type; varFname Emp.Fname%type; varLname Emp.Lname%type; varSal   Emp.Sal%type; varUname Emp.Uname%type; varpwd   Emp.pwd%type; Begin Open curEMP; If curEmp%ISOPEN

  • What formatting/zooming features do YOU use in Photoshop CS6? (Digital art question)

    Hi, I am a beginner dabbling in digital art, and I was wondering what format you use. Examples include "Default Photoshop size", "U.S. Paper", "Web", etcetera. I feel that the paper, without doing anything to it, is too small for details. Also, when