Linux common commands for Oracle 10,11,12c

In daily development, the commonly used Oracle operation commands under Linux summarize


oracle 10g, 11g database startup, close
1, su - oracle
2, echo $ORACLE_SID to see if the current instance name is the desired instance name, if not, execute export ORACLE_SID=instance name ,
     and then execute echo $ORACLE_SID to see if the current instance name has been modified successfully
3, sqlplus /nolog
4, conn / as sysdba
5, startup start shutdown immediate close
6, exit to


view the monitor
1, lsnrctl status
to start the monitor:
1, lsnrctl start  
close Listening
1. lsnrctl stop


Oracle12c
The previous operation is similar to
1, select con_id, dbid, NAME, OPEN_MODE from v$pdbs;
used to query seed and all pdb libraries
2, alter session set container=XXX;
set the currently active pdb library
3, starup     
Open the currently active pdb library
shutdown immediate
close the currently active pdb library
alter pluggable database all open;
open all mount libraries
alter pluggable database all close immediate;
close all mount libraries
Other
4, select tablespace_name, file_id, file_name from dba_data_files;
query the tablespace of the current library to



view number of machines, users, and connections
select machine , osuser, count(*) as count from v$session group by machine , osuser order by count; --The

maximum number of connections allowed by the database
select value from v$parameter where name ='processes'; --Modify the maximum number of
connections Number:
alter system set processes = 300 scope = spfile;
view the current instance
select instance_name from v$instance;
view how many users are under the instance
select username from all_users;


delete some trace files to make room for
Oracle's tarce file is the Oracle database is running When the log is generated, the trace file can be deleted and has no effect on the system.
Switch to the oracle user
cd $ORALCE_BASE/diag/rdbms/$ORACLE_SID/$ORACLE_SID

to delete these files: find trace -ctime +30 | xargs rm -fr
and then use the df command to check the disk space, there is free space, the problem is solved.

# df -lh

startup prompt
sqlplus /nolog;

connect/as sysdba;

Connected to an idle instance.


It means that your instance has not been started.

First startup

ORA-28000: the account is locked

alter user username account unlock

View the database default password management validity period
SELECT * FROM dba_profiles WHERE profile='DEFAULT' AND resource_name='PASSWORD_LIFE_TIME';

Modify the user password and set the database default password to permanent Valid
SQL> alter user xxx identified by xxx;
SQL> ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED ;

-- query the free space of the table space
select tablespace_name,count(*) as extends,round(sum(bytes) / 1024 / 1024, 2) as MB,sum(blocks) as blocks from dba_free_space group by tablespace_name; --Query


the total capacity of the
tablespace select tablespace_name, sum (bytes) / 1024 / 1024 as MB from dba_data_files group by tablespace_name;

nothing happens after lsnrctl status, but sqlplus is normal
oracle 10.2.0.1.0 caused by a bug of 4518443, this bug will automatically create a sub-listener, When this happens, the listening will hang
. View the lsnr process
ps -ef | grep lsnr

kill process
kill -9 pid

Then restart and listen to
lsnrctl start
lsnrctl status

to permanently solve
vi $ORACLE_HOME/network/admin/listener.ora
SUBSCRIBE_FOR_NODE_DOWN_EVENT_LISTENER=OFF #You

can add it after the last line
and restart

. Refer to the link
oracle to view the information such as the maximum number of connections allowed and the current number of connections. After

lsnrctl status No response, and SQL*Plus normal


Oracle10gLsnrctl does not reflect the failure to connect to the database

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326519061&siteId=291194637