oracle add a user

SQL> create user avicroot identified by P4;

SQL>  grant connect to avicroot;

SQL>  grant dba       to avicroot;

SQL> grant sysdba to avicroot;
grant sysdba to avicroot
*
ERROR at line 1:
ORA-01994: GRANT failed: cannot add users to public password file

SQL> show parameter spfile;

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string
SQL> create spfile from pfile;

File created.

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 581506616 bytes
Fixed Size 452152 bytes
Variable Size 402653184 bytes
Database Buffers 167772160 bytes
Redo Buffers 10629120 bytes
Database mounted.
Database opened.

SQL> show parameter spfile;

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string ?/dbs/[email protected]

SQL> grant sysdba to avicroot;
grant sysdba to avicroot
*
ERROR at line 1:
ORA-01994: GRANT failed: cannot add users to public password file

SQL> show parameter remote;

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
remote_archive_enable string true
remote_dependencies_mode string TIMESTAMP
remote_listener string
remote_login_passwordfile string NONE
remote_os_authent boolean FALSE
remote_os_roles boolean FALSE

SQL> alter system set remote_login_passwordfile=exclusive scope=spfile;

System altered.

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 581506616 bytes
Fixed Size 452152 bytes
Variable Size 402653184 bytes
Database Buffers 167772160 bytes
Redo Buffers 10629120 bytes
ORA-01990: error opening password file '/u01/oravis/visdb/9.2.0/dbs/orapw'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3

[oravis@rhel39 9.2.0]$ cd dbs
[oravis@rhel39 dbs]$ ll
total 80
-rw-r--r-- 1 oravis dba 12920 Mar 10 2002 initdw.ora
-rw-r--r-- 1 oravis dba 8385 Mar 10 2002 init.ora
-rw-r--r-- 1 oravis dba 19651 Jan 9 23:04 initVIS_noaq.ora
-rw-r--r-- 1 oravis dba 19605 Jan 9 22:56 initVIS.ora
-rw-rw---- 1 oravis dba 24 Jan 12 11:11 lkVIS
-rw-r----- 1 oravis dba 5632 Jan 12 11:10 spfileVIS.ora
-rw-r--r-- 1 oravis dba 0 Jan 9 23:04 VIS_rhel39_ifile.ora
[oravis@rhel39 dbs]$ pwd
/u01/oravis/visdb/9.2.0/dbs

[oravis@rhel39 dbs]$ echo $ORACLE_SID
VIS
[oravis@rhel39 dbs]$ orapwd file=/u01/oravis/visdb/9.2.0/dbs/orapwVIS password=manager entries=10

[oravis@rhel39 dbs]$ ls -l orapw*
-rwSr----- 1 oravis dba 2560 Jan 12 11:14 orapwVIS
[oravis@rhel39 dbs]$ exit
exit

SQL> alter database open;

Database altered.

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 581506616 bytes
Fixed Size 452152 bytes
Variable Size 402653184 bytes
Database Buffers 167772160 bytes
Redo Buffers 10629120 bytes
Database mounted.
Database opened.
SQL> grant sysdba to avicroot;

Grant succeeded.

C:\Windows\System32\drivers\etc>sqlplus avicroot/[email protected]:1521/VIS as sysdba

SQL*Plus: Release 10.2.0.5.0 - Production on 星期日 1月 12 11:16:49 2020

Copyright (c) 1982, 2010, Oracle. All Rights Reserved.

ERROR:
ORA-12547: TNS: 丢失连接


请输入用户名:

[oravis@rhel39 oravis]$ cd /u01/oravis/visdb/9.2.0/network/admin

