Using DUAL table in Oracle

DUAL is a special table found in some of the databases e.g Oracle, Informix and DB2 etc. MySQL, Microsoft SQL (MS SQL) does not have this table moreover MySQL allows DUAL to be specified as a table in queries that do not need data from any tables.In oracle, this DUAL table is having one row and one column by default. The owner of DUAL is sys, can be accessed by all user. The table has a single VARCHAR2(1) column called DUMMY that has a value of ‘X’.This table was created by Charles Weiss of Oracle corporation to provide a table for joining in internal views. We mostly uses this to find the calculations or checking system variables etc. Examples 1. The following query displays the string value from the DUAL table SELECT ‘Test String’ FROM DUAL; Output: Test String ———– Test String 2. The following query displays the numeric value… Read more“Using DUAL table in Oracle”

How to copy one schema into another using SQL

Some times we don’t have the DBA access and need to copy data from one schema to another. You can perform that by executing migration SQL script in Oracle XE. Step 1. Generate migration script.

Step 2. Run Below script by updating Source and Target connection details

Step 3. Execute the script. and commit the changes. This will migrate data from one schema to another.

Recover oracle database from error ORA-00333

To restore the oracle from ORA-00333: redo log error , you need to follow the below steps, SQL> connect system Enter password: ERROR: ORA-01033: ORACLE initializatio Process ID: 0 Session ID: 0 Serial number: 0 ORA-00333: redo log read error block 767 count 7428 SQL>connect sys as sysdba password SQL> startup SQL>select l.status, member from v$logfile inner join v$log l using (group#); SQL>recover database using backup controlfile; Enter and provide the current file path – /oracle/fast_recovery_area/redo01.log SQL>alter database open resetlogs;