电脑知识|欧美黑人一区二区三区|软件|欧美黑人一级爽快片淫片高清|系统|欧美黑人狂野猛交老妇|数据库|服务器|编程开发|网络运营|知识问答|技术教程文章 - 好吧啦网

您的位置:首頁技術(shù)文章
文章詳情頁

講解Oracle數(shù)據(jù)庫的sysdba權(quán)限登錄問題

瀏覽:220日期:2023-11-29 10:41:51
sysdba權(quán)限的登錄測試:

數(shù)據(jù)庫用sysdba登錄的驗證有兩種方式,一種是通過os認證,一種是通過密碼文件驗證;登錄方式有兩種,一種是在數(shù)據(jù)庫主機直接登錄(用os認證的方式),一種是通過網(wǎng)絡(luò)遠程登錄;需要設(shè)置的參數(shù)有兩個,一個是SQLNET.AUTHENTICATION_SERVICES,一個是REMOTE_LOGIN_PASSWORDFILE。

os認證:假如啟用了os認證,以sysdba登錄,那么只需要使用oracle軟件的安裝用戶就能登錄:sqlplus “/ as sysdba”。如果我們要禁用os認證,只利用密碼文件登錄,我們首先要有一個密碼文件:

D:oracleora92database>orapwd file=PWDoralocal.ora password=mypassword entries=10;

D:oracleora92database>

然后我們要把$ORACLE_HOME/network/admin/sqlnet.ora中設(shè)置:

SQLNET.AUTHENTICATION_SERVICES= none

大家需要注意,密碼文件只在數(shù)據(jù)庫啟動的時候加載進去,一旦加載進去,密碼文件就脫離了oracle管理,所以在你使用orapwd新建密碼文件后,里面指定的密碼需要在數(shù)據(jù)重啟后才能發(fā)生作用:

D:oracleora92database>sqlplus 'sys/mypassword as sysdba'

SQL*Plus: Release 9.2.0.1.0 - Production on Fri May 16 21:59:42 2008

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

ERROR:

ORA-01031: insufficient privileges

Enter user-name:

ERROR:

ORA-01017: invalid username/password; logon denied

Enter user-name:

ERROR:

ORA-01017: invalid username/password; logon denied

SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus

### 這里我們通過改SQLNET.AUTHENTICATION_SERVICES= (NTS)用os認證登錄數(shù)據(jù)庫:

sys@ORALOCAL(192.168.50.29)> shutdown immediate;

Database closed.

Database dismounted.

ORACLE instance shut down.

sys@ORALOCAL(192.168.50.29)>

sys@ORALOCAL(192.168.50.29)>

sys@ORALOCAL(192.168.50.29)>

sys@ORALOCAL(192.168.50.29)> startup

ORACLE instance started.

Total System Global Area 135338868 bytes

Fixed Size 453492 bytes

Variable Size 109051904 bytes

Database Buffers 25165824 bytes

Redo Buffers 667648 bytes

Database mounted.

Database opened.

sys@ORALOCAL(192.168.50.29)>

sys@ORALOCAL(192.168.50.29)>

sys@ORALOCAL(192.168.50.29)>

sys@ORALOCAL(192.168.50.29)> exit

Disconnected from Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production

With the Partitioning, OLAP and Oracle Data Mining options

JServer Release 9.2.0.1.0 - Production

D:oracleora92database>

D:oracleora92database>

D:oracleora92database>

### 我們把SQLNET.AUTHENTICATION_SERVICES= (NTS)改回去。

D:oracleora92database>sqlplus '/ as sysdba'

SQL*Plus: Release 9.2.0.1.0 - Production on Fri May 16 22:03:59 2008

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

ERROR:

ORA-01031: insufficient privileges

Enter user-name:

ERROR:

ORA-01017: invalid username/password; logon denied

Enter user-name:

ERROR:

ORA-01017: invalid username/password; logon denied

SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus

D:oracleora92database>

D:oracleora92database>

D:oracleora92database>

D:oracleora92database>sqlplus 'sys/mypassword as sysdba'

SQL*Plus: Release 9.2.0.1.0 - Production on Fri May 16 22:04:07 2008

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

Connected to:

Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production

With the Partitioning, OLAP and Oracle Data Mining options

