Login oracle in linux

2 Starting Up and Shutting Down

This section describes how to start up and shut down Oracle Database Express Edition. It contains the following topics:

Starting Up the Database

Oracle Database Express Edition (Oracle Database XE) starts up automatically immediately after installation and after each system restart. Thus, there is no need to start up the database unless you previously shut it down.

You can start up the database from the desktop or with the SQL Command Line (SQL*Plus). Each of these methods is described in the following sections:

Starting Up the Data base from the Desktop

This section explains how to start up the database from the desktop in Windows and in the following two Linux windowing managers: KDE and Gnome. If your Linux computer is not running a windowing manager, or is running a windowing manager other than KDE or Gnome, you must start the database with the SQL Command Line. See «Starting Up the Database Using the SQL Command Line» for instructions.

To start up the database using the desktop:

  1. Do one of the following:
    • On Windows: Log in to the Oracle Database XE host computer as the user that installed Oracle Database XE or as a Windows administrator—that is, as a user who is a member of the Administrator group.
    • On Linux: Log in to the Oracle Database XE host computer as the user that installed Oracle Database XE or as a user who is a member of the dba user group. This is typically the user oracle . See «Operating System Authentication» for more information.
  2. Do one of the following:
    • On Windows: Click Start , point to Programs (or All Programs) , point to Oracle Database 11g Express Edition , and then select Start Database .
    • On Linux with Gnome: In the Applications menu, point to Oracle Database 11g Express Edition , and then select Start Database .
    • On Linux with KDE: Click the icon for the K Menu, point to Oracle Database 11g Express Edition , and then select Start Database .

Starting Up the Databas e Using the SQL Command Line

When you start up the database with the SQL Command Line, you must run the SQL Command Line on the same computer where you installed Oracle Database XE (the «Oracle Database XE host computer»).

To start up the database using the SQL Command Line:

  1. Do one of the following:
    • On Windows: Log in to the Oracle Database XE host computer as the user that installed Oracle Database XE or as a Windows administrator—that is, as a user who is a member of the Administrator group.
    • On Linux: Log in to the Oracle Database XE host computer as the user that installed Oracle Database XE or as a user who is a member of the dba user group. This is typically the user oracle . See «Operating System Authentication» for more information.
  2. If not already opened, open a terminal session or command window.
  3. Linux platform only: Ensure that environment variables are set properly. See «Setting Environment Variables on the Linux Platform» for details.
  4. At the operating system prompt, enter the following command to start the SQL Command Line and connect to the database:

If the command is successful, it displays output similar to the following. (System global area sizes will vary depending on the amount of physical memory in your Oracle Database XE host computer.)

ORACLE instance started. Total System Global Area 599785472 bytes Fixed Size 1220804 bytes Variable Size 180358972 bytes Database Buffers 415236096 bytes Redo Buffers 2969600 bytes Database mounted. Database opened.
SQL> select count(*) from hr.employees;

Shutting Down the Database

Oracle Database Express Edition (Oracle Database XE) shuts down automatically when you shut down the computer that hosts it. However, you can also shut Oracle Database XE down manually whenever you want, such as to reduce the overall system processing overhead when you do not need to use the database.

Before shutting down Oracle Database XE, it is best to ensure that all users and applications have completed their work and logged out. See «Monitoring Sessions» for information on how to view current database sessions.

If users or applications are still logged in when you begin a shutdown operation, the shutdown proceeds under the following conditions:

  • No new connections are permitted, and no new transactions are allowed to be started.
  • Any uncommitted transactions are rolled back.
  • All users and applications are immediately disconnected.

You can shut down the database with the desktop or with the SQL Command Line (SQL*Plus). Each of these methods is described in the following sections:

Shut ting Down the Database from the Desktop

This section explains how to shut down the database from the desktop in Windows and in the following two Linux windowing managers: KDE and Gnome. If your Linux computer is not running a windowing manager, or is running a windowing manager other than KDE or Gnome, you must shut down the database with the SQL Command Line.

To shut down the database using the desktop:

  1. Do one of the following:
    • On Windows: Log in to the Oracle Database XE host computer as the user that installed Oracle Database XE or as a Windows administrator—that is, as a user who is a member of the Administrator group.
    • On Linux: Log in to the Oracle Database XE host computer as the user that installed Oracle Database XE or as a user who is a member of the dba user group. This is typically the user oracle . See «Operating System Authentication» for more information.
  2. Do one of the following:
    • On Windows: Click Start , point to Programs (or All Programs) , point to Oracle Database 11g Express Edition , and then select Stop Database .
    • On Linux with Gnome: In the Applications menu, point to Oracle Database 11g Express Edition , and then select Stop Database .
    • On Linux with KDE: Click the icon for the K Menu, point to Oracle Database 11g Express Edition , and then select Stop Database .

Shutti ng Down the Database Using the SQL Command Line

When you shut down the database with the SQL Command Line, you must run the SQL Command Line on the same computer where you installed Oracle Database XE (the «Oracle Database XE host computer»).

