You can do this (works for versions 12c or later):
alter table your_table add id number generated always as identity;
Though, this also generates new values for column, for future insertions.
Also about total row number
, this should almost always generate values from 1 to "total row number", but anyway (don't know exactly, when this may work incorrectly), for check this, after alter
you can do: select count(*), max(id) from your_table
. values should match together.