Oracle数据库常用操作

编程

第一步 命令su - oracle

要启动必须先切换到oracle用户下

第二步,进入sqlplus命令行

sqlplus / as sysdba

第三步,启动数据库实例

startup;

数据库会正常启动完成

第四步,退出sqlplus命令行,回到直接的操作系统命令行

exit;

第五步,启动数据库监听

lsnrctl start

Oracle数据库扫表查询-SQL查询字符串在库中哪张表哪个字段

DECLARE  

CURSOR cur_query IS  

 SELECT table_name, column_name, data_type FROM user_tab_columns;  

a NUMBER;  

sql_hard VARCHAR2(2000);  

vv NUMBER;  

BEGIN  

FOR rec1 IN cur_query LOOP  

a:=0;  

IF rec1.data_type ="VARCHAR2"OR rec1.data_type="CHAR" THEN  

a := 1;  

END IF;  

IF a>0 THEN  

sql_hard := "";  

sql_hard := "SELECT count(*) FROM "|| rec1.table_name ||" where "  

||rec1.column_name|| " like""1001A110000000000MXQ""";

 --dbms_output.put_line(sql_hard);

EXECUTE IMMEDIATE sql_hard INTO vv;  

IF vv > 0 THEN dbms_output.put_line("[字段值所在的表.字段]:["||rec1.table_name||"].["||rec1.column_name||"]");  

END IF;  

END IF;  

END LOOP;  

END;

NC建库脚本

create tablespace NNC_DATA01 DATAFILE "D:appAdministratororadataSTPS

nc_data01.dbf" size 3000M AUTOEXTEND ON NEXT 50M EXTENT MANAGEMENT LOCAL UNIFORM SIZE 256K;

ALTER TABLESPACE NNC_DATA01 DATAFILE "D:appAdministratororadataSTPS

nc_data01_01.dbf" size 2500M AUTOEXTEND ON NEXT 50M EXTENT MAXSIZE UNLIMITED;

create tablespace NNC_INDEX01 DATAFILE "D:appAdministratororadataSTPS

nc_INDEX01.dbf" size 3000M AUTOEXTEND ON NEXT 50M EXTENT MANAGEMENT LOCAL UNIFORM SIZE 128K;

ALTER TABLESPACE NNC_INDEX01 DATAFILE "D:appAdministratororadataSTPS

nc_INDEX01_01.dbf" size 2500M AUTOEXTEND ON NEXT 50M EXTENT MANAGEMENT LOCAL UNIFORM SIZE 128K;

CREATE USER CSWM IDENTIFIED BY CSWM DEFAULT TABLESPACE NNC_DATA01 TEMPORARY TABLESPACE temp;

数据泵导入导出

D:appwangmoproduct11.2.0dbhome_1BINexpdp twentynine/1@orcl schemas=twentynine dumpfile=20200617.dmp logfile=20200617.log

D:appwangmoproduct11.2.0dbhome_1BINimpdp twentynine/1 dumpfile=NCCKF20200629.DUMP remap_schema=NCCKF:twentynine

wangmob@yonyou.com

用友网络科技有限公司四川分公司

以上是 Oracle数据库常用操作 的全部内容, 来源链接: utcz.com/z/517953.html

回到顶部