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
Similar Messages
-
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. -
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
thanksHello;
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 -
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 infoEbenezer_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 -
Why does my function not return anything when I create as a schema object
I have user ABC who owns several tables some of which have foreign key constraints.
I have user XYZ that has been granted access to all tables owned by user ABC.
When I create a function as user XYZ using following I get no return when I issue:
select XYZ.ztm_tables_depended_on('ABC', 'A_TABLE_OWNED_BY_ABC') from dual :
Please see after function definition.
CREATE OR REPLACE FUNCTION ZTM_TABLES_DEPENDED_ON(p_Owner VARCHAR2, p_Table_Name VARCHAR2) RETURN VARCHAR2 IS
CURSOR C1 IS
SELECT OWNER, CONSTRAINT_NAME, R_OWNER, R_CONSTRAINT_NAME
FROM ALL_CONSTRAINTS
WHERE OWNER = p_Owner
AND TABLE_NAME = p_Table_Name
AND CONSTRAINT_TYPE = 'R'
ORDER BY OWNER, CONSTRAINT_NAME, R_OWNER, R_CONSTRAINT_NAME;
v_Referenced_Owner VARCHAR2(31);
v_Ret_Val VARCHAR2(4000);
FUNCTION CONSTRAINT_TABLE_NAME(p_Owner VARCHAR2, p_Constraint_Name VARCHAR2) RETURN VARCHAR2 IS
CURSOR C1 IS
SELECT TABLE_NAME
FROM ALL_CONSTRAINTS
WHERE OWNER = p_Owner
AND CONSTRAINT_NAME = p_Constraint_Name;
v_Ret_Val ALL_CONSTRAINTS.TABLE_NAME%TYPE;
BEGIN
OPEN C1;
FETCH C1 INTO v_Ret_Val;
CLOSE C1;
RETURN v_Ret_Val;
END;
BEGIN
FOR R IN C1 LOOP
IF (R.OWNER <> R.R_OWNER) THEN v_Referenced_Owner := R.R_OWNER || '.';
ELSE v_Referenced_Owner := NULL;
END IF;
v_Ret_Val := v_Ret_Val || ', ' || v_Referenced_Owner || CONSTRAINT_TABLE_NAME (R.R_OWNER, R.R_CONSTRAINT_NAME);
END LOOP;
RETURN LTRIM(v_Ret_Val, ', ');
END;
But, if I embed the function within an anonymous block as follows, I get results:
DECLARE
CURSOR C1 IS
select owner, table_name
FROM all_tables where owner = 'ABC';
FUNCTION ZTM_TABLES_DEPENDED_ON(p_Owner VARCHAR2, p_Table_Name VARCHAR2) RETURN VARCHAR2 IS
CURSOR C1 IS
SELECT OWNER, CONSTRAINT_NAME, R_OWNER, R_CONSTRAINT_NAME
FROM ALL_CONSTRAINTS
WHERE OWNER = p_Owner
AND TABLE_NAME = p_Table_Name
AND CONSTRAINT_TYPE = 'R'
ORDER BY OWNER, CONSTRAINT_NAME, R_OWNER, R_CONSTRAINT_NAME;
v_Referenced_Owner VARCHAR2(31);
v_Ret_Val VARCHAR2(4000);
FUNCTION CONSTRAINT_TABLE_NAME(p_Owner VARCHAR2, p_Constraint_Name VARCHAR2) RETURN VARCHAR2 IS
CURSOR C1 IS
SELECT TABLE_NAME
FROM ALL_CONSTRAINTS
WHERE OWNER = p_Owner
AND CONSTRAINT_NAME = p_Constraint_Name;
v_Ret_Val ALL_CONSTRAINTS.TABLE_NAME%TYPE;
BEGIN
OPEN C1;
FETCH C1 INTO v_Ret_Val;
CLOSE C1;
RETURN v_Ret_Val;
END;
BEGIN
FOR R IN C1 LOOP
IF (R.OWNER <> R.R_OWNER) THEN v_Referenced_Owner := R.R_OWNER || '.';
ELSE v_Referenced_Owner := NULL;
END IF;
v_Ret_Val := v_Ret_Val || ', ' || v_Referenced_Owner || CONSTRAINT_TABLE_NAME (R.R_OWNER, R.R_CONSTRAINT_NAME);
END LOOP;
RETURN LTRIM(v_Ret_Val, ', ');
END;
BEGIN
FOR R IN C1 LOOP
DBMS_OUTPUT.PUT_LINE(ztm_tables_depended_on(R.Owner, R.Table_Name));
END LOOP;
END;
Any ideas what is happening here?Any ideas what is happening here?
Justin explained the probable reason.
See the 'How Roles Work in PL/SQL Blocks' section of the database security doc for the details
http://docs.oracle.com/cd/E25054_01/network.1111/e16543/authorization.htm#i1007304
How Roles Work in PL/SQL Blocks
The use of roles in a PL/SQL block depends on whether it is an anonymous block or a named block (stored procedure, function, or trigger), and whether it executes with definer's rights or invoker's rights.
Roles Used in Named Blocks with Definer's Rights
All roles are disabled in any named PL/SQL block (stored procedure, function, or trigger) that executes with definer's rights. Roles are not used for privilege checking and you cannot set roles within a definer's rights procedure.
The SESSION_ROLES view shows all roles that are currently enabled. If a named PL/SQL block that executes with definer's rights queries SESSION_ROLES, then the query does not return any rows.
Roles Used in Named Blocks with Invoker's Rights and Anonymous PL/SQL Blocks
Named PL/SQL blocks that execute with invoker's rights and anonymous PL/SQL blocks are executed based on privileges granted through enabled roles. Current roles are used for privilege checking within an invoker's rights PL/SQL block. You can use dynamic SQL to set a role in the session.
See that line starting with 'All roles are disables in any named PL/SQL block'? -
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 -
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} -
How many control file should be created in ASM for ORACLE 4 nodes RAC
We have a oracle 10G(10.2.0.4) database with 4 nodes locates ASM in redhat linux5.
The vendor created this RAC system with database.
I saw below infornation as
SQL> select name from GV_$CONTROLFILE;
NAME
+FLSDISK1/sale/controlfile/current.256.690290159
+FLSDISK1/sale/controlfile/current.256.690290159
+FLSDISK1/sale/controlfile/current.256.690290159
+FLSDISK1/sale/controlfile/current.256.690290159
It seems that each node with one control file.
I got a feedback that vender claimed SAN is very reliable.
I am new person for database at ASM for RAC.
Could you make a explain for this condition? Do I need to add ( mirror) another 2 control file into ASM?
The Oracle recommands that at least 2 contril files( best 3 files) in different place. This is true for signle instance.
How about RAC that database locates in ASM?
Please help me!!
JimYou are fine using the standard three controlfiles in ASM, four is fine too, but it does not need to be tied to the number of instances as all the instances in a RAC database use the same controlfile (and its copies). ASM knows the controlfile type and will stripe each one in 128k pieces across as many volumes as it can. I much prefer to have my controlfiles in ASM, it prevents accidental deletion and generally makes DBA life easier.
Cheers!
Jay Caviness
http://www.grumpy-dba.com -
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; -
Where can I find the files when I "Created iPod version"?
I tried getting some of my video podcasts onto my iPod by using the "Create iPod version" but only audio plays. Where can I find these files so I can delete them and get them off my iPod?
Select the movie in the iTunes Window (you should see it in Library > Movies) and ctrl-click or right-click it. Then select "Show in Finder" and you will see the File.
Usually it should be located at
Users > your home >Music >iTunes >iTunes Music > Movies >your movie name(iPhone & iPod).m4v
if your library is managed by iTunes and located at the default place.
But don't delete the movie in the Finder, delete from iTunes, otherwise you will be left with an inconsistent library. -
Using trim and date function in control file
I want to load "?30/12/2005 22:13?" into the table table1 and remove the "?" characters.
LOAD DATA
INTO TABLE TABLE1
FIELDS TERMINATED BY ","
(ORDER_DATE "TRIM('?', 'MM/DD/YYYY HH24:MI')"
What's wrong with the above statement ?
thanks.in addition, can i specify the starting row from the text file to load the data ?
e.g. i only want to load from the 10th row Use SKIP 9 for that
http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96652/ch04.htm#1004940
and to eliminate the last 2 rows of the text file.There is no command for that, but if these rows can be identified through some pattern you could use conditional loading and exclude these rows
http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96652/ch05.htm#1005658 -
I am getting error while creating Control file for a fla file upoad in HANA
Hi Experts,
I am getting the following error when I try to create crtrol file for a flat file extraction in SAP HANA.
Could not execute 'import data into table P935718."COPATBL" from 'COPATBL.csv' record delimited by '\n' fields ...'
SAP DBTech JDBC: [257] (at 14): sql syntax error: incorrect syntax near "into": line 2 col 1 (at pos 14)
Here is the code I have used to create control file after I creating the table.
import data
into table P935718."COPATBL"
from 'COPATBL.csv'
record delimited by '\n'
fields delimited by ','
optionally enclosed by '"'
error log 'P935718.COPATBL.err'
p935718 is my user ID, COPATBL is my table created, COPABL.CSV is a flat file.
Please help me in this regard.
Thanks,
GunaHello,
guessing from the error message it looks that you are trying to execute "import data" as SQL command.
Please note that import data is NOT SQL command but it is syntax for control file. You need to create file with this syntax on server and then use command: IMPORT FROM '/<path>/<filename>.ctl'
In a shortcut:
1.- create comma separated CSV file with your data - <source cvs>.csv
2.- upload CVS file to HANA server
3.- create the control file <filename>.ctl:
import data
into table <schema>."<table name>"
from '<source cvs>.csv'
record delimited by '
fields delimited by ','
optionally enclosed by '"'
error log '<file name>.err'
4.- execute command:
IMPORT FROM '/<path>/<filename>.ctl'
Please check following threads:
How to load CSV files into HANA
Will HANA supports Bulkload
Tomas -
Urgent: DBrefresh error 354 while creating control file, oracle9i, SAP R3
Hi experts,
I have created trace file in Source system and moved the same to target system and edited and then while executing the trace file to create control file the following eeror is coming
my trace file is like this. . .
STARTUP NOMOUNT
CREATE CONTROLFILE SET DATABASE "P47" RESETLOGS ARCHIVELOG
-- SET STANDBY TO MAXIMIZE PERFORMANCE
MAXLOGFILES 255
MAXLOGMEMBERS 3
MAXDATAFILES 336
MAXINSTANCES 50
MAXLOGHISTORY 8168
'/oracle/P47/sapdata9/btabd_63/btabd.data63',
'/oracle/P47/sapdata9/stabi_27/stabi.data27',
'/oracle/P47/sapdata9/btabi_122/btabi.data122',
'/oracle/P47/sapdata9/stabd_28/stabd.data28',
'/oracle/P47/sapdata9/btabi_123/btabi.data123',
'/oracle/P47/sapdata9/btabd_64/btabd.data64',
'/oracle/P47/sapdata9/btabi_124/btabi.data124'
CHARACTER SET WE8DEC
i run command like this:
SQL> @/oracle/P47/saptrace/usertrace/control.sql
ORACLE instance started.
Total System Global Area 1249618992 bytes
Fixed Size 732208 bytes
Variable Size 788529152 bytes
Database Buffers 459022446 bytes
Redo Buffers 1335296 bytes
<b>354</b>
when I press 'enter' again SQL prompt is comming
Please help
rgdsHi markus,
thanks for reply . .
control files are not created. . . .
alertSID logs shows as follows
orap47> tail -f alert_P47.log
ARCH shutting down
Thu Dec 13 13:01:51 2007
ARC0: Archival stopped
Thu Dec 13 13:01:51 2007
ARC1: Archival stopped
Thu Dec 13 13:01:54 2007
ARCH: Archiving is disabled
Shutting down archive processes
Archiving is disabled
Archive process shutdown avoided: 0 active
<b>When @/oracle/saptrace/usertrace/control.sql command given in sepearate SQL window</b>
Thu Dec 13 13:03:37 2007
Starting ORACLE instance (normal)
Disable cache advisory with old cache parameters
Thu Dec 13 13:03:37 2007
WARNING: EINVAL creating segment of size 0x000000004b800000
fix shm parameters in /etc/system or equivalent
LICENSE_MAX_SESSION = 0
LICENSE_SESSIONS_WARNING = 0
SCN scheme 3
LICENSE_MAX_USERS = 0
SYS auditing is disabled
Starting up ORACLE RDBMS Version: 9.2.0.4.0.
System parameters with non-default values:
processes = 80
sessions = 96
timed_statistics = TRUE
shared_pool_size = 704643072
enqueue_resources = 8000
control_files = /oracle/P47/sapdata1/cntrl/cntrlP47.dbf, /oracle/P47/sapdata2/cntrl/cntrlP47.dbf, /oracle/P47/sapdata3/cntrl/cntrlP47.dbf
db_block_buffers = 56033
db_block_checksum = FALSE
db_block_size = 8192
compatible = 9.2.0
log_archive_start = TRUE
log_archive_dest = /oracle/P47/saparch/P47arch
log_buffer = 1048576
log_checkpoint_interval = 0
db_files = 354
db_file_multiblock_read_count= 8
log_checkpoints_to_alert = TRUE
control_file_record_keep_time= 30
dml_locks = 2500
row_locking = always
replication_dependency_tracking= FALSE
transactions_per_rollback_segment= 20
rollback_segments = PRS_0, PRS_1, PRS_10, PRS_11, PRS_12, PRS_13, PRS_14, PRS_2, PRS_3, PRS_4, PRS_5, PRS_6, PRS_7, PRS_8, PRS_9
transaction_auditing = FALSE
remote_os_authent = TRUE
db_domain = world
parallel_max_servers = 20
hash_join_enabled = FALSE
background_dump_dest = /oracle/P47/saptrace/background
user_dump_dest = /oracle/P47/saptrace/usertrace
core_dump_dest = /oracle/P47/saptrace/background
optimizer_features_enable= 9.2.0
sort_area_size = 2097152
sort_area_retained_size = 0
db_name = P47
open_cursors = 800
optimizer_mode = choose
btree_bitmap_plans = FALSE
pushjoin_predicate = FALSE
optimizer_index_cost_adj = 10
newinitial_join_orders = FALSE
optimpeek_user_binds = FALSE
PMON started with pid=2
DBW0 started with pid=3
LGWR started with pid=4
CKPT started with pid=5
SMON started with pid=6
RECO started with pid=7
Thu Dec 13 13:03:39 2007
ARCH: STARTING ARCH PROCESSES
ARC0 started with pid=8
ARC0: Archival started
ARC1 started with pid=9
Thu Dec 13 13:03:39 2007
ARCH: STARTING ARCH PROCESSES COMPLETE
Thu Dec 13 13:03:39 2007
ARC0: Thread not mounted
Thu Dec 13 13:03:39 2007
ARC1: Archival started
ARC1: Thread not mounted
rgds -
Function for column validation in SQl Loader control file.
Hello Gurus,
We have an requirement to create a function to validate all date and number columns in control file, and return 0/1 accordingly to valid_column which is last column . I have developed the function which accepts the number and date type columns as parameter and return Y/N. My question is, is there any way so that the function could be created without passing any parameter to it?
If yes, then how to call the function in control file?
I have been searching since a while on Google to find out any solution but could find out.
Using Oracle 11g Enterprise Edition Release 11.2.0.1.0
Thanks!
Edited by: Sush on Jul 5, 2012 2:23 AM
Edited by: Sush on Jul 5, 2012 4:16 AM
Edited by: Sush on Jul 5, 2012 7:28 AMHi Srini,
I have gone through this document and i couldn’t find out any solution. That’s why i was seeking help from you Gurus.
Thanks for your help, i think i have learnt few new things abt SQL Loader by studying this document :)
Thanks! -
Whwn to create a standby control file?
Hi All ,
I want to setup a standby database for my Production DB.
I have a doubt, can we create a Standby by control file when the Primary database is up and running(read-write) mode. or else it is must to be in mount state only ?
Please advise.
Thanks.Hello;
I do it like this: (And then copy the STANDBY.ctl to the Standby system and rename)
SQL>startup mount;
SQL>alter database create standby controlfile as 'STANDBY.ctl';
This command will fail is STANDBY.ctl exists.
See step 8 of my cliff notes here:
http://www.visi.com/~mseberg/data_guard_on_oracle_10_step_by_step.html
Or Step 7 if Oracle 11 here:
http://www.visi.com/~mseberg/data_guard_on_oracle_11_step_by_step.html
Best Regards
mseberg
Maybe you are looking for
-
Print VI front panel to file does not work after building executable.
I am using a property and invoke node to print the front panel of my VI to an HTML file. It works fine in the development mode. After Building the application, this subvi will no longer print the front panel. Is there some special files that includ
-
How to show/hide a form field?
Hi all, Is it possible to programaticlly show/hide a from input field at runtime? best
-
Hi, we have problem with ACS 3.2(Win2k): 2 days before, ACS starts logging messages "Service CSAuth has been stopped or paused by the system". Occurence is random and frequent. No changes on system done. Any ideas? Thanks for help Stepan 03/24/2005,1
-
Hi support, there is an oss note certifying the use of fault tolerance vSphere 4.1 in production environment? I have read the best practices for its use with MSCS, but I find no note Thanks a lot
-
I am trying to load Adobe Photoshop CS5 and get the message: Windows cannot find C:/users/****/appdata/local/adobe/oobe/pdapp/dwa/setup.exe Can someone please help. I am a novice so please give step by step instructions.