JServer Release 9.2.0.1.0 - Production

sys@ORALOCAL(192.168.50.29)> exit

在這里,我們看到這個新改的密碼要數(shù)據(jù)庫重啟后加載才生效。同時我們看到,用os認證是無法登錄的,但是通過網(wǎng)絡(luò)(用@sid)是可以登錄。

D:oracleora92database>sqlplus '/ as sysdba'

SQL*Plus: Release 9.2.0.1.0 - Production on Sat May 17 00:58:32 2008

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

ERROR:

ORA-01031: insufficient privileges

Enter user-name:

ERROR:

ORA-01017: invalid username/password; logon denied

Enter user-name:

ERROR:

ORA-01017: invalid username/password; logon denied

SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus

D:oracleora92database>

D:oracleora92database>sqlplus 'sys/mypassword as sysdba'

SQL*Plus: Release 9.2.0.1.0 - Production on Sat May 17 00:59:15 2008

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

Connected to:

Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production

With the Partitioning, OLAP and Oracle Data Mining options

JServer Release 9.2.0.1.0 - Production

sys@ORALOCAL(192.168.50.29)>

sys@ORALOCAL(192.168.50.29)>

sys@ORALOCAL(192.168.50.29)> exit

Disconnected from Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production

With the Partitioning, OLAP and Oracle Data Mining options

JServer Release 9.2.0.1.0 - Production

D:oracleora92database>sqlplus 'sys/mypassword@oralocal as sysdba'

SQL*Plus: Release 9.2.0.1.0 - Production on Sat May 17 00:59:38 2008

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

Connected to:

Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production

With the Partitioning, OLAP and Oracle Data Mining options

JServer Release 9.2.0.1.0 - Production

sys@ORALOCAL(192.168.50.29)>

至此,我們已經(jīng)實現(xiàn)不用os認證(sqlplus “/ as sysdba”的方式登錄不了)。那么我們怎么限制網(wǎng)絡(luò)方面利用sysdba遠程登錄呢?我們可以設(shè)置初始化文件中的REMOTE_LOGIN_PASSWORDFILE=none。

注意,當(dāng)REMOTE_LOGIN_PASSWORDFILE=none時,這個參數(shù)生效需要重啟數(shù)據(jù)庫,并且,一旦啟用這個參數(shù),將使用操作系統(tǒng)認證,不使用口令文件。因此如果REMOTE_LOGIN_PASSWORDFILE=none且SQLNET.AUTHENTICATION_SERVICES= none這個時候數(shù)據(jù)庫是無法登錄的。

[coolcode lang=”sql” linenum=”off”]

D:oracleora92database>sqlplus “sys/change_on_install as sysdba”

SQL*Plus: Release 9.2.0.1.0 - Production on Sat May 17 01:28:58 2008

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

Connected to:

Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production

With the Partitioning, OLAP and Oracle Data Mining options

JServer Release 9.2.0.1.0 - Production

sys@ORALOCAL(192.168.50.29)> show parameter remote_login

NAME TYPE VALUE

———————————— ———– ——————————

remote_login_passwordfile string EXCLUSIVE

sys@ORALOCAL(192.168.50.29)> alter system set remote_login_passwordfile=none scope=spfile;

System altered.

Elapsed: 00:00:00.01

sys@ORALOCAL(192.168.50.29)> shutdown immediate;

Database closed.

Database dismounted.

ORACLE instance shut down.

sys@ORALOCAL(192.168.50.29)> startup

ORA-01031: insufficient privileges

sys@ORALOCAL(192.168.50.29)>exit

C:Documents and SettingsAdministrator>sqlplus “/ as sysdba”

SQL*Plus: Release 9.2.0.1.0 - Production on Sat May 17 08:26:43 2008

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

ERROR:

ORA-01031: insufficient privileges

Enter user-name:

ERROR:

ORA-01017: invalid username/password; logon denied

Enter user-name:

ERROR:

ORA-01017: invalid username/password; logon denied

SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus

C:Documents and SettingsAdministrator>sqlplus “sys/change_on_install as sysdba”

SQL*Plus: Release 9.2.0.1.0 - Production on Sat May 17 08:26:53 2008

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

ERROR:

ORA-01017: invalid username/password; logon denied

