1. Database OPEN mode startopen. The default mode is this mode or alterdatabaseopen. This is the normal operation status of the database, any legal user can connect to the database and perform normal data access operations. In this case, ORACLE starts the instance, opens the control file, opens all online data files, and opens all online redo logs.
1. database OPEN mode: start open. The default mode is this mode, or alter database open. This is the normal operation status of the database, any legal user can connect to the database and perform normal data access operations. In this case, ORACLE starts the instance, opens the control file, opens all online data files, and opens all online redo logs.
1. Database OPEN Mode
Start open, which is in this mode by default, or alter database open; this is the normal operation of the database. In this state, any legal user can connect to the database and perform normal data access operations.
In this case, ORACLE starts the instance, opens the control file, opens all online data files, and opens all online redo log files.
If no data file or online redo log file exists, ORACLE returns an error message. After that, ORACLE will check whether all online data files and all online redo log files can be opened and data consistency is checked. If they are inconsistent, the SMON background process will restore the instance.
2. Several Special modes of OPEN Database:
Alterdatabase read only;Open the database to read-only mode.
Alterdatabase read write;Restore to normal mode.
Read-Only databases can:Execute the query and use the tablespace managed locally to sort the disks. Offline and online data files. You cannot perform this operation on the table space. Perform offline recovery of data files and tablespaces.
Database restrictions:At this time, only users with restricted session system permissions can log on ,. Startup restrict
Set the running database to the restricted mode: alter system enable restricted session. logged-in users are not affected. Unlogged-in users must have the restricted session system permission. You can use alter system kill session 'sid, serial # 'to KILL the logged-in user process.
Query which users have logged on:
SQL> select sid, serial #, username, type from v $ session where type like '% user ';
3. Control File importance
Because the control file records database data files, log file locations, checkpoint information, and so on, in the OPEN stage, ORACLE finds the corresponding file based on the information recorded in the control file, then check the checkpoint and integrity. If the problem does not exist, the database is started normally. If the checkpoint is inconsistent or the file is lost, you need to restore it.
4. During the OPEN process, ORACLE checks the following two items:
Check whether the checkpoint CNT in the data file header is consistent with the checkpoint CNT in the control file. To determine whether the data file is from the recovery file.
If the checkpoint count check is successful, the database performs the second check to check whether the starting SCN of the data file header is consistent with the ending SCN of the file recorded in the control file, if the ending SCN recorded in the control file is equal to the starting SCN of the data file header, no restoration is required.
Detailed analysis of instance recovery:Http://blog.csdn.net/haibusuanyun/article/details/17082235
After the above two checks are passed, open the database, lock the data file, and set the ending SCN of each data file to infinity.
The following is an experiment:
SQL> alter database open;
Alterdatabase open
*
Row 3 has an error:
ORA-01157: unable to identify/lock data file 1-see DBWR trace file
ORA-01110: Data File 1: 'e: \ SYSORADATA \ system01.dbf' ---------------- at the beginning of this article part of the Command Re-command this file
SQL> host move e: \ sysoradata \ system01bak. dbf e: \ sysoradata \ system01.dbf
SQL> alter database open;
The database has been changed.
SQL> select status from v $ instance;
STATUS
------------
OPEN
5. Information in the ALERT Log during OPEN --- Determination of Character Set
The Database Characterset is ZHS16GBK in the log is used to determine whether the character set recorded in the control file matches the character set in the Database when the Database is started.
Otherwise, the Character set information in the control file is updated based on the Character set in the database. The generated log is similar to: updating Character set in controlfile to ZHS16GBK.
Logs generated when the data file does not exist for the first time:
Sun Feb 03 22:44:07 2013
Alterdatabase open
Sun Feb 03 22:44:07 2013
Errorsin file c: \ app \ administrator \ diag \ rdbms \ orcl \ trace \ orcl_dbw0_988.trc:
ORA-01157: cannot identify/lock data file 1-see DBWR trace file
ORA-01110: data file 1: 'e: \ SYSORADATA \ system01.dbf'
ORA-27041: unable to open file
OSD-04002: Unable to open file
O/S-Error: (OS 2) the system cannot find the specified file.
Errorsin file c: \ app \ administrator \ diag \ rdbms \ orcl \ trace \ orcl_ora_324.trc:
ORA-01157: unable to identify/lock data file 1-see DBWR trace file
ORA-01110: Data File 1: 'e: \ SYSORADATA \ system01.dbf'
ORA-1157signalled during: alter database open...
Sun Feb 03 22:44:09 2013
Checkerrun found 1 new persistent data failures
OPEN log after data file recovery: Database Characterset is ZHS16GBK statement is behind
Sun Feb 03 22:45:01 2013
Alterdatabase open
Sun Feb 03 22:45:01 2013
LGWR: STARTING ARCH PROCESSES
Sun Feb 03 22:45:01 2013
ARC0started with pid = 19, OS id = 420
ARC0: Archival started
LGWR: STARTING ARCH PROCESSES COMPLETE
ARC0: STARTING ARCH PROCESSES
Sun Feb 03 22:45:02 2013
ARC1started with pid = 21, OS id = 2440
Sun Feb 03 22:45:02 2013
ARC2started with pid = 22, OS id = 3216
ARC1: Archival started
ARC2: Archival started
ARC1: Becoming the 'no fal' ARCH
ARC1: Becoming the 'no srl' ARCH
ARC2: Becoming the heartbeat ARCH
Sun Feb 03 22:45:02 2013
ARC3started with pid = 23, OS id = 2460
Thread1 opened at log sequence 56
Current log #8 seq #56 mem #0: D: \ DISK1 \ REDO05A. LOG
Current log #8 seq #56 mem #1: D: \ DISK2 \ REDO05B. LOG
Current log #8 seq #56 mem #2: D: \ DISK3 \ REDO05C. LOG
Current log #8 seq #56 mem #3: D: \ DISK4 \ REDO05D. LOG
Current log #8 seq #56 mem #4: D: \ DISK5 \ REDO05E. LOG
Successfulopen of redo thread 1
MTTRadvisory is disabled because FAST_START_MTTR_TARGET is not set
Sun Feb 03 22:45:02 2013
SMON: enabling cache recovery
ARC3: Archival started
ARC0: STARTING ARCH PROCESSES COMPLETE
ArchivedLog entry 86 added for thread 1 sequence 53 ID 0x4f44a7a1 dest 1:
Successfullyonlined Undo Tablespace 2.
Verifyingfile header compatibility for 11 gtablespace encryption ..
Verifying11g file header compatibilityfor tablespace encryption completed
SMON: enabling tx recovery
Sun Feb 03 22:45:17 2013
ArchivedLog entry 87 added for thread 1 sequence 54 ID 0x4f44a7a1 dest 1:
ArchivedLog entry 88 added for thread 1 sequence 54 ID 0x4f44a7a1 dest 2:
ArchivedLog entry 89 added for thread 1 sequence 54 ID 0x4f44a7a1 dest 3:
ArchivedLog entry 90 added for thread 1 sequence 54 ID 0x4f44a7a1 dest 4:
ArchivedLog entry 91 added for thread 1 sequence 54 ID 0x4f44a7a1 dest 5:
Sun Feb 03 22:45:18 2013
ArchivedLog entry 92 added for thread 1 sequence 55 ID 0x4f44a7a1 dest 1:
ArchivedLog entry 93 added for thread 1 sequence 55 ID 0x4f44a7a1 dest 2:
ArchivedLog entry 94 added for thread 1 sequence 55 ID 0x4f44a7a1 dest 3:
ArchivedLog entry 95 added for thread 1 sequence 55 ID 0x4f44a7a1 dest 4:
ArchivedLog entry 96 added for thread 1 sequence 55 ID 0x4f44a7a1 dest 5:
Sun Feb 03 22:45:18 2013
Database Characterset is ZHS16GBK
NoResource Manager plan active
Sun Feb 03 22:45:30 2013
Startingbackground process QMNC
Sun Feb 03 22:45:30 2013
QMNCstarted with pid = 24, OS id = 3684
Sun Feb 03 22:45:40 2013
Completed: alter database open