First, let's talk about the truncate command:Syntax: truncate table;The data in the table is cleared and the storage space is released.After the task is run, the task is automatically submitted, including other uncommitted sessions. Once the task is cleared, the task cannot be rolled back.Only the table creator or other users (such as DBA) with the permission to delete any table can clear the table.Truncate table dept30;Table truncated.
The following
/group_4.266.685491921
Name---------------------------+ Rac_disk/novadb/tempfile/temp.263.685491617
12 rows selected.
SQL>
All ASM disks belonging to the "rac_disk" disk group
SQL> select path from V $ asm_disk where group_number in (select group_number from V $ asm_diskgroup where name = 'rac _ disk ');
Path---------------------------/Dev/raw/raw3/Dev/raw/raw4Orcl: nova3
Start/stop a RAC cluster
Make sure that you log on with an oracle UNIX user. We
I collected a summary of Common commands used to execute scripts in oracle databases, hoping to help you.
1. Execute an SQL script file
The Code is as follows:
Copy code
Sqlplus user/pass @ servicename OrSQL> start file_namesOrSQL> @ file_name
We can save multiple SQL statements in a text file, so that when we want to execute all the SQL statements in this file, we can use any
Common maintenance commands for Oracle 10g RAC: status of all instances and services [oracle @ vzwc1 ~] $ Srvctl status database-d zwc Instance zwc1 is running on node vzwc1 Instance zwc2 is running on node vzwc2 status of a single Instance [oracle @ vzwc1 ~] $ Srvctl status instance-d zwc-I zwc1 Instance zwc1 is runni
autoextend on next 5 M maxsize 2048M; #增加数据文件方式且允许自动增长sql> ALTER DATABASE datafile '/HOME/ORACLE/TABLESPACE.DBF ' autoextend on next 5M maxsize 2048M; #允许已存在的数据文件自动扩展sql> ALTER DATABASE datafile '/HOME/ORACLE/TABLESPACE.DBF ' resize 2048M; # Change the current data file size#调整临时表空间文件sql> Alter tablespace temp add tempfile '/home/oracle/temp2.dbf ' size 2048M; #
Trimspool on
set Linesize a
set pagesize
set newpage 1
set heading off
set term Off
spool path + filename
Select col1| | ', ' | | col2| | ', ' | | col3| | ', ' | | col4| | '. ' FROM TableName;
Spool off
With some basic commands
1. Get database name and date created
Copy Code code as follows:
SELECT name, created, Log_mode, open_mode from V$database;
2, the Oracle databa
Create/delete Table spaces
Created: Create tablespace USERS datafile '/oracle/oradata/mytest/tsuser.dbf ' size 500M autoextend on next 10M maxsize unlimite d extent management local; Delete: Drop tablespace USERS including CONTENTS and datafiles;2. Create/delete usersCreate User ERIC identified by Password Default tablespace USERS; You can also do this without specifying a table space, and you can authorize drop user Eric Cascadegrant Connect,resour
. dmp schemas = ScottImpdp system/manager directory = dump_dir dumpfile = schema. dmp schemas = Scott remap_schema = SCOTT: System3. Import the tablespaceImpdp system/manager directory = dump_dir dumpfile = tablespace. dmp tablespaces = user014. Import the databaseImpdp system/manager directory = dump_dir dumpfile = full. dmp full = y
There are two scenarios for the features of our system1. the username and tablespace of the imported database are the same as those of the exported database. For e
tiger
1 input C: \ sqlplus/nolog in Dos
2. Log On As A DBA
connsys/passwordassysdba;
3 unlock
alteruserscottaccountunlock;
4. A dialog box is displayed to change the password.
Conn scott/tiger
SQL> conn sys/sysAsSysdba;
Connected.
SQL>AlterUserScott account unlock;
UserAltered.
SQL>Commit;
CommitComplete.
SQL> conn scott/tiger // enter the new password and confirm the password. OK
PasswordChanged
Connected.
Common commands in Oracle Oracle
Log Management
1.forcing Log Switches
sql> alter system switch logfile;
2.forcing checkpoints
Sql> alter system checkpoint;
3.adding Online Redo Log groups
sql> ALTER DATABASE Add logfile [Group 4]
Sql> ('/disk3/log4a.rdo ', '/disk4/log4b.rdo ') size 1m;
4.adding Online Redo Log Members
sql> ALTER DATABASE Add logfile Member
1. log on to Oracle AS A DBA
A: Start Oracle services.
B: Run cmd to open the command window.
C: Enter "sqlplus sys/root as sysdba" in the command line. The root is the logon password.
In this way, you can successfully log on to Oracle.
2. query all usernames in the Or
Tags: environment variable min Resolve successful configuration environment variable startup directory ... Usejust like completing the JDK installation, you need to configure the environment variable java_home and path for the system to let the system know the Javac command inside the JDK. Similarly, there is a process required to install Oracle. When you install Oracle under normal conditions, the system
Several commands required to understand the Oracle physical system 1. display the parameters related to the rollback segment ChenZw> show parameter undo name type value =---------------- undo_management string AUTOundo_retention integer 900undo_tablespace string UNDOTBS1 2. Display SGA related parameter ChenZw> show parameter sga name type value -------------------------------------- ----------- ----------
commands
startupnomount
alterdatabasemount
alterdatabaseopen
5. startup restrict
Constraint-based startup
This method can start the database, but only allow access by users with certain privileges
When a non-authorized user accesses the service, the following prompt is displayed:
ERROR:
ORA-01035: Oracle only allows users with restricted session Permissions
6. startup force
Forced start met
common maintenance commands for Oracle 10g Dataguard.
Basic common
1. Stop standbySelect process, status from V$managed_standby; --See if the standby is restored in the application logALTER DATABASE recover managed standby database cancel;Shutdown immediate;2. Switch to read-only mode-----switched from Shutdown mode to read-only mode-------Startup Nomount;ALTER DATABASE mount standby database;ALTER DATAB
Quickly create a user to import data
Sqlplus/nolog
Conn/As sysdba;
Drop user Feiyang cascade;
Create user Feiyang identified by Feiyang;
Grant create session to Feiyang;
Grant resource, connect, DBA to Feiyang;
Conn Feiyang/Feiyang;
Select table_name from user_tables;
IMP Feiyang/Feiyang @ oraclefile = D: \ Feiyang. dmp full = y;
Exp Feiyang/Feiyang @ oraclefile = D: \ Feiyang. dmp owner = (Feiyang );
Login:
Sqlplus/nolog
Conn apps/apps as sysdba
A
Profiling oerr commands in Oracle
The commands in Oralce are very rich. The oerr command is a good auxiliary tool. Many error codes that do not seem to have an eyebrow purpose can help DBAs quickly identify the cause of the problem, we don't need to remember the ORA errors at all, unless they are completely inseparable from your work.
Most of the
This document describes how to create and delete users and roles in Oracle. importing and exporting data imp/exp is equivalent to restoring and backing up oracle data. The exp command can export data from the remote database server to the local dmp file, and the imp command can import the dmp file from the local to the distant database server. This function can be used to build two identical databases, one
Oracle Data Import and Export imp/exp function: Oracle Data Import and Export imp/exp is equivalent to oracle data restoration and backup. In most cases, you can use Oracle data import and export to back up and restore data (without causing data loss ). Oracle has a benefit.
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.