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

Summary of oracle common commands

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

Log in to oracle

Sqlplus / as sysdba

SQL > startup-start the oracle database

SQL > shutdown immediate-- stop the database

Conn smsdb/password-Connect to smsdb user

Back in terminal mode, type:

$lsnrctl status

Check to see if the listener is activated

If it is not started, you can enter:

$lsnrctl start

Emctl

In addition, it can also be found that the http://localhost.localdomain:1158/em is currently unresponsive. You need to start it separately. The startup instructions are as follows:

$emctl start dbconsole

2. Close the database

In addition to shutdown immediate, you can also use shutdown abort-- generally for database errors

3. Start the database

Startup mount

Alter database open

Delete oracle database user

Drop user smsdb cascade

Sql > create or replace directory P_DIR as'/ home/oracle'

-- check the created path

Sql > select DIRECTORY_NAME,DIRECTORY_PATH from dba_directories where DIRECTORY_NAME='P_DIR'

-- assign read and write permissions to the directory to the user smsdb

Sql > Grant read,write on directory P_DIR to smsdb

Database export

Expdp user/passwd directory=P_DIR dumpfile=20160801_%U.dmp filesize=61440M parallel=5 reuse_dumpfiles=y

Partial export

Expdp user/passwd exclude=table:\ "IN\ (\ 'T_SMSGATEWAY_MO\','\ 'T_SMSGATEWAY_REPORT_HIS\')\" directory=P_DIR dumpfile=smsdbputian.dmp

Database import

Impdp user/passwd directory=P_DIR dumpfile=smsdbputian.dmp LOGFILE=exp_tab.log

4 launch mode of dual instance of Oracle

First of all, you need to know the name of the instance, assuming that my two instances are oracle10 and oracle11 respectively, so the way to start two instances is as follows:

Su-oracle

Export ORACLE_SID=oracle10

Sqlplus / as sysdba

Startup;-start the oracle10 instance

Export ORACLE_SID=oracle11

The steps are as above!

5. Set single table not to generate archive log

Alter table nologging

6. Add table partitions

ALTER TABLE "XXX"

ADD PARTITION P_20170401_23_MP3 values less than (to_date ('2017-04-01 00 hh34:mi:ss'), 4)

TABLESPACE SMSDBMT_DATA UPDATE INDEXES

7. Upload local data-sqlldr

Sqlldr userid=username/paswd control=/home/oracle/data/load.ctl

Load.ctl file configuration

Load data

Infile'/ home/oracle/data/test.txt'

APPEND into table T_TB_4

Fields terminated by ","

Trailing

(MOBILE)

8. The uploaded Chinese content is garbled:

I.

View server-side coding

Select userenv ('language') from dual

The result I actually found is: AMERICAN_AMERICA.AL32UTF8

II.

Execute the statement select * from V$NLS_PARAMETERS-Log in to the user to import the data

Check to see if the VALUE entry corresponding to NLS_LANGUAGE in the PARAMETER item in the first line is the same as the value obtained in the first step.

If not, you need to set the environment variable.

Inconsistent execution of SIMPLIFIED CHINESE

Export NLS_LANG= "SIMPLIFIED CHINESE"

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

Database

Wechat

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

12
Report