create table ware_retail_part --创建一个描述商品零售的数据表 ( id integer primary key,--销售编号 retail_date date,--销售日期 ware_name )--商品名称 ) partition by range(retail_date) ( --2011年第一个季度为part_01分区 partition par_01 values less than(to_date('2011-04-01','yyyy-mm-dd'))…
create procedure pro_insertDept is begin ,'市场拓展部','JILIN'); --插入数据记录 commit; --提交数据 dbms_output.put_line('插入新记录成功!'); --提示插入记录成功 end pro_insertDept; / create or replace procedure pro_insertDept is begin ,'市场拓展部','BEIJING'); --插入数据记录 commit; --提交数据 db…
run{ allocate channel ch_1 device type disk format = 'd:\oraclebf\%u_%c.bak'; backup tablespace system,users,tbsp_1,ts_1 channel ch_1; } --在SQL*Plus环境下 connect system/1qaz2wsx create tablespace rman_tbsp datafile 'D:\OracleFiles\Recover\rman_tbsp.dbf…
set serveroutput on declare a ; b ; c number; begin c:=(a+b)/(a-b); dbms_output.put_line(c); exception when zero_divide then dbms_output.put_line('除数不许为零!'); end; / set serveroutput on declare var_ename emp.ename%type; --声明与ename列类型相同的变量 var_job emp.…
alter system set db_recovery_file_dest_size=4g scope=both; connect system/1qaz2wsx as sysdba; archive log list; shutdown immediate; startup mount; alter database archivelog; ; alter database flashback on; alter database open; archive log list; connec…
create directory dump_dir as 'd:\dump'; grant read,write on directory dump_dir to scott; --在cmd下 expdp scott/1qaz2wsx directory=dump_dir dumpfile=tab.dmp tables=emp,dept expdp system/1qaz2wsx directory = dump_dir dumpfile=schema.dmp schemas = scott,h…
create or replace procedure trun_table(table_deleted in varchar2) as --创建一个存储过程,传入一个表示表名称的参数,实现清空指定的表 cur_name integer;--定义内部变量,存储打开的游标 begin cur_name := dbms_sql.open_cursor;--打开游标 dbms_sql.parse(cur_name,'truncate table'||table_deleted ||'drop stor…
--修改 alter system set large_pool_size=64m; --显示 show parameter large_pool_size; select sum(getmisses) 不命中数 from v$rowcache;…
create user mr identified by mrsoft default tablespace users temporary tablespace temp; create user east identified by mrsoft default tablespace users temporary tablespace temp quota 10m on tbsp_1; create user df identified by mrsoft default tablespa…
create index emp_deptno_index on emp(deptno) pctfree tablespace users; create bitmap index emp_salary_bmp on employees(salary) tablespace users; connect scott/1qaz2wsx create index emp_job_reverse on emp(job) reverse tablespace users; create index em…