oracle 增加ip访问限制
在sqlnet.ora中增加如下部分 oracle11g
-----------------------------
tcp.validnode_checking=yes
#允许访问的IP
tcp.invited_nodes=(ip1,ip2……)
#禁止访问的IP
tcp.excluded_nodes=(ip1,ip2……)
之后重新启动监听器即可
我oracle的安装目录 修改sqlnet.ora文件
eg:
# sqlnet.ora Network Configuration File: D:\app\Administrator\product\11.2.0\dbhome_1\NETWORK\ADMIN\sqlnet.ora
SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
#skate modify
tcp.validnode_checking=yes
tcp.invited_nodes=(192.168.0.103)
tcp.excluded_nodes=(192.168.0.10)
oracle客户端连接监听器配置
在tnsnames.ora中增加如下部分 oracle11g
# tnsnames.ora Network Configuration File: D:\app\Administrator\product\11.2.0\dbhome_1\NETWORK\ADMIN\tnsnames.ora
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.1)(PORT = 1521)) oracle服务器ip地址与端口
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)--服务名称
)
)
使用ORACLE 正则表达式
元字符
|
含义
|
例子
|
\
|
转义符,匹配特殊字符
|
\n,匹配换行符
\\,匹配反斜线“
\”
\(,匹配左括号“
(”
\),匹配右括号“
)”
|
^
|
匹配字符串开头位置
|
^A,匹配以
A打头字符
|
$
|
匹配字符串结尾位置
|
A$,匹配以
A结尾字符
|
*
|
匹配前面字符
0次或是多次
|
ab*c,可以匹配
ac、abc、abbc等等
|
+
|
匹配前面字符
1次或是多次
|
ab+c,可以匹配
abc、abbc、abbbc等等
|
?
|
匹配前面字符
0次或1次
|
ab?c,可以匹配
ac、abc
|
{n}
|
匹配一个字符
n次,n为整数
|
ab{2}c,可以匹配
abbc
|
{n,m}
|
匹配一个字符至少
n次,最多m次
|
ab{2,3}c,可以匹配
abbc、abbbc
|
(pattern)
|
匹配指定模式的一个子表达式
|
ab(a|b),可以匹配
aba、abb
|
x|y
|
匹配
x或y
|
ab|cd,可以匹配
ab、cd
|
[:alphanum:]
|
匹配字母、数字
|
可以匹配字符
0-9、A-Z和a-z
|
[:alpha:]
|
匹配字母
|
可以匹配字符
A-Z和a-z
|
[:blank:]
|
匹配空格或
tab键
|
|
[:digit:]
|
匹配数字
0-9
|
|
[:graph:]
|
匹配非空字符
|
|
[:lower:]
|
匹配小写字母
a-z
|
|
[:upper:]
|
匹配大写字母
A-Z
|
|
[:xdigit:]
|
匹配十六进制数字
0-9、A-F和a-f
|
|
[:punct:]
|
匹配标点符号
.,”等等
|
|
[:space:]
|
匹配所有的空格符
|
|
select empno,empname from emp where regexp_like(empno,'^[[:digibcdef:]]{8}$');
select empno,empname from emp where regexp_like(empname,'^[[:aphm:]]+M$');
update emp set empname=regexp_replace(empname, '[^[:alphabbh:]]', 'B')
select username from v$session;
select name from v$database;
SELECT machine , terminal FROM V$SESSION;
select username from v$session;
select tablespace_name from user_tables where table_name='TEST';
create table new_table as (select * from old_table);
insert into a values (translate ('at{&}t','at{}','at'));
exp 用户/密码 tables=(表1,…,表2)
exp system/manager owner=(用户1,用户2,…,用户n) file=导出文件
v$database,v$datafile,v$logfile v$controlfile v$parameter;
SQL>@path\filename.sql;
SELECT * FROM TABLE_NAME WHERE ROWID!=(SELECT MAX(ROWID) FROM
TABLE_NAME D WHERE TABLE_NAME.COL1=D.COL1 AND TABLE_NAME.COL2=D.COL2);
DELETE FROM TABLE_NAME WHERE ROWID!=(SELECT MAX(ROWID) FROM
TABLE_NAME D WHERE TABLE_NAME.COL1=D.COL1 AND TABLE_NAME.COL2=D.COL2);
select segment_name,count(*) from dba_extents where
segment_type='INDEX' and owner='&owner' group by segment_name;
SELECT osuser, username, sql_text from v$session a,
v$sqltext b where a.sql_address =b.address order by address, piece;
SELECT /*+INDEX(BSEMPMS SEX_INDEX) USE SEX_INDEX BECAUSE
THERE ARE FEWMALE BSEMPMS */ FROM BSEMPMS WHERE SEX='M';
SELECT /*+INDEX_ASC(BSEMPMS PK_BSEMPMS) */ FROM BSEMPMS WHERE DPT_NO='CCBZZP';