Hello José,
In this case I believe you would have to create a custom script that starts the database first, confirms that it was started successfully (if "R3trans -d" returns 0 that is confirmed), and then starts SAP.
How to start the database will depend on which database system is in use.
I do not have such script.
Regards,
Isaías
PS: if the database is running on the same server as SAP, maybe creating a script the switches to <sid>adm and executes "startsap" would be enough?