How To clean Linux Kernal Headers

Every time Ubuntu installs a new Linux kernel, the old one is left behind.
This means that if you are regularly updating an Ubuntu system the Grub boot
menu becomes longer and longer with kernels you don't need anymore. those
previous kernels, images and modules are usually just wasting space.

The old kernels are deliberately left installed and on the menu so you can
boot a previous kernel if you have trouble with a new one. But if the new
one works, you can safely uninstall the old kernel, which will also result
in the Grub menu being cleaned up.

To remove all the unused Linux Kernel headers, images and modules, simply
run this command:

 dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge

Convert Oracle Datatype LONG to NUMBER

How to convert LONG datatype to Number in ORACLE ?

This was the requirement in our organization to convert LONG datatype to Number datatype, It is relatively easy and According to my logic.

– Here C1 Column datatype is LONG , First I Modify with CLOB

ALTER TABLE SCHEMA.TABLE_NAME MODIFY(C1 CLOB);

– Then Add new Column TEST1 with datatype Varchar2

ALTER TABLE SCHEMA.TABLE_NAME ADD (TEST1 VARCHAR2(50));

– Then transfer C1 column data into TEST1 column and commit.

UPDATE SCHEMA.TABLE_NAME SET TEST1=C1;

COMMIT;

– Again add new Column TEST2 with NUMBER datatype

ALTER TABLE SCHEMA.TABLE_NAME ADD (TEST2 NUMBER(20,2));

– Then Copy TEST1 data to TEST2 and commit.

UPDATE SCHEMA.TABLE_NAME SET TEST2=TEST1;

COMMIT;

– Now drop old original column C1

ALTER TABLE SCHEMA.TABLE_NAME DROP COLUMN C1;

– Also drop new column TEST1

ALTER TABLE SCHEMA.TABLE_NAME DROP COLUMN TEST1;

– And last rename the second new column TEST2 to original column name like here C1

ALTER TABLE SCHEMA.TABLE_NAME RENAME COLUMN T2 TO C1;

Follow

Get every new post delivered to your Inbox.