有关数据库中庞大数据量查询的问题!

有关数据库中庞大数据量查询的问题!,第1张

遍历一遍?你是搞c的吧?

晕死,搞数据库的和搞c的果然有一道鸿沟,语言说不到一起去,如果是你要求的目的,其实很简单

首先,索引是必须的,这可以减少大量的查询时间,至于是否重复,各个数据库有不同的语法,这里只说通用写法,而不说个别数据库的专用写法

比如说有一张表users,里面存了所有人的人员信息,其中,姓名,性别,年龄,出身时间几个字段不能完全相同,最简单的方法就是将这几个字段设为唯一索引,好处是如果出现重复会自动停止报错,坏处是如果你有大量 *** 作的话,可能会因为报错,整个作业都停下来

第二种方法,将这几个字段拼起来进行存在性判断,将不存在的插入

比如将user1的数据插入user2,且都有主键user_id,最简单的防止重复手段是

insert into user2 select from user1 where user_id not in (select user_id from user2)

这种解决办法的写法很多,但是大多数属于专用的,不是所有数据库都能用的,比如 insert into user2 select from user1 except select from user2

这是很少有数据库能用的专用语句

当然,这种写法虽然通用,性能不是如何好

第三种是比较特殊的,需要写过很长时间语句的人才能写出来,为什么这么写我很难解释清楚,但是性能提高很多,这里举个例子。

insert into user2

select a from user1 a left join user2 b on auser_id=buser_id

where buser_id is null

access数据库本身不提供加密,加密过程受控于网站的asp代码,你没有代码就不知道怎么加的密,不过大量网站都是用md5加密的,随便找个软件就能破解了。不过md5是单向散列算法(不明白就算了),也就是说,你只能靠枚举来破解密码,不要指望能通过算法解密出来

MD5加密算法

单向不可逆的算法

用MD5加密的方式是把用户的密码通过MD5加密后存储在数据库里,验证的时候只要把用户输入的密码用MD5加密以后与数据库里面的比较,一样就是正确的密码。

如果你密码忘了的话,把数据库里保存的MD5那段改成 202cb962ac59075b964b07152d234b70 ,然后用密码123登录。

因为123用MD5加密之后就是202cb962ac59075b964b07152d234b70,然后你再在你的修改密码中改成其他的。

在oracle11g中,数据库的审计功能是默认开启的(这和oracle10g的不一样,10g默认是关闭的),

oracle11gr2的官方文档上写的是错的,当上说default是none,而且是审计到db级别的,这样就会

往aud$表里记录统计信息。

1如果审计不是必须的,可以关掉审计功能;

sql>

show

parameter

audit_trail;

name

type

value

------------------------------------

-----------

------------------------------

audit_trail

string

db

sql>

alter

system

set

audit_trail=none

scope=spfile;

sql>

shut

immediate;

sql>startup

2删除已有的审计信息

可以直接truncate表aud$,

truncate

table

sysaud$;

3或者将aud$表移到另外一个表空间下,以减少system表空间的压力和被撑爆的风险。

附:11g中有关audit_trail参数的设置说明:

audit_trail

property

description

parameter

type

string

syntax

audit_trail

=

{

none

|

os

|

db

[,

extended]

|

xml

[,

extended]

}

default

value

none

modifiable

no

basic

no

audit_trail

enables

or

disables

database

auditing

values:

none

disables

standard

auditing

this

value

is

the

default

if

the

audit_trail

parameter

was

not

set

in

the

initialization

parameter

file

or

if

you

created

the

database

using

a

method

other

than

database

configuration

assistant

if

you

created

the

database

using

database

configuration

assistant,

then

the

default

is

db

os

directs

all

audit

records

to

an

operating

system

file

oracle

recommends

that

you

use

the

os

setting,

particularly

if

you

are

using

an

ultra-secure

database

configuration

db

directs

audit

records

to

the

database

audit

trail

(the

sysaud$

table),

except

for

records

that

are

always

written

to

the

operating

system

audit

trail

use

this

setting

for

a

general

database

for

manageability

if

the

database

was

started

in

read-only

mode

with

audit_trail

set

to

db,

then

oracle

database

internally

sets

audit_trail

to

os

check

the

alert

log

for

details

db,

extended

performs

all

actions

of

audit_trail=db,

and

also

populates

the

