I have read for stateful session bean:
"While in the ready stage, the EJB container may decide to deactivate, or passivate, the bean by moving it from memory to secondary storage"
So what is this secondary storage? Is it the underline database? Also, how is an object saved (persisted) in a relational database like Oracle?
Java EE is only a specification and it is up to the JEE compliant application server (such as Glassfish, Wildfly, or WebLogic) to determine exactly what the secondary storage is.
WebLogic, at least by default, passivates the EJB:s to disk which is described by this image:
The WildFly/JBoss (which is my application server of choice) documentation is quite sparse regarding this, but a fair guess is that the default behaviour is to passivate the EJB:s to disk as well, though I cannot swear on it.
So, once again, the specification doesn't give any rules on how to passivate the EJB:s, it is up to the implementation.