Oct 10, 2005
Difference between RAMN backup and traditional hot backup
Alter Tablespace users Begin Backup;
It'll freeze SCN in the file header of corresponding data files, while SCN of data blocks continute increased to reflect the changes. When recover the database, these two SCN will be compared to see if data block needs to be recovered from archived log files.
RMAN writes frozen SCN of data file header into either control file (nocatalog) or recovery catalog instead to "Alter Tablespace users Begin Backup;".
Oct 6, 2005
RMAN Maintenance
RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 14;
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/dbBackup/hotbackup/controlfile%F';
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/dbhome/product/10.2.0/dbs/snapcf_tedsdb.f'; # default
--
--List
--
list backup;
list backup summary;
list backup by file;
list expired backup;
list copy of database archivelog all;
--
--Report
--
report obsolete;
report need backup;
--
--Delete
--
delete obsolete;
delete force obsolete;
--
--Crosscheck
--
crosscheck backup;
delete expired backup;
--
--Change
--
CHANGE BACKUPSET TAG year_end_2005 KEEP FOREVER NOLOGS;
CHANGE BACKUPSET TAG year_end_2005 NOKEEP;
--
--Monitor RMAN via v$ views
--
COLUMN CLIENT_INFO FORMAT a30
COLUMN SID FORMAT 999
COLUMN SPID FORMAT 9999
SELECT s.SID, p.SPID, s.CLIENT_INFO
FROM V$PROCESS p, V$SESSION s
WHERE p.ADDR = s.PADDR
AND CLIENT_INFO LIKE 'rman%'
/
--Monitor Job Progress
SELECT SID, SERIAL#, CONTEXT, SOFAR, TOTALWORK,
ROUND(SOFAR/TOTALWORK*100,2) "%_COMPLETE"
FROM V$SESSION_LONGOPS
WHERE OPNAME LIKE 'RMAN%'
AND OPNAME NOT LIKE '%aggregate%'
AND TOTALWORK != 0
AND SOFAR <> TOTALWORK
/
--Monitor sbt event
SELECT p.SPID, EVENT, SECONDS_IN_WAIT AS SEC_WAIT,
sw.STATE, CLIENT_INFO
FROM V$SESSION_WAIT sw, V$SESSION s, V$PROCESS p
WHERE sw.EVENT LIKE '%sbt%'
AND s.SID=sw.SID
AND s.PADDR=p.ADDR
/
--Monitor backup and restore performance
V$BACKUP_SYNC_IO and V$BACKUP_ASYNC_IO
--to validate all datafiles
run {
allocate channel d1 type disk;
backup check logical validate database;
release channel d1;
}
--To test the most recent RMAN database backup:
RMAN> restore validate database;
--To test the most recent RMAN spfile backup:
RMAN> restore validate spfile to 'c:\temp\spfile.ora';
--To test the most recent RMAN controlfile backup:
RMAN> restore validate controlfile to 'c:\temp\control01.ctl';
--To test the most recent RMAN archivelog file(s) backup.
--First determine which archivelog sequences are in the last backup:
RMAN> list backup of archivelog all;
or
RMAN> list backup of archivelog all completed after 'sysdate -1';
--then:
--the beginning number is inclusive and the ending sequence number is not.
RMAN> restore validate archivelog from sequence ii until sequence XX?;
--To test for earlier backups via TAG
RMAN> restore validate database from tag=;
--RMAN configuration
select * from v$rman_configuration;
--
--Make Cold/Consistent Backup
--
run {
shutdown immedate;
startup mount pfile=/yourpath/initxxx.ora;
backup incremental level 0
database format '/yourpath/%d_closed_%U'
tag=PROD_COLD_L0;
shutdown;
startup pfile=/yourpath/initxxx.ora;
}
--RMAN related V$ views
select object_name from dba_objects
where object_name like 'V$BACKUP%'
and object_type = 'SYNONYM';
select object_name from dba_objects
where object_name like 'V$RMAN%'
and object_type = 'SYNONYM';
select TYPE, RECORDS_TOTAL, RECORDS_USED
from v$controlfile_record_section
where type like '%BACKUP%';
* V$CONTROLFILE_RECORD_SECTION
* V$COPY_CORRUPTION
* V$DATABASE
* V$DATABASE_BLOCK_CORRUPTION
* V$DATABASE_INCARNATION
* V$DATAFILE
* V$DATAFILE_COPY
* V$PROXY_ARCHIVEDLOG
* V$PROXY_ARCHIVELOG_DETAILS
* V$PROXY_ARCHIVELOG_SUMMARY
* V$PROXY_COPY_DETAILS
* V$PROXY_COPY_SUMMARY
* V$PROXY_DATAFILE
* V$OBSOLETE_BACKUP_FILES
* V$OFFLINE_RANGE
* V$SESSION_LONGOPS
* V$BACKUP
* V$BACKUP_ARCHIVELOG_DETAILS
* V$BACKUP_ARCHIVELOG_SUMMARY
* V$BACKUP_ASYNC_IO
* V$BACKUP_CONTROLFILE_DETAILS
* V$BACKUP_CONTROLFILE_SUMMARY
* V$BACKUP_COPY_DETAILS
* V$BACKUP_COPY_SUMMARY
* V$BACKUP_CORRUPTION
* V$BACKUP_DATAFILE
* V$BACKUP_DATAFILE_DETAILS
* V$BACKUP_DATAFILE_SUMMARY
* V$BACKUP_DEVICE
* V$BACKUP_FILES
* V$BACKUP_PIECE
* V$BACKUP_PIECE_DETAILS
* V$BACKUP_REDOLOG
* V$BACKUP_SET
* V$BACKUP_SET_DETAILS
* V$BACKUP_SET_SUMMARY
* V$BACKUP_SPFILE
* V$BACKUP_SPFILE_DETAILS
* V$BACKUP_SPFILE_SUMMARY
* V$BACKUP_SYNC_IO
* V$RMAN_BACKUP_JOB_DETAILS
* V$RMAN_BACKUP_SUBJOB_DETAILS
* V$RMAN_BACKUP_TYPE
* V$RMAN_CONFIGURATION
* V$RMAN_ENCRYPTION_ALGORITHMS
* V$RMAN_OUTPUT
* V$RMAN_STATUS
Aug 25, 2005
native XML database
Commerical namtive XML database
Tamino Developer Community Home
JaxMe2 (open source implementation of JAXB) Access a Tamino Database
Aug 3, 2005
Monitoring undo segments usage
--To check current all undo segments
--
select s.usn,
n.name,
extents,
Round(rssize/(1024*1024)) rssize_MB,
Round(hwmsize/(1024*1024)) hwmsize_MB,
s.OPTSIZE,
s.SHRINKS,
s.WRAPS,
s.EXTENDS
from v$rollstat s,v$rollname n
where s.usn = n.usn;
--
--to check all historical undo activities
--
set linesize 160
set pagesize 60
alter session set nls_date_format = "yy-mm-dd hh24:mi:ss";
col begin_time head 'begin|time'
col txncount for 99,999 head 'txn|cnt'
col maxquerylen for 99,999 head 'max|query'
col maxconcurrency for 9,999 head 'max|concr|txn'
col bks_per_sec for 99,999 head 'blks/sec'
col kb_per_second for 99,999 head 'kb/|sec'
col undo_mb_required for 9,999,999 head 'mb|undo|needed'
col ssolderrcnt for 9,999 head 'ora-1555|cnt'
col nospaceerrcnt for 9,999 head 'no|space|cnt'
col unxpstealcnt for 99,999 head 'unxp|steal|cnt'
col unxpblkrelcnt for 99,999 head 'unxp|blkrel|cnt'
col unxpblkreucnt for 99,999 head 'unxp|blkreu|cnt'
col expstealcnt for 99,999 head 'exp|steal|cnt'
col expblkrelcnt for 99,999 head 'exp|blkrel|cnt'
col expblkreucnt for 99,999 head 'exp|blkreu|cnt'
break on report
compute max of txncount -
maxquerylen -
maxconcurrency -
bks_per_sec -
kb_per_second -
undo_mb_required -
ssolderrcnt -
nospaceerrcnt -
unxpstealcnt -
unxpblkrelcnt -
unxpblkreucnt -
expstealcnt -
expblkrelcnt -
expblkreucnt on report
select begin_time,
txncount-lag(txncount) over (order by end_time) as txncount,
maxquerylen,
maxconcurrency,
undoblks/((end_time - begin_time)*86400) as bks_per_sec,
(undoblks/((end_time - begin_time)*86400)) * t.block_size/1024 as kb_per_second,
round((undoblks/((end_time - begin_time)*86400)
* t.block_size
* to_number(p2.value)
+ to_number(p2.value)*24
)/1024/1024
) as undo_mb_required,
ssolderrcnt,
nospaceerrcnt,
unxpstealcnt,
unxpblkrelcnt,
unxpblkreucnt,
expstealcnt,
expblkrelcnt,
expblkreucnt
from v$undostat s,
dba_tablespaces t,
v$parameter p,
v$parameter p2
where t.tablespace_name = upper(p.value)
and p.name = 'undo_tablespace'
and p2.name = 'undo_retention'
order by begin_time;
show parameter undo
clear computes
Jul 29, 2005
More daylight-saving time means problems for developers
More daylight-saving time means problems for developers
Oracle Enterprise Manager 10g Grid Control Release 10.1.0.3 Readme Last updated: July 12, 2004Daylight savings time is not supported for blackouts. Users need to manually adjust a blackout's schedule, as needed, to accommodate schedule changes due to daylight savings time.
Jul 28, 2005
Good to know cURL
[From cURL official website]
curl is a command line tool for transferring files with URL syntax, supporting FTP, FTPS, HTTP, HTTPS, GOPHER, TELNET, DICT, FILE and LDAP. Curl supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading, HTTP form based upload, proxies, cookies, user+password authentication (Basic, Digest, NTLM, Negotiate, kerberos...), file transfer resume, proxy tunneling and a busload of other userfeul tricks.
Jul 27, 2005
Can we trust auto_sample_size in 9i dbms_stats?
On 9.2.04(we experienced) and 9.2.05(Oracle confirmed), if you specify estimate_percent=>dbms_stats.auto_sample_size, it can be extremely slow.
It is bug# 3150750, and has been fixed in 9.2.0.6 as Note:283897.1
Jul 12, 2005
Oracle and Open Source
Jul 5, 2005
why does undo tablespace grow so fast?
-The value for undo_retention also has a role in growth of undo tablespace. Ex: when load data into tables immediately after each other, then the UNDO_RETENTION time was probably too long, which resulted in more space being used instead of reused.
-UNDO is using autoallocation option of LMT. As the number of the extents goes up, the extent size will be increased too. When the number of extent reaches hundreds, the size could be 8M to 64M+ each. As it reaches thousands, the extent size will be even bigger.
This algorithm is meant to fit most cases, but if you know the size of most of your transactions you can use UNIFORM rather than AUTO.
ELLISON TO GRADS: DIPLOMAS ARE FOR LOSERS
Oracle CEO:有史以来最狂妄的演讲
耶鲁的毕业生们,我很抱歉——如果你们不喜欢这样的开场。我想请你们为我做一件事。请你---好好看一看周围,看一看站在你左边的同学,看一看站在你右边的同学。
请你设想这样的情况:从现在起5年之后,10年之后,或30年之后,今天站在你左边的这个人会是一个失败者;右边的这个人,同样,也是个失败者。而你,站在中间的家伙,你以为会怎样?一样是失败者。失败的经历。失败的优等生。
说 实话,今天我站在这里,并没有看到一千个毕业生的灿烂未来。我没有看到一千个行业的一千名卓越领导者,我只看到了一千个失败者。你们感到沮丧,这是可以理 解的。为什么,我,埃里森,一个退学生,竟然在美国最具声望的学府里这样厚颜地散布异端?我来告诉你原因。因为,我,埃里森,这个行星上第二富有的人,是 个退学生,而你不是。因为比尔-盖茨,这个行星上最富有的人——就目前而言---是个退学生,而你不是。因为艾伦,这个行星上第三富有的人,也退了学,而 你没有。再来一点证据吧,因为戴尔,这个行星上第九富有的人——他的排位还在不断上升,也是个退学生。而你,不是。
......你们非常沮丧,这是可以理解的。
你们将来需要这些有用的工作习惯。你将来需要这种'治疗'。你需要它们,因为你没辍学,所以你永远不会成为世界上最富有的人。哦,当然,你可以,也许,以你的方式进步到第10位,第11位,就像Steve。但,我没有告诉你他在为谁工作,是吧?
根据记载,他是研究生时辍的学,开化得稍晚了些。
现在,我猜想你们中间很多人,也许是绝大多数人,正在琢磨,'我能做什么? 我究竟有没有前途?'当然没有。太晚了,你们已经吸收了太多东西,以为自己懂得太多。你们再也不是19岁了。你们有了'内置'的帽子,哦,我指的可不是你们脑袋上的学位帽。
嗯......你们已经非常沮丧啦。这是可以理解的。所以,现在可能是讨论实质的时候啦——
绝 不是为了你们,2000年毕业生。你们已经被报销,不予考虑了。我想,你们就偷偷摸摸去干那年薪20万的可怜工作吧,在那里,工资单是由你两年前辍学的同 班同学签字开出来的。事实上,我是寄希望于眼下还没有毕业的同学。我要对他们说,离开这里。收拾好你的东西,带着你的点子,别再回来。退学吧,开始行动。
我要告诉你,一顶帽子一套学位服必然要让你沦落......就像这些保安马上要把我从这个讲台上撵走一样必然......(此时,Larry被带离了讲台)
ELLISON TO GRADS: DIPLOMAS ARE FOR LOSERS
Oracle CEO Urges Students to Drop out, Start up
NEW HAVEN, CONN. (SatireWire.com) — In one of the more controversial commencement addresses in memory, Oracle CEO and college dropout Larry Ellison told Yale's Class of 2000 they were "losers" whose hard-won diplomas would never propel them into the ranks of the super rich.
The evangelical Ellison, noting that college dropouts Bill Gates, Paul Allen, and Michael Dell were, like himself, on Forbes' recent top 10 list of billionaires, urged freshmen and sophomores at the ceremony to "drop out and start up," and added that the undereducated Yale security guards who ushered him off stage probably had a better shot at uber-wealth than graduating seniors.
What follows is a transcript of the speech delivered by Ellison at the Yale University last month:
"Graduates of Yale University, I apologize if you have endured this type of prologue before, but I want you to do something for me. Please, take a good look around you. Look at the classmate on your left. Look at the classmate on your right. Now, consider this: five years from now, 10 years from now, even 30 thirty years from now, odds are the person on your left is going to be a loser. The person on your right, meanwhile, will also be a loser. And you, in the middle? What can you expect? Loser. Loserhood. Loser Cum Laude.
"In fact, as I look out before me today, I don't see a thousand hopes for a bright tomorrow. I don't see a thousand future leaders in a thousand industries. I see a thousand losers.
"You're upset. That's understandable. After all, how can I, Lawrence 'Larry' Ellison, college dropout, have the audacity to spout such heresy to the graduating class of one of the nation's most prestigious institutions? I'll tell you why. Because I, Lawrence "Larry" Ellison, second richest man on the planet, am a college dropout, and you are not.
"Because Bill Gates, richest man on the planet -- for now, anyway -- is a college dropout, and you are not.
"Because Paul Allen, the third richest man on the planet, dropped out of college, and you did not.
"And for good measure, because Michael Dell, No. 9 on the list and moving up fast, is a college dropout, and you, yet again, are not.
"Hmm... you're very upset. That's understandable. So let me stroke your egos for a moment by pointing out, quite sincerely, that your diplomas were not attained in vain. Most of you, I imagine, have spent four to five years here, and in many ways what you've learned and endured will serve you well in the years ahead. You've established good work habits. You've established a network of people that will help you down the road. And you've established what will be lifelong relationships with the word 'therapy.' All that of is good. For in truth, you will need that network. You will need those strong work habits. You will need that therapy.
"You will need them because you didn't drop out, and so you will never be among the richest people in the world. Oh sure, you may, perhaps, work your way up to No. 10 or No. 11, like Steve Ballmer. But then, I don't have to tell you who he really works for, do I? And for the record, he dropped out of grad school. Bit of a late bloomer.
"Finally, I realize that many of you, and hopefully by now most of you, are wondering, 'Is there anything I can do? Is there any hope for me at all?' Actually, no. It's too late. You've absorbed too much, think you know too much. You're not 19 anymore. You have a built-in cap, and I'm not referring to the mortar boards on your heads.
"Hmm... you're really very upset. That's understandable. So perhaps this would be a good time to bring up the silver lining. Not for you, Class of '00. You are a write-off, so I'll let you slink off to your pathetic $200,000-a-year jobs, where your checks will be signed by former classmates who dropped out two years ago.
"Instead, I want to give hope to any underclassmen here today. I say to you, and I can't stress this enough: leave. Pack your things and your ideas and don't come back. Drop out. Start up.
"For I can tell you that a cap and gown will keep you down just as suredly as these security guards dragging me off this stage are keeping me dow..."
"Hero and Beauty"
Jun 30, 2005
Lsof - LiSt Open File
It has been tested recently on these UNIX dialects:
- AIX 5.[123]
- Apple Darwin 7.7.0 for Power Macintosh Systems
- BSDI BSD/OS 4.3.1 for x86-based systems
- FreeBSD 4.[2-9], 4.1[01], 5.[012] and 6.0 for x86-based systems
- FreeBSD 5.[01234] and 6.0 for Alpha, AMD64 and Sparc64 based systems
- HP-UX 11.00, 11.11 and 11.23
- Linux 2.1.72 and above for x86-based systems
- NetBSD 1.[456] and 2.x for Alpha, x86, and SPARC-based systems
- NEXTSTEP 3.[13] for NEXTSTEP architectures
- OpenBSD 2.[89] and 3.[0123456] for x86-based systems
- OpenStep 4.x
- SCO OpenServer Release 5.0.6 for x86-based systems
- SCO|Caldera UnixWare 7.1.4 for x86-based systems
- Solaris 2.6, 8, 9 and 10
- Tru64 UNIX 5.1
Please download source code from ftp://vic.cc.purdue.edu/pub/tools/unix/lsof
=========================
Example of Making Lsof on RedHat9
=========================
$ cd lsof_4.75_src
$ ./Configure linux
$ make
=========================
Example of Using Lsof
=========================
Finding Processes Blocking Umount
=================================
When you need to unmount a file system with the umount command,
you may find the operation blocked by a process that has a file
open on the file systems. Lsof may be able to help you find the
process. In response to:
$ lsof
Lsof will display all open files on the named file system. It
will also set its exit code zero when it finds some open files
and non-zero when it doesn't, making this type of lsof call
useful in shell scripts. (See section 16.)
Consult the output of the df command for file system names.
See the caveat in the preceding section about file references
that persist in the kernel without open file traces. That
situation may hamper lsof's ability to help with umount, too.
More example please see 00QUICKSTART, you will know it might be very helpful to you.
Jun 20, 2005
bzip2 and bunzip2
Download it from http://www.bzip.org/
Jun 17, 2005
Swap space on Solaris
Here is what I found from http://www.princeton.edu/~psg/unix/solaris/troubleshoot/ram.html
The Solaris virtual memory system combines physical memory with available swap space via swapfs. If insufficient total virtual memory space is provided, new processes will be unable to open.
Swap space can be added, deleted or examined with the swap
command.
reports total and free space for each of the swap partitions or files that are available to the system. Note that this number does not reflect total available virtual memory space, since physical memory is not reflected in the output.
swap -l
reports the total available amount of virtual memory, as does
swap -ssar -r
.
If swap is mounted on /tmp
via tmpfs, df -k /tmp
will report on total available virtual memory space, both swap and physical.
Jun 13, 2005
ORA-04030: out of process memory when trying to allocate 33352 bytes (pga heap,ksm stack)
Errors in file /dbhomeams/ams/admin/amsora/bdump/amsora_ckpt_10317.trc:
ORA-04030: out of process memory when trying to allocate 33352 bytes (pga heap,ksm stack)
Sat Jun 11 17:33:26 2005
Errors in file /dbhomeams/ams/admin/amsora/bdump/amsora_ckpt_10317.trc:
ORA-04030: out of process memory when trying to allocate 33352 bytes (pga heap,ksm stack)
Sat Jun 11 17:33:26 2005
CKPT: terminating instance due to error 4030
Instance terminated by CKPT, pid = 10317
What does an ORA-4030 mean?
---------------------------
This error indicates that the oracle server process is unable to allocate more memory from the operating system.This memory consists of the PGA (Program Global Area) and its contents depend upon the server configuration.For dedicated server processes it contains the stack and the UGA (User Global Area) which holds user session data, cursor information and the sort area. In a multithreaded configuration (shared server), the UGA is allocated in the SGA (System Global Area) and will not be responsible for ORA-4030 errors. The ORA-4030 thus indicates the process needs more memory (stack UGA or PGA) to perform its job.
What causes this error?
-----------------------
Since you run into this error, you can't allocate memory from the operating system. This could be caused by your process itself, like your process is just requesting too much memory, or some other reasons cause the operating system memory to be depleted, like a too big SGA or too many processes to be accomadated for the systems virtual memory (physical memory + swap space). Many operating systems impose limits on the amout of memory a single process can acquire to protect itself.
Jun 5, 2005
ORA-29952: cannot issue DDL on a domain index partition marked as LOADING
ORA-29902: error in executing ODCIIndexStart() routine
Fixed in 9.2.0.3.
Sounds it comes back again in 9.2.0.6 as reproduced by oracle
TESTCASE
-----------------------
Unfortunately, ctx_adm.mark_failed does not fix the problem:
.
SQL> alter index story_test_text_idx rebuild partition p1985 parameters
('resume');
alter index story_test_text_idx rebuild partition p1985 parameters ('resume')
*
ERROR at line 1:
ORA-29952: cannot issue DDL on a domain index partition marked as LOADING
.
SQL> connect ctxsys/ctxsys;
Connected.
.
SQL> begin
2 ctx_adm.mark_failed('TEST','STORY_TEST_TEXT_IDX');
3 end;
4 /
.
PL/SQL procedure successfully completed.
.
SQL> connect test/test;
Connected.
.
SQL> alter index story_test_text_idx rebuild partition p1985 parameters
('resume');
alter index story_test_text_idx rebuild partition p1985 parameters ('resume')
*
ERROR at line 1:
ORA-29952: cannot issue DDL on a domain index partition marked as LOADING