Skip to main content

Posts

Showing posts from November, 2024

SQL Script to Mirror a user in Oracle Database

SQL Script to Mirror a user in Oracle Database Save the following as mirror_user.sql. SET SERVEROUTPUT ON; SET VERIFY OFF; -- Prompt for source user PROMPT Enter the source user name (to mirror): DEFINE SOURCE_USER = &1 -- Prompt for target user PROMPT Enter the target user name (new user): DEFINE TARGET_USER = &2 -- Prompt for target user password PROMPT Enter the password for the new user: DEFINE NEW_PASSWORD = &3 DECLARE     -- Variables for SQL commands and user details     v_sql VARCHAR2(4000);     v_default_ts VARCHAR2(100);     v_temp_ts VARCHAR2(100); BEGIN     -- Fetch the default and temporary tablespaces for the source user     SELECT default_tablespace, temporary_tablespace     INTO v_default_ts, v_temp_ts     FROM dba_users     WHERE username = UPPER('&SOURCE_USER');     -- Create the target user     v_sql := 'CREATE USER ' || UPPER('&TARGET_USER...

How to reset an Oracle database user password using an encrypted password

How to reset an Oracle database user password using an encrypted password When a user's account is marked as expired in Oracle Database, it indicates the account is in a state where the user cannot log in until the issue is resolved. This typically happens because of password expiration policies.If you want to reset the password using an encrypted value then we can follow below steps 1) Query the Existing Encrypted Password  If you want to reset the password to its previous encrypted value, you can retrieve it from the dba_users or user$ tables. Older Version of DB SELECT username, password FROM dba_users WHERE username = 'TARGET_USER'; OR SELECT name, password AS encrypted_password FROM sys.user$ WHERE name = 'TARGET_USER'; 2) Reset Password Using the Encrypted Value ALTER USER <username> IDENTIFIED BY VALUES '<encrypted_password>'; Example: ALTER USER TARGET_USER IDENTIFIED BY VALUES '4CFD12416C11EC7D75C2F3F4AEF3C93D8C94F1AC3823A38ED603A942...

Unexpected error while executing the action at state: supportedOSCheck 19c on Oracle Linux 8

Unexpected error while executing the action at state: supportedOSCheck 19c on Oracle Linux 8 Error: WARNING:  [Nov 12, 2024 7:56:21 AM] [WARNING] [INS-08101] Unexpected error while executing the action at state: 'supportedOSCheck'    CAUSE: No additional information available.    ACTION: Contact Oracle Support Services or refer to the software manual.    SUMMARY:        - java.lang.NullPointerException. Refer associated stacktrace #oracle.install.commons.util.exception.AbstractErrorAdvisor:499 Solution: # uname -a Linux ol8u2.wadhahdaouehi.tn 5.4.17-2011.1.2.el8uek.x86_64 #2 SMP Mon Apr 20 22:10:46 PDT 2020 x86_64 x86_64 x86_64 GNU/Linux Edit the File: cvu_config $ vi /u01/app/oracle/product/19.3.0/dbhome_1/cv/admin/cvu_config Old Value: #CV_ASSUME_DISTID=OEL5 New Value: CV_ASSUME_DISTID=OEL8 Rerun and verify  Or Set the OS parameter in your terminal to a previous version and re-start the Oracle Universal Installer. export CV_A...

How To Failover and Flashback a Physical Standby for testing without recreating Database

How To Failover and Flashback a Physical Standby for testing without recreating Database Failing over and using flashback on a physical standby database for testing without recreating the database involves a structured approach to ensure you can revert to the original state afterward. This can help for Disaster Recovery testing and we was to have the original state back after the testing. Pre-requisites: 1) Ensure there is enough space in the Fast Recovery Area (FRA) to hold the flashback logs. On primary: SQL> show parameter db_recovery NAME                                 TYPE        VALUE ------------------------------------ ----------- -------------------- db_recovery_file_dest                string      /u01/install/APPS/data db_recovery_file_dest_size           big integer 150G df -h /u01/in...