Monday, 6 November 2017

ORACLE START / STOP AND STATUS CHECKING COMMANDS

ORACLE START / STOP AND STATUS CHECKING COMMANDS

  • Export environment variables

export ORACLE_SID=sterdb
export ORACLE_HOME=/home/oracle1/app/oracle1/product/12.2.0/dbhome_1
export PATH=$ORACLE_HOME/bin:$PATH

     $ps -ef|grep pmon [checking database status]
   Username: oracle1
   Dbname: sterdb
   $sqlplus '/ as sysdba' [connecting to Oracle Database]
   START the Database

  • SHUTDOWN the Database

SQL> SHUTDOWN IMMEDIATE

TNS LISTENER STARTING PROCESS

$Ps –ef|grep tns
$lsnrctl status LISTENER
$ lsnrctl start
$lsnrctl status LISTENER

DATABASE USER CREATION PROCESS

$sqlplus '/ as sysdba'

SQL> select username from dba_users;
SQL> alter session set "_ORACLE_SCRIPT"=true;
SQL> CREATE USER rama1 IDENTIFIED BY Admin123;
SQL> GRANT CREATE SESSION, ALTER SESSION, CREATE DATABASE LINK, - CREATE MATERIALIZED VIEW, CREATE PROCEDURE, CREATE PUBLIC SYNONYM, - CREATE ROLE, CREATE SEQUENCE, CREATE SYNONYM, CREATE TABLE, - CREATE TRIGGER, CREATE TYPE, CREATE VIEW, UNLIMITED TABLESPACE - to rama1;
GRANT CONNECT,RESOURCE  to rama1;

SQL> sqlplus rama1/Admin123@sterdb
select username, account_status, created from dba_users where username='RAMA1';
select GRANTEE,PRIVILEGE from dba_sys_privs where GRANTEE='RAMA1';
select GRANTEE,GRANTED_ROLE,ADMIN_OPTION from dba_role_privs where GRANTED_ROLE='RAMA1';
select GRANTEE, PRIVILEGE from dba_tab_privs where GRANTEE='RAMA1';
sqlplus rama1/Admin123@sterdb
select tablespace_name, table_name from user_tables;
select tablespace_name, table_name from dba_tables;
all the best..

No comments:

Post a Comment