Adsense Ad

Thursday, 24 August 2017

How to check if a radiobutton is checked in a radiogroup in Android?


You can take the RadioGroup id which contains 3 radio buttons.
  RadioGroup radiogrp = (RadioGroup) findViewById(R.id.RadioGroup);
  int id = radiogrp.getCheckedRadioButtonId();
This will return the identifier of the selected radio button in this group. Upon empty selection, the returned value is -1.
So you can put if condition and check whether the id == -1 than no radio button is selected.

if (id == -1)
{
  // no radio buttons are checked
}
else
{
  // one of the radio buttons is checked
}

Thursday, 17 August 2017

Oracle: ORA-02064 Error Message

Error Description:
Distributed operation not supported
Error Cause:
One of the following unsupported operations was attempted:
1. array execute of a remote update with a subquery that references a dblink, or
2. an update of a long column with bind variable and an update of a second column with a subquery that both references a dblink and a bind variable, or
3. a commit is issued in a coordinated session from an RPC procedure call with OUT parameters or function call.
.
Action:
Simplify remote update statement.

Tuesday, 15 August 2017

Accessing the Database Home Page

The Database Home page is the main database management page in Oracle Enterprise Manager Database Control (Database Control).

To access the Database Home page:

1.) Ensure that the dbconsole process is running on the database host computer.

2.) In your Web browser, enter the following URL:

https://hostname:portnumber/em
For example, if you installed the database on a host computer named comp42.mycompany.com, and the installer indicated that your Enterprise Manager Console HTTP port number is 1158, enter the following URL:

https://comp42.mycompany.com:1158/em

You can determine the port number for Database Control on Linux and UNIX systems by viewing the Oracle_home/install/portlist.ini file. On Microsoft Windows systems, you can determine the URL for Database Control by viewing the Database Control Properties window. To view this window, use the Start menu, navigate to the Database Control entry in the Oracle home folder, then right-click this entry and select Properties.

When you access Database Control, if the database is running, it displays the Login page. If the database is down and needs to be restarted, Database Control displays the Startup/Shutdown and Perform Recovery page.

You must do the following to start the database:

     A.) Click Startup/Shutdown, enter the host login user name and password, and then enter the database login user name and password.

For the database user name and password, use SYS and the password that you specified during installation.

    B.) Click OK to start the database, and then in the Confirmation page, click Yes to start the database in open mode.

3.) Log in to the database with a user account that is authorized to access Database Control. This initially could be SYS or SYSTEM, with the password that you specified during database installation.

For typical day-to-day administrative tasks, it is recommended that you log in with the SYSTEM account. If you want to back up, recover, or upgrade the database, you must log in with the SYS account.


Database Control displays the Database Home page.


Modifying the Default Password Policy

You modify the default password policy for every database user account by modifying the password-related attributes of the profile named DEFAULT.
To modify the default password policy:

  1. Go to the Database Home page.
    See "Accessing the Database Home Page".
  2. At the top of the page, click the Server link to view the Server subpage.
  3. In the Security section, click Profiles.
    The Profiles page appears.
  4. In the Select column, select the profile named DEFAULT, and then click Edit.
    The Edit Profile page appears.
  5. Toward the top of the page, select the Password subpage.


How to Fix an Oracle User's Password When It Has Expired

If an Oracle user's password has expired or is about to expire (within 14 days), then its account will be locked. If this occurs on an Oracle database being used with Mobility Suite, then there will be many Oracle ORA-28001 errors that appear in the '/var/log/nukona/celery.log' file that contain entries eluding to the Oracle password being expired. The below steps will need to be followed from the SQL Plus interface for both the mdmcore and appstore databases once their ORACLE_SID's have been exported from the Linux Terminal:
1. Export your database and login to the SQL Plus interface:
export ORACLE_SID=YourDB
sqlplus /nolog
connect sys as sysdba
2. Modify the default user profile to set the password policies to 'UNLIMITED':
ALTER PROFILE DEFAULT LIMIT COMPOSITE_LIMIT UNLIMITED
  PASSWORD_LIFE_TIME UNLIMITED
  PASSWORD_REUSE_TIME UNLIMITED
  PASSWORD_REUSE_MAX UNLIMITED
  PASSWORD_VERIFY_FUNCTION NULL
  PASSWORD_LOCK_TIME UNLIMITED
  PASSWORD_GRACE_TIME UNLIMITED
  FAILED_LOGIN_ATTEMPTS UNLIMITED;
3. Check the password expiration and status of the user account associated with the Mobility Suite's '/usr/local/nukona/etc/settings.cfg' file:
SELECT EXPIRY_DATE from dba_users where username = 'YourUser';

SELECT RESOURCE_NAME,LIMIT FROM DBA_PROFILES WHERE PROFILE='DEFAULT' AND RESOURCE_NAME IN ('FAILED_LOGIN_ATTEMPTS','PASSWORD_LOCK_TIME');

SELECT USERNAME, ACCOUNT_STATUS FROM DBA_USERS WHERE USERNAME='YourUser';
4. Set the updated default password policy profile and reset the password for the user account associated for the Mobility Suite's databases while also unlocking the user account:
ALTER USER YourUser PROFILE DEFAULT;

connect YourUser

ALTER USER YourUser IDENTIFIED BY YourPassword;

ALTER USER YourUser ACCOUNT UNLOCK;

Your user account should now be unlocked, the password should be updated, the Mobility Suite services should have reestablished communication with the database, and the user account's password should not expire again. If there are any problems with running the above commands, it could be that the Mobility Suite services are still attempting to communicate with the database. If this happens, then the following commands can be run to end the sessions once the 'SID' and 'SERIAL' has been determined for 'YourUser':
SELECT s.sid, s.serial#, s.status, p.spid 
  FROM v$session s, v$process p 
 WHERE s.username = 'YourUser' --<<<--
  AND p.addr(+) = s.paddr
 /

ALTER SYSTEM KILL SESSION '<SID>, <SERIAL>'
/















Monday, 7 August 2017

OPMN: OracleFRHome1ProcessManager service not starting. Oracle Application Server 10G is dead! GetLastError()=1053


Issue:

opmnctl: starting opmn and all managed processes...
Failed to Start Service with error The service did not respond to the start or c
ontrol request in a timely fashion.
(GetLastError()=1053)
Warning: Service startup failed

Step1

Download opmn\bin files


Step2

Un-rar opmn-bin and copy paste / overwrite all on following path
Oracle_home$\FRHome_1\opmn\bin

Un-rar dcm.rar and copy paste / overwrite on following path
Oracle_home$\FRHome_1\dcm\config


Step3
Restart All Oracle Application Server services.




GENERATE ALPHABETS IN SEQUENCE WITH ORACLE SQL

SQL> -- HOW TO GENERATE ALPHABETS WITH ORACLE SQL QUERIES
SQL>
SQL>
SQL> SELECT CHR(X.RNO +64) "ALPHA" FROM (
  2                select level rno
  3                from dual
  4                connect by level <= 26 ) X ;

ALPHA
-----
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z

26 rows selected

SQL>