Thursday, September 20, 2018

Oracle delete archive log

Oracle delete archive log

RMAN>DELETE ARCHIVELOG ALL COMPLETED BEFORE ‘sysdate-1’;
RMAN>DELETE ARCHIVELOG ALL BACKED UP 2 TIMES to disk;
RMAN>DELETE NOPROMPT ARCHIVELOG UNTIL SEQUENCE = 3790;



OR

Delete all after backup

RMAN> backup archivelog all delete input;

Wednesday, September 19, 2018

Oracle startup error ORA-03113: end-of-file on communication channel

Oracle startup error ORA-03113: end-of-file on communication channel

Solution 1:

SQLplus connect as sysdba;
SQL> STARTUP MOUNT;

SQL> ALTER DATABASE RECOVER DATABASE UNTIL CANCEL;

SQL> ALTER DATABASE OPEN RESETLOGS;

Solution 2:
SQLplus connect as sysdba;
sql > startup nomount;
sql> alter database mount;
sql> alter database clear unarchived logfile group 1;
sql> alter database clear unarchived logfile group 2;
sql> alter database clear unarchived logfile group 3;
try #4 until you dont have any more group
sql> shutdown immediate;
sql> startup;

Wednesday, September 12, 2018

PLSQL Decode function



DECODE( expression , search , result [, search , result]... [, default] )

Example

The DECODE function can be used in Oracle/PLSQL.
You could use the DECODE function in a SQL statement as follows:
SELECT supplier_name,
DECODE(supplier_id, 10000, 'IBM',
                    10001, 'Microsoft',
                    10002, 'Hewlett Packard',
                    'Gateway') result
FROM suppliers;
The above DECODE statement is equivalent to the following IF-THEN-ELSE statement:
IF supplier_id = 10000 THEN
   result := 'IBM';

ELSIF supplier_id = 10001 THEN
   result := 'Microsoft';

ELSIF supplier_id = 10002 THEN
   result := 'Hewlett Packard';

ELSE
   result := 'Gateway';

END IF;

AWS how to delete VPC when it has error with Network interface , Gateway decencies

   how to delete VPC when it has error with Network interface , Gateway decencies  in AWS 1. Check if it is running on EC2 instance then Sto...