数据库审计(create/alter/drop table、user、tablespace)
一、需求:要求审计1、创建、修改、删除表;2、创建、修改、删除用户;3、创建、修改、删除表空间;二、实现:可以理解为对表、用户表空间的ddl操作进行审计,包括:CREATE - 创建对象DROP - 删除对象ALTER - 删除对象TRUNCATE - 清除表中所有记录 三、操作步骤oracle@oracle[/home/oracle]> sqlplus / as sysdbaSQL*Plus: Release 10.2.0.1.0 - Production on Fri Mar 27 12:33:09 2009Copyright (c) 1982, 2005, Oracle. All rights reserved.Connected to:Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - ProductionW
设置sqlplus环境
在tom的《Oracle 9i & 10g编程艺术:深入数据库体系结构》中,设置sqlplus环境的方法:1、创建文件login.sql,内容如下:define _editor=viset serveroutput on size 1000000set trimspool onset long 5000set linesize 100set pagesize 9999column plan_plus_exp format a80column global_name new_value gnameset termout offdefine gname=idlecolumn global_name new_value gnameselect lower(user) || '@' || substr( global_name, 1, decode( dot, 0,length(global_name), dot-1) ) global_namefrom (select global_name, instr(
设置linux/unix的shell环境
当使用bash的时候,编辑/etc/bashrc或~/.bash_profile当使用ksh的时候,编辑~/.profile增加如下语句:PS1=`hostname`@`whoami`'[$PWD]> 'export PS1stty erase ^Hstty -istrip cs8set -o vi[@more@]
创建catalog并注册数据库
一、环境说明:1、catalog数据库sid:catalogusername:rmanpassword:rman2、备份数据库sid:orcl二、操作步骤1、在catalog数据库上创建用户oracle@oracle[/home/oracle]> export ORACLE_SID=catalogoracle@oracle[/home/oracle]> sqlplus / as sysdbaSQL*Plus: Release 10.2.0.1.0 - Production on Fri Mar 27 06:10:11 2009Copyright (c) 1982, 2005, Oracle. All rights reserved.Connected to:Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - ProductionWith the Partitioning, OLAP and Data Mining optionssy