[oravis@rhel39 admin]$ cd VIS_rhel39/
[oravis@rhel39 VIS_rhel39]$ pwd
/u01/oravis/visdb/9.2.0/network/admin/VIS_rhel39
[oravis@rhel39 VIS_rhel39]$ ll
total 20
-rw-r--r-- 1 oravis dba 2 Jan 9 23:04 listener_ifile.ora
-rw-r--r-- 1 oravis dba 1239 Jan 9 23:04 listener.ora
-rw-r--r-- 1 oravis dba 2 Jan 9 23:04 sqlnet_ifile.ora
-rw-r--r-- 1 oravis dba 678 Jan 9 23:04 sqlnet.ora
-rw-r--r-- 1 oravis dba 2046 Jan 9 23:04 tnsnames.ora
[oravis@rhel39 VIS_rhel39]$ cat sqlnet.ora
###############################################################
#
# This file is automatically generated by AutoConfig. It will be read and
# overwritten. If you were instructed to edit this file, or if you are not
# able to use the settings created by AutoConfig, refer to Metalink document
# 165195.1 for assistance.
#
#$Header: NetServiceHandler.java 115.33 2004/09/22 08:21:05 dvijayas ship $
#
###############################################################

NAMES.DIRECTORY_PATH=(TNSNAMES, ONAMES, HOSTNAME)
SQLNET.EXPIRE_TIME= 10
tcp.validnode_checking = yes
tcp.invited_nodes=(RHEL39.catic.net)


IFILE=/u01/oravis/visdb/9.2.0/network/admin/VIS_rhel39/sqlnet_ifile.ora[oravis@rhel39 VIS_rhel39]$

[oravis@rhel39 VIS_rhel39]$ cp sqlnet.ora sqlnet.ora.20200112
[oravis@rhel39 VIS_rhel39]$ vi sqlnet.ora
[oravis@rhel39 VIS_rhel39]$ cat sqlnet.ora
###############################################################
#
# This file is automatically generated by AutoConfig. It will be read and
# overwritten. If you were instructed to edit this file, or if you are not
# able to use the settings created by AutoConfig, refer to Metalink document
# 165195.1 for assistance.
#
#$Header: NetServiceHandler.java 115.33 2004/09/22 08:21:05 dvijayas ship $
#
###############################################################

NAMES.DIRECTORY_PATH=(TNSNAMES, ONAMES, HOSTNAME)
SQLNET.EXPIRE_TIME= 10
tcp.validnode_checking = no
tcp.invited_nodes=(RHEL39.catic.net)


IFILE=/u01/oravis/visdb/9.2.0/network/admin/VIS_rhel39/sqlnet_ifile.ora

C:\Windows\System32\drivers\etc>sqlplus avicroot/[email protected]:1521/VIS as sysdba

SQL*Plus: Release 10.2.0.5.0 - Production on 星期日 1月 12 11:20:46 2020

Copyright (c) 1982, 2010, Oracle. All Rights Reserved.

ERROR:
ORA-12537: TNS: 连接关闭


请输入用户名:

C:\Windows\System32\drivers\etc>sqlplus avicroot/[email protected]:1521/VIS as sysdba

SQL*Plus: Release 10.2.0.5.0 - Production on 星期日 1月 12 11:23:49 2020

Copyright (c) 1982, 2010, Oracle. All Rights Reserved.

ERROR:
ORA-01017: invalid username/password; logon denied


请输入用户名:

SQL> alter user avicroot account unlock;

User altered.

SQL> alter user scott account unlock;

User altered.

SQL> alter user scott identified by tiger;

User altered.

C:\Windows\System32\drivers\etc>sqlplus scott/[email protected]:1521/VIS

SQL*Plus: Release 10.2.0.5.0 - Production on 星期日 1月 12 11:27:54 2020

Copyright (c) 1982, 2010, Oracle. All Rights Reserved.


连接到:
Oracle9i Enterprise Edition Release 9.2.0.5.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.5.0 - Production

SQL>

SQL> alter user avicroot identified by P4;

User altered.

SQL> drop user avicroot;

User dropped.

SQL> create user avicroot identified by Avicr00o1
2 ;

User created.

SQL> grant connect,resource to avicroot;

Grant succeeded.

SQL> grant dba,sysdba to avicroot;

Grant succeeded.

猜你喜欢

转载自www.cnblogs.com/rocazj/p/12182208.html