Database Commands

3
Database Commands Steps when the database state is down: 1. Login to sqlplus -sqlplus /nolog -connect / as sysdba 2. The db must be mounted EXCLUSIVE and not open for operation startup mount; 3. Check the log mode status of the database select log_mode from v$database; 4. Setting it to noarchivelog mode alter database noarchivelog; 5. Setting db open for user operation alter database open; 6. Reverting back to archivelog mode alter database archivelog; https://mohibalvi.wordpress.com/tag/ora-01012-not-logged-on/ http://hemantoracledba.blogspot.in/2009/04/bringing-online-datafile- that-is-in.html http://levicorp.com/2010/04/15/recover-the-database-without- archivelog/ http://www.dbspecialists.com/files/presentations/missing_logs.html http://www.orafaq.com/wiki/Archivelog_mode_and_datafile_recovery_ %28non-SYSTEM_tablespace%29

description

Database Commands

Transcript of Database Commands

Page 1: Database Commands

Database Commands

Steps when the database state is down:1. Login to sqlplus -sqlplus /nolog  -connect / as sysdba2. The db must be mounted EXCLUSIVE and not open for operation –startup mount;3. Check the log mode status of the database –select log_mode from v$database;4. Setting it to noarchivelog mode –alter database noarchivelog;5. Setting db open for user operation –alter database open;6. Reverting back to archivelog mode –alter database archivelog;

https://mohibalvi.wordpress.com/tag/ora-01012-not-logged-on/

http://hemantoracledba.blogspot.in/2009/04/bringing-online-datafile-that-is-in.html

http://levicorp.com/2010/04/15/recover-the-database-without-archivelog/

http://www.dbspecialists.com/files/presentations/missing_logs.html

http://www.orafaq.com/wiki/Archivelog_mode_and_datafile_recovery_%28non-SYSTEM_tablespace%29

After Moving the datafile (shutdownDB) please execute the below commands

alter database rename file '/oracle/T03/sapdata4/t03_14/t03.data14' to '/oracle/T03/sapdata2/t03_14/t03.data14';

alter database rename file

Page 2: Database Commands

'/oracle/T03/sapdata4/t03_19/t03.data19' to '/oracle/T03/sapdata2/t03_19/t03.data19';

◄ next => 13:34:30◄ alter database rename file

'/oracle/T03/sapdata5/t03_15/t03.data15' to '/oracle/T03/sapdata3/t03_15/t03.data15';

alter database rename file '/oracle/T03/sapdata5/t03_20/t03.data20' to '/oracle/T03/sapdata3/t03_20/t03.data20';

13:34:33

select file_name from dba_data_files where file_name ='t03.data14'

◄ select * from v$datafile where file_name ='/oracle/T03/sapdata2/t03_14/t03.data14';

13:37:29

[11/3/2015 1:17 PM] Khan, Javed: alter database rename file '/oracle/T03/sapdata4/t03_14/t03.data14' to '/oracle/T03/sapdata6/t03_14/t03.data14'; alter database rename file '/oracle/T03/sapdata4/t03_19/t03.data19' to '/oracle/T03/sapdata6/t03_19/t03.data19'; alter database rename file '/oracle/T03/sapdata5/t03_15/t03.data15' to '/oracle/T03/sapdata7/t03_15/t03.data15'; alter database rename file '/oracle/T03/sapdata5/t03_20/t03.data20' to '/oracle/T03/sapdata7/t03_20/t03.data20'; [11/3/2015 1:18 PM] Khan, Javed: cp -pr  t03_14 /oracle/T03/sapdata6/ [11/3/2015 1:24 PM] Khan, Javed: select name from v$datafile_header where status='OFFLINE';