Depending on the version of Oracle DB you are using, the way you have done it is the correct way to do it. Prior to 12C, Oracle has no real concept of an automatically incrementing identity column, but this works perfectly well. In versions of Oracle from 12C on, though, new features were introduced. One way to do this is like this:
CREATE TABLE test_tab (
id NUMBER GENERATED ALWAYS AS IDENTITY,
something VARCHAR2(30)
);
insert into test_tab('something') values('Hi de hi');
You can get more details
here[
^].