SQL> grant connect to system>
SQL> grant connect to sys>
SQL>>
SQL>> SQL>password //需要输入原口令
// 注:以上修改口令的方法等价;sys与system用户可以互相修改口令;如果sys与system用户的口令都忘记了,使用如下方法:
D:/>svrmgrl
Oracle Server Manager> 版权所有 (c) 1997,1999,Oracle Corporation。保留所有权利。
Oracle8i Enterprise Edition> With the Partitioning option
JServer> SVRMGR> connect internal/oracle
连接成功。
SVRMGR> grant connect to system> 语句已处理。
SVRMGR> exit
服务器管理程序结束。
[2002.04.18]
//=========================================================================================================
八、Oracle 产品组成
查询数据库选件产品:
SQL> select * from v$option;
一般都是True, 如果是False, 可以双击激活。
/* cartridges (小产品的)插件,(大产品的)选件(options)*/
[SYS用户是Oracle数据库中权限最大的用户。]
[SQL*Plus登录方法]
1. c:/> sqlplus "/ as sysdba"
2. c:/> sqlplus internal
// 注意:以上两种方法可以类似的使用于SQL*Plus的图形登录界面中
// 用这种登录方法登录进去,所使用的用户均为SYS。
[之所以会出现这种登录方法,是因为在NT的用户组中存在一个ORA_DBA的本地组, 凡在此组中的用户使用操作系统认证,即在此组中的用户登录数据库时不需要密码。]
[orapwd命令:修改internal用户的口令字]
/* orapwd的命令行参数
D:/>orapwd
Usage: orapwd file= password= entries=
where
file - name of password file (mand),
password - password for SYS and INTERNAL (mand),
entries - maximum number of distinct DBA and OPERs (opt),
There are no spaces around the equal-to (=) character. */
修改internal口令字(internal默认口令为oracle)认证方法(A B两个步骤):
A. 修改Oracle登录认证方法:
修改文件SQLNET.ORA文件。
SQLNET.AUTHENTICATION_SERVICES=(NTS) //将这一行前面加上#号注释掉,即可将Oracle的认证方法由操作系统认证改为Oracle认证
SQLNET.ORA文件的位置:
UNIX:/u01/app/oracle/product/8.1.6/network/admin/sqlnet.ora
Windows NT/2000: d:/oracle/ora81/network/admin/sqlnet.ora
B. 修改Internal口令字:
Windows NT/2000:
C:/>ORAPWD file=d:/oracle/ora81/database/pwdora8i.ora
password=YourPassword // YourPassword为你要设置的密码
entries=30
/* ORAPWD file=d:/oracle/ora81/database/pwdora54.ora password=qev entries=30 */
UNIX:
$ orapwd file=$ORACLE_HOME/dbs/orapwSID
password=YourPassword
entries=30
然后重新启动Oracle服务(服务->OracleServiceHOSTNAME)。
/* 在执行上述命令之前,需要先将相应目录的pwdora8i.ora(或orapwSID)文件删除或者改名,因为口令字文件不能重名。*/
[tkprof 跟踪文件整理工具]
$ tkprof x.trc x.txt
Windows 2000/NT:
d:/oracle/admin/db_name/udump/*.trc
UNIX:/u01/app/oracle/amdin/db_name/udump/*.trc // */
九、Oracle数据分区技术:8.0以后开始使用
(一)LOB(Large Object)大对象类型数据:
1. BLOB:存储二进制数据,如图象、视频、声音等,用于代替Long raw类型(Oracle7.0以前的数据类型,今后不再支持)
2. CLOB:存储大字符,如:个人简历,用于代替long字段。
3. NCLOB:其它民族语言的支持
(1) 数据库字符集NLS:
Server端:NLS_CHARACTERSET: (如果为以下的字符集,Oracle的数据库可以用来存储汉字)
ZHS16GBK(Oraclei8, Oracle8)
ZHS16CGB231280(Oracle7.3, 8, 8i)
此参数位置在数据字典中,查询核心字符集(语言、日期、货币等):
SQL>select * from nls_database_parameters;
Client端:NLS_LANG=Simplified Chinese_CHINA.ZHS16GBK (如果没有设置,默认是英文)
regedit.exe
UNIX Client中:
$ NLS_LANG="simplified chinese"_china.zhs16gbk
$ export NLS_LANG
//一般将上述环境变量放入.profile文件中。
/***********************************************插入内容********************************************************
(1) sys是一种用户,internal是一种方式,用来启动关闭数据库,9.0以后不再使用internal,全部是sys。
(2) SQL>set com v7 //将8i版本暂时退回到7版