Oracle common command

xiaoxiao2021-03-19  199

First, common commands

1.Imp command (under cmd)

(1) IMP username / password @ host string tables = (Table name 1, table name 2, ...) file = path name file name .dmp (import partial table and data)

For example: IMP

SHC / SHC @ Shc Tables = (BBZW_BBB, BBZW_RKD, BBZW_CKO) File = D: /EXPDAT.DMP

(2) IMP username / password @ host string fromuser = SHC Touser = SHC file = path name file name .dmp (import full table and data)

For example: IMP

SHC / SHC @ Shc fromuser = SHC Touser = SHC File = D: /EXPDAT.DMP

2.EXP statement command (under cmd)

(1) EXP username / password @ Host string Owner = (service name) Export all tables and data

For example: exp

SHC / SHC @ SHC Owner = (SHC)

(2) EXP username / password @ host string Tables = (Table 1, Table 2, ...) Export partial table and data

For example: exp

SHC / SHC @ Shc Tables = (BBZW_RKD, BBZW_CKD, BBZW_BBB)

The derived table name is deflated by expdate.dmp on the execution directory: If it is executed under C: / down, put it under D: / under the D disk.

3.TNSPING statement (under cmd)

Oracle Net Tool (Command) TNSPING is a tool for an OSI session, which is used:

(1)

Verify name analysis (Name Resolution, Oracle's own network service name)

(2) Whether the remote Listener is started

When the Tnsping command is issued in the command line, the parsing of the Oracle network alias (ie the network service name, the host connection string) is executed. This parsing work is performed in the local TNSNames.ora file or Oracle command server or Oracle LDAP (Directory Service). The purpose of parsing is to obtain the machine name (IP address) and the port number of the Listener listening.

Once you get the Listener's machine name and port number, you can open a TCP connection to the target machine with the port. In order to open this TCP connection, the Listener's machine name must be parsed to an IP address (of course, this only does this only when the resolution of the Listener connection address is the machine name), and then TCP / IP performs three handshakes to complete this connection.

After the connection is created, the TNSPING will then send an Oracle TNS connection package to Oracle Listener, Listener and respond to a TNS refusal package (the TCP / IP connection between the two machines is over. The total time-consuming time from the parsing of the Oracle network alias is displayed in the output of the TNSPing command.

E.g:

C: /> TNSPING SHC

4. SHOW ERR statement (SQLPLUS)

For example: SQL> show ERR

5.Rename statement (SQLPLUS)

For example: rename xx to xx2

Second, common operation

1. Client connection server

Start -> Oracle-OraHome81 -> NetWork Administration -> Net8 Configuration Assist

Popup Configuration dialog:

Local Network Service Name Configuration -> Add -> Select Oracle8i Database or Service -> Enter service name (such as SHC) -> Select the protocol of the database you want to access to TCP -> Hostname input (such as SHC) - -> Test -> Complete 2. Create users and authorization

For example: Create User XX Identified XX

Grant DBA (highest permission) TO XX

3. View Create User

For example: SELECT * (or XX) from DBA_USERS

Select * from all_users

4. Delete the created user

You must have no content in the user under the DBA permission.

For example: DROP User XX

转载请注明原文地址:https://www.9cbs.com/read-130213.html

New Post(0)