sql

bind

and

sql

text

clob-type

columns

of

the

sysaud$

table,

when

available

these

two

columns

are

populated

only

when

this

parameter

is

specified

if

the

database

was

started

in

read-only

mode

with

audit_trail

set

to

db,

extended,

then

oracle

database

internally

sets

audit_trail

to

os

check

the

alert

log

for

details

xml

writes

to

the

operating

system

audit

record

file

in

xml

format

records

all

elements

of

the

auditrecord

node

except

sql_text

and

sql_bind

to

the

operating

system

xml

audit

file

xml,

extended

performs

all

actions

of

audit_trail=xml,

and

populates

the

sql

bind

and

sql

text

clob-type

columns

of

the

sysaud$

table,

wherever

possible

these

columns

are

populated

only

when

this

parameter

is

specified

you

can

use

the

sql

audit

statement

to

set

auditing

options

regardless

of

the

setting

of

this

parameter

你熟悉except这个单词吗except表示除了在句子中它可作为多种词性使用,下面是整理的except的用法总结大全,希望大家喜欢。

except的释义

prep除……之外

conj只是;除非;除……之外;要不是由于

v不计,把除外;反对

except相关短语

except gate[计]禁止门;除外闸;最佳能见度;翻译

except buses公车除外

EXCEPT BENTLEY 哪个区是;最安全的

Except daggers 有匕首除外

except annotation 包名必须在第一行

full except 除了全

except DIN 除了丁

Except jade除非是玉石

Except ShowMessage 数据库打开失败

except词语辨析

except,besides,except forexcept 除了(不包括在内),

besides 除了还(包括在内)

except for 整体除了某一点以外The composition is good except for a few spelling mistakes

except拥法总结

一except用作动词

1except用作及物动词时的基本意思是“把除外”。引申可指“免除”,一般接人作宾语,且通常用于否定结构。

You will be punished,I can except no one

你们都得受到惩罚,我不放过任何人。

All the students are late, not excepting John

所有学生都迟到了,约翰也不例外。

2except与介词to或against连用,意为“反对…”;与介词for连用表示“不包括在之内”。

二except用作介词

1except用作介词可表示“除之外”,通常指所排除的事物不在所述范围之内,后面可接名词或代词。

2except可接反身代词、副词、介词短语或状语从句,也可接(省略to的)动词不定式、动名词、基数词,还可接that或wh-从句。

I like her except when she is angry

我喜欢她,只要她不发脾气。

He could do little except write

他除了会写之外,其他什么都不行。

三except用作连词

except用作连词表示除非,除了…之外,若不是。

I would go,except it's too far我想去,只是太远了。

They didn't open their mouths except to complain除了抱怨他们从不开口

办法有好几个,这里说两个:

1、直接复制粘贴法,如果你的两个表再同一数据库中,直接复制粘贴就行了,先把那个空表删除,再粘贴那个有数据的表,粘贴命令之后,ACCESS会提示你给粘贴后表取名的。如果两个表不在一个数据库中,那就得打开两个数据库,有时候ACCESS不让你同时打开两个ACCESS,但反复多打开几次就可以打开了。打开之后,再进行复制粘贴 *** 作。

2、如果说这种 *** 作是经常的,也就是要提供给软件用户 *** 作的,那就只有通过DELPHI代码来实现了。

用代码进行复制,可以直接用SQL命令进行表的复制和粘贴。但具体的SQL命令,我不太清楚。

就按你说用ADO组件来进行复制

首先确定一个数据库还是两个,如果两个表在同一数据库中,这样只要一个数据库连接组件TADOConnection就行了,如果两个表是在不同的数据库中,那最好用两个TADOConnection连接组件。一个用于连接A数据库,另一个用连接B数据库。

再放两个TADODataSet组件,我习惯使用ADODataSet组件,根本不用TADOQuery和TADOTable因为ADODataSet兼有这两个组件的全部功能。放好这四个组件后,再做好连接的设置。

然后写代码:

以上就是关于有关数据库中庞大数据量查询的问题!全部的内容,包括:有关数据库中庞大数据量查询的问题!、请问Access数据库里面的一些密码是用什么方式加密的、oracle数据库的审计功能等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/sjk/9284073.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-04-26
下一篇2023-04-26

发表评论

登录后才能评论

评论列表(0条)

    保存