View Full Version : scn number
FredBear
12-16-2004, 03:23 AM
"Uwe Schmidt" <uwe.schmidt@dataport.de> a écrit dans le message de
news:newscache$hx7t8i$9om$1@www-neu.dzsh.de...
| Hy NG,
|
|
| is there
| 1) a view or a table where i can select the actuel scn-number from the db ?
| 2) if the db is down (offline), can i see the last scn-number ? in
| ctrl-file, data-file, logfile (in alert-file, i
| know)
|
|
| Thanks .....
|
1. select dbms_flashback.get_system_change_number from dual;
2. It is in the control file but you can't see it.
Maybe in the mount state there is a x$ table containing that?
Regards
Michel Cadot
You can also see it from the view v$database, and therefore, as Michel
suggested,
is available under x$kccdi.dicur_scn (from which v$database is based
on).
The funny thing is that this value is set to 0 when the database is in
a mount state.
The value is only set to the current SCN when the database is open.
Denis Do
12-18-2004, 04:16 PM
v$datafile_header view is probably the best source
FredBear
12-19-2004, 12:32 AM
"Michel Cadot" <micadot{at}altern{dot}org> a écrit dans le message de
news:41c16f14$0$7556$636a15ce@news.free.fr...
|
| "Uwe Schmidt" <uwe.schmidt@dataport.de> a écrit dans le message de
| news:newscache$hx7t8i$9om$1@www-neu.dzsh.de...
| | Hy NG,
| |
| |
| | is there
| | 1) a view or a table where i can select the actuel scn-number from the db ?
| | 2) if the db is down (offline), can i see the last scn-number ? in
| | ctrl-file, data-file, logfile (in alert-file, i
| | know)
| |
| |
| | Thanks .....
| |
|
| 1. select dbms_flashback.get_system_change_number from dual;
| 2. It is in the control file but you can't see it.
| Maybe in the mount state there is a x$ table containing that?
|
| Regards
| Michel Cadot
|
|
Assuming the last shutdown was not abort, in the mount state, you can get it with:
select checkpoint_change# from v$database; -- from control file
select checkpoint_change#, last_changes# from v$datafile; -- from control file
select checkpoint_change# from v$datafile_header; -- from datafile headers
Regards
Michel Cadot
Denis Do
12-19-2004, 02:40 AM
Hi Michael!
I gave the same answer - and just couple seconds later realised it was not
exactly what has been asked:-)
Have a look here:
1 select current_scn, flashback_on, CONTROLFILE_CHANGE#, CHECKPOINT_CHANGE#
2* from v$database
SQL> /
CURRENT_SCN FLA CONTROLFILE_CHANGE# CHECKPOINT_CHANGE#
----------- --- ------------------- ------------------
386884 NO 386780 386617
SQL> /
CURRENT_SCN FLA CONTROLFILE_CHANGE# CHECKPOINT_CHANGE#
----------- --- ------------------- ------------------
386886 NO 386780 386617
SQL> commit;
Commit complete.
SQL> /
Commit complete.
SQL> select current_scn, flashback_on, CONTROLFILE_CHANGE#, CHECKPOINT_CHANGE#
2 from v$database;
CURRENT_SCN FLA CONTROLFILE_CHANGE# CHECKPOINT_CHANGE#
----------- --- ------------------- ------------------
386898 NO 386780 386617
SQL> select distinct CHECKPOINT_CHANGE# from v$datafile_header;
CHECKPOINT_CHANGE#
------------------
386617
So, I would say correct answer is :
- on open instance - v$database.CURRENT_SCN column
- on mounted instance - v$datafile_header
Cheers!
On 2004-12-19, Michel Cadot <micadot{at}altern{dot}org> wrote: "Michel Cadot" <micadot{at}altern{dot}org> a écrit dans le message de news:41c16f14$0$7556$636a15ce@news.free.fr...
select checkpoint_change# from v$database; -- from control file select checkpoint_change#, last_changes# from v$datafile; -- from control file select checkpoint_change# from v$datafile_header; -- from datafile headers
MyLounge.com Site Map
Forum:
Cars,
Cell Phone,
Database,
Games,
Home Improvement,
IT,
Music,
School,
Sports,
Web Design,
Web Server,
Weight Loss
The MyLounge.com forum is intended for informational use only and should not
be relied upon and is not a substitute for any advice. The information contained
on MyLounge.com are opinions and suggestions of members and is not a representation
of the opinions of MyLounge.com. MyLounge.com does not warrant or vouch for
the accuracy, completeness or usefulness of any postings or the qualifications
of any person responding. Please consult a expert or seek the services of an
attorney in your area for more accuracy on your specific situation. Please note
that our forums also serve as mirrors to Usenet newsgroups. Many posts you see
on our forums are made by newsgroup users who may not be members of MyLounge.com
Term of Service
vBulletin v3.0.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.