Useful Oracle Database Administration Commands:
Sql> select fuzzy,name,status from v$datafile_header;
fuzzy status name
--------------------------------------------
Yes online /u01/app/oracle/oradata/nina/system01.dbf
Yes online /u01/app/oracle/oradata/nina/sysaux01.dbf
Yes online /u01/app/oracle/oradata/nina/undotbs01.dbf
Yes online /u01/app/oracle/oradata/nina/users01.dbf
Yes online /u01/app/oracle/oradata/nina/example01.dbf
Sql> shutdown
Sql> startup mount
Sql> select fuzzy,name,status from v$datafile_header;
fuzzy name
--------------------------------------------
NO /u01/app/oracle/oradata/nina/system01.dbf
NO /u01/app/oracle/oradata/nina/sysaux01.dbf
NO /u01/app/oracle/oradata/nina/undotbs01.dbf
NO /u01/app/oracle/oradata/nina/users01.dbf
NO /u01/app/oracle/oradata/nina/example01.dbf
Sql>alter database open;
Sql> select fuzzy,name,status from v$datafile_header;
fuzzy status name
--------------------------------------------
It shows fuzzy yes
parameter file spfile pfile
Sql>!oerr ora 600
[oracle@localhost]$ oerr ora 600
Sql> create pfile from spfile;
Created
Sql> create spfile from pfile;
--cannot create spfile already being used by the instance
Sql> show paramterer control_files;
Name type value
Control_files string /u01/app/oracle/oradata/nina/control01.ctl,
/u01/app/oracle/fast_recovery_area/nina/control02.ctl
Sql>select value from v$paramter2 where name=’control_files’;
Sql> select name from v$controlfile;
[oracle@localhost]$ cd $ORACLE_HOME/dbs
ls –l
init.ora
spfilenina.ora
control file
Sql> set pages 150 lines 150
Sql> select * from v$controlfile_record_section;
Sql> show paramterer control;
Name type value
control_file_record_keep_time integer 7
Control_files string string /u01/app/oracle/oradata/nina/control01.ctl,
/u01/app/oracle/fast_recovery_area/nina/control02.ctl
Control_management_pack_access string DIAGNOSTIC+TUNING
[ORACLE@LOCALHOST trace]$ /sbin/fuser/ /u01/app/oracle/oradata/nina/control01.ctl
$ ps –ef | grep 7013
$ps –ef | grep 7017
Sql>database open
Sql>alter database backup controlfile to ‘/home/oracle/controlbackup’;
Sql>!ls –l /home/oracle
Sql>alter database backup controlfile to trace;
Sql>alter session set tracefile_identifier=’sam’;
Sql>alter database backup controlfile to trace;
[ORACLE@LOCALHOST trace]$ /sbin/fuser/ /u01/app/oracle/oradata/nina/control01.ctl
/sbin/fuser/ /u01/app/oracle/fast_recovery_area/nina/control02.ctl
/sbin/fuser/
/home/oracle/control03.ctl -----------------------------this command checks anyone using file else blank shows
Cp /u01/app/oracle/oradata/nina/control01.ctl /home/oracle/control03.ctl
Sql>alter system set
control_files=’/u01/app/oracle/oradata/nina/control01.ctl’,’/u01/app/oracle/fast_recovery_area/nina/contr
ol02.ctl’,’ /home/oracle/control03.ctl’ scope=spfile
System altered
Shutdown
Database not mounted
Oracle instance shutdown
Sql> startup
Sql>show parameter control;