日期:2014-05-16 浏览次数:20339 次
You can allow administrators to connect to the database by using
operating system authentication or password file authentication. For remote
or local database administration, you can use either method, but you can use
the operating system authentication method with remote administration
only if you have a secured network connection.
? OSDBA and OSOPER are not Oracle privileges or roles that you grant
through the Oracle database. The operating system manages them. When
you connect to the database by using the OSOPER privilege (or SYSOPER
privilege), you can perform STARTUP, SHUTDOWN, ALTER DATABASE [OPEN/
MOUNT], ALTER DATABASE BACKUP, ARCHIVE LOG, and RECOVER, and
SYSOPER includes the RESTRICTED SESSION privilege.
When you connect to
the database by using the OSDBA privilege (or SYSDBA privilege), you have all
system privileges with ADMIN OPTION, the OSOPER role, CREATE DATABASE,
and time-based recovery.
?
To use operating system authentication, set the REMOTE_LOGIN_
PASSWORDFILE parameter to NONE
, which is the default.
?
sqlplus /nolog
?
CONNECT / AS SYSDBA or CONNECT / AS SYSOPER.
?
orapwd
Usage: orapwd file=<fname> password=<password>
entries=<users>
where
file - name of password file (mand),
password - password for SYS and INTERNAL (mand),
entries - maximum number of distinct DBAs and
OPERs (opt),
?
orapwd file=pwd.file password=111111 entries=5
To use password file authentication, follow these steps:
1. Using the ORAPWD utility, create a password file with the SYS password.
When you change the password in the database, the password in
this file is automatically updated.
2. Set the REMOTE_LOGIN_PASSWORDFILE parameter.
You can set the parameter REMOTE_LOGIN_PASSWORDFILE to either
EXCLUSIVE or SHARED.
If you set the parameter to EXCLUSIVE, the password
file can be used for only one database; you can add users other than SYS and
INTERNAL to the password file. If you set the parameter to SHARED, the password
file is shared among multiple databases, but you cannot add any user
other than SYS or INTERNAL to the password file.
3. Grant the appropriate users SYSDBA or SYSOPER privilege. When you
grant this privilege, these users are added to the password file. (For add new users to use password file authentication)
?
When you connect to the database by using the SYSDBA privilege, you are
connected to the SYS schema, and when you connect by using the SYSOPER
privilege, you are connected to the PUBLIC schema.
?
sqlplus username/password@tns_name as sysdba
?
If the tns has not been created in the current client. You can use the following connection string:
sqlplus system/111111@(description=(address_list=(address=(protocol=TCP)(host=Ipaddress)(port=1521)))(connect_data=(SID=orcl))) as sysdba
To start or stop an Oracle instance, you must have the SYSDBA or
SYSOPER privilege.
The database start-up is done in three stages. First,
you start an instance associated with the database, then the instance mounts
the database, and finally you open the database for normal use.