Showing posts with label Administer Database. Show all posts
Showing posts with label Administer Database. Show all posts

Wednesday, August 26, 2015

How to change an Oracle password temporarily?

SQL> SELECT a.username, b.password
  FROM dba_users a, sys.user$ b
 WHERE a.username = 'HRPAY' AND a.user_id = b.user#

USERNAME PASSWORD
-------- ----------------
HRPAY 7DD505A0C01598B1

SQL> alter user HRPAY identified by newpassword


Now login with the following credentials: hrpay/ newpassword

After doing your work you can change the password back by using an undocumented feature called "by values"


SQL> alter user scott identified by values '7DD505A0C01598B1';


Sunday, June 14, 2015

Why Indexes of Foreign Key needs have same order

Follow the below said Blog for detailed explaining with Excellent Scenario which covers every bit of what needs to be incorporated. 


https://richardfoote.wordpress.com/2014/04/02/indexing-foreign-keys-helden/

Tuesday, June 9, 2015

Difference between ALL_OBJECTS and DBA_OBJECTS

Difference between ALL_OBJECTS and DBA_OBJECTS
·         USER_OBJECTS lists the objects owned by the current user i.e. User you have logged in
·         ALL_OBJECTS lists all the objects owned by the current user and those objects the current user has access to.
·         DBA_OBJECTS lists all objects in the database.

Saturday, March 7, 2015

ORA-27101: shared memory realm does not exist

Step 1: Log into root user

Step 2: Switch to database tier i.e. oradev in my case
Example: su – oradev

Step 3: Check if Oracle Home and SID is in Order (If incorrect, correct the path using export command)
                Example: echo $ORACLE_HOME
                                   echo $ORACLE_SID

Step 4: login to SYSDBA (Continue to Step 4 if the Home and SID are in order)
                Example: oradev@xxxdevdbsrv:~$ sqlplus / as sysdba

Step 5: Startup Database
                Example:
                               SQL> startup
ORACLE instance started.
Total System Global Area 3207790592 bytes
Fixed Size                  2163592 bytes
Variable Size             469769336 bytes
Database Buffers         2717908992 bytes
Redo Buffers               17948672 bytes
Database mounted.
Database opened.

Wednesday, June 25, 2014

How to Alter Session Language

alter session set nls_language = 'AMERICAN'

alter session set nls_language = 'ARABIC'

Friday, May 30, 2014

API to Create User Securing Attributes

DECLARE
   l_return_status    VARCHAR2 (2000);
   l_msg_count        NUMBER;
   l_msg_data         VARCHAR2 (2000);
   l_attribute_code   VARCHAR2 (500) := 'ICX_HR_PERSON_ID';
   l_application_id NUMBER := NULL;

   CURSOR c1
   IS
      SELECT *
        FROM fnd_user
       WHERE user_name = 'BIJOYJ';
BEGIN
   -- Block to Get Application ID
   BEGIN
      SELECT application_id
        INTO l_application_id
        FROM fnd_application_tl
       WHERE application_name = 'Oracle iProcurement' AND language = 'US';
   EXCEPTION
      WHEN OTHERS
      THEN
         l_application_id := NULL;
   END;

   FOR i IN c1
   LOOP
      BEGIN
         icx_user_sec_attr_pub.
          create_user_sec_attr (p_api_version_number   => 1,
                                p_return_status        => l_return_status,
                                p_msg_count            => l_msg_count,
                                p_msg_data             => l_msg_data,
                                p_web_user_id          => i.user_id,
                                p_attribute_code       => l_attribute_code,
                                p_attribute_appl_id    => l_application_id,
                                p_varchar2_value       => '',
                                p_date_value           => '',
                                p_number_value         => i.employee_id,
                                p_created_by           => -1,
                                p_creation_date        => SYSDATE,
                                p_last_updated_by      => -1,
                                p_last_update_date     => SYSDATE,
                                p_last_update_login    => -1);

         COMMIT;

         IF (l_return_status <> 'S')
         THEN
            DBMS_OUTPUT.
             put_line (
               'Failue !!! Attribute has not been created for '
               || i.user_name);
         ELSE
            DBMS_OUTPUT.
             put_line ('Attribute has been created for ' || i.user_name);
         END IF;
      EXCEPTION
         WHEN OTHERS
         THEN
            DBMS_OUTPUT.put_line ('Inner Exception: ' || SQLERRM);
      END;
   END LOOP;
EXCEPTION
   WHEN OTHERS
   THEN
      DBMS_OUTPUT.put_line ('Main Exception: ' || SQLERRM);
END;


Query to Check if Securing Attributes have been loaded Successfully

SELECT *
  FROM ak_web_user_sec_attr_values
 WHERE web_user_id = (SELECT user_id
                        FROM fnd_user

                       WHERE user_name = 'BIJOYJ')