BNFD - Your DBA NoteBook On The Net!!!

Thursday, January 31, 2008

Practice Session 1

C:\orcl>sqlplus /nolog

SQL*Plus: Release 9.2.0.1.0 - Production on Fri Feb 1 02:42:58 2008
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

SQL> conn sys/justchill as sysdba ;Connected.SQL> select name from v$database ;

NAME
---------
DIPS

SQL> select status from v$instance ;

STATUS
------------
MOUNTED

SQL> alter database open ;

Database altered.

SQL> select status from v$instance ;

STATUS
------------
OPEN

SQL> shut immediate ;
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup nomount
ORACLE instance started.

Total System Global Area 135338868
bytesFixed Size 453492
bytesVariable Size 109051904
bytesDatabase Buffers 25165824 bytes
Redo Buffers 667648 bytes

SQL> select name from v$controlfile ;
no rows selected

SQL> select * from v$log ;
*ERROR at line 1:ORA-01507: database not mounted

SQL> alter database mount 2 ;
Database altered.

SQL> select status from v$instance ;
STATUS
------------
MOUNTED

SQL> select * from v$logfile ;
GROUP# STATUS TYPE MEMBER
---------- ------- --------- ---------------
3 ONLINEC:\ORCL\Z123DATA\Z123\REDO03.LOG
2 ONLINEC:\ORCL\Z123DATA\Z123\REDO02.LOG
1 ONLINEC:\ORCL\Z123DATA\Z123\REDO01.LOG

SQL> alter database open resetlogs ;
*ERROR at line 1:ORA-01139: RESETLOGS option only valid after an incomplete database recovery

SQL> recover database ;
ORA-00283: recovery session canceled due to errorsORA-00264: no recovery required

SQL> alter database open ;
Database altered.

SQL> select status from v$instance ;
STATUS
------------
OPEN