I'm using Oracle 12c.
I would like to set up a script to use the data Pump expdp and impdp utility.
I would like to be able to shut down the database so I can run the script, but the script doesn't run when I start it in read-only mode.
sql> shutdown;
sql> startup mount;
sql> alter database open read only;
Is there a way to stop the database using the expdp utility?
Thanks in advance
You probably don't want to stop the database; as gsalem pointed out, running datapump requires writing to the database. But you can restrict the database; in this mode, only users with administrator privileges can run commands.
There are several others ways to accomplish restricted mode, depending on your version and multitenant architecture. You might want to look up the above commands in the relevant Oracle documentation if you need more options.