oracle DBMS_LOCK.SLEEP()的使用
一、執行 ORACLE_HOME/rdbms/admin/dbmslock.sql 来创建 dbms_lock;-在DBA身分下grant execute on dbms_lock to USERNAME;-執行測試代碼begindbms_output.put_line(to_char(sysdate,'yyyymmddhh24miss'));dbms_lock.sleep(60);dbms_output.put_line(to_char(sysdate,'yyyymmddhh24miss'));end;--...
判断一个表空间是在备份模式的方法
select A.NAME,B.STATUS from v$datafile a , v$backup b where a.file#=b.file# and b.status = 'ACTIVE'OR SELECT A.TABLESPACE_NAME,A.FILE_NAME ,B.STATUS FROM DBA_DATA_FILES A , V$BACKUP B WHERE A.FILE_ID =B.FILE# AND B.STATUS='ACTIVE';
rman 创建catalog实验及说明
前提:请在两台机器上分别装上数据库软件,分别创建数据库,并启动数据库;本例相关说明一、主机作用说明:[Oracle@Oracle11gOcp_catalog ~]$ cat /etc/hosts# Do not remove the following line, or various programs# that require network functionality will fail.127.0.0.1 localhost.localdomai...
flashback database 恢复误删除的表空间。
转载自http://ms.itpub.net/redirect.php?fid=2&tid=1229988&goto=nextnewset 通过flashback database恢复被删除的表空间(测试案例) 网友问题:《FLASHBACK DATABASE可以恢复删除的TABLESPACE吗?》http://www.itpub.net/thread-1042099-1-1.html 重新发贴,贴测试案例过程:...
Flashback Transaction
With Flashback Transaction Query, it is possible to identify all incorrect changes that were made to table and reverse them, maintaining referential integrity. The FLASHBACK_TRANSACTION_QUERY data dictionary view contains all information needed to identify the offending transaction. The same...
基于值的审计(value-based auditing)
基于值的审计(value-based auditing)进行数据库审计时会记录审计对象中发生的插入、更新和删除操作,但是不会捕获更改的实际值。要扩展数据库审计,可使用基于值的审计,利用数据库触发器(事件驱动的PL/SQL 构造)来捕获更改的值。用户在连接了相应触发器的表中插入...
mysql 连接时通时不通解决一例
A ip:202.10.2.5 10.2.21.25 web B ip:202.10.2.6 10.2.5.3 mysqlA ping B 没有问题 因为ping的202 的公网ipA telnet 202.10.2.6 3306 时而通时而不通 分析原因总是得不到问题的答案 。后来觉得停掉A的内网ip看看 。停掉后果然连接畅通了 。telnet 202.10.2.6 3306 畅通了 。看...
Segment Transaction Slot Internals
http://www.dba-oracle.com/art_dbazine_nanda_segment_transaction_slot_internals.htmInterested Transaction List (ITL) Waits DemystifiedWhat is ITL?Ever wondered how Oracle locks rows on behalf of transactions? In some RDBMS vendor implementations, a lock manager maintains information on whi...
Oracle用户访问权限与PUBLIC角色的关系
http://www.linuxidc.com/Linux/2012-06/62060.htm在数据库中创建了一个用户,这是给第三方系统用的。客户强调,这个用户只能访问到有限的表,在我们规定的范围内的表。于是,我创建 一个用户,如user_third ,只给了connect 角色,用grant select on table 有限授权。为此,我写了一文,请见 如何实现 Oracle...
ALL, ANY and SOME Comparison Conditions in SQL
http://www.oracle-base.com/articles/misc/all-any-some-comparison-conditions-in-sql.phpIt is quite possible you could work with Oracle databases for many years and never come across the ALL, ANY and SOME comparison conditions in SQL because there are alternatives to them that are used more regula...
WITH CHECK OPTION 详解
WITH CHECK OPTION Specify WITH CHECK OPTION to indicate that Oracle Database prohibits any changes to the table or view that would produce rows that are not included in the subquery. When used in the subquery of a DML statement, you can specify this clause in a subquery in the FROM clause bu...
Oracle 闪回特性(FLASHBACK DROP & RECYCLEBIN)
http://www.xue5.com/Data/Oracle/585388.htmlFLASHBACK DROP 特性允许在不丢失任何数据库的情况下将指定的表恢复至其被删除的时间点,并保持数据库为当前状态。闪回删除并不是真正的删除表,而是把该表重命名并放入回收站,类似于Windows的回收站一样。当某个活动对象需要使用该表所占用的空间时,该表才会被真正...
Merge into 详细介绍l
http://www.cnblogs.com/linbaoji/archive/2009/08/04/1538140.html\/*Merge into 详细介绍MERGE语句是Oracle9i新增的语法,用来合并UPDATE和INSERT语句。通过MERGE语句,根据一张表或子查询的连接条件对另外一张表进行查询,连接条件匹配上的进行UPDATE,无法匹配的执行INSERT。这个语法仅需要一次全表扫描就完成了...
Oracle INTERVAL DAY TO SECOND数据类型
INTERVAL DAY TO SECOND数据类型 Oracle语法: INTERVAL '{ integer | integer time_expr | time_expr }' { { DAY | HOUR | MINUTE } [ ( leading_precision ) ] | SECOND [ ( leading_precision [, fractional_seconds_precision ] ) ] } [ TO { DAY | HOUR | MINUTE | SECOND [ (fractiona...
Enabling and disabling Oracle Constraints
Enabling and disabling Oracle constraints can be accomplished by usingDrop constraint commandDisable constraint commandConstraints specified in the enable and disable clauses of a CREATETABLE statement must be defined in the statement.Enabling and disabling Oracle constraints ca...
Oracle/PLSQL: Grant/Revoke Privileges
Oracle/PLSQL: Grant/Revoke PrivilegesLearn how to grant and revoke privileges in Oracle with syntax and examples. DescriptionYou can GRANT and REVOKE privileges on various database objects in Oracle. We'll first look at how to grant and revoke privileges on tables and then how ...
ORACLE WITH CHECK OPTION子句详解
今天一个朋友在问关于创建视图时候WITH CHECK OPTION是什么意思,我当时也没多想,就比较笼统的回答了一下。后来自己想了想,好像自己也记不太清楚了,脑子里只有个大概的印象。好了话不多说,下面还是通过实验来看一下吧。C:/Documents and Settings/Admin>sqlplus /nologSQL*Plus: Release 10....
Oracle INTERVAL DAY TO SECOND数据类型
http://leeldy.blog.163.com/blog/static/1398530620107172249285/INTERVAL DAY TO SECOND数据类型 Oracle语法: INTERVAL '{ integer | integer time_expr | time_expr }' { { DAY | HOUR | MINUTE } [ ( leading_precision ) ] | SECOND [ ( leading_precision [, fractional_seconds_precision...
pivoting insert等
http://hi.baidu.com/noyes_dk/item/55ffa05259b1a8a2acc857a9Use the following types of multitable inserts?Unconditional INSERT?Pivoting INSERT?Conditional ALL INSERT?Conditional FIRST INSERT:) Create and use external tables:) Name the index at the time of creating a primary key constraintun...
rman 删除日志的几有用的命令
http://www.itpub.net/thread-729956-1-1.htmlbackup format '/backup/dmp/dbf_%d_%T_%s_%p' ARCHIVELOG UNTIL TIME '(SYSDATE - 4)' ;delete archivelog until time '(SYSDATE - 4)';run{allocate channel c1 type disk format '/backup/dmp/%T_%U.bak' maxpiecesize = 2000M;backup ARCHIVELOG UNTIL TIME '(SYS...