101
create type body type_map as map member function con return real is begin return tsal + tcomm; end;end;create table t_type_map of type_map;ins...
100
二:开窗函数 开窗函数指定了分析函数工作的数据窗口大小,这个数据窗口大小可能会随着行的变化而变化,举例如下:1...
99
--查看表空间使用率select used_percent from dba_tablespace_usage_metrics where tablespace_name = 'system';declare type t_cur_test_n is table of varchar2(20); t_tab t_cur_test_n := t_cur_te...
98
select name from t1 minus select name from t2 ; -- 差select name from t1 intersect select name from t2 ;-- 交select * from t1,t2 where t1.name = t2.name;1. 字符集为gbk时,数据类型为varch...
97
create table tt(A1 CHAR(2) , A2 VARCHAR2(2)) ;INSERT INTO TT VALUES('A','A') ;insert into tt values('A','A ') ;COMMIT ;select rowid,a1,a2 from tt;select length(a1),length(a2) from tt;select rowid,a1,a...
96
-- rmanSQL> show parameter db_recovery-- 查看快闪区,rman自动备份恢复需要的目录select * from v$recovery_file_dest;--修改快闪区alter system set db_recovery_file_size = 4G;如果空间不足,有三种方法:1.修...
95
-- 使用绑定变量1.打开时间显示SQL> set timing on ;2.语句绑定变量select * from trans_table t where t.id = &id;3.语句块SQL> create table D ( id varchar(10));绑定前declare i &...
94
2.查看保持池大小SQL> show parameter keep;NAME  ...
93
7、执行脚本: sqlplus / as sysdba@?/rdbms/admin/catalog;@?/rdbms/admin/catproc;@?/rdbms/admin/catblock;@?/rdbms/admin/catoctk;@?/rdbms/admin/owminst.plb;sqlplus system@?/sqlplus/admin/pupbld.sql...
92
5、生成spfile文件,并启动到nomount状态:sqlplus / as sysdbacreate spfile from pfile;startup nomount;6、创建数据库:CREATE DATABASE orcl USER SYS IDENTIFIED BY oracle USER SYST...
91
-- oracle 10G 手工创建数据库1、设置实例名:修改/home/oracle/.bash_profile文件,添加下列这行内容。export ORACLE_SID=orcl修改之后使用命令source /home/oracle/.bash_profile让它生效。2、创建相关目录:mkdir...
90
介绍下oracle的RAC、集群、双机热备、Dataguard1、RAC就是集群,改变了过去一个实例连接数据库磁阵的处理模式,而是采用多个ORacle实例连接数据库磁阵,各个ORacle实例进行负载均衡,当某个实例down掉,其他实例像备...
89
-- 下面2个语句都是有时间限制的,一般是900秒内,可以修改参数SQL> show parameter undo;alter system set undo_retention=1200;select id, name, versions_operation, versions_starttime, versions_endtime ...
88
2、dropcreate table flash_table_drop(id int,name varchar2(32));select * from flash_table_drop t;insert into flash_table_drop values(1,'aaa');insert into flash_table_drop values(2,'bbb');insert into fl...
87
-- oracle闪回 flashback1、deletecreate table flash_table_del(id int,name varchar2(32));select * from flash_table_del t;insert into flash_table_del values(1,'aaa');insert into flash_table_del values(2,...
86
2、执行文件cmd-sqlplus /nolog-SQL> @D:\appdata\dataport\call.sql在该目下下就生成ldr_test.csv文件,并包含表中数据spool本身其实没有啥难的 ,就是set参数的个数太太多啦!!!下面就是我网上Copy的,当然有一...
85
SQL Loadera.固定格式加载数据1、建表create table user21(userid number,username varchar2(10),userage number,usermail varchar2(20));select * from user21;2、建excel,写数据,列数和表对应,保存为.csv3、建c...
84
-- 数据泵1.先建一个外部目录,在需要导出的用户下create or replace directory MYPORT as 'D:\appdata\dataport';2.system授权grant read,write on directory myport to smstest;3.进入BIn目录cmd——d:-cd D...
83
bfilecreate table bfile_table(id number primary key, bfi...
82
临时表分为:事务临时表delete(commit后就没数据) 会话临时表PRESERVE(断开session后没数据)事务:CREATE GLOBAL TEMPORARY TABLE t_g_tmp_...