|
SQL> select name from v$controlfile;
NAME
----------------------------------------------------------------------
-----------------------------------------------------
/home/human/oradata/HUMAN/control01.ctl
/home/human/oradata/HUMAN/control02.ctl
/home/human/oradata/HUMAN/control03.ctl
SQL> select member from v$logfile;
MEMBER
----------------------------------------------------------------------
-----------------------------------------------------
/home/human/oradata/HUMAN/redo01.log
/home/human/oradata/HUMAN/redo02.log
/home/human/oradata/HUMAN/redo01b.rdo
/home/human/oradata/HUMAN/log02b.rdo
SQL>
SQL>
SQL> select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM
---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- ---------
1 1 19 104857600 2 YES INACTIVE 1053988 27-JUL-03
2 1 20 104857600 2 NO CURRENT 1053993 27-JUL-03
SQL>
SQL>
SQL> !ls $HOME/arch
log
SQL> !ls $HOME/arch/log
1.ARC 12.ARC 15.ARC 18.ARC 3.ARC 6.ARC 9.ARC
10.ARC 13.ARC 16.ARC 19.ARC 4.ARC 7.ARC
11.ARC 14.ARC 17.ARC 2.ARC 5.ARC 8.ARC
$ rm -f control0*
SQL> startup
Redo Buffers 667648 bytes
ORA-00205: error in identifying controlfile, check alert log for more info
SQL> shutdown abort
ORACLE instance shut down.
SQL>
SQL>
SQL> !
$ cp ONBACKUP/backup_controlfile.bak $HOME/oradata/HUMAN/control01.ctl
$ cp ONBACKUP/backup_controlfile.bak $HOME/oradata/H
UMAN/control02.ctl
$ cp ONBACKUP/backup_controlfile.bak $HOME/oradata/H
UMAN/control03.ctl
SQL> startup
Database mounted.
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
SQL> recover database using backup controlfile;
ORA-00279: change 890677 generated at 07/25/2003 12:22:42 needed for thread 1
ORA-00289: suggestion : /home/human/arch/log/10.ARC
ORA-00280: change 890677 for thread 1 is in sequence #10
......
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
/home/human/oradata/HUMAN/redo02.log
<-- À§¿¡¼ ºÁµÎ¾ú´ø ¸¶Áö¸· archive log±îÁö <Enter> Key¸¦ Âß Ä¡°í °¡´Ù°¡ Current log¸¦ ¿ä±¸ÇÒ ¶§ online redo log ÀÇ file ¸íÀ» full path·Î ÀÔ·Â
Log applied.
Media recovery complete.
SQL>
SQL>
SQL> alter database open resetlogs;
SQL> select * from v$tempfile; <-- temporary tablespace¸¦ ±¸¼ºÇÏ´Â datafileÀº?
no rows selected
SQL> select username,temporary_tablespace from dba_users;
USERNAME TEMPORARY_TABLESPACE
------------------------------ ------------------------------
SYS TEMP
SYSTEM TEMP
OUTLN TEMP
DBSNMP TEMP
NANUNE NANUNETEMP
HR TEMP
WKPROXY TEMP
WKSYS TEMP
ISAYA TEMP
CTXSYS TEMP
XDB TEMP
USERNAME TEMPORARY_TABLESPACE
------------------------------ ------------------------------
ANONYMOUS TEMP
12 rows selected.
SQL>
SQL>
SQL>
SQL> select property_name,property_value from database_properties
2 where property_name='DEFAULT_TEMP_TABLESPACE';
PROPERTY_NAME
------------------------------
PROPERTY_VALUE
----------------------------------------------------------------------
-----------------------------------------------------
DEFAULT_TEMP_TABLESPACE
TEMP
SQL>
SQL> select tablespace_name,status from dba_tablespaces;
TABLESPACE_NAME STATUS
------------------------------ ---------
SYSTEM ONLINE
UNDOTBS1 ONLINE
TEMP ONLINE
DRSYS ONLINE
INDX ONLINE
TOOLS ONLINE
USERS ONLINE
XDB ONLINE
NANUNE01 ONLINE
NANUNETEMP ONLINE
ISAYA01 ONLINE
TABLESPACE_NAME STATUS
------------------------------ ---------
QUERY_DATA READ ONLY
SQL> drop tablespace temp including contents and datafiles;
drop tablespace temp including contents and datafiles
*
ERROR at line 1:
ORA-12906: cannot drop default temporary tablespace
SQL>
SQL> create temporary tablespace temp2
2 tempfile '$HOME/oradata/HUMAN/temp02.dbf' size 15m;
Tablespace created.
SQL>
SQL>
SQL> alter database default temporary tablespace temp2;
Database altered.
SQL>
SQL>
SQL> drop tablespace temp including contents;
Tablespace dropped.
SQL>
SQL>
SQL> !rm /home/human/oradata/HUMAN/temp01.dbf
SQL>
SQL>
SQL> create temporary tablespace temp
2 tempfile '$HOME/oradata/HUMAN/temp01.dbf' size 15m;
Tablespace created.
SQL>
SQL>
SQL>
SQL> alter database default temporary tablespace temp;
Database altered.
SQL> drop tablespace temp2 including contents and datafiles;
Tablespace dropped.
SQL>
SQL>
SQL> select * from v$tempfile;
FILE# CREATION_CHANGE# CREATION_ TS# RFILE# STATUS ENABLED BYTES BLOCKS CREATE_BYTES
---------- ---------------- --------- ---------- ---------- ------- ---------- ---------- ---------- ------------
BLOCK_SIZE
----------
NAME
----------------------------------------------------------------------
-----------------------------------------------------
2 0 2 1 ONLINE READ WRITE 15728640 1920 15728640
8192
/home/human/oradata/HUMAN/temp01.dbf
SQL>
SQL> select * from dba_temp_files;
FILE_NAME
----------------------------------------------------------------------
-----------------------------------------------------
FILE_ID TABLESPACE_NAME BYTES BLOCKS STATUS RELATIVE_FNO AUT MAXBYTES MAXBLOCKS
---------- ------------------------------ ---------- ---------- --------- ------------ --- ---------- ----------
INCREMENT_BY USER_BYTES USER_BLOCKS
------------ ---------- -----------
/home/human/oradata/HUMAN/temp01.dbf
2 TEMP 15728640 1920 AVAILABLE 1 NO 0 0
0 14680064 1792
4) Á¤»óÀΰ¡ È®ÀÎ
SQL> select count(*) from hr.emphist;
COUNT(*)
----------
105
5) whole backupÀÇ ¼öÇà
SQL> !rm $HOME/arch/log/*
SQL> @LABS/onlinebackup
SQL>alter system switch logfile; <-- 4¹ø ¼öÇàÇÑ´Ù.
|