Startup and Shutdown

Can I Open Database to READ ONLY with RESETLOGS?

You can have this one:

SQL> ALTER DATABASE OPEN READ ONLY;

And also this one:

SQL> ALTER DATABASE OPEN RESETLOGS;

But there’s NO combined statement like this.

SQL> ALTER DATABASE OPEN READ ONLY RESETLOGS;

You cannot use the RESETLOGS clause with a READ ONLY clause. (Reference: Opening a Database in Read-Only Mode)

That is, you have to go there by three steps.

  1. Open the database with resetlogs
  2. SQL> ALTER DATABASE OPEN RESETLOGS;
  3. Shutdown the database
  4. SQL> SHUTDOWN IMMEDIATE;
  5. Starup the database to OPEN READ ONLY
  6. SQL> STARTUP OPEN READ ONLY;

Leave a Reply

Your email address will not be published. Required fields are marked *