Remove the current control file when the database is running on linux or un

Question From Oracler:
下面这个例子中,假如controlfile被删除掉了,instance还没有关闭,可以通过lsof找出controlfile的file descriptors,再通过dd把文件恢复过来...
我觉得这样dd出来的控制文件是没有办法直接启动这个数据库的,因为CKPT每3S一次,你dd恢复出来的控制文件SCN肯定和datafile不一样,比datafile小,... 要是recover会提示控制文件太久,不知道我理解正不正确啊?
http://www.oracledatabase12g.com/archives/unix-linux%e4%b8%8b%e5%88%a0%e9%99%a4oracle%e6%8e%a7%e5%88%b6%e6%96%87%e4%bb%b6controlfile%e4%b8%ba%e4%bb%80%e4%b9%88%e5%ae%9e%e4%be%8binstance%e6%b2%a1%e6%9c%89%e7%ab%8b%e5%8d%b3%e5%a5%94%e6%ba%83.html
dd恢复的控制文件 怎么会比打他file、
怎么会比datafile的scn 小呢
一旦关库,那么fd是不是就消失了,没有办法dd了, 那么造成scn不相同的原因是dd过程中scn的变化么?
还请大致谈一下造成scn更新的必要条件。

有网友提问,若控制文件是 create controlfile 重建得来的 又会如何? 这里我们可以看一下:
我们来看一下:
SQL> alter system switch logfile;
System altered.
SQL> select distinct checkpoint_change# from v$datafile_header;
CHECKPOINT_CHANGE#
15169797
SQL> alter system checkpoint;
System altered.
SQL> select distinct checkpoint_change# from v$datafile_header;
CHECKPOINT_CHANGE#
15169802 =>E7783A
15169802 =>E7783A 最近的一次FULL CHECKPOINT的SCN
SQL> select name from v$tablespace;
NAME
SYSTEM
UNDOTBS1
SYSAUX
USERS
EXAMPLE
TEMP
SQL> alter tablespace SYSTEM begin backup;
Tablespace altered.
SQL> alter tablespace UNDOTBS1 begin backup;
Tablespace altered.
SQL> alter tablespace SYSAUX begin backup;
Tablespace altered.
SQL> alter tablespace USERS begin backup;
Tablespace altered.
SQL> alter tablespace EXAMPLE begin backup;
Tablespace altered.
SQL> alter tablespace SYSTEM end backup;
Tablespace altered.
SQL> alter tablespace UNDOTBS1 end backup;
Tablespace altered.
SQL> alter tablespace SYSAUX end backup;
Tablespace altered.
SQL> alter tablespace USERS end backup;
Tablespace altered.
SQL> alter tablespace EXAMPLE end backup;
Tablespace altered.
begin /end backup 会引发FILE CHECKPOINT ,造成datafile_header的 checkpoint_change# 更新
SQL> select distinct checkpoint_change# from v$datafile_header;
CHECKPOINT_CHANGE#
15169814
15169827
15169842
15169821
15169835
15169814 =>E77916 是最小的一个 datafile header checkpoint_change#
SQL> oradebug setmypid;
Statement processed.
SQL> oradebug dump controlf 3;
Statement processed.
SQL> oradebug tracefile_name;
但是此时去dump controlf 可以发现 控制文件中的database checkpint 仍是 E7783A 15169802 即上一次FULL CHECKPOINT的 SCN
DATABASE ENTRY
(size = 316, compat size = 316, section max = 1, section in-use = 1,
last-recid= 0, old-recno = 0, last-recno = 0)
(extent = 1, blkno = 1, numrecs = 1)
03/09/2012 23:04:33
DB Name "G10R21"
Database flags = 0x00404001 0x00001000
Controlfile Creation Timestamp 03/09/2012 23:04:33
Incmplt recovery scn: 0x0000.00000000
Resetlogs scn: 0x0000.00e7784f Resetlogs Timestamp 03/09/2012 23:11:46
Prior resetlogs scn: 0x0000.00e77780 Prior resetlogs Timestamp 03/09/2012 22:57:44
Redo Version: compatible=0xa200100
#Data files = 16, #Online files = 16
Database checkpoint: Thread=1 scn: 0x0000.00e7790a ==>15169802
Threads: #Enabled=1, #Open=1, Head=1, Tail=1
REDO THREAD RECORDS
(size = 256, compat size = 256, section max = 8, section in-use = 1,
last-recid= 0, old-recno = 0, last-recno = 0)
(extent = 1, blkno = 9, numrecs = 8)
THREAD #1 - status:0xf thread links forward:0 back:0
#logs:3 first:1 last:3 current:2 last used seq#:0x2
enabled at scn: 0x0000.00e7784f 03/09/2012 23:11:46
disabled at scn: 0x0000.00000000 01/01/1988 00:00:00
opened at 03/09/2012 23:11:46 by instance G10R21
Checkpointed at scn: 0x0000.00e7790a 03/09/2012 23:12:12
thread:1 rba:(0x2.3.10)
SQL> alter database backup controlfile to trace;
Database altered.
SQL> oradebug setmypid;
Statement processed.
SQL> oradebug tracefile_name;
SQL> shutdown abort;
ORACLE instance shut down.
[oracle@vrh8 ~]$ rm /s01/recreate.ctl
我们以NORESETLOGS重建控制文件:
SQL> startup nomount;
ORACLE instance started.
Total System Global Area 620756992 bytes
Fixed Size 2022760 bytes
Variable Size 234881688 bytes
Database Buffers 377487360 bytes
Redo Buffers 6365184 bytes
SQL> show parameter control
NAME TYPE VALUE
control_file_record_keep_time integer 7
control_files string /s01/recreate.ctl
SQL> CREATE CONTROLFILE REUSE DATABASE "G10R21" NORESETLOGS ARCHIVELOG
2 MAXLOGFILES 16
3 MAXLOGMEMBERS 3
4 MAXDATAFILES 100
5 MAXINSTANCES 8
6 MAXLOGHISTORY 2921
7 LOGFILE
8 GROUP 1 (
9 '/s01/oradata/G10R21/onlinelog/o1_mf_1_7ch812dg_.log',
10 '/s01/flash_recovery_area/G10R21/onlinelog/o1_mf_1_7ch813h5_.log'
11 ) SIZE 50M,
12 GROUP 2 (
13 '/s01/oradata/G10R21/onlinelog/o1_mf_2_7ch8144q_.log',
14 '/s01/flash_recovery_area/G10R21/onlinelog/o1_mf_2_7ch815cj_.log'
15 ) SIZE 50M,
16 GROUP 3 (
17 '/s01/oradata/G10R21/onlinelog/o1_mf_3_7ch816g2_.log',
18 '/s01/flash_recovery_area/G10R21/onlinelog/o1_mf_3_7ch817gp_.log'
19 ) SIZE 50M
20 -- STANDBY LOGFILE
DATAFILE
21 22 '/s01/oradata/G10R21/datafile/o1_mf_system_7ch8004t_.dbf',
23 '/s01/oradata/G10R21/datafile/o1_mf_undotbs1_7ch80081_.dbf',
24 '/s01/oradata/G10R21/datafile/o1_mf_sysaux_7ch8004x_.dbf',
25 '/s01/oradata/G10R21/datafile/o1_mf_users_7ch80085_.dbf',
26 '/s01/oradata/G10R21/datafile/o1_mf_example_7ch81ch3_.dbf',
27 '/s01/oradata/G10R21/datafile/o1_mf_users_7gvd5pwh_.dbf',
28 '/s01/oradata/G10R21/datafile/o1_mf_users_7h6t6fdt_.dbf',
29 '/s01/oradata/G10R21/datafile/o1_mf_users_7h6t6nxy_.dbf',
30 '/s01/oradata/G10R21/datafile/o1_mf_users_7h6t6qc2_.dbf',
31 '/s01/oradata/G10R21/datafile/o1_mf_users_7h6t6stt_.dbf',
32 '/s01/oradata/G10R21/datafile/o1_mf_users_7h6t6w5w_.dbf',
33 '/s01/oradata/G10R21/datafile/o1_mf_users_7h6t6yo0_.dbf',
34 '/s01/oradata/G10R21/datafile/o1_mf_users_7h6t717x_.dbf',
35 '/s01/oradata/G10R21/datafile/o1_mf_undotbs1_7h6ttkkx_.dbf',
36 '/s01/oradata/G10R21/datafile/o1_mf_undotbs1_7h6ttpn1_.dbf',
37 '/s01/oradata/G10R21/datafile/o1_mf_undotbs1_7h6ttsbd_.dbf'
38 CHARACTER SET AL32UTF8;
Control file created.
SQL> oradebug setmypid;
Statement processed.
SQL> oradebug dump controlf 3;
Statement processed.
DATABASE ENTRY
(size = 316, compat size = 316, section max = 1, section in-use = 1,
last-recid= 0, old-recno = 0, last-recno = 0)
(extent = 1, blkno = 1, numrecs = 1)
03/09/2012 23:16:57
DB Name "G10R21"
Database flags = 0x00400103 0x00001000
Controlfile Creation Timestamp 03/09/2012 23:16:58
Incmplt recovery scn: 0x0000.00000000
Resetlogs scn: 0x0000.00e7784f Resetlogs Timestamp 03/09/2012 23:11:46
Prior resetlogs scn: 0x0000.00e77780 Prior resetlogs Timestamp 03/09/2012 22:57:44
Redo Version: compatible=0xa200100
#Data files = 16, #Online files = 16
Database checkpoint: Thread=1 scn: 0x0000.00e77902 15169794
Threads: #Enabled=1, #Open=1, Head=1, Tail=1
Database checkpoint: 变成了 00e77902 =》 15169794,比上次FULL CHECKPOINT的15169802 还要小
这个
00e77902 =》 15169794从哪里来?
REDO THREAD RECORDS
(size = 256, compat size = 256, section max = 8, section in-use = 1,
last-recid= 0, old-recno = 0, last-recno = 0)
(extent = 1, blkno = 9, numrecs = 8)
THREAD #1 - status:0x7 thread links forward:0 back:0
#logs:3 first:1 last:3 current:2 last used seq#:0x2
enabled at scn: 0x0000.00e7784f 03/09/2012 23:11:46
disabled at scn: 0x0000.00000000 01/01/1988 00:00:00
opened at 01/01/1988 00:00:00 by instance
Checkpointed at scn: 0x0000.00e77902 03/09/2012 23:11:54
thread:1 rba:(0x2.2.0)
LOG FILE RECORDS
(size = 72, compat size = 72, section max = 16, section in-use = 3,
last-recid= 0, old-recno = 0, last-recno = 0)
(extent = 1, blkno = 10, numrecs = 16)
LOG FILE #1:
(name #3) /s01/oradata/G10R21/onlinelog/o1_mf_1_7ch812dg_.log
(name #4) /s01/flash_recovery_area/G10R21/onlinelog/o1_mf_1_7ch813h5_.log
Thread 1 redo log links: forward: 2 backward: 0
siz: 0x19000 seq: 0x00000001 hws: 0x4 bsz: 512 nab: 0xb6 flg: 0x0 dup: 2
Archive links: fwrd: 2 back: 0 Prev scn: 0x0000.00000000
Low scn: 0x0000.00e7784f 03/09/2012 23:11:46
Next scn: 0x0000.00e77902 03/09/2012 23:11:54
LOG FILE #2:
(name #1) /s01/oradata/G10R21/onlinelog/o1_mf_2_7ch8144q_.log
(name #2) /s01/flash_recovery_area/G10R21/onlinelog/o1_mf_2_7ch815cj_.log
Thread 1 redo log links: forward: 3 backward: 1
siz: 0x19000 seq: 0x00000002 hws: 0x1 bsz: 512 nab: 0xffffffff flg: 0xa dup: 2
Archive links: fwrd: 0 back: 1 Prev scn: 0x0000.00e7784f
Low scn: 0x0000.00e77902 03/09/2012 23:11:54
Next scn: 0xffff.ffffffff 01/01/1988 00:00:00
LOG FILE #3:
(name #5) /s01/oradata/G10R21/onlinelog/o1_mf_3_7ch816g2_.log
(name #6) /s01/flash_recovery_area/G10R21/onlinelog/o1_mf_3_7ch817gp_.log
Thread 1 redo log links: forward: 0 backward: 2
siz: 0x19000 seq: 0x00000000 hws: 0x2 bsz: 512 nab: 0x2 flg: 0x1 dup: 2
Archive links: fwrd: 0 back: 0 Prev scn: 0x0000.00000000
Low scn: 0x0000.00000000 01/01/1988 00:00:00
Next scn: 0x0000.00000000 01/01/1988 00:00:00
原来这个
00e77902 =》 15169794 来源于 current online redo logfile中最小的LOW SCN
DATA FILE RECORDS
(size = 428, compat size = 428, section max = 100, section in-use = 19,
last-recid= 0, old-recno = 0, last-recno = 0)
(extent = 1, blkno = 11, numrecs = 100)
DATA FILE #1:
(name #22) /s01/oradata/G10R21/datafile/o1_mf_system_7ch8004t_.dbf
creation size=0 block size=8192 status=0x12 head=22 tail=22 dup=1
tablespace 0, index=1 krfil=1 prev_file=0
unrecoverable scn: 0x0000.00000000 01/01/1988 00:00:00
Checkpoint cnt:2314 scn: 0x0000.00e77916 03/09/2012 23:12:46
Stop scn: 0xffff.ffffffff 03/09/2012 23:16:58
Creation Checkpointed at scn: 0x0000.00000008 10/22/2005 21:44:31
thread:0 rba:(0x0.0.0)
DATAFILE 1 的checkpoint scn最小为 00e77916 =》15169814
SQL> recover database using backup controlfile;
ORA-00279: change 15169814 generated at 03/09/2012 23:12:46 needed for thread 1
ORA-00289: suggestion :
/s01/flash_recovery_area/G10R21/archivelog/2012_03_09/o1_mf_1_2_%u_.arc
ORA-00280: change 15169814 for thread 1 is in sequence #2
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
ORA-00279: change 15169814 generated at 03/09/2012 23:12:46 needed for thread 1
可以看到 recover database using backup controlfile 的起点是 15169814 即 最小的一个 datafile header 的CHECKPOINT CHANGE#,
也就是说 丢失控制文件 并(create controlfile)重建后的recover 从 最小的datafile header CHECKPOINT_CHANGE#开始 ,直到NEXT SCN 无穷大的 current logfile的 end 为止!
我们在看一下 RESETLOGS的情况:
SQL>
SQL> CREATE CONTROLFILE REUSE DATABASE "G10R21" RESETLOGS ARCHIVELOG
MAXLOGFILES 16
2 3 MAXLOGMEMBERS 3
4 MAXDATAFILES 100
5 MAXINSTANCES 8
6 MAXLOGHISTORY 2921
7 LOGFILE
8 GROUP 1 (
9 '/s01/oradata/G10R21/onlinelog/o1_mf_1_7ch812dg_.log',
10 '/s01/flash_recovery_area/G10R21/onlinelog/o1_mf_1_7ch813h5_.log'
11 ) SIZE 50M,
12 GROUP 2 (
13 '/s01/oradata/G10R21/onlinelog/o1_mf_2_7ch8144q_.log',
14 '/s01/flash_recovery_area/G10R21/onlinelog/o1_mf_2_7ch815cj_.log'
15 ) SIZE 50M,
16 GROUP 3 (
17 '/s01/oradata/G10R21/onlinelog/o1_mf_3_7ch816g2_.log',
18 '/s01/flash_recovery_area/G10R21/onlinelog/o1_mf_3_7ch817gp_.log'
19 ) SIZE 50M
20 -- STANDBY LOGFILE
21 DATAFILE
22 '/s01/oradata/G10R21/datafile/o1_mf_system_7ch8004t_.dbf',
23 '/s01/oradata/G10R21/datafile/o1_mf_undotbs1_7ch80081_.dbf',
'/s01/oradata/G10R21/datafile/o1_mf_sysaux_7ch8004x_.dbf',
24 25 '/s01/oradata/G10R21/datafile/o1_mf_users_7ch80085_.dbf',
26 '/s01/oradata/G10R21/datafile/o1_mf_example_7ch81ch3_.dbf',
27 '/s01/oradata/G10R21/datafile/o1_mf_users_7gvd5pwh_.dbf',
28 '/s01/oradata/G10R21/datafile/o1_mf_users_7h6t6fdt_.dbf',
29 '/s01/oradata/G10R21/datafile/o1_mf_users_7h6t6nxy_.dbf',
30 '/s01/oradata/G10R21/datafile/o1_mf_users_7h6t6qc2_.dbf',
31 '/s01/oradata/G10R21/datafile/o1_mf_users_7h6t6stt_.dbf',
32 '/s01/oradata/G10R21/datafile/o1_mf_users_7h6t6w5w_.dbf',
33 '/s01/oradata/G10R21/datafile/o1_mf_users_7h6t6yo0_.dbf',
34 '/s01/oradata/G10R21/datafile/o1_mf_users_7h6t717x_.dbf',
35 '/s01/oradata/G10R21/datafile/o1_mf_undotbs1_7h6ttkkx_.dbf',
36 '/s01/oradata/G10R21/datafile/o1_mf_undotbs1_7h6ttpn1_.dbf',
37 '/s01/oradata/G10R21/datafile/o1_mf_undotbs1_7h6ttsbd_.dbf'
CHARACTER SET AL32UTF8; 38
Control file created.
SQL> oradebug setmypid;
Statement processed.
SQL> oradebug dump controlf 3;
Statement processed.
SQL> oradebug tracefile_name;
DATABASE ENTRY
(size = 316, compat size = 316, section max = 1, section in-use = 1,
last-recid= 0, old-recno = 0, last-recno = 0)
(extent = 1, blkno = 1, numrecs = 1)
03/09/2012 23:20:03
DB Name "G10R21"
Database flags = 0x00400147 0x00001000
Controlfile Creation Timestamp 03/09/2012 23:20:03
Incmplt recovery scn: 0x0000.00e77932
Resetlogs scn: 0x0000.00e7784f Resetlogs Timestamp 03/09/2012 23:11:46
Prior resetlogs scn: 0x0000.00e77780 Prior resetlogs Timestamp 03/09/2012 22:57:44
Redo Version: compatible=0xa200100
#Data files = 16, #Online files = 16
Database checkpoint: Thread=0 scn: 0x0000.00000000
Threads: #Enabled=1, #Open=0, Head=0, Tail=0
REDO THREAD RECORDS
(size = 256, compat size = 256, section max = 8, section in-use = 1,
last-recid= 0, old-recno = 0, last-recno = 0)
(extent = 1, blkno = 9, numrecs = 8)
THREAD #1 - status:0x6 thread links forward:0 back:0
#logs:3 first:1 last:3 current:3 last used seq#:0x0
enabled at scn: 0x0000.00000000 01/01/1988 00:00:00
disabled at scn: 0x0000.00000000 01/01/1988 00:00:00
opened at 01/01/1988 00:00:00 by instance
Checkpointed at scn: 0x0000.00000000
thread:0 rba:(0x0.0.0)
LOG FILE RECORDS
(size = 72, compat size = 72, section max = 16, section in-use = 3,
last-recid= 0, old-recno = 0, last-recno = 0)
(extent = 1, blkno = 10, numrecs = 16)
LOG FILE #1:
(name #5) /s01/oradata/G10R21/onlinelog/o1_mf_1_7ch812dg_.log
(name #6) /s01/flash_recovery_area/G10R21/onlinelog/o1_mf_1_7ch813h5_.log
Thread 1 redo log links: forward: 2 backward: 0
siz: 0x19000 seq: 0x00000000 hws: 0x0 bsz: 512 nab: 0x0 flg: 0x1 dup: 2
Archive links: fwrd: 0 back: 0 Prev scn: 0x0000.00000000
Low scn: 0x0000.00000000 01/01/1988 00:00:00
Next scn: 0x0000.00000000 01/01/1988 00:00:00
LOG FILE #2:
(name #3) /s01/oradata/G10R21/onlinelog/o1_mf_2_7ch8144q_.log
(name #4) /s01/flash_recovery_area/G10R21/onlinelog/o1_mf_2_7ch815cj_.log
Thread 1 redo log links: forward: 3 backward: 1
siz: 0x19000 seq: 0x00000000 hws: 0x0 bsz: 512 nab: 0x0 flg: 0x1 dup: 2
Archive links: fwrd: 0 back: 0 Prev scn: 0x0000.00000000
Low scn: 0x0000.00000000 01/01/1988 00:00:00
Next scn: 0x0000.00000000 01/01/1988 00:00:00
LOG FILE #3:
(name #1) /s01/oradata/G10R21/onlinelog/o1_mf_3_7ch816g2_.log
(name #2) /s01/flash_recovery_area/G10R21/onlinelog/o1_mf_3_7ch817gp_.log
Thread 1 redo log links: forward: 0 backward: 2
siz: 0x19000 seq: 0x00000000 hws: 0x0 bsz: 512 nab: 0x2 flg: 0xb dup: 2
Archive links: fwrd: 0 back: 0 Prev scn: 0x0000.00000000
Low scn: 0x0000.00000000 01/01/1988 00:00:00
Next scn: 0x0000.00000000 01/01/1988 00:00:00
虽然database checkpoint scn 等都是0 ,但是不影响 从 最小的datafile header checkpoint change 开始recover的 结论。
SQL> recover database using backup controlfile;
ORA-00279: change 15169814 generated at 03/09/2012 23:12:46 needed for thread 1
ORA-00289: suggestion :
/s01/flash_recovery_area/G10R21/archivelog/2012_03_09/o1_mf_1_2_%u_.arc
ORA-00280: change 15169814 for thread 1 is in sequence #2
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}

Similar Messages

  • Can change the size of the redolog files while the database is running.

    How the size of the redolog files will hurt your database performance ?
    Can change the size of the redolog files while the database is running in oracle 9i. ?
    What will be its impact on the standby database ?
    Thanks in advance.

    redo logs that are too small can cause waits on the switches for heavily utilized systems. logs that are too large are a pain the a$$ during recovery. check v$loghist to see how often switches occur - an average of 20 minutes is good; if you have many switches happening back-to-back, that's a bad sign.
    you can change the sizes while the db is up. choose a redo group that is INACTIVE, drop it, delete the files, and recreate it with larger files. then force a switch ("alter system switch logfile;"), and do another inactive group. I actually prefer to do as many switches as necessary to make the new group active so I can verify that I didn't screw up before dropping the next group.
    not sure of impact on standby database.

  • SQL Loader Control file WHEN clause

    LOAD DATA
    REPLACE
    INTO TABLE IDL_Investments
    WHEN average_balance < '100.00'
    FIELDS TERMINATED BY X'9'
    TRAILING NULLCOLS
    Borrower_Id,
    Account_No,
    customer_No,
    cptype_id "GETID(:cptype_id)",
    customer_name,
    average_balance,
    CP_GroupName,
    CP_type,
    Account_Type,
    Instrument_type,
    DD_date "TO_DATE(:DD_date, 'dd/mm/yy')",
    fac_Maturity_date "TO_DATE(:fac_Maturity_date, 'dd/mm/yy')"
    above one is the control file. when i tried to load data i waas getting the following error.
    SQL*Loader-350: Syntax error at line 4.
    Illegal combination of non-alphanumeric characters
    WHEN average_balance < '100.00'
    ^
    instead of '<' symbol if i place an '=' symbol then its workig fine.
    So how do I use <, <=, > or >= operators in a WHEN clause of a control file can any one help me?
    Thanks in advance.

    Thanks for the suggestion but by searching in someother sites i found that
    only equality operators ('=', '!=' or '<>') are permited in the WHEN clause expressions of a control file in SQL Loader.
    So now i changed my logic.
    thanks anyway.

  • RECREATE DATABASE Using CONTROL File After SUSPEND Database

    Hello All,
    Does someone can tell me if he does achieve recreating a database using "Backup Control File" after putting database in "suspend" mode?
    The procedure looks like this :
    1 - Alter DATABASE Suspend
    2 - A Snapshot of the filesystem where the oracle datafile are located
    3 - Copy of those files to another file systeme
    4 - Startup setting a new database name
    Does someone as do it successfully ?
    Thanks for your answer

    Carlos,
    I tried to do it without putting the tablespaces in backup mode and it didn't work for me. At that time adding the backup mode wasn't a big deal for me, so I didn't investigate the problem thoroughly.
    Logically thinking you sould be able to do:
    1. suspend database
    the SCNs recored in datafiles headers could be incosistent at this point
    2. make a snapshot
    3. mount the backup database
    4. run recover until cancel using backup controlfile - I don't think you can avoid this step in case if you have inconsistent SCNs in the datafiles headers - you'll need to synchronize them
    5. open resetlogs.
    the suspend database should eliminate the possibility of inconsistent data within a block during the backup.
    Just out of curiosity - why don't you want to put the tablespace in the backup mode?
    Mike

  • Removing the database from Linux

    What I have to delete (files) in order to remove my database from my computer (Linux) ?
    Thanks,
    Paul

    Sounds like you want a clean system ... no trace of Oracle. Under Linux, the correct way of doing that would be
    1) For each database, use DBCA to remove/drop the database.
    Depending on the version of the DBCA, you may need to follow up with manually removing the "Oracle Data" directories, the "Flashback" directories (especially if they changed over time), and the "Admin" directories (where the alert.log and other trace files are kept)
    2) For each set of software (ORACLE_HOME), use the Oracle Universal Installer to remove the Oracle software.
    Depending on the version of the Oraclee Universal Installer, and which patches have been applied, you may need to manually remove the directories under the ORACLE_HOME
    3) Manually remove the Oracle Inventory, as identified by the oraInst.loc file
    4) Manually remove the /etc/oratab, /etc/oraInst.log and (if RAC has been installed) the /etc/oracle directory tree.
    Under Linux, you can cheat - skip the DBCA and OUI portions of the first 2 steps and go to the manual deletes.
    In Linux, I typically install everything Oracle under /u01/app/oracle as my ORACLE_BASE ... to clean the system, I simply "rm -rf /u01/app/oracle /etc/oratab /etc/oraInst.loc /etc/oracle"
    Or better, just start up a saved VMWare clone, if this is not a real system.

  • Functioning of control file when re-created

    Hi friends,
    we can recover database without data loss when there is a situation to re-create control file(for suppose control file is lost and no multiplexed copies are available) using NORESETLOGS option in controlfile script.
    when we re-create controlfile, no SCN and checkpoint information will be there in controlfile. Then how controlfile will get the latest SCN and how it allows DB to be up and running.
    please explain. thanks in advance

    Hi,
    As per my knowledge I am explaning what will happen at Background.
    As you said that control File is lost and no mutiplexed, In that scenario you are going to recreate the Controlfile. As we know that control file will be in Sync with All DataFiles (System etc.,) , which will hold the SCN numbers, When the Instance is UP with the newly Created ControlFile (Since scn is not available), it will get the Highest SCN Number from Current DataFiles and Check for in Sync with other Datafiles, whether SCN is in Sync with the Other data files or not.
    And further proceed with Recovery Process Based on the Redo Logs.
    As you said if the required SCN is not available in the Redo Logs it will Check for the Archive Redo Logs Based on the SCN i.e., (If Req SCN is < SCN in Redo Logs) It will Check for Archive Logs files.
    Let me know in case If I am not clear or some where wrong in concept so that I can learn some thing inturn from others.!!
    Thanks & Regards,
    Pavan Kumar N

  • Problem in identifying control file when creating physical standby

    hi there,
    (database version: 10.2.0.4
    plateform linux)
    I'm using the command as below to create physical standby database from backup:
    rman target / auxiliary sys/tiger@paceview
    Recovery Manager: Release 10.2.0.4.0 - Production on Tue Sep 4 18:05:53 2012
    Copyright (c) 1982, 2007, Oracle.  All rights reserved.
    connected to target database: PACEVIEW (DBID=2092349485)
    connected to auxiliary database: PACEVIEW (not mounted)
    run {
    allocate auxiliary channel c1 device type DISK;
    set until sequence 38;
    duplicate target database for standby dorecover nofilenamecheck;
    released channel: ORA_DISK_1
    allocated channel: c1
    channel c1: sid=35 devtype=DISK
    allocated channel: c2
    channel c2: sid=36 devtype=DISK
    executing command: SET until clause
    Starting Duplicate Db at 04-SEP-12
    contents of Memory Script:
       set until scn  138180211934;
       restore clone standby controlfile;
       sql clone 'alter database mount standby database';
    executing Memory Script
    executing command: SET until clause
    Starting restore at 04-SEP-12
    channel c1: restoring control file
    ORA-19625: error identifying file /backup/rman/paceview/DEL1_standby.ctl
    ORA-27037: unable to obtain file status
    Linux-x86_64 Error: 2: No such file or directory
    Additional information: 3
    ORA-19600: input file is control file  (/backup/rman/paceview/DEL1_standby.ctl)
    ORA-19601: output file is control file  (/PGHProdDB/oradata/paceview/control1.ctl)
    failover to previous backup
    released channel: c1
    released channel: c2
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of Duplicate Db command at 09/04/2012 18:01:44
    RMAN-03015: error occurred in stored script Memory Script
    RMAN-06026: some targets not found - aborting restore
    RMAN-06024: no backup or copy of the control file found to restorei have already tried crosscheck but still giving same error
    thanks

    Hello;
    So this is what I would do :
    Backup Primary ( change to your directory as need )
    RMAN RUN {
    allocate channel d1 type disk;
    backup format '/u01/backups/PRIMARY/df_t%t_s%s_p%p' database;
    sql 'alter system archive log current';
    backup format '/u01/backups/PRIMARY/al_t%t_s%s_p%p' archivelog all;
    backup current controlfile for standby format '/u01/backups/PRIMARY/sb_t%t_s%s_p%p';
    release channel d1;
    }Move the backup and duplicate like this :
    rman target sys/password@PRIMARY auxiliary /
    RMAN> run {
    allocate channel C1 device type disk;
    allocate auxiliary channel C2 device type disk;
    duplicate target database for standby nofilenamecheck;
    }For complete details of this method see :
    http://www.visi.com/~mseberg/duprman2.html
    Best Regards
    mseberg

  • Mv control files, redo.log, database fies

    Hello,
    I installed Oracle 10.2. on Unix.
    we have created file systems for our data/control files.
    some how we missed that part to define location for dbf, control & redo.log files during installation.
    My question is how to mv all control files, redo.log and dbf files to one location to another.
    for. eg:
    currently there are installed in /opt/oracle/oradata.
    now i want o move in /u03/oradata.
    Please note:
    Prior to that I'd like to put in archive log mode.
    shutdown immediate;
    startup mount;
    alter database archivelog;
    alter database open;
    DN

    For DB and Redo files
    conn / as sysdba
    shutdown immediate;
    startup mount
    host
    $ cp old_name new_name
    $ exit
    alter database rename file old_name
    to new_name;
    alter database open
    host
    $ rm old_name
    $ exitFor control files
    1. Shut down the database.
    2. Copy an existing control file to a different locations, using operating system commands.
    3. Edit the CONTROL_FILES parameter in the database's initialization parameter file to add the new control file's name, or to change the existing control filename.
    4. start the database.
    Message was edited by:
    tekicora

  • Who will update control file when renaming a redolog file

    Hi when we rename a redolog file in mount state of database using the following command
    ALTER DATABASE
    RENAME FILE '/diska/logs/log1a.rdo', '/diska/logs/log2a.rdo'
    TO '/diskc/logs/log1c.rdo', '/diskc/logs/log2c.rdo';
    how the new location and new name of redo log files will be updated to control file and who will update that inforamtion
    thanks in advance.

    Where did you get this?
    oracle    4774  4733  0 12:04 pts/0    00:00:00 sqlplus   as sysdba
    oracle    4797     1  0 12:04 ?        00:00:00 ora_pmon_DB1
    oracle    4799     1  0 12:04 ?        00:00:00 ora_vktm_DB1
    oracle    4803     1  0 12:04 ?        00:00:00 ora_diag_DB1
    oracle    4805     1  0 12:04 ?        00:00:00 ora_dbrm_DB1
    oracle    4807     1  0 12:04 ?        00:00:00 ora_psp0_DB1
    oracle    4811     1  0 12:04 ?        00:00:00 ora_dia0_DB1
    oracle    4813     1  0 12:04 ?        00:00:00 ora_mman_DB1
    oracle    4815     1  0 12:04 ?        00:00:00 ora_dbw0_DB1
    oracle    4817     1  0 12:04 ?        00:00:00 ora_lgwr_DB1
    oracle    4819     1  0 12:04 ?        00:00:00 ora_ckpt_DB1
    oracle    4821     1  0 12:05 ?        00:00:00 ora_smon_DB1
    oracle    4823     1  0 12:05 ?        00:00:00 ora_reco_DB1
    oracle    4825     1  0 12:05 ?        00:00:00 ora_mmon_DB1
    oracle    4827     1  0 12:05 ?        00:00:00 ora_mmnl_DB1
    oracle    4829     1  0 12:05 ?        00:00:00 ora_d000_DB1
    oracle    4831     1  0 12:05 ?        00:00:00 ora_s000_DB1
    oracle    4855  4774  0 12:05 ?        00:00:00 oracleDB1 (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
    oracle    4858  4729  0 12:05 pts/1    00:00:00 bash
    oracle    4875  4858  0 12:05 pts/1    00:00:00 ps -fu oracleA ps output. The db is in mounted state.
    Dim

  • ORA-00205: error in identifying control file while startup database

    Dear Experts,
    we are using Oracle 10g on RHEL5.4 64Bit ecc 6.0 with eph 4 i have moved all my sap data files along with Temp file.
    when i startup my database getting error.
    SQL> startup mount
    ORACLE instance started.
    Total System Global Area 535662592 bytes
    Fixed Size 1334380 bytes
    Variable Size 306185108 bytes
    Database Buffers 222298112 bytes
    Redo Buffers 5844992 bytes
    ORA-00205: error in identifying control file, check alert log for more info
    when i checked initSID.ora then found old location of control file.
    1)/oracle/SID/sapdata1/cntrl
    2)/oracle/SID/origlogA/cntrl
    3)/oracle/SID/origlogB/cntrl
    i have manually changed location of control file.
    1)/oracle/SID/sapdata10/cntrl
    2)/oracle/SID/origlogA/cntrl
    3)/oracle/SID/origlogB/cntrl
    SQL> Create Pfile from Spfile;
    File Created.
    i would like to mount my database from Pfile plese help me i execute scripts below.
    SQL> STARTUP MOUNT=/oracle/SID/ORACLE_HOME/dbs/initSID.ora
    invalid startup option.
    or suggest me some other way so that i can startup my Database.
    with Regards

    Thanks,LOG of alert_SID.log  control_files            = /oracle/PRD/origlogA/cntrl/cntrlPRD.dbf, /oracle/PRD/origlogB/cntrl/cntrlPRD.dbf, /oracle/PRD/sapdata1/cntrl/cntrlPRD.dbf, control_file_record_keep_time= 30, Mon Nov 14 08:24:52 2011
    CREATE DATABASE PRD CONTROLFILE REUSE  MAXLOGFILES 255 MAXLOGMEMBERS 3 MAXLOGHISTORY 1000 MAXDATAFILES 254 MAXINSTANCES 50 NOARCHIVELOG CHARACTER SET UTF8 NATIONAL CHARACTER SET UTF8 DATAFILE '/oracle/PRD/sapdata1/system_1/system.data1' SIZE 350M REUSE AUTOEXTEND ON NEXT 20M MAXSIZE 10000M EXTENT MANAGEMENT LOCAL DEFAULT TEMPORARY TABLESPACE PSAPTEMP TEMPFILE '/oracle/PRD/sapdata1/temp_1/temp.data1' SIZE 570M REUSE AUTOEXTEND ON NEXT 20M MAXSIZE 10000M UNDO TABLESPACE PSAPUNDO DATAFILE '/oracle/PRD/sapdata1/undo_1/undo.data1' SIZE 700M REUSE AUTOEXTEND ON NEXT 20M MAXSIZE 10000M SYSAUX DATAFILE '/oracle/PRD/sapdata1/sysaux_1/sysaux.data1' SIZE 200M REUSE AUTOEXTEND ON NEXT 20M MAXSIZE 10000M
    LOGFILE GROUP 1 ('/oracle/PRD/origlogA/log_g11m1.dbf',
    '/oracle/PRD/mirrlogA/log_g11m2.dbf') SIZE 50M  REUSE ,GROUP 2 ('/oracle/PRD/origlogB/log_g12m1.dbf',
    '/oracle/PRD/mirrlogB/log_g12m2.dbf') SIZE 50M  REUSE ,GROUP 3 ('/oracle/PRD/origlogA/log_g13m1.dbf',
    '/oracle/PRD/mirrlogA/log_g13m2.dbf') SIZE 50M  REUSE ,GROUP 4 ('/oracle/PRD/origlogB/log_g14m1.dbf',
    '/oracle/PRD/mirrlogB/log_g14m2.dbf') SIZE 50M  REUSEMon Nov 14 08:24:53 2011Database mounted in Exclusive Mode
    Mon Nov 14 08:25:06 2011Successful mount of redo thread 1, with mount id 1830841300
    Assigning activation ID 1830841300 (0x6d206bd4) Thread 1 opened at log sequence 1
    Current log# 1 seq# 1 mem# 0: /oracle/PRD/origlogA/log_g11m1.dbf
      Current log# 1 seq# 1 mem# 1: /oracle/PRD/mirrlogA/log_g11m2.dbf,m Successful open of redo thread 1
    Mon Nov 14 08:25:06 2011 MTTR advisory is disabled because FAST_START_MTTR_TARGET is not set
    Mon Nov 14 08:25:06 2011 SMON: enabling cache recovery
    Mon Nov 14 08:25:06 2011
    create tablespace SYSTEM datafile  '/oracle/PRD/sapdata1/system_1/system.data1' SIZE 350M REUSE AUTOEXTEND ON NEXT 20M MAXSIZE 10000M
      EXTENT MANAGEMENT LOCAL online
    Mon Nov 14 08:25:09 2011
    Incremental checkpoint up to RBA [0x1.3.0], current log tail at RBA [0x1.3.0]
    Mon Nov 14 08:25:15 2011
    Completed: create tablespace SYSTEM datafile  '/oracle/PRD/sapdata1/system_1/system.data1' SIZE 350M REUSE AUTOEXTEND ON NEXT 20M MAXSIZE 10000M
      EXTENT MANAGEMENT LOCAL online
    Mon Nov 14 08:25:15 2011
    create rollback segment SYSTEM tablespace SYSTEM
      storage (initial 50K next 50K)
    Completed: create rollback segment SYSTEM tablespace SYSTEM
      storage (initial 50K next 50K)
    Mon Nov 14 08:25:19 2011
    CREATE UNDO TABLESPACE PSAPUNDO DATAFILE  '/oracle/PRD/sapdata1/undo_1/undo.data1' SIZE 700M REUSE AUTOEXTEND ON NEXT 20M MAXSIZE 10000M
    Mon Nov 14 08:25:36 2011
    Successfully onlined Undo Tablespace 1.
    Completed: CREATE UNDO TABLESPACE PSAPUNDO DATAFILE  '/oracle/PRD/sapdata1/undo_1/undo.data1' SIZE 700M REUSE AUTOEXTEND ON NEXT 20M MAXSIZE 10000M
    Mon Nov 14 08:25:36 2011
    create tablespace SYSAUX datafile  '/oracle/PRD/sapdata1/sysaux_1/sysaux.data1' SIZE 200M REUSE AUTOEXTEND ON NEXT 20M MAXSIZE 10000M
      EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO online
    Completed: create tablespace SYSAUX datafile  '/oracle/PRD/sapdata1/sysaux_1/sysaux.data1' SIZE 200M REUSE AUTOEXTEND ON NEXT 20M MAXSIZE 10000M
      EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO online

  • Exact location of control file when db_create_online_log_dest_1 is set

    In case in the init.ora file the below three parameters are set
    db_create_file_dest =somepath1
    db_create_online_log_dest_1 =somepath2
    db_create_online_log_dest_2 = somepath3
    then in which location will the control files be created? Its an interview question.
    Kindly provide me info

    Ebenezer_863977 wrote:
    In case in the init.ora file the below three parameters are set
    db_create_file_dest =somepath1
    db_create_online_log_dest_1 =somepath2
    db_create_online_log_dest_2 = somepath3
    then in which location will the control files be created? Its an interview question.
    Kindly provide me info"Its an interview question."
    It's also a doc question
    http://download.oracle.com/docs/cd/E11882_01/server.112/e25494/omf002.htm#ADMIN11490
    http://download.oracle.com/docs/cd/E11882_01/server.112/e25513/initparams052.htm#REFRN10034

  • Do i need to install srwAPIins.sql in the database to run reports

    I have a report where i have to generate whenever a row is inserted into a table. I have to automate this process.So, i am using event based publishing API in the after insert trigger or a procedure.We have 9i database and 10g developer suite. When i compiled the trigger it is says that variables should be declared.
    like srw_paramlist
    I am guessing that i should install this API in the database too.
    DO i have install in the database too.
    I tried to run srwAPIins.sql and srwAPIgrant.sql
    Where can i get these sqls to run in these in the database.
    Thank you very much.
    Sree

    Hi Sree,
    Suppose you are using the following code:
    DECLARE
    myPlist SRW_PARAMLIST;
    myIdent SRW.Job_Ident;
    BEGIN
    myPlist := SRW_PARAMLIST(SRW_PARAMETER('',''));
    srw.add_parameter(myPlist,'GATEWAY','http://machine:port/reports/rwservlet');
    srw.add_parameter(myPlist,'SERVER','mySVR');
    srw.add_parameter(myPlist,'REPORT','myReport.RDF');
    srw.add_parameter(myPlist,'USERID','me/secret');
    myIdent := srw.run_report(myPlist);
    END;
    In this case, you need to make sure the following:
    1. Make sure that the reports servlet is running, and that you provide the correct address of the servlet in your code. In 10g DS, to start the servlet, you need to go to your windows start menu > Programs > 10g DS > Reports Developer > Start OC4J instance. By default, this starts OC4J on port 8888. So submit the following command on a web browser:
    http://hostname:port/reports/rwservlet
    You should see the rwservlet page. (if there is a problem, also try ports 7777 and 7778).
    If you see the rwservlet page, you should use the above URL for the GATEWAY parameter.
    2. In the REPORT parameter, you need to provide the report name. If you provide complete path and report name, it's fine. Otherwise, you place the reports in any directory, add the directory to REPORTS_PATH, and provide only the report name in the code.
    As you can see, GATEWAY and REPORT are separate parameters, and are not connected to each other.
    Navneet.
    PS: the advantage of posting in this Forum is that other users facing the same problem can search the forum and get answers to their queries.

  • Sqlloader control file when clause

    Problem 1
    Lets say, I have a table x with (f1 number(2), f2 varchar(14), f3 Number(1))
    datafile1
    10,ls
    22,st
    45,tanveer
    77,cool
    1,not cool
    requirement is to insert the first 2 columns in f1 and f2 and insert 0 in f3 only
    if f2 == tanveer
    Problem 2
    Table is y (f4 number (2), f5 varchar (16))
    datafile2
    ls,xxxx
    tanveer,yyyy
    cool,zzzz
    not cool, mmmm
    given the value of the first coloumn I would like to query table x
    and find the corresponding value of f1 insert it to table y's column f4
    and associated string to f5.
    Please let me know how to write the control files for sqlloader.

    Problem 1:
    -- control file:
    LOAD DATA
    INFILE 'DATAFILE1.DAT'
    APPEND
    INTO TABLE x
    FIELDS TERMINATED BY ','
    TRAILING NULLCOLS
    (f1, f2,
    f3 "DECODE (:f2, 'tanveer', 0, NULL)")
    Problem 2:
    Create another table z,
    load the data into z,
    insert into y selecting
    from join of x and z:
    -- create staging table:
    CREATE TABLE z
      (f6 VARCHAR2 (14),
       f7 VARCHAR2 (16));
    -- control file:
    LOAD DATA
    INFILE 'DATFILE2.DAT'
    APPEND
    INTO TABLE z
    FIELDS TERMINATED BY ','
    TRAILING NULLCOLS
    (f6, f7)
    -- insert:
    INSERT INTO y (f4, f5)
    SELECT x.f1, z.f7
    FROM   x, z
    WHERE  z.f6 = x.f2;

  • When will the DIrectory Server run on Linux?

    Does anyone know when the DS software (and more specifically the admin server) will actually run on recent versions of Linux?
    The version of RHE it runs on is ancient...
    Is this typical Sun talking out of both sides of their mouth when it comes to Linux?
    Our enterprise will likely be forced to move to a different DS (eDirectory?) if Sun is going to continue to drag it's feet around making their software run on Linux.

    I can answer your questions but not in this forum - this is not the appropriate place to discuss products other than Sun's. You should be able to get my email address by clicking on the link to richm31415 next to Author:. If not, post here again.

  • How to check the database is running in which normalization

    All,
    I wanted to know in which normal form(1NF,2NF,BCNF) my database is working. How to find that...Suggestions Please .

    Tippu, I will agree with pretty much everything that the other posters have already posted.
    Related to the concept of normalization, in the database would be the definitions of primary key (PK), unique key (UK), and foreign key (FK) constainsts within the database. Looking at the constaints definded in the database by querying the rdbms dictionary view DBA_CONSTRAINTS might be of interest for trying to identify and understand the relationship between tables in your applications. However, there is no database requirement that these relationships be defined within the database.
    That is instead of declaring a PK on tableA there might just be a unique index and no FK to the header table, tableA, from its child detail table, tableB, declared in the database in this case. It would be totally up to the application to enforce this relationship. Still the view will provide information if most of the table relationships are formally defined in the database or not.
    HTH -- Mark D Powell --

Maybe you are looking for

  • Unable to edit theme correctly

    Hi, we're working with WDA which is integrated in a portal. I use the sap-ep-themeroot parameter to link to a theme which has been designed in the portal. we don't have wda iviews which is a customers prerequisite anyway its working that I can see a

  • Why is a layer blending mode result altered by adding and effect?

    I've done a search online and haven't come up with an answer but does anyone know why a layers blending mode result is altered by adding an effect? I am using CS3 on a PC (Windows XP SP2) and have two layers; one a Tiff and a second a text layer with

  • How do I disable "Add Image to iPhoto Library?"

    When you right click on an image in Safari, it gives you the option to add the image to your iPhoto Library. I never ever want to do this. How can I remove that context menu item? I click on it accidentally all the time and it's really annoying. I re

  • Archives in dataguard.

    Hi Group, I have a doubt. When configure dataguard (10g, 11g), while archive received from the primary are applied the standby database also generates archives?

  • How to make iTunes automatically add music to my library when its downloaded from the web?

    Before OS Yosemite, when I downloaded music off the web it would automatically be added to my iTunes library.  Now they just ends up in my downloads folder but once I click on them, they start playing in my iTunes.