sqlplus '!@#/!!! as sysdba' 竟然看不懂?
短信预约 -IT技能 免费直播动态提醒
今日分享,今天在银行待了一天,明天可以休息一下了,祝大家周末愉快!
如果大家看到以下几种写法,大家会有什么想法?有什么区别?
告诉大家,这几种写法默认都可以登录到数据库的。
<rac01:orcl1:/home/oracle>$sqlplus xxx/xxx as sysdba
<rac01:orcl1:/home/oracle>$sqlplus roidba/roidba as sysdba
<rac01:orcl1:/home/oracle>$sqlplus / as sysdba
<rac01:orcl1:/home/oracle>$sqlplus '!@#/!!! as sysdba'
这里有几个小知识点值得注意。
1、Oracle 默认使用系统认证,登录数据库
2、单引号在这里强调忽略所有特殊字符,这就是为什么有时候我们需要单引号,而有的时候不需要。
我们在做数据库备份的时候,有的时候用sys,有的时候用system,有的时候有业务用户来做逻辑备份,而我又不想把密码暴露出来的话,怎么办呢?
有不少朋友就是使用了expdp \'/ as sysdba\'
例如
<rac01:orcl1:/home/oracle>$expdp \'/ as sysdba\'
Export: Release 12.1.0.2.0 - Production on Fri Dec 15 22:42:17 2017
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Advanced Analytics and Real Application Testing options
Starting "SYS"."SYS_EXPORT_SCHEMA_01": "/******** AS SYSDBA"
Estimate in progress using BLOCKS method...
Total estimation using BLOCKS method: 0 KB
Processing object type SCHEMA_EXPORT/STATISTICS/MARKER
ORA-31655: no data or metadata objects selected for job
Job "SYS"."SYS_EXPORT_SCHEMA_01" completed with 1 error(s) at Fri Dec 15 22:42:43 2017 elapsed 0 00:00:24
哪里来的xxx用户,别被忽悠了哈
<rac01:orcl1:/home/oracle>$sqlplus xxx/xxx as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Fri Dec 15 22:44:20 2017
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Advanced Analytics and Real Application Testing options
SYS@orcl1> select user from dual;
USER
------------------------------
SYS
哪里来的!@#用户哈,这下大家应该理解了吧,眼见不一定为实,自己动手测试验证了,才能得出最终的结论。
<rac01:orcl1:/home/oracle>$sqlplus '!@#/!!! as sysdba'
SQL*Plus: Release 12.1.0.2.0 Production on Fri Dec 15 22:45:35 2017
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Advanced Analytics and Real Application Testing options
SYS@orcl1> select user from dual;
USER
------------------------------
SYS
SYS@orcl1>
免责声明:
① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。
② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341