To shut down the database using the SQL Command Line:

  1. Do one of the following:
    • On Windows: Log in to the Oracle Database XE host computer as the user that installed Oracle Database XE or as a Windows administrator—that is, as a user who is a member of the Administrator group.
    • On Linux: Log in to the Oracle Database XE host computer as the user that installed Oracle Database XE or as a user who is a member of the dba user group. This is typically the user oracle . See «Operating System Authentication» for more information.
  2. If not already opened, open a terminal session or command window.
  3. Linux platform only: Ensure that environment variables are set properly. See «Setting Environment Variables on the Linux Platform» for details.
  4. At the operating system prompt, enter the following command to start the SQL Command Line and connect to the database:

Note that this command may take a short while to complete. If the command is successful, it displays the following output:

Database closed. Database dismounted. ORACLE instance shut down.

If the command displays no output after a number of minutes, indicating that the shutdown operation is not proceeding, you can press CTRL-C to interrupt the command, and then enter the following command:

The database must go through a recovery process when it starts up after a SHUTDOWN ABORT command. It is recommended that you enable the recovery process to take place immediately, after which you can shut down the database normally. To do this, enter the following commands when the SHUTDOWN ABORT completes:

SQL> STARTUP SQL> SHUTDOWN IMMEDIATE

Источник

Login oracle in linux

Connect from UNIX and UNIX-Like Systems

You can log in to an Oracle-provided Oracle Linux instance as the default user, opc . The opc user has sudo privileges.

You can use SSH to log in to your instance as the default user, opc , by using the following command:

ssh opc@ ip_address —i private_key

In this command, ip_address is the public IP address of the instance, and private_key is the full path and name of the file that contains the private key corresponding to the public key associated with the instance that you want to access.

If an error occurs, see Can’t connect to an instance using SSH in Using Oracle Cloud Infrastructure Compute Classic .

When you’re logged in as the default user, opc , use the sudo command to run administrative tasks.

You can log in to an Oracle-provided Oracle Linux instance as the default user, opc . The opc user has sudo privileges. If you’re using a Windows host, you can use PuTTY or any other similar client to connect to your instance using SSH.

  1. Run the PuTTY program. The PuTTY Configuration window is displayed, showing the Session panel.
  2. In Host Name (or IP address) box, enter the public IP address of your instance.
  3. Confirm that the Connection type option is set to SSH .
  4. In the Category tree, expand Connection if necessary and then click Data . The Data panel is displayed.
  5. In Auto-login username box, enter opc .
  6. Confirm that the When username is not specified option is set to Prompt .
  7. In the Category tree, expand SSH and then click Auth . The Auth panel is displayed.
  8. Click the Browse button next to the Private key file for authentication box. Navigate to and open the private key file that matches the public key that is associated with your instance.
  9. In the Category tree, click Session . The Session panel is displayed.
  10. In the Saved Sessions box, enter a name for this connection configuration and click Save .
  11. Click Open to open the connection. The PuTTY Configuration window is closed and the PuTTY window is displayed.
  12. If this is the first time you are connecting to an instance, the PuTTY Security Alert window is displayed, prompting you to confirm the public key. Click Yes to continue connecting.

If an error occurs, see Can’t connect to an instance using SSH in Using Oracle Cloud Infrastructure Compute Classic .

When you’re logged in as the default user, opc , use the sudo command to run administrative tasks.

Источник

How do you connect to an oracle database with os authentication linux

Let’s say we want to create a database user who logs in with their OS account. To do so, we will use the “external authentication” option offered by oracle.

Check the value of the os_authent_prefix parameter

SQL> show parameter os_authent_prefix NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ os_authent_prefix string ops$

The ops$ value is the prefix that oracle will use for each OS account. As we can see, our user is prefixed with ops$. Oracle uses the prefix to recognize OS users when they attempt to connect. It is also a way for Oracle to separate a database account and an OS account.

Let’s create the external user account in the database

SQL> create user ops$mikando identified externally;

As we can see, our user is prefixed with ops$.

Give the necessary privileges

SQL> grant connect, resource, create session to ops$mikando;

Let’s create the user named mikando and his password.

[r[email protected] ~]# useradd -g oinstall -G dba,oper,asmdba mikando

Open a new session and connect with the new operating system (os) user created “mikando”

[[email protected] ~]$ . oraenvoracle database 11 ORACLE_SID = [mikando] ? achats ORACLE_BASE environment variable is not being set since this information is not available for the current user ID mikando. You can set ORACLE_BASE manually if it is required. Resetting ORACLE_BASE to its previous value or ORACLE_HOME The Oracle base has been set to /u01/app/oracle/product/12.1.0/db

Here, our target database is called achats

[[email protected] ~]$ sqlplus / SQL*Plus: Release 12.1.0.2.0 Production on Mon Dec 23 09:47:48 2019 Copyright (c) 1982, 2014, Oracle. All rights reserved. Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics and Real Application Testing options SQL>

Now the os user named “mikando” can connect to the database without being asked for a password.

About KONE MIKANDO

An IT professional with more than 4 years of experience as an Oracle database administrator. Extensive installation experience (RAC and stand-alone), administration, implementation, troubleshooting, Oracle 12c / 11g tuning, export / import, OEM grid control, Data Guard on Unix, Rman backup / restore, upgrade, migration , correction (RDBMS, GRID) PSU & CPU, Database migration. I like everything about the Oracle & DB2 database. For me, sharing is the best thing we can offer in this job. And learning is not an option but a duty for database administrators.

Источник

Читайте также:  Php linux cannot open shared object file
Оцените статью
Adblock
detector