0% found this document useful (0 votes)
184 views

SQL Command

The document discusses SQL commands for managing Oracle database log files. It shows how to check the status of log files, perform a log switch to move to the next log file, and use the ALTER SYSTEM SWITCH LOGFILE command to manually trigger a log switch. It also shows archive log configuration and how to open a database already in use.

Uploaded by

Richa Pandey
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
184 views

SQL Command

The document discusses SQL commands for managing Oracle database log files. It shows how to check the status of log files, perform a log switch to move to the next log file, and use the ALTER SYSTEM SWITCH LOGFILE command to manually trigger a log switch. It also shows archive log configuration and how to open a database already in use.

Uploaded by

Richa Pandey
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 4

SQL> ed Wrote file afiedt.

buf 1* select name, value from v$parameter where name='undo_tablespace' SQL> / NAME -------------------------------------------------------------------------VALUE -------------------------------------------------------------------------undo_tablespace UNDOTBS1 SQL> alter system set undo_tablespace=undotbs2 scope=both; System altered. SQL> select name, value from v$parameter where name='undo_tablespace'; NAME -------------------------------------------------------------------------VALUE -------------------------------------------------------------------------undo_tablespace UNDOTBS2 SQL> create pfile from spflie; create pfile from spflie * ERROR at line 1: ORA-00922: missing or invalid option SQL> create pflie from spfile; create pflie from spfile * ERROR at line 1: ORA-00901: invalid CREATE command SQL> create pfile='c:/initorcl.ora from spfile'; create pfile='c:/initorcl.ora from spfile' * ERROR at line 1: ORA-00923: FROM keyword not found where expected SQL> ed Wrote file afiedt.buf 1* create pfile='c:/initorcl.ora' from spfile SQL> / File created. SQL> archive log list Database log mode Automatic archival No Archive Mode Disabled

Archive destination USE_DB_RECOVERY_FILE_DEST Oldest online log sequence 1 Current log sequence 2 SQL> desc v$log Name Null? Type ----------------------------------------- -------- ---------------------GROUP# NUMBER THREAD# NUMBER SEQUENCE# NUMBER BYTES NUMBER MEMBERS NUMBER ARCHIVED VARCHAR2(3) STATUS VARCHAR2(16) FIRST_CHANGE# NUMBER FIRST_TIME DATE

check the ststus of log files n use of log switch ie moving from one log file to other log file

SQL> ed Wrote file afiedt.buf 1* select group#, members, status from v$log SQL> / GROUP# MEMBERS STATUS ---------- ---------- ---------------1 1 CURRENT 2 1 UNUSED 3 1 INACTIVE SQL> alter system switch log file; alter system switch log file * ERROR at line 1: ORA-01900: LOGFILE keyword expected SQL> ed Wrote file afiedt.buf 1* alter system switch logfile SQL> / System altered. SQL> select group#, members, status from v$log;

GROUP# MEMBERS STATUS ---------- ---------- ---------------1 1 INACTIVE 2 1 CURRENT 3 1 INACTIVE SQL>

C:\windows\system32>sqlplus " / as sysdba" SQL*Plus: Release 10.2.0.1.0 - Production on Tue Feb 18 11:09: Copyright (c) 1982, 2005, Oracle. All rights reserved. Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Pr With the Partitioning, OLAP and Data Mining options SQL> select group#, members , status from v$log; GROUP# MEMBERS STATUS ---------- ---------- ---------------1 1 INACTIVE 2 1 CURRENT 3 1 INACTIVE SQL> archive log list; Database log mode Archive Mode Automatic archival Enabled Archive destination USE_DB_RECOVERY_FILE_DEST Oldest online log sequence 1 Next log sequence to archive 3 Current log sequence 3 SQL> alter datbase open; alter datbase open * ERROR at line 1: ORA-00940: invalid ALTER command SQL> alter database open; alter database open * ERROR at line 1: ORA-01531: a database already open by the instance SQL> alter system switch logflie; alter system switch logflie * ERROR at line 1: ORA-01900: LOGFILE keyword expected

SQL> alter system switch LOGFILE; System altered. SQL> ALTER SYSTEM SWITCH LOGFILE; System altered. SQL> select name from v$database; NAME --------JUSTLIB SQL>

You might also like