标签云
asm恢复 bbed bootstrap$ dul In Memory kcbzib_kcrsds_1 kccpb_sanity_check_2 kfed MySQL恢复 ORA-00312 ORA-00607 ORA-00704 ORA-01110 ORA-01555 ORA-01578 ORA-08103 ORA-600 2131 ORA-600 2662 ORA-600 2663 ORA-600 3020 ORA-600 4000 ORA-600 4137 ORA-600 4193 ORA-600 4194 ORA-600 16703 ORA-600 kcbzib_kcrsds_1 ORA-600 KCLCHKBLK_4 ORA-15042 ORA-15196 ORACLE 12C oracle dul ORACLE PATCH Oracle Recovery Tools oracle加密恢复 oracle勒索 oracle勒索恢复 oracle异常恢复 Oracle 恢复 ORACLE恢复 ORACLE数据库恢复 oracle 比特币 OSD-04016 YOUR FILES ARE ENCRYPTED 勒索恢复 比特币加密文章分类
- Others (2)
- 中间件 (2)
- WebLogic (2)
- 操作系统 (102)
- 数据库 (1,687)
- DB2 (22)
- MySQL (74)
- Oracle (1,549)
- Data Guard (52)
- EXADATA (8)
- GoldenGate (24)
- ORA-xxxxx (159)
- ORACLE 12C (72)
- ORACLE 18C (6)
- ORACLE 19C (15)
- ORACLE 21C (3)
- Oracle 23ai (7)
- Oracle ASM (68)
- Oracle Bug (8)
- Oracle RAC (53)
- Oracle 安全 (6)
- Oracle 开发 (28)
- Oracle 监听 (28)
- Oracle备份恢复 (566)
- Oracle安装升级 (92)
- Oracle性能优化 (62)
- 专题索引 (5)
- 勒索恢复 (80)
- PostgreSQL (18)
- PostgreSQL恢复 (6)
- SQL Server (27)
- SQL Server恢复 (8)
- TimesTen (7)
- 达梦数据库 (2)
- 生活娱乐 (2)
- 至理名言 (11)
- 虚拟化 (2)
- VMware (2)
- 软件开发 (37)
- Asp.Net (9)
- JavaScript (12)
- PHP (2)
- 小工具 (20)
-
最近发表
- 迁移awr快照数据到自定义表空间
- .hmallox加密mariadb/mysql数据库恢复
- 2025年首个故障恢复—ORA-600 kcbzib_kcrsds_1
- 第一例Oracle 21c恢复咨询
- ORA-15411: Failure groups in disk group DATA have different number of disks.
- 断电引起的ORA-08102: 未找到索引关键字, 对象号 39故障处理
- ORA-00227: corrupt block detected in control file
- 手工删除19c rac
- 解决oracle数据文件路径有回车故障
- .wstop扩展名勒索数据库恢复
- Oracle Recovery Tools工具一键解决ORA-00376 ORA-01110故障(文件offline)
- OGG-02771 Input trail file format RELEASE 19.1 is different from previous trail file form at RELEASE 11.2.
- OGG-02246 Source redo compatibility level 19.0.0 requires trail FORMAT 12.2 or higher
- GoldenGate 19安装和打patch
- dd破坏asm磁盘头恢复
- 删除asmlib磁盘导致磁盘组故障恢复
- Kylin Linux 安装19c
- ORA-600 krse_arc_complete.4
- Oracle 19c 202410补丁(RUs+OJVM)
- ntfs MFT损坏(ntfs文件系统故障)导致oracle异常恢复
分类目录归档:Oracle 开发
在sqlplus中操作blob和clob
--create directory create directory ULTLOBDIR as 'd:' --create table create table blobtest(col1 BLOB); create table clobtest(col1 cLOB); --insert BLOB declare a_blob BLOB; bfile_name BFILE := BFILENAME('ULTLOBDIR','teslob.doc'); begin insert into blobtest values (empty_blob()) returning col1 into a_blob; dbms_lob.fileopen(bfile_name); dbms_lob.loadfromfile(a_blob, bfile_name, dbms_lob.getlength(bfile_name)); dbms_lob.fileclose(bfile_name); commit; end; --update BLOB declare a_blob BLOB; bfile_name BFILE := BFILENAME('ULTLOBDIR','log.txt'); begin update blobtest set col1=empty_blob() where rownum=1 returning col1 into a_blob; dbms_lob.fileopen(bfile_name); dbms_lob.loadfromfile(a_blob, bfile_name, dbms_lob.getlength(bfile_name)); dbms_lob.fileclose(bfile_name); commit; end; --insert CLOB declare a_clob CLOB; bfile_name BFILE := BFILENAME('ULTLOBDIR','teslob.doc'); begin insert into clobtest values (empty_clob()) returning col1 into a_clob; dbms_lob.fileopen(bfile_name); dbms_lob.loadfromfile(a_clob, bfile_name, dbms_lob.getlength(bfile_name)); dbms_lob.fileclose(bfile_name); commit; end; --update CLOB declare a_clob CLOB; bfile_name BFILE := BFILENAME('ULTLOBDIR','log.txt'); begin update clobtest set col1=empty_clob() where rownum=1 returning col1 into a_clob; dbms_lob.fileopen(bfile_name); dbms_lob.loadfromfile(a_clob, bfile_name, dbms_lob.getlength(bfile_name)); dbms_lob.fileclose(bfile_name); commit; end; --查询是否成功 select dbms_lob.getlength(col1) from blobtest; select dbms_lob.getlength(col1) from clobtest;
发表在 Oracle 开发
评论关闭
pl/sql 常用语法
1、procedure
CREATE [ OR REPLACE] PROCEDURE [schema.]procedure_name [parameter_lister] {AS|IS} declaration_section BEGIN executable_section [EXCEPTION exception_section] END [procedure_name] --举例 create or replace procedure dos_fx is cursor c1 is select get from dos_gj; begin for c2 in c1 loop insert into dos_gj_1(ip,gettime,get)values(REGEXP_SUBSTR( c2.get, '(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])(\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])){3} '), REGEXP_SUBSTR( c2.get, '^(\d{4})-(\d{2})-(\d{2}) (\d{2}:\d{2}:\d{2})'),c2.get); end loop; commit; end;
2、function
CREATE [ OR REPLACE] FINCTION [schema.]function_name [parameter_list] RETURN returning_datatype {AS|IS} declaration_section BEGIN executable_section [EXCEPTION] exception_section END [procedure_name] --举例 CREATE OR REPLACE function fn_md5(input_string VARCHAR2) return varchar2 IS raw_input RAW(128) := UTL_RAW.CAST_TO_RAW(input_string); decrypted_raw RAW(2048); error_in_input_buffer_length EXCEPTION; BEGIN sys.dbms_obfuscation_toolkit.MD5(input => raw_input,checksum => decrypted_raw); return rawtohex(decrypted_raw); END;
3、package
--header CREATE [OR REPLACE] PACKAGE package_name {AS|IS} public_variable_declarations | public_type_declarations | public_exception_declarations | public_cursor_declarations | function_declarations | procedure_specifications END [package_name] --body CREATE [OR REPLACE] PACKAGE BODY package_name {AS|IS} private_variable_declarations | private_type_declarations | private_exception_declarations | private_cursor_declarations | function_declarations | procedure_specifications END [package_name] --举例 --header create or replace package pk_t1 as procedure get_num(getnum in number,aname varchar2); end pk_t1; --body create or replace package body pk_t1 as procedure get_num(getnum in number,aname varchar2) is begin insert into shell_1 values(getnum,aname); end; end pk_t1;
4、trigger
CREATE [OR REPLACE] TRIGGER trigger_name {before|after|instead of} event ON {table_or_view_name|DATABASE} [FOR EACH ROW[WHEN condition]] trigger_body --举例 create or replace trigger add_shell before update on shell_1 for each row declare begin if :OLD.name!=:new.name then :new.name:='ggggg'; end if; end;
发表在 Oracle 开发
评论关闭
ORACLE 外部表
一、简单创建外部表
1、简单模拟外部文件
10,20,30
40,50,60
70,80,90
2、创建外部表用户名和授权
create user test identified by “123” default tablespace test quota unlimited on test; grant RESOURCE,create session,create any directory to test;
3、创建目录
conn test/"123" create directory ext as '/sdb/orcl/file';
4、创建外部表
create table exttable( id number, name varchar2(10), i number ) organization external ( type oracle_loader default directory ext access parameters ( records delimited by newline fields terminated by ',' ) location('ext.dat') );
二、使用外部表管理alert文件
create directory alert as 'create directory bdump as '/oracle/u01/app/oracle/admin/db2/bdump'; create table alert_log ( text varchar2(400) ) organization external ( type oracle_loader default directory alert access parameters ( records delimited by newline ) location('alert_orcl.log') ); --查找到ora错误记录 select * from alert_log where TEXT like 'ORA-%';
发表在 Oracle 开发
评论关闭