Select trunc (SYSDATE-1, 'Year')-1, 'Year') from dual -- Get first day of last YEAR, sysdate-1 indicate current day in DW case.
Select add_months (trunc (sysdate, 'Year'), 12)-(1/86400) from dual -- get the last minute and second of the year.
Select
If you are familiar with Oracle databases, I think you will not be familiar with Thomas Kyte. The asktom.oracle.com website hosted by Tomas has been well-known in the Oracle field for decades and is far from Lucky. Recently, in the library, I
Logon username for Linux: Oracle
Sqlplus/as sysdba
Alter system set OS _authent_prefix = ''scope = spfile;
Startup force;
Create user oracle identified externally;
Grant connect to oracle;
Exit the current session and then su to oracle
Exit
When viewing the SQL Execution Plan, we will find that there are many table connection methods. This article introduces the table connection methods to better understand the execution plan and understand the SQL Execution principles.
I. Connection
BecauseAUD $Audit-related tables such as tables are stored inSYSTEMTherefore, to avoid affecting system performanceSYSTEMTablespace.AUD $Move to another tablespace. You can use the following statement to move:
Oracle@www.bkjia.com ~ $
1Syntax
1.1Row-Level Definition
1.2Table-Level Definition
2NOT NULL
Row-level definition only.
SQL> create table tn0 (a number (4) not null, B varchar2 (20 ));
SQL> create table tn1 (a number (4) constraint nn_tn1_a not null, B varchar2 (
A new database was created in Oracle, And it was deleted today and then logged on to SQL * PLUS won't be logged on, with the ORA-12560: TNS: protocol adapter error.
Solution to ORA-12560: TNS: protocol adapter errors
There are three reasons for the
Database ora-27100: solution to shared memory realm already exists errors
Environment:Operating System Platform Windows Service 2003 R2 x86Database Version: Oracle Enterprise 9.2.0.1 for windows x86
Today a customer database cannot start,
Today, PMO issued a task order. After the database was transformed from the sybase system to the Oracle system, 312 entity tables were created for a total of 20 objects, it must be a monkey year, a month, and does not meet the schedule of the
In pl/SQL tools, you need to change the value of a field in a line:
Method 1.
Repeat the table to edit the data.
In this way, you can see the data you want to change at a glance when the data volume is small.
However, when the data volume is
Open PL/SQL Developer today and see the "ORA-12154: TNS: unable to resolve the specified connection identifier" error, which can be connected before, is to connect to my local machine.
View listener-enabled;
The configuration of the tnsnames. ora
Function: concatenates a column in a specified query SQL statement into a string separated by a specified character.
Deficiency: because the return value of the function is varchar2, And the commonly concatenated string is used to query SQL (because
A recently written data collection program generates a file containing more than million rows of data. The data consists of four fields, and the second field must be deleted as required, no suitable tool was found in linux. stream processing tools
When using spfile, you can use the v $ parameter. ISSYS_MODIFIABLE field to determine the initialization parameters that can take effect without restarting.
V $ parameter. ISSYS_MODIFIABLE parameter
Indicates whether the parameter can be changed
One day I met a colleague who asked me to help optimize an SQL statement, which took a long time to run. As a result, I queried the execution plan and found that the SQL was to perform a full table scan. At that time, I checked the definition of the
CUBE and ROLLUP are new SQL keywords since Oracle8i. 9i and-11G are not new. It is an extension of the GROUP BY clause, allows you to calculate the subtotal of different levels in the SELECT statement.
CUBE is another extension of the group by
This is an example of Tom's in-depth database architecture.
Back up a table to an external file
Create table gftuserOrganization external(Type Oracle_datapumpDefault directory tmpLocation ('test0801. dmp '))AsSelect * from all_objects
From
Run the following command
Sqlplus/as sysdba
Create tablespace test datafile '/data/test01.dbf' size 10240 M;
Quit;
EOF
Run the ps-ef | grep sqlplus command to obtain the process id of the Command executed above: 12345
(1) v $ process
If the
The control file is a very important file. Only when the instance reads the control file can it be mounted. One principle of DBA is multi-channel control files. Today I did an experiment and learned this.
The Code is as follows:
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