Oracle的sqlnet.ora与password文件试验
先看有没有sqlnet.ora
[Oracle@localhost ~]$ cd $ORACLE_HOME
[oracle@localhost dbhome_1]$ cd network
[oracle@localhost network]$ cd admin
[oracle@localhost admin]$ ls
listener.ora samples shrept.lst
[oracle@localhost admin]$
VMware+Linux+Oracle 10G RAC全程详细图解
在CentOS 6.4下安装Oracle 11gR2(x64)
Oracle 11gR2 在VMWare虚拟机中安装步骤
Debian 下 安装 Oracle 11g XE R2
Oracle 11gR2 在VMWare虚拟机中安装步骤
手动创建一个sqlnet.ora文件
[oracle@localhost admin]$ touch sqlnet.ora
[oracle@localhost admin]$ vim sqlnet.ora
[oracle@localhost admin]$ cat sqlnet.ora
SQLNET.AUTHENTICATION_SERVICES=(none);
[oracle@localhost admin]$
试验登陆情况:
[oracle@localhost admin]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Tue Apr 15 08:26:25 2014
Copyright (c) 1982, 2013, Oracle. All rights reserved.
ERROR:
ORA-01017: invalid username/password; logon denied
Enter user-name:
*********************************
查看口令文件情况:
[oracle@localhost dbs]$ pwd
/u01/app/oracle/product/11.2.0/dbhome_1/dbs
[oracle@localhost dbs]$ ls
hc_orcl.dat init.ora initorcl.ora lkORCL orapworcl spfileorcl.ora
[oracle@localhost dbs]$
现在执行口令文件处理:
用老的口令文件改口令不被允许:
[oracle@localhost dbs]$ orapwd file=orapworcl password=gaojian
OPW-00005: File with same name exists - please delete or renam
只好再作一个新的:
[oracle@localhost dbs]$ orapwd file=orapwgaojian password=gaojian
[oracle@localhost dbs]$ ls
hc_orcl.dat initorcl.ora orapwgaojian spfileorcl.ora
init.ora lkORCL orapworcl
[oracle@localhost dbs]$
用刚刚作好的口令,还是不行(因为它和oracle中的sys口令不一致,是我随便设的,所以不行,其实登陆到哪个实例,就会用哪个口令文件--orapw
[oracle@localhost admin]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Tue Apr 15 08:32:23 2014
Copyright (c) 1982, 2013, Oracle. All rights reserved.
ERROR:
ORA-01017: invalid username/password; logon denied
Enter user-name: sys as sysdba
Enter password:
ERROR:
ORA-01017: invalid username/password; logon denied
Enter user-name: sys
Enter password:
ERROR:
ORA-01017: invalid username/password; logon denied
SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
[oracle@localhost admin]$
*******************************
考虑删除orapworcl (这个操作实际上有一定的危险性):
[oracle@localhost dbs]$ rm orapworcl
[oracle@localhost dbs]$
一样也是登陆不进去:
[oracle@localhost admin]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Tue Apr 15 08:34:24 2014
Copyright (c) 1982, 2013, Oracle. All rights reserved.
ERROR:
ORA-01017: invalid username/password; logon denied
Enter user-name: sys as sysdba
Enter password:
ERROR:
ORA-01017: invalid username/password; logon denied
Enter user-name: sys
Enter password:
ERROR:
ORA-01017: invalid username/password; logon denied
SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
[oracle@localhost admin]$
*******************************
把sqlnet.ora中的 SQLNET.AUTHENTICATION_SERVICES=(none); 注释掉,再试验:
[oracle@localhost admin]$ cat sqlnet.ora
#SQLNET.AUTHENTICATION_SERVICES=(none);
[oracle@localhost admin]$
[oracle@localhost dbs]$ strings orapwgaojian
]\[Z
ORACLE Remote Password file
INTERNAL
FE406C76B620912C
861BAF16E111B672
[oracle@localhost dbs]$
登陆到数据库中,,来更改口令:
[oracle@localhost admin]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Tue Apr 15 08:44:08 2014
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> alter user sys identified by oracle;
User altered.
SQL>exit
[oracle@localhost dbs]$ strings orapwgaojian
]\[Z
ORACLE Remote Password file
INTERNAL
FE406C76B620912C
861BAF16E111B672
[oracle@localhost dbs]$
口令文件似乎无变化。
还是登陆不进去:
[oracle@localhost admin]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Tue Apr 15 08:45:41 2014
Copyright (c) 1982, 2013, Oracle. All rights reserved.
ERROR:
ORA-01017: invalid username/password; logon denied
Enter user-name: sys as sysdba
Enter password:
ERROR:
ORA-01017: invalid username/password; logon denied
Enter user-name:
*******************************
看来还得用orapw
[oracle@localhost dbs]$ orapwd file=orapworcl

MySQL是一种开源的关系型数据库管理系统,主要用于快速、可靠地存储和检索数据。其工作原理包括客户端请求、查询解析、执行查询和返回结果。使用示例包括创建表、插入和查询数据,以及高级功能如JOIN操作。常见错误涉及SQL语法、数据类型和权限问题,优化建议包括使用索引、优化查询和分表分区。

MySQL是一个开源的关系型数据库管理系统,适用于数据存储、管理、查询和安全。1.它支持多种操作系统,广泛应用于Web应用等领域。2.通过客户端-服务器架构和不同存储引擎,MySQL高效处理数据。3.基本用法包括创建数据库和表,插入、查询和更新数据。4.高级用法涉及复杂查询和存储过程。5.常见错误可通过EXPLAIN语句调试。6.性能优化包括合理使用索引和优化查询语句。

选择MySQL的原因是其性能、可靠性、易用性和社区支持。1.MySQL提供高效的数据存储和检索功能,支持多种数据类型和高级查询操作。2.采用客户端-服务器架构和多种存储引擎,支持事务和查询优化。3.易于使用,支持多种操作系统和编程语言。4.拥有强大的社区支持,提供丰富的资源和解决方案。

InnoDB的锁机制包括共享锁、排他锁、意向锁、记录锁、间隙锁和下一个键锁。1.共享锁允许事务读取数据而不阻止其他事务读取。2.排他锁阻止其他事务读取和修改数据。3.意向锁优化锁效率。4.记录锁锁定索引记录。5.间隙锁锁定索引记录间隙。6.下一个键锁是记录锁和间隙锁的组合,确保数据一致性。

MySQL查询性能不佳的原因主要包括没有使用索引、查询优化器选择错误的执行计划、表设计不合理、数据量过大和锁竞争。 1.没有索引导致查询缓慢,添加索引后可显着提升性能。 2.使用EXPLAIN命令可以分析查询计划,找出优化器错误。 3.重构表结构和优化JOIN条件可改善表设计问题。 4.数据量大时,采用分区和分表策略。 5.高并发环境下,优化事务和锁策略可减少锁竞争。

在数据库优化中,应根据查询需求选择索引策略:1.当查询涉及多个列且条件顺序固定时,使用复合索引;2.当查询涉及多个列但条件顺序不固定时,使用多个单列索引。复合索引适用于优化多列查询,单列索引则适合单列查询。

要优化MySQL慢查询,需使用slowquerylog和performance_schema:1.启用slowquerylog并设置阈值,记录慢查询;2.利用performance_schema分析查询执行细节,找出性能瓶颈并优化。

MySQL和SQL是开发者必备技能。1.MySQL是开源的关系型数据库管理系统,SQL是用于管理和操作数据库的标准语言。2.MySQL通过高效的数据存储和检索功能支持多种存储引擎,SQL通过简单语句完成复杂数据操作。3.使用示例包括基本查询和高级查询,如按条件过滤和排序。4.常见错误包括语法错误和性能问题,可通过检查SQL语句和使用EXPLAIN命令优化。5.性能优化技巧包括使用索引、避免全表扫描、优化JOIN操作和提升代码可读性。


热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

Dreamweaver Mac版
视觉化网页开发工具

螳螂BT
Mantis是一个易于部署的基于Web的缺陷跟踪工具,用于帮助产品缺陷跟踪。它需要PHP、MySQL和一个Web服务器。请查看我们的演示和托管服务。

适用于 Eclipse 的 SAP NetWeaver 服务器适配器
将Eclipse与SAP NetWeaver应用服务器集成。

VSCode Windows 64位 下载
微软推出的免费、功能强大的一款IDE编辑器

PhpStorm Mac 版本
最新(2018.2.1 )专业的PHP集成开发工具