Enter user-name:

ERROR:

ORA-01017: invalid username/password; logon denied

Enter user-name:

ERROR:

ORA-01017: invalid username/password; logon denied

SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus

C:Documents and SettingsAdministrator>

C:Documents and SettingsAdministrator>sqlplus “sys/change_on_install@oralocal as sysdba”

SQL*Plus: Release 9.2.0.1.0 - Production on Sat May 17 08:27:03 2008

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

ERROR:

ORA-01017: invalid username/password; logon denied

Enter user-name:

ERROR:

ORA-01017: invalid username/password; logon denied

Enter user-name:

ERROR:

ORA-01017: invalid username/password; logon denied

SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus

C:Documents and SettingsAdministrator>

[coolcode]

這里我們看到由于啟用了REMOTE_LOGIN_PASSWORDFILE=none,使用os認證,不用密碼文件認證,必須將SQLNET.AUTHENTICATION_SERVICES= none取消,不然是無法登錄。我們改成SQLNET.AUTHENTICATION_SERVICES= (NTS)后再次測試。

[coolcode lang=”sql” linenum=”off”]

### 非oracle軟件安裝軟件用戶:###

C:Documents and Settingshejianmin>sqlplus “/ as sysdba”

SQL*Plus: Release 9.2.0.1.0 - Production on Sat May 17 20:15:13 2008

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

ERROR:

ORA-01031: insufficient privileges

Enter user-name:

ERROR:

ORA-01017: invalid username/password; logon denied

Enter user-name:

ERROR:

ORA-01017: invalid username/password; logon denied

SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus

C:Documents and Settingshejianmin>

C:Documents and Settingshejianmin>sqlplus “sys/change_on_install as sysdba”

SQL*Plus: Release 9.2.0.1.0 - Production on Sat May 17 20:15:30 2008

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

ERROR:

ORA-01031: insufficient privileges

Enter user-name:

ERROR:

ORA-01017: invalid username/password; logon denied

Enter user-name:

ERROR:

ORA-01017: invalid username/password; logon denied

SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus

C:Documents and Settingshejianmin>

C:Documents and Settingshejianmin>sqlplus “sys/change_on_install@oralocal as sysdba”

SQL*Plus: Release 9.2.0.1.0 - Production on Sat May 17 20:15:42 2008

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

ERROR:

ORA-01031: insufficient privileges

Enter user-name:

ERROR:

ORA-01017: invalid username/password; logon denied

Enter user-name:

ERROR:

ORA-01017: invalid username/password; logon denied

SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus

C:Documents and Settingshejianmin>

### oracle 軟件安裝用戶 ####

C:Documents and SettingsAdministrator>sqlplus “/ as sysdba”

SQL*Plus: Release 9.2.0.1.0 - Production on 星期六 5月 17 20:19:13 2008

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

連接到:

Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production

With the Partitioning, OLAP and Oracle Data Mining options

JServer Release 9.2.0.1.0 - Production

sys@ORALOCAL(192.168.0.29)> exit

從Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production

With the Partitioning, OLAP and Oracle Data Mining options

JServer Release 9.2.0.1.0 - Production中斷開

C:Documents and SettingsAdministrator>sqlplus “sys/change_on_install as sysdba”

SQL*Plus: Release 9.2.0.1.0 - Production on 星期六 5月 17 20:19:33 2008

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

連接到:

Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production

With the Partitioning, OLAP and Oracle Data Mining options

JServer Release 9.2.0.1.0 - Production

sys@ORALOCAL(192.168.0.29)> exit

從Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production

With the Partitioning, OLAP and Oracle Data Mining options

JServer Release 9.2.0.1.0 - Production中斷開

C:Documents and SettingsAdministrator>sqlplus “sys/change_on_install@oralocal as sysdba”

SQL*Plus: Release 9.2.0.1.0 - Production on 星期六 5月 17 20:19:45 2008

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

連接到:

Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production

With the Partitioning, OLAP and Oracle Data Mining options

JServer Release 9.2.0.1.0 - Production

sys@ORALOCAL(192.168.0.29)> exit

從Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production

With the Partitioning, OLAP and Oracle Data Mining options

JServer Release 9.2.0.1.0 - Production中斷開

