oracle 19c command list

By ukmodak | March 31st 2024 10:32:28 AM | viewed 725 times
 c>sqlplus                                               
 c>user-name:sys as sysdba                                
 c>password:sys 
 sql>show user; 
 sql>COLUMN name FORMAT a20;    
 sql>SELECT * FROM all_users;  
 sql>SELECT * FROM all_users;
 sql>SELECT * FROM user_users;
 sql>show con_name;                                           // to check connection name to make sure you’re in the correct location, type
 sql>show pdbs;                                               // to show pluggable database
 sql>SELECT name, con_id FROM v$pdbs;                         // to get component id of pluggable database
 sql>SELECT name as "Service_name" from v$active_services WHERE con_id =3;  //  to get service name of pluggable database component id
 
 sql>alter pluggable database all open;                   // to open all pluggable database
 sql>alter pluggable database ukapex close;               // to close each pluggable database at all not possible
 
 sql> CREATE PLUGGABLE DATABASE ukapex ADMIN USER ukapexadmin IDENTIFIED BY ukapexadmin;   // to create new pdbs
 sql>show pdbs;                                           // to show pluggable database
 SQL> alter pluggable database ukapex OPEN;                // to open database
 sql>show pdbs;                                           // to show pluggable database
 sql>show con_name;                                           // to check connection name to make sure you’re in the correct location, type
 sql>alter session set container=ukapex;                  // To switch to the ukapex pluggable database,
 sql>show con_name;                                           // to check connection name to make sure you’re in the correct location, type
 SQL> ALTER DATABASE OPEN;                                    // Before creating a new user, you need to change the database to open by executing the following command:
 SQL> CREATE USER dekkoaccount IDENTIFIED BY dekkoaccount;     // to create a new user for creating the sample database in the pluggable database ukapex
 SQL> GRANT CONNECT, RESOURCE, DBA TO dekkoaccount;            // grant privileges to the dekkoaccount user
 SQL> CONNECT dekkoaccount@ukapex;                             //  error:ora-12154: tns: could not resolve the identifier
 
    // set listener  in tnsnames.ora as follows
  ukapex_tns =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = SDI-Uzzal)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = ukapex)
    )
  )
  
  // close command and reconnect 
  cmd> lsnrctl start    // no ;
  cmd>lsnrctl reload
  // again try to connect  
 
sql>alter pluggable database open; // pluggable database already open sql>select ora_database_name from dual; // to show open database sql>select tablespace_name from dba_tablespaces; // to show table space name sql>show parameter sga; // to check memory use; sql>select COMP_ID, STATUS from DBA_REGISTRY // USER_REGISTRY displays information about the components loaded into the database that are owned by the current user. Column, Datatype, NULL, Description sql>select account_status from dba_users // to all user status sql>ALTER USER APEX_LISTENER IDENTIFIED BY listener_user ACCOUNT UNLOCK; // overwrite previous user and password sql>ALTER USER dba_users ACCOUNT UNLOCK; // problem sql>exit; sql>sqlplus sql>suer-name: sys as sysdba // no ; sql>password:sys sql>conn hongbao/hongbao@commonpdbs_tns; // connected sql>select account_status from dba_users where username = 'hongbao'; // no row selected sql>select name, open_mode from v$pdbs; // plugable database status sql>select instance_name from v$instance; // show sid sql>exit;
bONEandALL
Visitor

Total : 26654

Today :3

Today Visit Country :

  • France
  • United States