Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the common commands in oracle database?

2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces what commands are commonly used in oracle database, the content is very detailed, interested friends can refer to, hope to be helpful to you.

This article mainly introduces oracle query sentences, which is helpful for beginners to quickly familiarize themselves with the basic syntax of ORACLE and help them to quickly familiarize themselves with the basic syntax of ORACLE.

Oracle to view user status

Select username,account_status from dba_users

View all roles

Select * from dba_roles

Lock the user

Alter user XXX account lock

Create a new user under Linux

Useradd-d / home/XXX-s / usr/bin/ksh-m XXXpasswd XXX

User creation

Useradd-d / home/XXX-g users-s / bin/bash-m XXX-G users passwd XXX

Delete user

Userdel-r XXX

Linux View process

Ps-e | grep * kill-9 * * (PID)

Linux view version information

Lsb_release-a

Give debug permissions to the user

Grant debug any procedure, debug connect session to prodb

Oracle query user

Select username,password from dba_users

Oracle Delete user

Drop user XXX cascade

If you encounter an error report

Oracle cannot drop a user that is currently connected

Then execute the following command

Log in as sysdba

Shutdown immediate;startup restrict;drop user * cascade;alter system disable restricted session

Oracle snooping

Lsnrctl start

Can be started immediately

If the sysdba user connection fails to connect to the database

Check the environment variable ORACLE_HOME,ORACLE_SID

Delete symbols under sqlplus

Ctrl+backspace

Sqlplus remote connection

Sqlplus username / password @ 10.10.10.10:1521/orcl

Query the relationship between the tablespace and the corresponding data file

Select t1.name, t2.name from v$tablespace T1, v$datafile T2 where t1.ts# = t2.ts#

Delete tablespace

Drop tablespace * including contents and datafiles

Repeatedly insert data into the table

Insert into table_A (X Magi X Magi X) select X Magi X from table_B where XXX

Table_A and table_B can be a table. Of course, the data has to be updated and then inserted.

Assign debug permissions to the user

GRANT debug any procedure, debug connect session TO USER XXX

Check the number of connections for different users

Select username,count (username) from v$session where username is not null group by username

View the execution log

Select t. "SQL_TEXT", t. "SQL_FULLTEXT", t. "LAST_ACTIVE_TIME" from vests

What are the common commands on the oracle database to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report