linux: useradd test
passwd test
----- usermod -g oinstall test ( 划到和oracle用户同一个组 这个很重要 )
----- chmod -R 775 /u01/oracle (允许同组其他用户访问的权限)
vi /home/test/.bash_profile
和oracle用户一样的 (配置环境变量)
SQL> show parameter os
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
remote_os_authent boolean FALSE
remote_os_roles boolean FALSE
alter system set remote_os_authent=true scope=spfile; (代表允许远程用户连接,会导致startup时报错,但不影响启动)
shutdown immediate
startup
create pfile from spfile;
create user test identified externally; ----externally (允许这个用户外部连接)
passwd test
----- usermod -g oinstall test ( 划到和oracle用户同一个组 这个很重要 )
----- chmod -R 775 /u01/oracle (允许同组其他用户访问的权限)
vi /home/test/.bash_profile
和oracle用户一样的 (配置环境变量)
SQL> show parameter os
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
remote_os_authent boolean FALSE
remote_os_roles boolean FALSE
alter system set os_authent_prefix='' scope=spfile;
[os_authent_prefix 这个参数代表外部用户登录oracle的标示符,详细见另篇大神的博客{os_authent_prefix参数详解}
]alter system set remote_os_authent=true scope=spfile; (代表允许远程用户连接,会导致startup时报错,但不影响启动)
shutdown immediate
startup
create pfile from spfile;
create user test identified externally; ----externally (允许这个用户外部连接)
grant connect,resource to test; (赋予相关权限)
su - test
cd $ORACLE_HOME/bin
./sqlplus /
注意:
如此操作仍会报错 :
[yt1@node1 bin]$ ./sqlplus /
SQL*Plus: Release 11.2.0.1.0 Production on Sun Jul 21 00:21:45 2013
Copyright (c) 1982, 2009, Oracle. All rights reserved.
ERROR:
ORA-12547: TNS:lost contact
这是权限问题,解决办法如下:
/data2/oracle/product/11.2.0/bin/
-rwxr-x--x 1 oracle oinstall 210824714 Jun 26 16:33 oracle 权限有问题,更改权限
chmod 6751 oracle
-rwsr-s--x 1 oracle oinstall 210824714 Jun 26 16:33 oracle
再次连接数据库,正常