Common Oracle database operation commands

Source: Internet
Author: User

Oracle Database frequently used operation commands recently encountered a server that uses Oracle databases. After learning Oracle +, I finally got all the user passwords on the website background management interface, I found that Oracle operations were really too troublesome. In order to avoid detours in the future, I sorted out the necessary commands during the intrusion. All rights reserved for the whole week. For reprinted instructions, please indicate the author.
1. Su-Oracle is not required. It is suitable for use without a DBA password. You do not need a password to enter the sqlplus interface.
2. sqlplus/nolog, sqlplus system/manager, or./sqlplus system/manager @ ora9i;
3. SQL> connect/As sysdba; (as sysoper) or
Connect internal/Oracle AS sysdba; (Scott/TIGER)
Conn sys/change_on_install as sysdba;
4. SQL> startup; start the database instance
5. view all current databases: Select * from V $ database;
Select name from V $ database;
Desc v $ databases; view database structure Fields
7. How to check which users have sysdba and sysoper permissions:
SQL> select * from V _ $ pwfile_users;
Show user; view the current database connection user
8. Enter the Test Database: Database test;
9. View All database instances: Select * from V $ instance;
For example, ora9i
10. view all data tables of the current database:
SQL> select table_name from all_tables;
Select * From all_tables;
SQL> select table_name from all_tables where table_name like 'U ';
Table_name ---------------Default_auditing_options
11. view the table structure: DESC all_tables;
12. display the structure of all fields of CQI. t_bbs_xuser:
Desc CQI. t_bbs_xuser;
13. Obtain records in the CQI. t_bbs_xuser table:
Select * From CQI. t_bbs_xuser;
14. Add database users: (test11/test)
Create user test11 identified by test default tablespace users temporary tablespace temp;
15. user authorization:
Grant connect, resource, DBA to test11;
Grant sysdba to test11;
Commit;
16. change the password of the Database User: (change the password of SYS and system to test .)
Alter user SYS indentified by test;
Alter user system indentified by test;

 

 

Http://news.csdn.net/n/20061127/98323.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.