C:Documents and SettingsAdministrator>sqlplus “11/22 as sysdba”

SQL*Plus: Release 9.2.0.1.0 - Production on 星期六 5月 17 20:19:58 2008

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

連接到:

Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production

With the Partitioning, OLAP and Oracle Data Mining options

JServer Release 9.2.0.1.0 - Production

sys@ORALOCAL(192.168.0.29)>

[/coolcode]

在這里我們看到由于用了os認證,在oracle安裝用戶下,無論用什么方式都能登錄。非oracle用戶無論用什么用戶都無法登錄。

如果REMOTE_LOGIN_PASSWORDFILE=exclusive且SQLNET.AUTHENTICATION_SERVICES= none時:

[coolcode lang=”sql” linenum=”off”]

C:Documents and SettingsAdministrator>sqlplus “sys/change_on_install as sysdba”

SQL*Plus: Release 9.2.0.1.0 - Production on Sat May 17 20:30:57 2008

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

Connected to:

Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production

With the Partitioning, OLAP and Oracle Data Mining options

JServer Release 9.2.0.1.0 - Production

sys@ORALOCAL(192.168.0.29)> exit

Disconnected from Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production

With the Partitioning, OLAP and Oracle Data Mining options

JServer Release 9.2.0.1.0 - Production

C:Documents and SettingsAdministrator>

C:Documents and SettingsAdministrator>sqlplus “/ as sysdba”

SQL*Plus: Release 9.2.0.1.0 - Production on Sat May 17 20:31:04 2008

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

ERROR:

ORA-01031: insufficient privileges

Enter user-name:

ERROR:

ORA-01017: invalid username/password; logon denied

Enter user-name:

ERROR:

ORA-01017: invalid username/password; logon denied

SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus

C:Documents and SettingsAdministrator>

C:Documents and SettingsAdministrator>

[/coolcode]

結(jié)論:

(1)REMOTE_LOGIN_PASSWORDFILE=none且SQLNET.AUTHENTICATION_SERVICES= none:

oracle安裝用戶本地sqlplus “/ as sysdba”無法登錄

非oracle安裝用戶本機sqlplus “sys/change_on_install as sysdba”無法登錄

非oracle安裝用戶遠程sqlplus “/ as sysdba_on_install@sid as sysdba”無法登錄

(2)REMOTE_LOGIN_PASSWORDFILE=exclusive且SQLNET.AUTHENTICATION_SERVICES= none:

oracle安裝用戶本地sqlplus “/ as sysdba”無法登錄

非oracle安裝用戶本機sqlplus “sys/change_on_install as sysdba”能登錄

非oracle安裝用戶遠程sqlplus “/ as sysdba_on_install@sid as sysdba”能登錄

(3)REMOTE_LOGIN_PASSWORDFILE=none且SQLNET.AUTHENTICATION_SERVICES= (NTS):

oracle安裝用戶本地sqlplus “/ as sysdba”能登錄

非oracle安裝用戶本機sqlplus “sys/change_on_install as sysdba”無法登錄

非oracle安裝用戶遠程sqlplus “/ as sysdba_on_install@sid as sysdba”無法登錄

(4)REMOTE_LOGIN_PASSWORDFILE=exclusive且SQLNET.AUTHENTICATION_SERVICES= (NTS):

oracle安裝用戶本地sqlplus “/ as sysdba”能登錄

非oracle安裝用戶本機sqlplus “sys/change_on_install as sysdba”能登錄

非oracle安裝用戶遠程sqlplus “/ as sysdba_on_install@sid as sysdba”能登錄

