How can I create a new database in oracle12c?
I started the oracle using the command sqlplus "/as sysdba".then i tried to create a new database.For that use the command create database.When I give that query and press enter then a number 2 is displayed and nothing happens.I don't know what to do next?
Actually, you can create a database via SQLPlus; I do it all the time; what is happening to the user with the question, is he is entering just part of the create database command, hitting ENTER, and then SQL*Plus displays a "2" meaning it is ready to accept line 2 of the command. SQLPlus will not run the commands until you enter a ";" at the end of a line and press ENTER, or a "/" and press ENTER as the first character on last line.
What you can do is to create an initialization file, say /u01/app/oracle/product/12.1.0/dbs/initbadint1.ora, that might look something like this:
control_files = (/u02/oradata/badint1/badint1control01.ctl,
/u03/oradata/badint1/badint1control02.ctl,
/u04/oradata/badint1/badint1control03.ctl)
diagnostic_dest = /u01/app/oracle/admin/badint1/ddump
db_block_size = 8192
db_name = badint1
and then look at
http://docs.oracle.com/database/121/SQLRF/statements_5005.htm#SQLRF01204
for the full syntax of the create database command.
Then invoke the following in SQL*Plus:
startup nomount pfile=/u01/app/oracle/product/12.1.0/dbs/initbadint1.ora
create database "badint1"
controlfile reuse
maxlogfiles 32
maxdatafiles 1000
-- rest of commands go here ...
;
Once you enter the semicolon and press enter, then Oracle will create the database.
Once that is done, then invoke the following, one at a time, to set up the data dictionary:
#/u01/app/oracle/product/12.1.0/rdbms/admin/catalog
#/u01/app/oracle/product/12.1.0/rdbms/admin/catproc
All the databases have to be created with Database Configuration Assistant, it is possible to create in both command line and GUI interfaces. Also Oracle Corp. strongly recommends to use this tool to create databases.
PS: try to google next time you have a question, its is really easy, I found this after 5 sec I started the search
Related
I created one new database, then I am using psql to run this sql file(https://github.com/Arelle/Arelle/blob/master/arelle/plugin/xbrlDB/sql/public/xbrlPublicPostgresDB.ddl)
here is my command:
/usr/bin/psql postgresql://db_user:db_password#localhost:5432/my_new_db -f /tmp/xbrlPublicPostgresDB.ddl
psql show me the : , which is asking me to input something.
I checked xbrlPublicPostgresDB.ddl, which does not ask any user input. why does psql ask any user input?
That colon : is not asking for user input. That's from the pager less. By default, when psql outputs something greater than a certain number of lines at a time, it will "paginate" it with less. You can see the same thing by running
cat /tmp/xbrlPublicPostgresDB.ddl | less
You can use arrow keys, page up, page down, j, k, and other keys to move around and see all the output. To exit, press q.
Paginating individual queries doesn't make much sense for what you're running, so you can disable pagination altogether when you run psql by setting the environment variable PAGER to a blank string:
PAGER= psql dbname -f xbrlPublicPostgresDB.ddl
I found the following parameter can stop that pagination, then I do not need to enter any key to continue.
-P pager=off
As you see in the image I have listed all the tables in a database...
I can move up and down, but how can I get back to the postgres prompt? If I use CONTROL+X it takes me back to the linux prompt, but out of postgres.
Thank you ALL for your patience with non-programmers!
It's less pager, simply type q.
https://www.postgresql.org/docs/current/static/app-psql.html
If the environment variable PAGER is set, the output is piped to the
specified program. Otherwise a platform-dependent default (such as
more) is used
so If you are on linux and did not explicitely change PAGER, tap q
http://man7.org/linux/man-pages/man1/more.1.html
Press space to continue, 'q' to quit.
I'm trying to cut and paste multiple commands into the Neo4j browser. When I paste and individual command it works fine. When I paste multiple command sets all terminated by a ; I encounter errors.
The commands are for example as follows:
start n1=node:node_auto_index(id='1000038'),n2=node:node_auto_index(id='M5') create n1-
[:STUDIES]->n2;
start n1=node:node_auto_index(id='1000039'),n2=node:node_auto_index(id='M7') create n1-
[:STUDIES]->n2;
I get this error:
Invalid input 's': expected whitespace, comment or end of input (line 2, column 1)
"start n1=node:node_auto_index(id='1000040'),n2=node:node_auto_index(id='M15') create
n1-[:STUDIES]->n2;"
^
Any help would be greatly appreciated.
At the moment, the Neo4j Browser only supports single statements, which may be multi-line. Execution of multiple statements is planned as a feature enhancement.
Cheers,
Andreas
In Neo4j 2.2.3 web interface, press Shift + Enter to generate multiple new lines and then enter your code. Then click on the run button on the right. For me, it worked! :)
I need to set the table to perforce triggers from the command line on Windows 8.
I am entering the following command and pressing "enter":
C:\Program Files\Perforce>p4 -H localhost -p 1666 -u Administrator -P ** triggers -i
Text cursor moves to a new line as if it awaits the trigger lines. Good so far. I input triggers one by one and when I am done, I have no idea how to tell p4.exe to "flush" my input and save it. What is the correct way of setting triggers in my situation?
Omit the -i and things are much easier: Perforce will bring up your P4EDITOR, which is Notepad by default I think, and you can edit your trigger table in Notepad and then save it.
The -i option allows you to "Read the trigger table from standard input without invoking the editor". The keyword here is table. You have to enter the entire trigger table, in its proper format, not just your triggers. The trigger table starts with a line that contains the following...
Triggers:
...followed by "a list of triggers; one per line. Each trigger line must be indented with spaces or tabs in the form. Each line has four elements..."
So, entering the trigger table from the command line might look something like this (I'm just entering a single trigger in this example):
C:\>p4 triggers -i
Triggers:
example change-submit //depot/... "cmd %changelist%"
C:\>
The sequence is...
"Triggers:" Enter Tab [trigger line] Enter Tab [trigger line] Enter...
...until you are done entering all of your triggers. When you are done, hit Ctrl+C to "flush" your input and save it.
I'm using psql 8.2.3 on FreeBSD. Every time I press Insert, Home, Delete, End, Page Up or Page Down, a tilde (~) character is inserted instead of performing the expected function of the key. Why does this happen and how can I fix it?
As mentioned in Endlessdeath's answer, this turned out to be a key mapping problem with the operating system (FreeBSD), not psql. You can make these keys work as expected by creating or adding to a configuration file for inputrc.
You can create a file named .inputrc in your home directory with the following:
set meta-flag on
set input-meta on
set convert-meta off
set output-meta on
"\e[1~": beginning-of-line
"\e[4~": end-of-line
"\e[5~": beginning-of-history
"\e[6~": end-of-history
"\e[3~": delete-char
"\e[2~": quoted-insert
"\e[5C": forward-word
"\e[5D": backward-word
Alternatively, you can create a global file for all users. A common practice for this is to create or add to the file at /usr/local/etc/inputrc the same lines as above and then export the variable in /etc/profile:
export INPUTRC=/usr/local/etc/inputrc
Ensure that /etc/profile is sourced by your shell (most do by default) and you're good to go. Note that the file won't be sourced until you log out and in again.
Here are some other resources for this problem:
http://bsdpants.blogspot.com/2007/08/make-home-and-end-keys-work.html
http://www.cyberciti.biz/tips/freebsd-how-to-customized-home-del-insert-keys-for-bash-shell.html
http://www.ibb.net/~anne/keyboard.html
That shouldn't be a psql problem - it's os specific.
A quick search on google could help.