Create databases/tables in batches using Linux shell
The Shell script is as follows:
# Create database and table
HOST ='Localhost'
PORT ='123'
USER ='Root'
PWD =''
DBNAME ='Top123'
TABLENAME ='Gametop800'
Mysql_login =''
Mysql_create_db =
---------------------------------
--Create a new user
---------------------------------
Create user hahaya
Identified by hahaya
Default tablespace users
Temporary tablespace temp;
---------------------------------
--ToHahayaUser authorization
-------
A Date Field in the database has the following data. The SQL statement is as follows:
Select age, money, birthday from userinfo
Observe carefully that the date field has two formats, one with time and the other without time. In the
Grid plug-and-play (GPnP)
Grid plug-and-play is used to help administrators maintain clusters. Some manual operation steps required to add or delete nodes can now be automatically implemented by GPnP.
GPnP is not a separate concept. It relies on the
Hidden parameters are used internally by 0racle and start.You can view all hidden parameters in the following two ways:
SELECTI. ksppinmName,
I. ksppdesc description,
CV. ksppstvl VALUE,
CV. ksppstdf isdefault,
DECODE (BITAND (CV. ksppstvf, 7 )
Date typeDate includes year, month, day, hour, minute, and secondTimestamp this is an extended (timestamp) timestamp of the date data type of Oracle9i.
Image Type
Blob binary data can store pictures and sounds for 4 GB
Oracle table management
Create
Blob refers to the writing of a Binary Large Object, that is, the English Binary Large Object, and Clob refers to the writing of a Large Character Object, that is, the English Character Large Object. This type is designed to store a large amount of
1: The cursor instance displays the name and Department
DECLARE
Name VARCHAR2 (50 );
Department_name varchar (20); -- defines two variables to store the content in the employees table and the departments table.
CURSOR emp_cur IS -- defines the
I. system environment:
CentOS 1, 5.5
Host (MASTER): 192.168.0.10
SLAVE (SLAVE): 192.168.0.20
Install Mysql in yum on slave
# Yum install-y mysql-server
Do not enable the mysql service. Copy the/etc/my. cnf file on the master to the/etc directory on
Keywords: Hongqi Asianux3 + Oracle 10g R2 for Linux x86-64
1. Receive a consulting phone number in the morning: Oracle cannot be started in Linux. We will try to solve the problem at the site in the afternoon.
2. After arriving at the site, learn
The following are common scripts for Oracle DBAs.
1. Check data buffer and shared zone hit rate
Declare
Reads_value number (15 );
Direct_value number (15 );
Lob_value number (15 );
Consical_value number (15 );
Db_value number (15 );
X number;
I. Blocking Solution
1. Find out which users are blocking
Select sid, serial #, username from v $ session where sidIn(Select blocking_session from v $ session );
2. Kill the process in which the user is located
Alter system kill session'& Sid,
Oracle-view, sequence and Index
Goal: Learn to use view sequences and indexes!
I. View:
A) create a view:
Create ViewView nameAsSQL statement;
Extended: When you need to change the column name-- Create view name (column name 1, column name 2,...
For a long time, masters have told us that Oracle's NULL and 0 are different. What is the difference. When I practiced it, I forgot the warnings.
Yesterday I made a report. The customer said how to add the details differently from the value of the
1. imp user name/password @ Database Name (SID) file = "dmp file path" fromuser = User Name (from which user to export) touser = to which user example to import:
Imp public_hmis/public_hmis @ rldm file = d: \ hmis. dmp log = d: \ hmis. log fromuer =
It is mainly used to store database fields with a large amount of data. It can store up to 4 GB of unstructured data.This section describes the storage of character type and binary file type LOB data, and separately introduces the storage of binary
The database instance is disabled.Startup nomount database instance starts to the First Stage
(Steps:1. Search for the parameter file spfile . ora. If no, search for spfile. ora. If no, find init . ora.2. Allocate SGA3. Start the background process4.
For example, the data format is substring-substring.
-- Obtain the substring
Select substr (source string or field name, INSTR (source string or field name, '-') + 1, INSTR (source string or field name '-', 1, 2) -INSTR (source string or field
Data Table connections include:1. Inner join (natural join): Only the rows matching the two tables can appear in the result set.2. external connections: including(1) left Outer Join (the table on the left is not restricted)(2) Right Outer Join (the
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