主站蜘蛛池模板: 济南品牌包装设计公司_济南VI标志设计公司_山东锐尚文化传播 | 北京中航时代-耐电压击穿试验仪厂家-电压击穿试验机 | 武汉刮刮奖_刮刮卡印刷厂_为企业提供门票印刷_武汉合格证印刷_现金劵代金券印刷制作 - 武汉泽雅印刷有限公司 | 桑茶-七彩贝壳桑叶茶 长寿茶 | 钢衬四氟管道_钢衬四氟直管_聚四氟乙烯衬里管件_聚四氟乙烯衬里管道-沧州汇霖管道科技有限公司 | 展厅设计-展馆设计-专业企业展厅展馆设计公司-昆明华文创意 | 钢衬玻璃厂家,钢衬玻璃管道 -山东东兴扬防腐设备有限公司 | 电动百叶窗,开窗器,电动遮阳百叶,电动开窗机生产厂家-徐州鑫友工控科技发展有限公司 | 重庆波纹管|重庆钢带管|重庆塑钢管|重庆联进管道有限公司 | 公交驾校-北京公交驾校欢迎您! 工作心得_读书心得_学习心得_找心得体会范文就上学道文库 | 齿轮减速机_齿轮减速电机-VEMT蜗轮蜗杆减速机马达生产厂家瓦玛特传动瑞环机电 | 广东风淋室_广东风淋室厂家_广东风淋室价格_广州开源_传递窗_FFU-广州开源净化科技有限公司 | 一体化净水器_一体化净水设备_一体化水处理设备-江苏旭浩鑫环保科技有限公司 | 电动高尔夫球车|电动观光车|电动巡逻车|电动越野车厂家-绿友机械集团股份有限公司 | 众品地板网-地板品牌招商_地板装修设计_地板门户的首选网络媒体。 | 海水晶,海水素,海水晶价格-潍坊滨海经济开发区强隆海水晶厂 | 英国雷迪地下管线探测仪-雷迪RD8100管线仪-多功能数字听漏仪-北京迪瑞进创科技有限公司 | 沈飞防静电地板__机房地板-深圳市沈飞防静电设备有限公司 | 锡膏喷印机-全自动涂覆机厂家-全自动点胶机-视觉点胶机-深圳市博明智控科技有限公司 | 凝胶成像系统(wb成像系统)百科-上海嘉鹏| 铝扣板-铝方通-铝格栅-铝条扣板-铝单板幕墙-佳得利吊顶天花厂家 elisa试剂盒价格-酶联免疫试剂盒-猪elisa试剂盒-上海恒远生物科技有限公司 | 叉车电池-叉车电瓶-叉车蓄电池-铅酸蓄电池-电动叉车蓄电池生产厂家 | 青州搬家公司电话_青州搬家公司哪家好「鸿喜」青州搬家 | 注塑模具_塑料模具_塑胶模具_范仕达【官网】_东莞模具设计与制造加工厂家 | 超声波流量计_流量标准装置生产厂家 _河南盛天精密测控 | 818手游网_提供当下热门APP手游_最新手机游戏下载 | 山东风淋室_201/304不锈钢风淋室净化设备厂家-盛之源风淋室厂家 翻斗式矿车|固定式矿车|曲轨侧卸式矿车|梭式矿车|矿车配件-山东卓力矿车生产厂家 | 结晶点测定仪-润滑脂滴点测定仪-大连煜烁 | 首页 - 张店继勇软件开发工作室| 迪威娱乐|迪威娱乐客服|18183620002| 网带通过式抛丸机,,网带式打砂机,吊钩式,抛丸机,中山抛丸机生产厂家,江门抛丸机,佛山吊钩式,东莞抛丸机,中山市泰达自动化设备有限公司 | 反渗透水处理设备|工业零排放|水厂设备|软化水设备|海南净水设备--海南水处理设备厂家 | 电气控制系统集成商-PLC控制柜变频控制柜-非标自动化定制-电气控制柜成套-NIDEC CT变频器-威肯自动化控制 | 上海软件开发-上海软件公司-软件外包-企业软件定制开发公司-咏熠科技 | 南京租车,南京汽车租赁,南京包车,南京会议租车-南京七熹租车 | 多功能干燥机,过滤洗涤干燥三合一设备-无锡市张华医药设备有限公司 | 干洗店加盟_洗衣店加盟_干洗店设备-伊蔻干洗「武汉总部」 | 赛默飞Thermo veritiproPCR仪|ProFlex3 x 32PCR系统|Countess3细胞计数仪|371|3111二氧化碳培养箱|Mirco17R|Mirco21R离心机|仟诺生物 | 净化车间装修_合肥厂房无尘室设计_合肥工厂洁净工程装修公司-安徽盛世和居装饰 | 高压管道冲洗清洗机_液压剪叉式升降机平台厂家-林君机电 | 干法制粒机_智能干法制粒机_张家港市开创机械制造有限公司 |